Skip to content

Commit

Permalink
Amazfit inclusion in Mi Band (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiH authored Jul 23, 2022
1 parent 6508a22 commit 40e9b7d
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 8 deletions.
1 change: 1 addition & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ module.exports = {
title: '1 - Devices 🌡️', // required
sidebarDepth: 1, // optional, defaults to 1
children: [
'devices/Amazfit',
'devices/BM_V23',
'devices/BPARASITE',
'devices/BM2',
Expand Down
12 changes: 12 additions & 0 deletions docs/devices/Amazfit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Amazfit Smart Watch

|Model Id|[Amazfit](https://github.com/theengs/decoder/blob/development/src/devices/Miband_json.h)|
|-|-|
|Brand|Amazfit|
|Model|Smart Watch|
|Short Description|Various Amazfit Smart Watch models with step count and activity heart rate monitoring|
|Communication|BLE broadcast|
|Frequency|2.4Ghz|
|Power source|Rechargeable battery|
|Exchanged data|steps, activity heart rate (when activated in the Zepp Life settings)|
|Encrypted|No|
4 changes: 2 additions & 2 deletions docs/devices/Miband.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
|Short Description|Fitness band with step count and activity heart rate monitoring|
|Communication|BLE broadcast|
|Frequency|2.4Ghz|
|Power source|Battery|
|Exchanged data|steps, activity heart rate|
|Power source|Rechargeable battery|
|Exchanged data|steps, activity heart rate (when activated in the Zepp Life settings)|
|Encrypted|No|
8 changes: 4 additions & 4 deletions src/devices/Miband_json.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const char* _Miband_json = "{\"brand\":\"Xiaomi\",\"model\":\"Miband\",\"model_id\":\"MiBand\",\"condition\":[\"uuid\",\"contain\",\"fee0\"],\"properties\":{\"steps\":{\"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]}}}";
const char* _Miband_json = "{\"brand\":\"Xiaomi/Amazfit\",\"model\":\"Mi Band/Smart Watch\",\"model_id\":\"MB/SW\",\"condition\":[\"uuid\",\"contain\",\"fee0\"],\"properties\":{\"steps\":{\"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]}}}";
/*R""""(
{
"brand":"Xiaomi",
"model":"Miband",
"model_id":"MiBand",
"brand":"Xiaomi/Amazfit",
"model":"Mi Band/Smart Watch",
"model_id":"MB/SW",
"condition":["uuid", "contain", "fee0"],
"properties":{
"steps":{
Expand Down
4 changes: 2 additions & 2 deletions tests/BLE/test_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ const char* expected_mfg[] = {
};

const char* expected_uuid_mfgsvcdata[] = {
"{\"brand\":\"Xiaomi\",\"model\":\"Miband\",\"model_id\":\"MiBand\",\"steps\":9101,\"act_bpm\":125}",
"{\"brand\":\"Xiaomi/Amazfit\",\"model\":\"Mi Band/Smart Watch\",\"model_id\":\"MB/SW\",\"steps\":9101,\"act_bpm\":125}",
"{\"brand\":\"Radioland\",\"model\":\"RDL52832\",\"model_id\":\"RDL52832\",\"mfid\":\"4c00\",\"uuid\":\"fda50693a4e24fb1afcfc6eb07647825\",\"major\":1,\"minor\":2,\"txpower\":-40,\"tempc\":24.2265625,\"tempf\":75.6078125,\"hum\":47.19921875,\"accx\":-0.02,\"accy\":0.01,\"accz\":0.97}",
"{\"brand\":\"Radioland\",\"model\":\"RDL52832\",\"model_id\":\"RDL52832\",\"mfid\":\"4c00\",\"uuid\":\"fda50693a4e24fb1afcfc6eb07647825\",\"major\":1,\"minor\":2,\"txpower\":-40,\"tempc\":25.296875,\"tempf\":77.534375,\"hum\":58.22265625,\"accx\":0.14,\"accy\":0.09,\"accz\":-0.98}",
"{\"brand\":\"Radioland\",\"model\":\"RDL52832\",\"model_id\":\"RDL52832\",\"mfid\":\"4c00\",\"uuid\":\"fda50693a4e24fb1afcfc6eb07647825\",\"major\":1,\"minor\":2,\"txpower\":-40,\"tempc\":26.2734375,\"tempf\":79.2921875,\"hum\":61.203125,\"accx\":0.2,\"accy\":-0.96,\"accz\":0.15}",
};

const char* expected_uuid[] = {
"{\"brand\":\"Xiaomi\",\"model\":\"Miband\",\"model_id\":\"MiBand\",\"steps\":7842}",
"{\"brand\":\"Xiaomi/Amazfit\",\"model\":\"Mi Band/Smart Watch\",\"model_id\":\"MB/SW\",\"steps\":7842}",
"{\"brand\":\"Xiaomi\",\"model\":\"Mi_Smart_Scale\",\"model_id\":\"XMTZC01HM/XMTZC04HM\",\"weighing_mode\":\"person\",\"unit\":\"kg\",\"weight\":61.75}",
"{\"brand\":\"Xiaomi\",\"model\":\"Mi_Smart_Scale\",\"model_id\":\"XMTZC01HM/XMTZC04HM\",\"weighing_mode\":\"object\",\"unit\":\"kg\",\"weight\":9.55}",
"{\"brand\":\"Xiaomi\",\"model\":\"Mi_Smart_Scale\",\"model_id\":\"XMTZC01HM/XMTZC04HM\",\"weighing_mode\":\"person\",\"unit\":\"kg\",\"weight\":61.75}",
Expand Down

0 comments on commit 40e9b7d

Please sign in to comment.