Skip to content

Commit

Permalink
XOSS X2 heart rate sensor chest strap
Browse files Browse the repository at this point in the history
  • Loading branch information
DigiH committed Feb 14, 2024
1 parent 6748a21 commit bc95858
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/devices/XOSSX2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# XOSS X2 Heart Rate Sensor

|Model Id|[XOSSX2](https://github.com/theengs/decoder/blob/development/src/devices/XOSSX2_json.h)|
|-|-|
|Brand|XOSS|
|Model|X2 Heart Rate Sensor|
|Short Description|Chest strap heart rate sensor|
|Communication|BLE broadcast|
|Frequency|2.4Ghz|
|Power Source|CR2032|
|Exchanged Data|heart rate, battery|
|Encrypted|No|
1 change: 1 addition & 0 deletions src/decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ class TheengsDecoder {
AMPHIRO,
ORALB_BT,
PH10,
XOSSX2,
TPTH,
MOPEKA,
T201,
Expand Down
2 changes: 2 additions & 0 deletions src/devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
#include "devices/Amphiro_json.h"
#include "devices/OralB_json.h"
#include "devices/PH10_json.h"
#include "devices/XOSSX2_json.h"
#include "devices/TPTH_json.h"
#include "devices/Mopeka_json.h"
#include "devices/T201_json.h"
Expand Down Expand Up @@ -189,6 +190,7 @@ const char* _devices[][2] = {
{_AMPHIRO_json, _AMPHIRO_json_props},
{_OralB_json, _OralB_json_props},
{_PH10_json, _PH10_json_props},
{_XOSSX2_json, _XOSSX2_json_props},
{_TPTH_json, _TPTH_json_props},
{_Mopeka_json, _Mopeka_json_props},
{_T201_json, _T201_json_props},
Expand Down
33 changes: 33 additions & 0 deletions src/devices/XOSSX2_json.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const char* _XOSSX2_json = "{\"brand\":\"XOSS\",\"model\":\"X2 Heart Rate Sensor\",\"model_id\":\"XOSSX2\",\"tag\":\"0b00\",\"condition\":[\"manufacturerdata\",\"=\",12,\"index\",0,\"04ff\"],\"properties\":{\"bpm\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",10,2,false,false]},\"batt\":{\"decoder\":[\"value_from_hex_data\",\"manufacturerdata\",6,2,false,false],\"post_proc\":[\"&\",127]}}}";
/*R""""(
{
"brand":"XOSS",
"model":"X2 Heart Rate Sensor",
"model_id":"XOSSX2",
"tag":"0b00",
"condition":["manufacturerdata", "=", 12, "index", 0, "04ff"],
"properties":{
"bpm":{
"decoder":["value_from_hex_data", "manufacturerdata", 10, 2, false, false]
},
"batt":{
"decoder":["value_from_hex_data", "manufacturerdata", 6, 2, false, false],
"post_proc":["&", 127]
}
}
})"""";*/

const char* _XOSSX2_json_props = "{\"properties\":{\"bpm\":{\"unit\":\"bpm\",\"name\":\"heart rate\"},\"batt\":{\"unit\":\"%\",\"name\":\"battery\"}}}";
/*R""""(
{
"properties":{
"bpm":{
"unit":"bpm",
"name":"heart rate"
},
"batt":{
"unit":"%",
"name":"battery"
}
}
})"""";*/
3 changes: 3 additions & 0 deletions tests/BLE/test_ble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ const char* expected_mfg[] = {
"{\"brand\":\"Theengs\",\"model\":\"iBeacon Tracker\",\"model_id\":\"TheengsIB01\",\"type\":\"TRACK\",\"cidc\":false,\"track\":true,\"device\":\"Theengs iBeacon Tracker\"}",
"{\"brand\":\"Theengs\",\"model\":\"iBeacon Tracker\",\"model_id\":\"TheengsIB02\",\"type\":\"TRACK\",\"cidc\":false,\"track\":true,\"prmac\":true,\"device\":\"Theengs iBeacon Tracker\"}",
"{\"brand\":\"Mobvoi\",\"model\":\"TicWatch GTH (Pro)\",\"model_id\":\"TICWATCHGTH\",\"type\":\"TRACK\",\"cidc\":false,\"acts\":true,\"track\":true,\"device\":\"TicWatch GTH (Pro) Tracker\"}",
"{\"brand\":\"XOSS\",\"model\":\"X2 Heart Rate Sensor\",\"model_id\":\"XOSSX2\",\"type\":\"BODY\",\"bpm\":63,\"batt\":97}",
};

const char* expected_name_uuid_mfgsvcdata[] = {
Expand Down Expand Up @@ -540,6 +541,7 @@ const char* test_mfgdata[][3] = {
{"Theengs", "iBeacon Tracker", "4c000215546865656e67732d69426561636f6e31f644000064"},
{"Theengs", "iBeacon Tracker", "4c000215546865656e67732d69426561636f6e32f644000064"},
{"Mobvoi", "TicWatch GTH Pro", "0000aabbccddeeff"},
{"XOSS", "X2", "04ff0161063f"},
};

TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
Expand Down Expand Up @@ -668,6 +670,7 @@ TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{
TheengsDecoder::BLE_ID_NUM::TheengsIB01,
TheengsDecoder::BLE_ID_NUM::TheengsIB02,
TheengsDecoder::BLE_ID_NUM::TICWATCHGTH,
TheengsDecoder::BLE_ID_NUM::XOSSX2,
};

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

0 comments on commit bc95858

Please sign in to comment.