Hello,
I am developing two systems. One is a peripheral that advertises both a beacon and a ble peripheral custom service (using nRF51822 with s110 softdevice). The second is a central that is supposed to both detect the beacon and be able to connect to the first system's peripheral service (using nRF51822 with s130 softdevice).
in on_ble_central_evt(ble_evt_t * p_ble_evt)
, just as in the examples, I parse the advertising report and check if the UUID matches that of the custom service. I also parse the report with another function to see if it is a beacon broadcast with the desired UUID.
If the peripheral advertises either as a beacon or as a ble service, I can successfully detect those cases. However, if I make it advertise both, very often the ble service seems to shadow the beacon, and I am never able to detect the beacon broadcast. I know both are there, because the Master Control app shows both (the entry for the peripheral alternates between beacon and ble service). If the central does detect the beacon, it seems to be able to successfully detect both the beacon and the peripheral from that point on. But each time I turn on the peripheral, it is almost a random chance whether the central will detect the beacon at all.
Is there something I should be doing to allow the central to see both the beacon and the peripheral service reliably? Alternatively, is there a way to have the softdevice preferentially look for a beacon? If so, I could force it to look for the beacon periodically.
Note that because the beacon and the peripheral are generated by the same device, they share the same peer address, and I wonder if that causes any issue on detection by the central.
Thanks!
EDIT: I was able to get this working somewhat by making the advertising interval for the ble service much longer than that of the beacon (e.g. beacon @ 500ms, ble service @ 2000ms), but still there are long periods where it sees only the ble service and not the beacon.