From a94483d49b154b59000459c5a06612d4df049cd4 Mon Sep 17 00:00:00 2001 From: DigiH Date: Tue, 6 Feb 2024 16:00:12 +0100 Subject: [PATCH] Theengs iBeacon Trackers (#510) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For hardware programmable or software simulating iBeacons, set the following uuid • for static Bluetooth MAC address 546865656E67732D69426561636F6E31 • for randomly changing Bluetooth MAC address 546865656E67732D69426561636F6E32 Randomly changing Bluetooth MAC address is currently only usefully working with the the Theengs Gateway Identity Address and IRK functionality, if you know these details of your device. Major and Minor definitions are not taken into account and can be set freely. --- src/decoder.h | 2 ++ src/devices.h | 2 ++ src/devices/tracker_json.h | 30 ++++++++++++++++++++++++++++++ tests/BLE/test_ble.cpp | 6 ++++++ 4 files changed, 40 insertions(+) diff --git a/src/decoder.h b/src/decoder.h index 8f2532cdd..d142bec2a 100644 --- a/src/decoder.h +++ b/src/decoder.h @@ -133,6 +133,8 @@ class TheengsDecoder { TAGIT, TILE, TILEN, + TheengsIB01, + TheengsIB02, JAALEE, APPLEWATCH, APPLEDEVICE, diff --git a/src/devices.h b/src/devices.h index 82bb0aa36..d40ef12f4 100644 --- a/src/devices.h +++ b/src/devices.h @@ -199,6 +199,8 @@ const char* _devices[][2] = { {_tracker_json_tagit, _tracker_json_props}, {_tracker_json_tile, _tracker_json_props}, {_tracker_json_tilename, _tracker_json_props}, + {_tracker_json_theengs01, _tracker_json_props}, + {_tracker_json_theengs02, _tracker_json_props}, {_JAALEE_json, _JAALEE_json_props}, {_APPLEWATCH_json, _APPLEWATCH_json_props}, {_APPLEDEVICE_json, _APPLEDEVICE_json_props}, diff --git a/src/devices/tracker_json.h b/src/devices/tracker_json.h index 7bbe69c8e..36cf147c9 100644 --- a/src/devices/tracker_json.h +++ b/src/devices/tracker_json.h @@ -88,6 +88,36 @@ const char* _tracker_json_tilename = "{\"brand\":\"Tile\",\"model\":\"Smart Trac } })"""";*/ +const char* _tracker_json_theengs01 = "{\"brand\":\"Theengs\",\"model\":\"iBeacon Tracker\",\"model_id\":\"TheengsIB01\",\"tag\":\"1009\",\"condition\":[\"manufacturerdata\",\"=\",50,\"index\",0,\"4c000215546865656e67732d69426561636f6e31\"],\"properties\":{\"device\":{\"decoder\":[\"static_value\",\"Theengs iBeacon Tracker\"]}}}"; +/*R""""( +{ + "brand":"Theengs", + "model":"iBeacon Tracker", + "model_id":"TheengsIB01", + "tag":"1009", + "condition":["manufacturerdata", "=", 50, "index", 0, "4c000215546865656e67732d69426561636f6e31"], + "properties":{ + "device":{ + "decoder":["static_value", "Theengs iBeacon Tracker"] + } + } +})"""";*/ + +const char* _tracker_json_theengs02 = "{\"brand\":\"Theengs\",\"model\":\"iBeacon Tracker\",\"model_id\":\"TheengsIB02\",\"tag\":\"1019\",\"condition\":[\"manufacturerdata\",\"=\",50,\"index\",0,\"4c000215546865656e67732d69426561636f6e32\"],\"properties\":{\"device\":{\"decoder\":[\"static_value\",\"Theengs iBeacon Tracker\"]}}}"; +/*R""""( +{ + "brand":"Theengs", + "model":"iBeacon Tracker", + "model_id":"TheengsIB02", + "tag":"1019", + "condition":["manufacturerdata", "=", 50, "index", 0, "4c000215546865656e67732d69426561636f6e32"], + "properties":{ + "device":{ + "decoder":["static_value", "Theengs iBeacon Tracker"] + } + } +})"""";*/ + const char* _tracker_json_props = "{\"properties\":{\"device\":{\"unit\":\"string\",\"name\":\"tracker device\"}}}"; /*R""""( { diff --git a/tests/BLE/test_ble.cpp b/tests/BLE/test_ble.cpp index 2287b83ef..b2acd0da7 100644 --- a/tests/BLE/test_ble.cpp +++ b/tests/BLE/test_ble.cpp @@ -142,6 +142,8 @@ const char* expected_mfg[] = { "{\"brand\":\"Apple\",\"model\":\"Apple iPhone/iPad\",\"model_id\":\"APPLEDEVICE\",\"type\":\"TRACK\",\"track\":true,\"prmac\":true,\"unlocked\":false}", "{\"brand\":\"Apple\",\"model\":\"Apple iPhone/iPad\",\"model_id\":\"APPLEDEVICE\",\"type\":\"TRACK\",\"track\":true,\"prmac\":true,\"unlocked\":false}", "{\"brand\":\"Apple\",\"model\":\"Apple iPhone/iPad\",\"model_id\":\"APPLEDEVICE\",\"type\":\"TRACK\",\"track\":true,\"prmac\":true,\"unlocked\":true}", + "{\"brand\":\"Theengs\",\"model\":\"iBeacon Tracker\",\"model_id\":\"TheengsIB01\",\"type\":\"TRACK\",\"cidc\":false,\"track\":true,\"device\":\"Theengs iBeacon Tracker\"}", + "{\"brand\":\"Theengs\",\"model\":\"iBeacon Tracker\",\"model_id\":\"TheengsIB02\",\"type\":\"TRACK\",\"cidc\":false,\"track\":true,\"prmac\":true,\"device\":\"Theengs iBeacon Tracker\"}", }; const char* expected_name_uuid_mfgsvcdata[] = { @@ -534,6 +536,8 @@ const char* test_mfgdata[][3] = { {"Apple", "iPad", "4c0010020304"}, {"Apple", "iPad", "4c0010020704"}, {"Apple", "iPad", "4c0010050b1c93fbf5"}, + {"BM2", "Battery Monitor", "4c000215546865656e67732d69426561636f6e31f644000064"}, + {"BM2", "Battery Monitor", "4c000215546865656e67732d69426561636f6e32f644000064"}, }; TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{ @@ -659,6 +663,8 @@ TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{ TheengsDecoder::BLE_ID_NUM::APPLEDEVICE, TheengsDecoder::BLE_ID_NUM::APPLEDEVICE, TheengsDecoder::BLE_ID_NUM::APPLEDEVICE, + TheengsDecoder::BLE_ID_NUM::TheengsIB01, + TheengsDecoder::BLE_ID_NUM::TheengsIB02, }; // uuid test input [test name] [device name] [uuid] [manufacturer data] [service data]