Skip to content

Commit

Permalink
Update kineticinroadbike.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
cagnulein committed Dec 24, 2024
1 parent 13cd666 commit 9c79549
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/devices/kineticinroadbike/kineticinroadbike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ void kineticinroadbike::characteristicChanged(const QLowEnergyCharacteristic &ch
QByteArray encryptedData = newValue;
int dataSize = encryptedData.size();

if (dataSize < 14 || characteristic.uuid() != QBluetoothUuid(QStringLiteral("e9410201-b434-446b-b5cc-36592fc4c724"))) {
qDebug() << "Invalid data size";
return;
}

smart_control_power_data pD = smart_control_process_power_data((uint8_t *)newValue.data(), dataSize);

// Set the parsed values to the bike metrics
Expand Down

0 comments on commit 9c79549

Please sign in to comment.