From a1e9a46ef15e72a1298f4315863dc7f6806456f3 Mon Sep 17 00:00:00 2001 From: DigiH Date: Mon, 2 Sep 2024 04:16:11 +0200 Subject: [PATCH] Bosch Nyon eBike tracker --- docs/devices/devices_template.html | 2 +- src/decoder.h | 1 + src/devices.h | 1 + src/devices/tracker_json.h | 15 +++++++++++++++ tests/BLE/test_ble.cpp | 3 +++ 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/devices/devices_template.html b/docs/devices/devices_template.html index be1a4167..d0044051 100644 --- a/docs/devices/devices_template.html +++ b/docs/devices/devices_template.html @@ -209,7 +209,7 @@

Discover the extensive catalog of Bluetooth devices compatible with Theengs ecosystem, including our MQTT Gateway, Web Parser, - and OpenMQTTGateway. BLE trackers from Tile, Nut, TagIt, iTAG, Gigaset G-Tag and the TicWatch GTH (Pro) will also be recognised and published as device trackers. The table also indicates whether each device has been confirmed to work with our [mobile application](https://app.theengs.io/).

+ and OpenMQTTGateway. BLE trackers from Tile, Nut, TagIt, iTAG, Gigaset G-Tag, TicWatch GTH (Pro) and Bosch Nyon eBike computers will also be recognised and published as device trackers. The table also indicates whether each device has been confirmed to work with our [mobile application](https://app.theengs.io/).

{table_content_to_replace}

Note

All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by or of them.

diff --git a/src/decoder.h b/src/decoder.h index 4090dee9..4b0a8a17 100644 --- a/src/decoder.h +++ b/src/decoder.h @@ -145,6 +145,7 @@ class TheengsDecoder { TheengsIB02, TICWATCHGTH, GTAG, + BOSCHNYON, JAALEE, APPLEWATCH, APPLEDEVICE, diff --git a/src/devices.h b/src/devices.h index 25cfabf0..a3ea4c6c 100644 --- a/src/devices.h +++ b/src/devices.h @@ -218,6 +218,7 @@ const char* _devices[][2] = { {_tracker_json_theengs02, _tracker_json_props}, {_tracker_json_TICWATCHGTH, _tracker_json_props}, {_tracker_json_GTAG, _tracker_json_props}, + {_tracker_json_NYON, _tracker_json_props}, {_JAALEE_json, _JAALEE_json_props}, {_APPLEWATCH_json, _APPLEWATCH_json_props}, {_APPLEDEVICE_json, _APPLEDEVICE_json_props}, diff --git a/src/devices/tracker_json.h b/src/devices/tracker_json.h index c3a61e3c..a86d65e5 100644 --- a/src/devices/tracker_json.h +++ b/src/devices/tracker_json.h @@ -148,6 +148,21 @@ const char* _tracker_json_GTAG = "{\"brand\":\"Gigaset\",\"model\":\"G-Tag\",\"m } })"""";*/ +const char* _tracker_json_NYON = "{\"brand\":\"Bosch\",\"model\":\"Nyon\",\"model_id\":\"BOSCHNYON\",\"tag\":\"1008\",\"condition\":[\"manufacturerdata\",\"=\",14,\"index\",0,\"a602\"],\"properties\":{\"device\":{\"decoder\":[\"static_value\",\"Bosch Nyon Tracker\"]}}}"; +/*R""""( +{ + "brand":"Bosch", + "model":"Nyon", + "model_id":"BOSCHNYON", + "tag":"1008", + "condition":["manufacturerdata", "=", 14, "index", 0, "a602"], + "properties":{ + "device":{ + "decoder":["static_value", "Bosch Nyon Tracker"] + } + } +})"""";*/ + const char* _tracker_json_props = "{\"properties\":{\"device\":{\"unit\":\"string\",\"name\":\"tracker device\"}}}"; /*R""""( { diff --git a/tests/BLE/test_ble.cpp b/tests/BLE/test_ble.cpp index 523479a4..712206d9 100644 --- a/tests/BLE/test_ble.cpp +++ b/tests/BLE/test_ble.cpp @@ -160,6 +160,7 @@ const char* expected_mfg[] = { "{\"brand\":\"Otodata\",\"model\":\"Rotarex-compatible Monitor\",\"model_id\":\"RC1010\",\"type\":\"UNIQ\",\"level\":98.35,\"status\":0}", "{\"brand\":\"Otodata\",\"model\":\"Rotarex-compatible Monitor\",\"model_id\":\"RC1010\",\"type\":\"UNIQ\",\"serial\":56001608,\"modeltype\":67367466}", "{\"brand\":\"Tile\",\"model\":\"Smart Tracker\",\"model_id\":\"TILE\",\"type\":\"TRACK\",\"cidc\":false,\"acts\":true,\"track\":true,\"device\":\"Tile Tracker\"}", + "{\"brand\":\"Bosch\",\"model\":\"Nyon\",\"model_id\":\"BOSCHNYON\",\"type\":\"TRACK\",\"track\":true,\"device\":\"Bosch Nyon Tracker\"}", }; const char* expected_name_uuid_mfgsvcdata[] = { @@ -590,6 +591,7 @@ const char* test_mfgdata[][3] = { {"Otodata RC1010", "", "b1034f544f54454c4502006b260000366e0f000000"}, {"Otodata RC1010", "", "b1034f544f3332383148845603132111010400022af20304"}, {"Tile Name", "Tile", ""}, + {"Bosch Nyon", "Nyon-XXX", "a60210eb002500"}, }; TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{ @@ -733,6 +735,7 @@ TheengsDecoder::BLE_ID_NUM test_mfgdata_id_num[]{ TheengsDecoder::BLE_ID_NUM::OTOD, TheengsDecoder::BLE_ID_NUM::OTOD, TheengsDecoder::BLE_ID_NUM::TILEN, + TheengsDecoder::BLE_ID_NUM::BOSCHNYON, }; // uuid test input [test name] [device name] [uuid] [manufacturer data] [service data]