From 147a69a57f0d8706d2ca2325d1ec76f1a984e234 Mon Sep 17 00:00:00 2001 From: doudar Date: Tue, 5 Dec 2023 16:37:24 -0600 Subject: [PATCH 1/2] Fixes #500 Fixes #500 --- CHANGELOG.md | 5 +++++ data/bluetoothscanner.html | 2 +- lib/SS2K/include/Constants.h | 41 +++++++++++++++++++----------------- src/BLE_Client.cpp | 13 +++++++++++- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5f6fa74..2e4184a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated kit purchasing links. - MIN_ERG_CADENCE created and changed from 20 to 30. - Fixed DNS server in AP mode. +<<<<<<< Updated upstream +======= +- Switched from using Power Table to a Torque Table for better compensation in cad variations. +- Fixed an issue with IC4 and variants not displaying device name in Bluetooth scanner. Fixes #500 +>>>>>>> Stashed changes ### Hardware - Wire diameter reduced from 7.2mm to 6.0mm on the window passthrough to accommodate the latest batch of cables. diff --git a/data/bluetoothscanner.html b/data/bluetoothscanner.html index 5c92e7ab..27d41497 100644 --- a/data/bluetoothscanner.html +++ b/data/bluetoothscanner.html @@ -177,7 +177,6 @@

else if (t_obj[key].address) { optionRemote.text = t_obj[key].address; } - optionRemote.selected; remoteDropdown.add(optionRemote); } } @@ -202,6 +201,7 @@

