My app is a simple relay control system. I'm using a *022001 as as peripheral that advertises on button click (TO to the minimum 1 second) a command bit in which the Central, with the relay, scans the advertisement, stops scanning, toggles that relay, then resumes scanning. What is happening is that the Central processes the command and returns to scanning before the peripheral advertisement times out, so I believe it ends up being scanned multiple times, toggling the relay several times rather than just once. I tried Enabling Duplication filtering, but that ends up disregarding the advertisements sent afterward. My question is, what's a good method of either (A) Giving the Central just enough time to process the advertisement before stopping it on the peripheral end, or (B) Keeping the Central from processing an advertisement scan from the same peripheral before advertisement timing out?
If you stop and start the scanning again, duplicate filtering wont work. In this case, you have to manually keep track of the peripheral that is scanned already (by its address) and when it scans the same peripheral again you have to compare it with the previously scanned peripherals and just ignore it.
- Madhu Sudhan