capacitor-community/bluetooth-le

Extend RequestBleDeviceOptions with matchMode and matchNum

raphaeldas opened this issue · 5 comments

Hi

I would like to submit a feature request:
For my current project it would be great to define the DeviceOptions for a BLEScan more precisly.
In the android developers documentation i can see some more settings like MATCH_MODE_* and MATCH_NUM_*.

It would be interesting for me adding this settings to get closer to my goal.
How much work would that be?

Thank you for this awesome plugin!
Best Regards

raphaeldas

Thank you for the feature request.

Can you describe a bit more why you need those settings? As they are only available on Android and not on iOS and web, I'd like to understand the use case a bit better. Thanks.

Thank you for your answer.
I try to implement presence detection. for this i only listen to the advertisment signals of known ble devices and check their signal strength. the whole thing works pretty well. however, i sometimes receive relatively few signal updates. 2 to about 10 seconds pass between one update and the next. i am now trying to improve this time lag. MATCH_NUM_MAX_ADVERTISEMENT sounds promising for me to get a signal update more often. So do MATCH_MODE_AGGRESSIVE as this mode should also show weaker signals, which is important for me to recognise when you leave a certain position.
Do you know what the default is for this settings if not defined?
And do you have any other idea on how to address this problem?

Thanks for your efforts!
Regards
Raphael

Any Updates on that?

pwespi commented

Screenshot 2023-01-04 at 21 46 55

These are the default scan settings used by Android, and the plugin overwrites the default scan mode to SCAN_MODE_BALANCED.

The plugin exposes setting the scan mode. The other options are not exposed. It would be possible to implement this, but I'm not sure if it's worth it since the default values already seem to be the ones you would like to use, correct?

Yes, you're right. The default options looking good for my case. Thank you for the clarification.