Skip to content

Commit

Permalink
Mi Band/Amazfit restriction
Browse files Browse the repository at this point in the history
Mi Band/Amazfit decoder restriction to not catch wrongly decoded devices like the Amazfit Bip S and similar.
  • Loading branch information
DigiH committed Mar 25, 2023
1 parent 6c71958 commit b90eb3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/devices/Miband_json.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const char* _Miband_json = "{\"brand\":\"Xiaomi/Amazfit\",\"model\":\"Mi Band/Smart Watch\",\"model_id\":\"MB/SW\",\"tag\":\"0b0a\",\"condition\":[\"manufacturerdata\",\"=\",52,\"index\",0,\"5701\",\"&\",\"manufacturerdata\",\"mac@index\",40],\"conditionnomac\":[\"uuid\",\"contain\",\"fee0\"],\"properties\":{\"steps\":{\"condition\":[\"servicedata\",\"=\",8],\"decoder\":[\"value_from_hex_data\",\"servicedata\",0,4,true,false]},\"act_bpm\":{\"condition\":[\"manufacturerdata\",10,\"!\",\"f\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",10,2,false,false]},\"device\":{\"decoder\":[\"static_value\",\"Xiaomi/Amazfit Tracker\"]}}}";
const char* _Miband_json = "{\"brand\":\"Xiaomi/Amazfit\",\"model\":\"Mi Band/Smart Watch\",\"model_id\":\"MB/SW\",\"tag\":\"0b0a\",\"condition\":[\"manufacturerdata\",\"=\",52,\"index\",0,\"570102\",\"&\",\"manufacturerdata\",\"mac@index\",40],\"conditionnomac\":[\"uuid\",\"contain\",\"fee0\"],\"properties\":{\"steps\":{\"condition\":[\"servicedata\",\"=\",8],\"decoder\":[\"value_from_hex_data\",\"servicedata\",0,4,true,false]},\"act_bpm\":{\"condition\":[\"manufacturerdata\",10,\"!\",\"f\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",10,2,false,false]},\"device\":{\"decoder\":[\"static_value\",\"Xiaomi/Amazfit Tracker\"]}}}";
/*R""""(
{
"brand":"Xiaomi/Amazfit",
"model":"Mi Band/Smart Watch",
"model_id":"MB/SW",
"tag":"0b0a",
"condition":["manufacturerdata", "=", 52, "index", 0, "5701", "&", "manufacturerdata", "mac@index", 40],
"condition":["manufacturerdata", "=", 52, "index", 0, "570102", "&", "manufacturerdata", "mac@index", 40],
"conditionnomac":["uuid", "contain", "fee0"],
"properties":{
"steps":{
Expand Down
2 changes: 1 addition & 1 deletion tests/BLE/test_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ const char* test_mac_mfgsvcdata[][4] = {
{"MiBand", "AA:BB:CC:DD:EE:FF", "57010202017dffffffffffffffffffffffffff02aabbccddeeff", "8d230000"},
{"MiBand", "AA:BB:CC:DD:EE:FF", "570102020184ffffffffffffffffffffffffff02aabbccddeeff", ""},
{"MiBand", "AA:BB:CC:DD:EE:FF", "5701020201ffffffffffffffffffffffffffff02aabbccddeeff", "ac1e0000"},
{"MiBand", "AA:BB:CC:DD:EE:FF", "57010202ffffffffffffffffffffffffffffff02aabbccddeeff", ""},
{"MiBand", "AA:BB:CC:DD:EE:FF", "570102ffffffffffffffffffffffffffffffff02aabbccddeeff", ""},
};

TheengsDecoder::BLE_ID_NUM test_mac_mfgsvcdata_id_num[]{
Expand Down

0 comments on commit b90eb3c

Please sign in to comment.