let noneOptionHR = document.createElement('option'); noneOptionHR.text = 'none'; let noneOptionRemote = document.createElement('option'); + noneOptionRemote.selected; noneOptionRemote.text = 'none'; PMDropdown.add(noneOptionPM); HRDropdown.add(noneOptionHR); diff --git a/lib/SS2K/include/Constants.h b/lib/SS2K/include/Constants.h index faa52a13..e32cba0a 100644 --- a/lib/SS2K/include/Constants.h +++ b/lib/SS2K/include/Constants.h @@ -13,13 +13,16 @@ #define SMARTSPIN2K_SERVICE_UUID NimBLEUUID("77776277-7877-7774-4466-896665500000") #define SMARTSPIN2K_CHARACTERISTIC_UUID NimBLEUUID("77776277-7877-7774-4466-896665500001") +// Device Information Service +#define DEVICEINFORMATIONSERVICE_UUID NimBLEUUID((uint16_t)0x180A) + // Heart Service #define HEARTSERVICE_UUID NimBLEUUID((uint16_t)0x180D) #define HEARTCHARACTERISTIC_UUID NimBLEUUID((uint16_t)0x2A37) -//BatteryLevel Service -#define BATTERYSERVICE_UUID NimBLEUUID((uint16_t)0x180F) // heart rate sensor service uuid, as defined in gatt specifications -#define BATTERYCHARACTERISTIC_UUID NimBLEUUID ((uint16_t)0x2A19) +// BatteryLevel Service +#define BATTERYSERVICE_UUID NimBLEUUID((uint16_t)0x180F) // heart rate sensor service uuid, as defined in gatt specifications +#define BATTERYCHARACTERISTIC_UUID NimBLEUUID((uint16_t)0x2A19) // Cycling Power Service #define CSCSERVICE_UUID NimBLEUUID((uint16_t)0x1816) @@ -66,21 +69,21 @@ #define PELOTON_REQ_POS 1 #define PELOTON_CHECKSUM_POS 2 -//BLE HID -#define APPEARANCE_HID_GENERIC_UUID NimBLEUUID((uint16_t)0x3C0) -#define APPEARANCE_HID_KEYBOARD_UUID NimBLEUUID((uint16_t)0x3C1) -#define APPEARANCE_HID_MOUSE_UUID NimBLEUUID((uint16_t) 0x3C2) -#define APPEARANCE_HID_JOYSTICK_UUID NimBLEUUID((uint16_t)0x3C3) -#define APPEARANCE_HID_GAMEPAD_UUID NimBLEUUID((uint16_t)0x3C4) -#define APPEARANCE_HID_DIGITIZER_TABLET_UUID NimBLEUUID((uint16_t)0x3C5) -#define APPEARANCE_HID_CARD_READER_UUID NimBLEUUID((uint16_t)0x3C6) -#define APPEARANCE_HID_DIGITAL_PEN_UUID NimBLEUUID((uint16_t)0x3C7) -#define APPEARANCE_HID_BARCODE_SCANNER_UUID NimBLEUUID((uint16_t)0x3C8) -#define APPEARANCE_HID_TOUCHPAD_UUID NimBLEUUID((uint16_t)0x3C9) -#define APPEARANCE_HID_PRESENTATION_REMOTE_UUID NimBLEUUID((uint16_t)0x3CA) +// BLE HID +#define APPEARANCE_HID_GENERIC_UUID NimBLEUUID((uint16_t)0x3C0) +#define APPEARANCE_HID_KEYBOARD_UUID NimBLEUUID((uint16_t)0x3C1) +#define APPEARANCE_HID_MOUSE_UUID NimBLEUUID((uint16_t)0x3C2) +#define APPEARANCE_HID_JOYSTICK_UUID NimBLEUUID((uint16_t)0x3C3) +#define APPEARANCE_HID_GAMEPAD_UUID NimBLEUUID((uint16_t)0x3C4) +#define APPEARANCE_HID_DIGITIZER_TABLET_UUID NimBLEUUID((uint16_t)0x3C5) +#define APPEARANCE_HID_CARD_READER_UUID NimBLEUUID((uint16_t)0x3C6) +#define APPEARANCE_HID_DIGITAL_PEN_UUID NimBLEUUID((uint16_t)0x3C7) +#define APPEARANCE_HID_BARCODE_SCANNER_UUID NimBLEUUID((uint16_t)0x3C8) +#define APPEARANCE_HID_TOUCHPAD_UUID NimBLEUUID((uint16_t)0x3C9) +#define APPEARANCE_HID_PRESENTATION_REMOTE_UUID NimBLEUUID((uint16_t)0x3CA) -#define HID_SERVICE_UUID NimBLEUUID((uint16_t)0x1812) -#define HID_INFORMATION_UUID NimBLEUUID((uint16_t)0x2A4A) -#define HID_REPORT_MAP_UUID NimBLEUUID((uint16_t)0x2A4B) +#define HID_SERVICE_UUID NimBLEUUID((uint16_t)0x1812) +#define HID_INFORMATION_UUID NimBLEUUID((uint16_t)0x2A4A) +#define HID_REPORT_MAP_UUID NimBLEUUID((uint16_t)0x2A4B) #define HID_CONTROL_POINT_UUID NimBLEUUID((uint16_t)0x2A4C) -#define HID_REPORT_DATA_UUID NimBLEUUID((uint16_t)0x2A4D) +#define HID_REPORT_DATA_UUID NimBLEUUID((uint16_t)0x2A4D) diff --git a/src/BLE_Client.cpp b/src/BLE_Client.cpp index 9bf82a58..0567c38c 100644 --- a/src/BLE_Client.cpp +++ b/src/BLE_Client.cpp @@ -467,7 +467,14 @@ void SpinBLEClient::scanProcess(int duration) { } if (d.haveServiceUUID()) { - devices[device]["UUID"] = d.getServiceUUID().toString(); + // Workaround for IC4 advertising this service first instead of FTMS. + // Potentially others may need to be added in the future. + // The symptom was the bike name not showing up in the HTML. + if (d.getServiceUUID() == DEVICEINFORMATIONSERVICE_UUID) { + devices[device]["UUID"] = FITNESSMACHINESERVICE_UUID.toString(); + } else { + devices[device]["UUID"] = d.getServiceUUID().toString(); + } } } } @@ -532,6 +539,10 @@ void SpinBLEClient::resetDevices(NimBLEClient *pClient) { } } +<<<<<<< Updated upstream +======= +// Control a connected FTMS trainer. If no args are passed, treat it like an external stepper motor. +>>>>>>> Stashed changes void SpinBLEClient::FTMSControlPointWrite(const uint8_t *pData, int length) { NimBLEClient *pClient = nullptr; for (int i = 0; i < NUM_BLE_DEVICES; i++) { From 604f28cc6dba5d2069e37e126b7a4b0d69db3a41 Mon Sep 17 00:00:00 2001 From: doudar Date: Tue, 5 Dec 2023 16:46:50 -0600 Subject: [PATCH 2/2] Resolved Merge Conflicts --- CHANGELOG.md | 4 ---- src/BLE_Client.cpp | 3 --- 2 files changed, 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e4184a3..9369cff7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,11 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Updated kit purchasing links. - MIN_ERG_CADENCE created and changed from 20 to 30. - Fixed DNS server in AP mode. -<<<<<<< Updated upstream -======= -- Switched from using Power Table to a Torque Table for better compensation in cad variations. - Fixed an issue with IC4 and variants not displaying device name in Bluetooth scanner. Fixes #500 ->>>>>>> Stashed changes ### Hardware - Wire diameter reduced from 7.2mm to 6.0mm on the window passthrough to accommodate the latest batch of cables. diff --git a/src/BLE_Client.cpp b/src/BLE_Client.cpp index 0567c38c..0a306941 100644 --- a/src/BLE_Client.cpp +++ b/src/BLE_Client.cpp @@ -539,10 +539,7 @@ void SpinBLEClient::resetDevices(NimBLEClient *pClient) { } } -<<<<<<< Updated upstream -======= // Control a connected FTMS trainer. If no args are passed, treat it like an external stepper motor. ->>>>>>> Stashed changes void SpinBLEClient::FTMSControlPointWrite(const uint8_t *pData, int length) { NimBLEClient *pClient = nullptr; for (int i = 0; i < NUM_BLE_DEVICES; i++) {