Closed lizziemac closed 6 months ago
Hi Lizzie
When a central connects there is almost nothing known about it. The only thing you can count on is the mac address being there. So the RSSI value is the default -255. It seems that Bluez only updates RSSI values when it is discovering/scanning. But as a peripheral you typically don't scan so the RSSI value isn't there. Even when scanning, after a connection is made the RSSI value is never updated.
Of course this is a Bluez limitation because in theory it should be possible to get the RSSI for a connection. On Android for example, it is possible. You could try to request this feature to the Bluez team.
All in all, I'd say your approach is not feasible at the moment.
Thanks for the response! I appreciate it. I'll close this out
I have a device, acting as a Bluetooth peripheral, that I would like to have reject pairing requests from central devices that are not within a certain RSSI range. Specifically, I want to block devices that have a weak signal strength from pairing, ensuring that only devices in close proximity can establish a connection.
Here's the approach I've attempted in my code:
However, the
rssi
value seems to default to-255
, leading to all requests being rejected, regardless of their actual signal strength. I'm thinking that the peripheral might not be able to obtain the RSSI value of the central device before pairing, which would be the root cause of the issue. Is my current understanding correct, or is there a different method to achieve this functionality?Thank you in advance for your insights and help!