Skip to content

best mode/setup for enabling duplicates but deduping packets within certain timeframe #733

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

Closed
scripter-co opened this issue Oct 17, 2024 · 1 comment

Comments

@scripter-co
Copy link

I have a device that receives data from another devices once every 3 minutes. it sends packets at 80ms intervals for one second.

to avoid receiving all the packets advertised over that 1 second, what's the best way to setup nimble?

  • i tried using duplicates = false setAdvertisedDeviceCallbacks(callback, false) and setting a low value of setMaxResults
  • setMaxResults(0) and duplicates = true and then setting a flag within onResult e.g. isChecking to ensure we only get 1 packet until we've processed it then reset using esp_timer_create after N seconds.

the former caused advertisements to be lost (sometimes by 15 minutes) and the later caused what I think is a memory leak (although haven't had time to look into this with certainty)

any expertise on this would be appreciated

@scripter-co
Copy link
Author

i've got my answer here

i think this combined with restarting every ~20 minutes to avoid the memory leak discussed here should do for now.

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

1 participant