Skip to content

Commit

Permalink
Theengs iBeacon Trackers (#511)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DigiH authored Feb 6, 2024
1 parent 6f1835f commit 608e00e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ class TheengsDecoder {
TAGIT,
TILE,
TILEN,
TheengsIB01,
TheengsIB02,
JAALEE,
APPLEWATCH,
APPLEDEVICE,
Expand Down
2 changes: 2 additions & 0 deletions src/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
30 changes: 30 additions & 0 deletions src/devices/tracker_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -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""""(
{
Expand Down
6 changes: 6 additions & 0 deletions tests/BLE/test_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down Expand Up @@ -534,6 +536,8 @@ const char* test_mfgdata[][3] = {
{"Apple", "iPad", "4c0010020304"},
{"Apple", "iPad", "4c0010020704"},
{"Apple", "iPad", "4c0010050b1c93fbf5"},
{"Theengs", "iBeacon Tracker", "4c000215546865656e67732d69426561636f6e31f644000064"},
{"Theengs", "iBeacon Tracker", "4c000215546865656e67732d69426561636f6e32f644000064"},
};

TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 608e00e

Please sign in to comment.