Skip to content

Commit

Permalink
Only 98 & 18
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiH committed Nov 2, 2023
1 parent 63371be commit 84ea46b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
13 changes: 3 additions & 10 deletions src/devices/APPLEWATCH_json.h
Original file line number Diff line number Diff line change
@@ -1,34 +1,27 @@
const char* _APPLEWATCH_json = "{\"brand\":\"Apple\",\"model\":\"Apple Watch\",\"model_id\":\"APPLEWATCH\",\"tag\":\"0b08\",\"condition\":[\"manufacturerdata\",\"=\",18,\"index\",0,\"4c001005\"],\"properties\":{\"state\":{\"decoder\":[\"string_from_hex_data\",\"manufacturerdata\",10,2],\"lookup\":[\"98\",\"unlocked\",\"18\",\"locked\"]},\"device\":{\"decoder\":[\"static_value\",\"Apple Watch\"]}}}";
const char* _APPLEWATCH_json = "{\"brand\":\"Apple\",\"model\":\"Apple Watch\",\"model_id\":\"APPLEWATCH\",\"tag\":\"0b08\",\"condition\":[\"manufacturerdata\",\"index\",10,\"98\",\"|\",\"manufacturerdata\",\"index\",10,\"18\",\"&\",\"manufacturerdata\",\"=\",18,\"index\",0,\"4c001005\"],\"properties\":{\"state\":{\"decoder\":[\"string_from_hex_data\",\"manufacturerdata\",10,2],\"lookup\":[\"98\",\"unlocked\",\"18\",\"locked\"]}}}";
/*R""""(
{
"brand":"Apple",
"model":"Apple Watch",
"model_id":"APPLEWATCH",
"tag":"0b08",
"condition":["manufacturerdata", "=", 18, "index", 0, "4c001005"],
"condition":["manufacturerdata", "index", 10, "98", "|", "manufacturerdata", "index", 10, "18", "&", "manufacturerdata", "=", 18, "index", 0, "4c001005"],
"properties":{
"state":{
"decoder":["string_from_hex_data", "manufacturerdata", 10, 2],
"lookup":["98", "unlocked",
"18", "locked"]
},
"device":{
"decoder":["static_value", "Apple Watch"]
}
}
})"""";*/

const char* _APPLEWATCH_json_props = "{\"properties\":{\"state\":{\"unit\":\"string\",\"name\":\"state\"},\"device\":{\"unit\":\"string\",\"name\":\"device\"}}}";
const char* _APPLEWATCH_json_props = "{\"properties\":{\"state\":{\"unit\":\"string\",\"name\":\"state\"}}}";
/*R""""(
{
"properties":{
"state":{
"unit":"string",
"name":"state"
},
"device":{
"unit":"string",
"name":"device"
}
}
})"""";*/
7 changes: 2 additions & 5 deletions tests/BLE/test_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,8 @@ const char* expected_mfg[] = {
"{\"brand\":\"Oral-B\",\"model\":\"BT Toothbrush\",\"model_id\":\"ORALB_BT\",\"type\":\"BODY\",\"state\":\"running\",\"sector\":\"sector 3\",\"pressure\":50,\"time\":74}",
"{\"brand\":\"Oral-B\",\"model\":\"BT Toothbrush\",\"model_id\":\"ORALB_BT\",\"type\":\"BODY\",\"state\":\"idle\",\"mode\":\"daily clean\",\"sector\":\"sector 1\",\"pressure\":32,\"time\":0}",
"{\"brand\":\"Oral-B\",\"model\":\"BT Toothbrush\",\"model_id\":\"ORALB_BT\",\"type\":\"BODY\",\"state\":\"sleeping\",\"mode\":\"turbo\",\"sector\":\"sector 8\",\"pressure\":32,\"time\":135}",
"{\"brand\":\"Apple\",\"model\":\"Apple Watch\",\"model_id\":\"APPLEWATCH\",\"type\":\"BODY\",\"track\":true,\"state\":\"locked\",\"device\":\"Apple Watch\"}",
"{\"brand\":\"Apple\",\"model\":\"Apple Watch\",\"model_id\":\"APPLEWATCH\",\"type\":\"BODY\",\"track\":true,\"state\":\"unlocked\",\"device\":\"Apple Watch\"}",
"{\"brand\":\"Apple\",\"model\":\"Apple Watch\",\"model_id\":\"APPLEWATCH\",\"type\":\"BODY\",\"track\":true,\"device\":\"Apple Watch\"}",
"{\"brand\":\"Apple\",\"model\":\"Apple Watch\",\"model_id\":\"APPLEWATCH\",\"type\":\"BODY\",\"track\":true,\"state\":\"locked\"}",
"{\"brand\":\"Apple\",\"model\":\"Apple Watch\",\"model_id\":\"APPLEWATCH\",\"type\":\"BODY\",\"track\":true,\"state\":\"unlocked\"}",
};

const char* expected_name_uuid_mfgsvcdata[] = {
Expand Down Expand Up @@ -493,7 +492,6 @@ const char* test_mfgdata[][3] = {
{"Braun", "Oral-B", "dc000202067320020f07080004"},
{"Apple", "Watch", "4c0010050b182068dd"},
{"Apple", "Watch", "4c0010050b982068dd"},
{"Apple", "Watch", "4c00100501145085dd"},
};

TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
Expand Down Expand Up @@ -609,7 +607,6 @@ TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
TheengsDecoder::BLE_ID_NUM::ORALB_BT,
TheengsDecoder::BLE_ID_NUM::APPLEWATCH,
TheengsDecoder::BLE_ID_NUM::APPLEWATCH,
TheengsDecoder::BLE_ID_NUM::APPLEWATCH,
};

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

0 comments on commit 84ea46b

Please sign in to comment.