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

s140 nRF52 v6.1.0 Softdevice. Debugging multiple advertising set configuration

I am attempting to implement an application using the s140 6.1.0 softdevice on an nRF52840 which "concurrently" advertises as a connectable device while at the same time transmits an iBeacon formatted non-connectable advertisement.

The idea is that we can transmit state information in the major/minor fields of the iBeacon packet and our central device (iOS mobile app) will be woken by the iBeacon and can decide whether to connect to the device to read more data using the connectable advertisement using a custom GATT service we defined.

We were hoping this method would reduce battery consumption as the mobile app wouldn't have to connect to our peripheral to understand state.

I attempted to implement this using two calls to sd_ble_gap_adv_set_configure() with two separate ad handles.  Each of my advertisement configurations work individually, but when I try and call this twice to initialize two handles that I can start and stop, I get a NRF_ERROR_NO_MEM on the second.

I found this comment on this tracker which indicates the v6.0.0 soft device does not allow multiple adv sets, so basically I can't do this.  Is this still true?
https://devzone.nordicsemi.com/f/nordic-q-a/35200/sd_ble_gap_adv_set_configure-returning-error-4-nrf_error_no_mem

I suppose alternatively, I will need to have one m_adv_handle:

  1. sd_ble_gap_adv_set_configure(&m_adv_handle, <iBeacon data + params>)
  2. sd_ble_gap_adv_start(m_adv_handle)
  3. I'll configure some timeout or event to happen
  4. sd_ble_gap_adv_stop(m_adv_handle)
  5. sd_ble_gap_adv_set_configure(&m_adv_handle, <Connectable adv data + params>)
  6. sd_ble_gap_adv_start(m_adv_handle)
  7. I'll configure some timeout or event to happen
  8. sd_ble_gap_adv_stop(m_adv_handle)
  9. Goto step 1

Questions:

1) Does v6.1.0 s140 softdevice not allow multiple advertisement handles?

2) Does this alternative seem like a reasonable approach to solve the problem?  I was originally going to have two advhandle {ahandle1, ahandle2} and simply start stop based on the handle and only have to call the configuration SD API once for each packet.

Parents Reply Children
Related