mirror of
https://github.com/esphome/esphome.git
synced 2025-09-07 13:52:20 +01:00
fix
This commit is contained in:
@@ -12,8 +12,8 @@ namespace esphome::bluetooth_proxy {
|
|||||||
|
|
||||||
static const char *const TAG = "bluetooth_proxy.connection";
|
static const char *const TAG = "bluetooth_proxy.connection";
|
||||||
|
|
||||||
// This function is designed to be allocation-free and only called in the event loop (not thread-safe)
|
// This function is allocation-free and directly packs UUIDs into the output array
|
||||||
// It directly packs UUIDs into the output array with precalculated constants for the base UUID
|
// using precalculated constants for the Bluetooth base UUID
|
||||||
static void fill_128bit_uuid_array(std::array<uint64_t, 2> &out, esp_bt_uuid_t uuid_source) {
|
static void fill_128bit_uuid_array(std::array<uint64_t, 2> &out, esp_bt_uuid_t uuid_source) {
|
||||||
// Bluetooth base UUID: 00000000-0000-1000-8000-00805F9B34FB
|
// Bluetooth base UUID: 00000000-0000-1000-8000-00805F9B34FB
|
||||||
// out[0] = bytes 8-15 (big-endian)
|
// out[0] = bytes 8-15 (big-endian)
|
||||||
|
@@ -447,7 +447,6 @@ def parse_properties(char_conf):
|
|||||||
|
|
||||||
def parse_uuid(uuid):
|
def parse_uuid(uuid):
|
||||||
# If the UUID is a int, use from_uint32
|
# If the UUID is a int, use from_uint32
|
||||||
cg.add_define("USE_ESP32_BLE_UUID")
|
|
||||||
if isinstance(uuid, int):
|
if isinstance(uuid, int):
|
||||||
return ESPBTUUID_ns.from_uint32(uuid)
|
return ESPBTUUID_ns.from_uint32(uuid)
|
||||||
# Otherwise, use ESPBTUUID_ns.from_raw
|
# Otherwise, use ESPBTUUID_ns.from_raw
|
||||||
@@ -530,6 +529,7 @@ async def to_code_characteristic(service_var, char_conf):
|
|||||||
async def to_code(config):
|
async def to_code(config):
|
||||||
# Register the loggers this component needs
|
# Register the loggers this component needs
|
||||||
esp32_ble.register_bt_logger(BTLoggers.GATT, BTLoggers.SMP)
|
esp32_ble.register_bt_logger(BTLoggers.GATT, BTLoggers.SMP)
|
||||||
|
cg.add_define("USE_ESP32_BLE_UUID")
|
||||||
|
|
||||||
var = cg.new_Pvariable(config[CONF_ID])
|
var = cg.new_Pvariable(config[CONF_ID])
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user