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

Multiactivity_beacon advertiser for nRF52 (Service and iBeacon together)

I am trying to port the experimental_ble_app_multiactivity_beacon advertiser example to nRF52.

I have used the document 'Migrating an nRF51 BLE project to nRF52' (infocenter.nordicsemi.com/index.jsp

I have only changed the Memory Areas as follows:

  • IROM1: 0x1C000/0x64000
  • IRAM1: 0x20002080/0xDF80

Moreover, I have changed:

  • APP_COMPANY_IDENTIFIER to 0x004C
  • BEACON_UUID, BEACON_MAJOR, BEACON_MINOR as per my needs.

(I did exactly the same with ble_app_beacon which worked as expected).

All the services are properly advertised and I am able to connect to them, but unfortunately the iBeacon is not detected by my iOS device.

I have also tried the timeslot variation, but I am not able to compile because of this error:

cannot open source input file "ble_stack_handler_types.h": No such file or directory

Can anyone help me with this or point me to a working sample of a BLS service together with iBeacon?

Tks

  • @fab: Please use one of these to capture the advertising packet and send me the screenshot:

    • Master Control Panel application on PC
    • NRF Master Control Panel app on Android
    • nRF Sniffer.

    The screenshot that you took didn't show much information about the advertising packet.

  • Hi Hung, thank you for your support. I eventually made it working. Using Master Control Panel on Android I realized that the minor value was wrong: 256 instead of 1. This because the major/minor have to be expressed in little endian format. What fooled my is that in the ibeacon example major/minor are in big endian format instead.

    Unfortunately, I have not reached my actual goal yet. I need to make the ibeacon advertise all the time and not when a device is connected. I think I need timeslot api. Is there any specific example to start with?

  • Hi fab,

    Please be aware that by spec, iBeacon should be advertise with the non-connectable flag set. So you won't be able to connect to the beacon when it's advertise with the iBeacon data. So you still need to advertise with normal mode (non beacon)

    What you can do is to use a timer and switch between the two advertising data and flags. You only need to call sd_ble_gap_adv_data_set() with the appropriate parameter to change the advertising data and flags. If you use ble_advertising.c module, you can call ble_advertising_init() instead.

Related