Skip to content

Commit

Permalink
Apple Continuity extension (#306)
Browse files Browse the repository at this point in the history
* Apple Continuity extension

Apple Continuity extension with likely AirTags broadcasts

* model_id separation
  • Loading branch information
DigiH authored Mar 11, 2023
1 parent f82d1b5 commit 223c1e0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class TheengsDecoder {
IBT4XS,
IBT6XS_SOLIS,
APPLE_CONT,
APPLE_CONTAT,
MIBAND,
XMTZC04HM,
XMTZC05HM,
Expand Down
1 change: 1 addition & 0 deletions src/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ const char* _devices[][2] = {
{_IBT_4XS_json, _IBT_4XS_json_props},
{_IBT_6XS_SOLIS6_json, _IBT_6XS_SOLIS6_json_props},
{_APPLE_json, _APPLE_json_props},
{_APPLE_json_at, _APPLE_json_props},
{_Miband_json, _Miband_json_props},
{_XMTZC04HM_json, _XMTZC04HM_json_props},
{_XMTZC05HM_json, _XMTZC05HM_json_props},
Expand Down
15 changes: 15 additions & 0 deletions src/devices/APPLE_json.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ const char* _APPLE_json = "{\"brand\":\"Apple\",\"model\":\"Apple Continuity\",\
}
})"""";*/

const char* _APPLE_json_at = "{\"brand\":\"Apple\",\"model\":\"Apple Continuity\",\"model_id\":\"APPLE_CONTAT\",\"tag\":\"fe\",\"condition\":[\"manufacturerdata\",\"=\",58,\"index\",0,\"4c000\",\"|\",\"manufacturerdata\",\"=\",58,\"index\",0,\"4c001\"],\"properties\":{\"device\":{\"decoder\":[\"static_value\",\"Apple device\"]}}}";
/*R""""(
{
"brand":"Apple",
"model":"Apple Continuity",
"model_id":"APPLE_CONTAT",
"tag":"fe",
"condition":["manufacturerdata", "=", 58, "index", 0, "4c000", "|", "manufacturerdata", "=", 58, "index", 0, "4c001"],
"properties":{
"device":{
"decoder":["static_value", "Apple device"]
}
}
})"""";*/

const char* _APPLE_json_props = "{\"properties\":{\"device\":{\"unit\":\"string\",\"name\":\"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 @@ -116,6 +116,8 @@ const char* expected_mfg[] = {
"{\"brand\":\"Atomax\",\"model\":\"Skale I/II\",\"model_id\":\"SKALE\",\"type\":\"SCALE\",\"cidc\":false,\"weight\":-92.8}",
"{\"brand\":\"Apple\",\"model\":\"Apple Continuity\",\"model_id\":\"APPLE_CONT\",\"type\":\"RMAC\",\"device\":\"Apple device\"}",
"{\"brand\":\"Apple\",\"model\":\"Apple Continuity\",\"model_id\":\"APPLE_CONT\",\"type\":\"RMAC\",\"device\":\"Apple device\"}",
"{\"brand\":\"Apple\",\"model\":\"Apple Continuity\",\"model_id\":\"APPLE_CONTAT\",\"type\":\"RMAC\",\"device\":\"Apple device\"}",
"{\"brand\":\"Apple\",\"model\":\"Apple Continuity\",\"model_id\":\"APPLE_CONTAT\",\"type\":\"RMAC\",\"device\":\"Apple device\"}",
"{\"brand\":\"iTAG\",\"model\":\"Smart Tracker\",\"model_id\":\"ITAG\",\"type\":\"TRACK\",\"cidc\":false,\"acts\":true,\"cont\":true,\"device\":\"iTAG Tracker\"}",
"{\"brand\":\"Tile\",\"model\":\"Smart Tracker\",\"model_id\":\"TILE\",\"type\":\"TRACK\",\"cidc\":false,\"acts\":true,\"cont\":true,\"device\":\"Tile Tracker\"}",
};
Expand Down Expand Up @@ -398,6 +400,8 @@ const char* test_mfgdata[][3] = {
{"Atomax", "Skale I/II", "ef8160fcffff"},
{"Apple", "Continuity", "4c0009060304c0a87b1e130c1adefc915b9ef8010401030c"},
{"Apple", "Continuity", "4c00130100"},
{"Apple", "Continuity", "4c001219003d9967e0d67bf55617939043e48fd6762144da3e35160300"},
{"Apple", "Continuity", "4c000719010e2022f58f00000a7d9fff27234873d4305e0fed1b39e2b8"},
{"Tracker iTAG", "iTAG", "8afc23eb"},
{"Tile name", "Tile", "xxxx"},
};
Expand Down Expand Up @@ -498,6 +502,8 @@ TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
TheengsDecoder::BLE_ID_NUM::SKALE,
TheengsDecoder::BLE_ID_NUM::APPLE_CONT,
TheengsDecoder::BLE_ID_NUM::APPLE_CONT,
TheengsDecoder::BLE_ID_NUM::APPLE_CONTAT,
TheengsDecoder::BLE_ID_NUM::APPLE_CONTAT,
TheengsDecoder::BLE_ID_NUM::ITAG,
TheengsDecoder::BLE_ID_NUM::TILEN,
};
Expand Down

0 comments on commit 223c1e0

Please sign in to comment.