This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Turn LED off when not advertising nrf 52840 PCA10059 SDK 15.3

Good day

Im trying to switch off an LED when my relay/hopper is not advertising. I switch the LED on successfully when transmission starts but I'm struggling to do the sd_ble_gap_adv_stop check to switch the led off. This is a simple relay/hopper and retransmits the MAC address of a received beacon + its own address. It works very well and I manage to stop the advertising successfully after a tiem out. Just need to switch the LED off.

The scanning part

end loop while waiting for new data to come in for retransmission. I think this is where I need to switch my " adv in progress LED off"

From  what I have seen on the forum  here https://devzone.nordicsemi.com/f/nordic-q-a/14071/check-if-currently-advertising

in my "if (  ) " statement that is currently blank I need to check for a NRF_Success error code return but have not had any success.

any suggestions will be welcomed? :)