bristlemouth / bm_protocol

Primary Bristlemouth firmware repository
https://www.bristlemouth.org/
Apache License 2.0
10 stars 7 forks source link

Fix/dont send reports when no managed sensors #81

Closed victorsowa12 closed 7 months ago

victorsowa12 commented 7 months ago

This is a fix for an edge case. In a system like devkit | soft if the SOFT were to go offline, before this fix we would have continued to send BMSensorData1 messages with empty payloads. Now we will only send a report if we have > 1 "managed/known" sensor in out latest topology.

Below we can see after the fix is implemented a line that reads: Adding sample for 24636777862fb376 to list this is the sensorController saying I didn't get anything from the soft sensor(node id 24636777862fb376), but here is a NAN report in case during the first sample the sensor was online. This is followed by a line No nodes to send data for, and this is the reportBuilder saying during our report window we had no known sensors appear in the topology, so we aren't going to send anything. In this case the node that is lost at the end 193e6faff528b841 is the devkit.

Screenshot 2024-02-05 at 9 55 40 AM