This commit is contained in:
Jonas Rabenstein 2025-11-30 17:32:49 +01:00
commit fb9dc91392
2 changed files with 8 additions and 2 deletions

View file

@ -4,6 +4,7 @@
#include "fastcon_controller.h"
#include "protocol.h"
namespace esphome
{
namespace fastcon
@ -84,9 +85,14 @@ namespace esphome
adv_data_raw[adv_data_len++] = MANUFACTURER_DATA_ID & 0xFF;
adv_data_raw[adv_data_len++] = (MANUFACTURER_DATA_ID >> 8) & 0xFF;
const auto str = format_hex_pretty(cmd.data);
ESP_LOGI(TAG, "cmd: %s", str.c_str());
memcpy(&adv_data_raw[adv_data_len], cmd.data.data(), cmd.data.size());
adv_data_len += cmd.data.size();
const auto adv = format_hex_pretty(adv_data_raw);
ESP_LOGI(TAG, "adv: %s", adv.c_str());
esp_err_t err = esp_ble_gap_config_adv_data_raw(adv_data_raw, adv_data_len);
if (err != ESP_OK)
{

View file

@ -4,14 +4,14 @@
#include <mutex>
#include <vector>
#include "esphome/core/component.h"
#include "esphome/components/esp32_ble_server/ble_server.h"
#include "esphome/components/esp32_ble/ble.h"
namespace esphome
{
namespace fastcon
{
class FastconController : public Component
class FastconController : public Component, public esp32_ble::GAPEventHandler
{
public:
FastconController() = default;