Skip to content

Commit

Permalink
Theengs iBeacon Trackers
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiH committed Jan 14, 2024
1 parent faed54b commit ddca729
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,
JHT_F525,
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},
{_JHT_F525_json, _JHT_F525_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 @@ -143,6 +143,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 @@ -533,6 +535,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[]{
Expand Down Expand Up @@ -658,6 +662,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 ddca729

Please sign in to comment.