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

nRF Beacon with Scanning Feature

Hi,

I have a couple of nRF Beacons and want to change the program so that it scans for iBeacon packets before starting to advertise.

The flashed program is just advertising and I think uses S110 soft device. Correct me if I'm wrong:

  • For adding the scan feature I have to program S130, and I expect that the same program (advertising) should work without any change, but it will just give me the feature of scanning too.

  • I need a simple example for "scanning". I think the "Sniffer" program does that on the nRF DKs but that one is in HEX only.

  • I found this topics: devzone.nordicsemi.com/.../

I think I should be able to use the scanning features from that program, but as the program was with S130 0.9.0-1 and PCA10001, would it cause a problem? I'm still a beginner about nRF MCU registers and board specific pins, but I think one of the tutorials was saying that you can change the target board in Keil and the required header files will be added, so that the program should run on a different board (here PCA20006).

Thanks, FA main_woPointer.c main_wPointer.c

  • @FA: When you have addition question, please create a new case.

    This check:

    while (start <= 2)
    		{
    			if (start == 4)
    			{
    

    Doesn't make much sense because you only stay in side the loop when start <=2. If start =3 it will exit the loop. You have pretty small chance that it would be incremented by 2 just between the 2 instructions.

    I don't have the PCA20006 here for testing. That's why I asked for a simple example that I can test with 1 single board, prefer the PCA10028.

  • Those queations are exactly related to the program that was sent to me as part of one of the answers. If I was reading a post I prefer to have all related problems at one place. Also, this doesn't make sense that you don't answer it jist because you think it ahould not be here. The program I sent just has one additional WHILE loop compared to the one Petter sent, so it's fairly simple and it was written for another board, maybe PCA10028 that you want I think. So, it's easy to test if you want. About the condition inside the loop, you didn't read my explanation completely, that was exaxtly my point. As long as I just check a condition inside, even if it's always wrong, the program works as expected. That condition is just a dummy one for the main and is there just to make the WHILE loop working.

Related