diff --git a/src/devices/Miband_json.h b/src/devices/Miband_json.h index 88c40684..40ff5d14 100644 --- a/src/devices/Miband_json.h +++ b/src/devices/Miband_json.h @@ -1,4 +1,4 @@ -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,\"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\",0,\"570102\",\"&\",\"manufacturerdata\",10,\"!\",\"f\"],\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",10,2,false,false]},\"device\":{\"decoder\":[\"static_value\",\"Xiaomi/Amazfit Tracker\"]}}}"; /*R""""( { "brand":"Xiaomi/Amazfit", @@ -13,7 +13,7 @@ const char* _Miband_json = "{\"brand\":\"Xiaomi/Amazfit\",\"model\":\"Mi Band/Sm "decoder":["value_from_hex_data", "servicedata", 0, 4, true, false] }, "act_bpm":{ - "condition":["manufacturerdata", 10, "!", "f"], + "condition":["manufacturerdata", 0, "570102", "&", "manufacturerdata", 10, "!", "f"], "decoder":["value_from_hex_data", "manufacturerdata", 10, 2, false, false] }, "device":{ diff --git a/tests/BLE/test_ble.cpp b/tests/BLE/test_ble.cpp index 51a98d58..8a34d711 100644 --- a/tests/BLE/test_ble.cpp +++ b/tests/BLE/test_ble.cpp @@ -273,6 +273,7 @@ const char* expected_mac_mfgsvcdata[] = { "{\"brand\":\"Xiaomi/Amazfit\",\"model\":\"Mi Band/Smart Watch\",\"model_id\":\"MB/SW\",\"type\":\"BODY\",\"acts\":true,\"track\":true,\"act_bpm\":132,\"device\":\"Xiaomi/Amazfit Tracker\"}", "{\"brand\":\"Xiaomi/Amazfit\",\"model\":\"Mi Band/Smart Watch\",\"model_id\":\"MB/SW\",\"type\":\"BODY\",\"acts\":true,\"track\":true,\"steps\":7852,\"device\":\"Xiaomi/Amazfit Tracker\"}", "{\"brand\":\"Xiaomi/Amazfit\",\"model\":\"Mi Band/Smart Watch\",\"model_id\":\"MB/SW\",\"type\":\"BODY\",\"acts\":true,\"track\":true,\"device\":\"Xiaomi/Amazfit Tracker\"}", + "{\"brand\":\"Xiaomi/Amazfit\",\"model\":\"Mi Band/Smart Watch\",\"model_id\":\"MB/SW\",\"type\":\"BODY\",\"acts\":true,\"track\":true,\"steps\":7852,\"device\":\"Xiaomi/Amazfit Tracker\"}", }; // Service data test input [test name] [data] @@ -813,8 +814,9 @@ TheengsDecoder::BLE_ID_NUM test_mac_mfgdata_id_num[]{ 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", "ac1e0000"}, + {"MiBand", "AA:BB:CC:DD:EE:FF", "570102ffffffffffffffffffffffffffffffff02aabbccddeeff", ""}, + {"Amazfit Bip S", "AA:BB:CC:DD:EE:FF", "570100dcdde701d61acdc010c59c77fad0bf8e02aabbccddeeff", "ac1e0000"}, }; TheengsDecoder::BLE_ID_NUM test_mac_mfgsvcdata_id_num[]{ @@ -822,6 +824,7 @@ TheengsDecoder::BLE_ID_NUM test_mac_mfgsvcdata_id_num[]{ TheengsDecoder::BLE_ID_NUM::MIBAND, TheengsDecoder::BLE_ID_NUM::MIBAND, TheengsDecoder::BLE_ID_NUM::MIBAND, + TheengsDecoder::BLE_ID_NUM::MIBAND, }; template