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

Advertise 'Connected' when connected

Hello,

we are developing an asset tracking solution. The Noridic send out BLE Advertisements to show, that they are still available. These signals are received by Receivers in the room. So far, so common.

The special thing in our case is, that the Trackers are connectable. When somebody (not the Receivers) connect to the Trackers, they don't send out Advertisements any more. So the Receivers don't get the "Heartbeat" anymore and think the Devices have left the room and start an alarm.

So the expected behavior could be one of these two options:

  • (Prefered): When a connection is established, they send out a 'Connected' Signal, so the Receivers can remove them from the list of Objects that need to be tracked. (Kind of a sign off the system). We are already using the Manufacturer Specific Data for stuff like that.
  • Continue the advertisement when connected.

We are using SDK 15.3.0 with Softdevice 6.1.1 on Nordic NRF52340.

Thanks for your help in advance!

Sebastian

Parents Reply Children
  • Hello awneil,

    I read your thread back and forth and again. I understand that with the proposed code, it is possible to change the Advertisement Type. I'm still a bit lost though. Could you please give a little more detailed answer to my question?

    Thanks!

  • Especially one question is still not solved in my head: How can I prevent the chip from stopping the advertisement when connected?

  • Are you using the Advertising Module?

    Do you want to continue connectable advertising, or switch to non-connectable?

  • Yes, I'm using the Advertising Module.

    Switching to non-connectable would be preferable.

  • As noted in the other thread, the Advertising Module doesn't support non-connectable - so you have to do that bit manually.

    You can still use the Advertising Module to do your "normal"  (connectable) advertising (I use the Advertising Module to initially start advertising).

     In my BLE Event Handler, I have:

    my advertising_start() decides whether to start Connectable or Non-Connectable advertsing, based on the g_conn_handle:

    Note that I am updating the Manufacturer-Specific Data in the Advertising Data each time I (re-)start - just omit that if you don't want it.

    One of the things in my Manufacturer-Specific Data is a flag which identifies whether the unit is busy (ie, already connected) or not - so that things other don't try to connect while the device is already connected. 

    This is because not all Centrals pas the 'connectable' flag to the application.

    Disappointed