mirror of
https://github.com/esphome/esphome.git
synced 2025-09-04 20:32:21 +01:00
Improve manufacturer data tracing to identify BLE devices a bit easie… (#7332)
This commit is contained in:
@@ -31,6 +31,13 @@ ESPBTUUID ESPBTUUID::from_raw(const uint8_t *data) {
|
||||
memcpy(ret.uuid_.uuid.uuid128, data, ESP_UUID_LEN_128);
|
||||
return ret;
|
||||
}
|
||||
ESPBTUUID ESPBTUUID::from_raw_reversed(const uint8_t *data) {
|
||||
ESPBTUUID ret;
|
||||
ret.uuid_.len = ESP_UUID_LEN_128;
|
||||
for (int i = 0; i < ESP_UUID_LEN_128; i++)
|
||||
ret.uuid_.uuid.uuid128[ESP_UUID_LEN_128 - 1 - i] = data[i];
|
||||
return ret;
|
||||
}
|
||||
ESPBTUUID ESPBTUUID::from_raw(const std::string &data) {
|
||||
ESPBTUUID ret;
|
||||
if (data.length() == 4) {
|
||||
|
@@ -20,6 +20,7 @@ class ESPBTUUID {
|
||||
static ESPBTUUID from_uint32(uint32_t uuid);
|
||||
|
||||
static ESPBTUUID from_raw(const uint8_t *data);
|
||||
static ESPBTUUID from_raw_reversed(const uint8_t *data);
|
||||
|
||||
static ESPBTUUID from_raw(const std::string &data);
|
||||
|
||||
|
Reference in New Issue
Block a user