Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manufacturerData is not being updated fast enough #817

Open
Laestry opened this issue Nov 8, 2023 · 1 comment
Open

manufacturerData is not being updated fast enough #817

Laestry opened this issue Nov 8, 2023 · 1 comment

Comments

@Laestry
Copy link

Laestry commented Nov 8, 2023

Describe the bug
I have a ble device that advertises every second, one of the data it's advertising is the frame count in other words the amount of advertised packets (hope my terminology is correct). But using this library I'm not seeing a change every second but only about 5-7 seconds. The frame changes like this 1, 5, 10, 17. The data is stored in the manufacturerData.

To Reproduce
Steps to reproduce the behavior:

  1. scan for devices
  2. check for changes in manufacturerData

Expected behavior
The frame changes like this 1, 5, 10, 17 but I should be receiving changes in an order of 1, 2, 3, 4, 5, etc. On windows I'm using a program to scan for devices and during it's scan phase I'm getting constant one second updates, so the fault is not with the ble device.

Smartphone / tablet

  • Infinix Hot 30 Play NFC
  • android v13 Samsung galaxy a13. SM-A135U

Peripheral device

  • esp32 s3 as the ble to advertise

Additional context
The rssi is changing constantly, is there maybe a way to get the manufacturerData to update in the same interval as the rssi value?

@BenelliFurtado
Copy link

If this is still an issue for someone, here are some thoughts to consider:

  • Use lowLatency scan mode on Android
ble.scanForDevices(scanMode:` ScanMode.lowLatency)
  • Scanning if the app is in the background is considerably slower on most devices (and you need to filter for service UUIDs using withServices attribute)
  • Restart the scan at least every 30 seconds otherwise the it will slow down or stop entirely
  • Some devices simply seem to restrict the amount of scan results. From my experience iPhones and for example Google Pixel phones have extremely high scan rates (far more than 1 per sec.). I have a Nokia 7.2 that does not provide consistent scan results at all - it sometimes just pauses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants