Conversation
|
--- Part 1/2 --- Ahoy there, matey! This here pull request be a hefty one, but worry not—I’ll be navigating through these murky code waters to raise me flag on some observations! Let’s dive straight into the depths! 1. Code Quality and Potential Issues ⚙️(a) General Code Cleanup and Structure
(b) Implicit/Explicit Conversions
(c) DRYer Code ApproachYer duplicatin' notable portions of yer code—like how ye be checking cadence to ensure it falls within bounds. Examples:
Ye could extract such validation into a helper function like 2. Security Concerns 🏴☠️(a) UDP Logging with BLE_UDPLoggingYer new case handling for if (rxValue[0] == cc_write) {
userConfig->setUdpLogEnabled(rxValue[2]);
}Ye might want to validate that (b) BLE SecurityIn if (adevName.startsWith("IC Bike")) {
resistanceRangeCharacteristic = nullptr;
}It’s great ye be filterin' out erroneous devices like Schwinn IC4 bikes. But do bear in mind: spoofing device names can lead to bypasses. Secure this by more deterministic means, like verifying specific device characteristics or IDs. (c) Floating-Point Precision IssuesYe be heavy on calculations involvin’ floatin’ point numbers (e.g., cadence computations). These could suffer from precision drift, especially over time or when scaled to high values. Potential for edge-case issues—be cautious and test thoroughly. 3. Performance Implications ⚡(a) Rounding/PrecisionYe be liberal with yer (b) ResistanceModel ComputationYer (c) BLE Logging SpamToo much logging, like here: String rrLog = "FTMS Resistance Range raw data:";
for (size_t i = 0; i < rr.size(); i++) {
...
rrLog += " " + String(buf);
}Logs be growin' exponentially. If UDP |
No description provided.