Skip to content

Commit

Permalink
HomePod Test
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiH committed Jan 31, 2024
1 parent 6f1835f commit 1f277d0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class TheengsDecoder {
JAALEE,
APPLEWATCH,
APPLEDEVICE,
APPLEHOMEPOD,
IBEACON,
APPLE_CONT,
APPLE_CONTAT,
Expand Down
2 changes: 2 additions & 0 deletions src/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
#include "devices/JAALEE_json.h"
#include "devices/APPLEWATCH_json.h"
#include "devices/APPLEDEVICE_json.h"
#include "devices/APPLEHOMEPOD_json.h"
#include "devices/iBeacon_json.h"
#include "devices/APPLE_json.h"
#include "devices/ServiceData_json.h"
Expand Down Expand Up @@ -202,6 +203,7 @@ const char* _devices[][2] = {
{_JAALEE_json, _JAALEE_json_props},
{_APPLEWATCH_json, _APPLEWATCH_json_props},
{_APPLEDEVICE_json, _APPLEDEVICE_json_props},
{_APPLEHOMEPOD_json, _APPLEHOMEPOD_json_props},
{_ibeacon_json, _ibeacon_json_props},
{_APPLE_json, _APPLE_json_props},
{_APPLE_json_at, _APPLE_json_props},
Expand Down
25 changes: 25 additions & 0 deletions src/devices/APPLEHOMEPOD_json.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const char* _APPLEHOMEPOD_json = "{\"brand\":\"Apple\",\"model\":\"Apple HomePod (mini)\",\"model_id\":\"APPLEHOMEPOD\",\"tag\":\"ff10\",\"condition\":[\"manufacturerdata\",\">=\",16,\"index\",0,\"4c0009\",\"|\",\"manufacturerdata\",\">=\",16,\"index\",0,\"4c0010\"],\"properties\":{\"test\":{\"decoder\":[\"string_from_hex_data\",\"manufacturerdata\",6,14]}}}";
/*R""""(
{
"brand":"Apple",
"model":"Apple HomePod (mini)",
"model_id":"APPLEHOMEPOD",
"tag":"ff10",
"condition":["manufacturerdata", ">=", 16, "index", 0, "4c0009", "|", "manufacturerdata", ">=", 16, "index", 0, "4c0010"],
"properties":{
"test":{
"decoder":["string_from_hex_data", "manufacturerdata", 6, 14]
}
}
})"""";*/

const char* _APPLEHOMEPOD_json_props = "{\"properties\":{\"test\":{\"unit\":\"string\",\"name\":\"test\"}}}";
/*R""""(
{
"properties":{
"test":{
"unit":"string",
"name":"test"
}
}
})"""";*/
5 changes: 4 additions & 1 deletion tests/BLE/test_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ 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\":\"Apple\",\"model\":\"Apple HomePod (mini)\",\"model_id\":\"APPLEHOMEPOD\",\"type\":\"UNIQ\",\"prmac\":true,\"test\":\"08130ac0a8000f\"}",
};

const char* expected_name_uuid_mfgsvcdata[] = {
Expand Down Expand Up @@ -495,7 +496,7 @@ const char* test_mfgdata[][3] = {
{"Atomax", "Skale I/II", "ef81d70400ff"},
{"Atomax", "Skale I/II", "ef81280100ff"},
{"Atomax", "Skale I/II", "ef8160fcffff"},
{"Apple", "Continuity", "4c0009060304c0a87b1e130c1adefc915b9ef8010401030c"},
{"Apple", "Continuity", "4c000a060304c0a87b1e130c1adefc915b9ef8010401030c"},
{"Apple", "Continuity", "4c00130100"},
{"Apple", "Continuity", "4c001219003d9967e0d67bf55617939043e48fd6762144da3e35160300"},
{"Apple", "Continuity", "4c000719010e2022f58f00000a7d9fff27234873d4305e0fed1b39e2b8"},
Expand Down Expand Up @@ -534,6 +535,7 @@ const char* test_mfgdata[][3] = {
{"Apple", "iPad", "4c0010020304"},
{"Apple", "iPad", "4c0010020704"},
{"Apple", "iPad", "4c0010050b1c93fbf5"},
{"Apple", "HomePod mini", "4c000908130ac0a8000f1b5813081ae5b284f28a4600"},
};

TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
Expand Down Expand Up @@ -659,6 +661,7 @@ 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::APPLEHOMEPOD,
};

// uuid test input [test name] [device name] [uuid] [manufacturer data] [service data]
Expand Down

0 comments on commit 1f277d0

Please sign in to comment.