Skip to content

refactor(connections): Improve RSSI reading robustness#3804

Merged
jamesarich merged 2 commits into
mainfrom
fix/rssi
Nov 24, 2025
Merged

refactor(connections): Improve RSSI reading robustness#3804
jamesarich merged 2 commits into
mainfrom
fix/rssi

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

fixes crash @mdecourcy was seeing on main, slight adjustment to connection timing

This commit enhances the reliability of the RSSI (Received Signal Strength Indicator) reading for connected BLE devices.

- Introduces a 5-second timeout for the `readRssi` operation to prevent indefinite hangs.
- Implements more specific exception handling for `PeripheralNotConnectedException`, `OperationFailedException`, and `SecurityException` to gracefully exit the reading loop and provide clearer error logging.
- Removes the generic `Exception` catch block for more precise error management.
- Extracts magic numbers for the RSSI reading delay and timeout into named constants (`RSSI_DELAY`, `RSSI_TIMEOUT`).

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
@jamesarich jamesarich merged commit f781cab into main Nov 24, 2025
3 of 4 checks passed
@jamesarich jamesarich deleted the fix/rssi branch November 24, 2025 23:25
@github-actions github-actions Bot added the bugfix PR tag label Nov 25, 2025
@jamesarich jamesarich added this to the 2.7.8 milestone Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant