SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By Encounterzz
#180910
I've been running into a strange problem trying to scan for peripheral devices using the BLE Mate 2. Using the example code in the Sparkfun library, I am able to successfully scan for devices using the do_central_example function. If I attempt to execute the function again, though (like using a loop), this results in module error being reported back from the BLE mate.
The second attempt I made to try to solve this was to reset the BLE mate using the setup_central_example function every time I wanted to scan. Doing this allowed the BLE mate to scan a couple of times. However, only the first scan returned an accurate device MAC address. The other scans were corrupted somehow, returning similar but not exact MAC addresses to the first one. And after a few moments, module error would happen again.
So I am confused. It looks like maybe the buffer isn't clearing out? Is there leftover data somehow getting in the way even when I flush the buffer? Could it be a timing issue?
On a side note, using the example code to reset the module causes the BLE mate to eventually go into a state where the both the blue and red lights are blinking, with the blue blinking at a higher frequency. Can anyone explain what's going on there?