1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-04 20:32:21 +01:00

Bluetooth Proxy: Raw bundled advertisements (#4924)

This commit is contained in:
Jesse Hills
2023-06-09 07:41:09 +12:00
committed by GitHub
parent 1cf210fa25
commit ce13979690
16 changed files with 450 additions and 235 deletions

View File

@@ -244,6 +244,17 @@ void ESP32BLE::dump_config() {
}
}
uint64_t ble_addr_to_uint64(const esp_bd_addr_t address) {
uint64_t u = 0;
u |= uint64_t(address[0] & 0xFF) << 40;
u |= uint64_t(address[1] & 0xFF) << 32;
u |= uint64_t(address[2] & 0xFF) << 24;
u |= uint64_t(address[3] & 0xFF) << 16;
u |= uint64_t(address[4] & 0xFF) << 8;
u |= uint64_t(address[5] & 0xFF) << 0;
return u;
}
ESP32BLE *global_ble = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
} // namespace esp32_ble

View File

@@ -18,6 +18,8 @@
namespace esphome {
namespace esp32_ble {
uint64_t ble_addr_to_uint64(const esp_bd_addr_t address);
// NOLINTNEXTLINE(modernize-use-using)
typedef struct {
void *peer_device;