10 static const char *
const TAG =
"mopeka_ble";
13 static const uint16_t SERVICE_UUID_CC2540 = 0xADA0;
14 static const uint16_t MANUFACTURER_CC2540_ID = 0x000D;
15 static const uint8_t MANUFACTURER_CC2540_DATA_LENGTH = 23;
18 static const uint16_t SERVICE_UUID_NRF52 = 0xFEE5;
19 static const uint16_t MANUFACTURER_NRF52_ID = 0x0059;
20 static const uint8_t MANUFACTURER_NRF52_DATA_LENGTH = 10;
41 if (service_uuids.size() != 1) {
44 const auto &service_uuid = service_uuids[0];
47 if (manu_datas.size() != 1) {
50 const auto &manu_data = manu_datas[0];
58 if (manu_data.data.size() != MANUFACTURER_CC2540_DATA_LENGTH) {
62 const bool sync_button_pressed = (manu_data.data[3] & 0x80) != 0;
65 ESP_LOGI(TAG,
"MOPEKA STD (CC2540) SENSOR FOUND: %s", device.
address_str().c_str());
74 if (manu_data.data.size() != MANUFACTURER_NRF52_DATA_LENGTH) {
78 const bool sync_button_pressed = (manu_data.data[2] & 0x80) != 0;
81 ESP_LOGI(TAG,
"MOPEKA PRO (NRF52) SENSOR FOUND: %s", device.
address_str().c_str());
bool show_sensors_without_sync_
std::string address_str() const
const std::vector< ServiceData > & get_manufacturer_datas() const
const std::vector< ESPBTUUID > & get_service_uuids() const
static ESPBTUUID from_uint16(uint16_t uuid)
bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override
Parse all incoming BLE payloads to see if it is a Mopeka BLE advertisement.
Implementation of SPI Controller mode.