Skip to content

Commit

Permalink
added back IC4 workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
doudar committed Mar 5, 2024
1 parent 21b1fd0 commit ed7283e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/BLE_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ void SpinBLEClient::scanProcess(int duration) {
StaticJsonDocument<1000> devices;

// Check if 'devices' JSON document already exists and has content; if so, deserialize it.
const char* foundDevicesJson = userConfig->getFoundDevices();
const char *foundDevicesJson = userConfig->getFoundDevices();
if (foundDevicesJson[0] != '\0') {
deserializeJson(devices, userConfig->getFoundDevices());
}
Expand Down Expand Up @@ -482,8 +482,12 @@ void SpinBLEClient::scanProcess(int duration) {
} else {
devices[device]["address"] = d.getAddress().toString();
}

if (d.haveServiceUUID()) {
// Workaround for IC4 not advertising FTMS as the first service.
// Potentially others may need to be added in the future.
// The symptom was the bike name not showing up in the HTML.
if (d.haveServiceUUID() && d.isAdvertisingService(FITNESSMACHINESERVICE_UUID)) {
devices[device]["UUID"] = FITNESSMACHINESERVICE_UUID.toString();
} else {
devices[device]["UUID"] = d.getServiceUUID().toString();
}
}
Expand Down

0 comments on commit ed7283e

Please sign in to comment.