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

BLE/NRF51: how to not stop advertising on connect

The way i understood GAP, it's supposed to be some sort of stateless key/value protocol.

In order to get GAP working with an ibeacon, i took the ibeacon example, and changed m_adv_params.type from BLE_GAP_ADV_TYPE_ADV_NONCONN_IND to BLE_GAP_ADV_TYPE_ADV_IND

Then i used BLE Explorer for android to inspect the GAP services. All good, except the device stops advertising. So, not exactly stateless.

The nordic ble analyzer gives me no clue either. i can't even see what is happening during the GAP stuff, all i see is advertisment frames and then they stop. How do i get something more useful out of the ble analyzer (with the dongle), like actually see all the packages on the air?

This question devzone.nordicsemi.com/.../how-to-stop-the-advertising-after-connecting-the-master reveals that the S110 is neither intended not capable of advertising during connection. So i'm guessing this is a dead end. What other method would i use for a wide variety of devices to be able to get a single response to a single request without being able to lock each other out?

Specifically i am trying to implement a key-value scheme, where some device will ask for "key apples", and the nrf51 should respond with "value green". The information is totally public, and shouldn't require bonding. Would a scan response work?

thanks.

Parents
  • I can't really see any way to solve your use case except to let each device connect, run the query and then disconnect. This will cause small periods of lockout for the other devices, but these should be short (i.e. < 1 s), so unless you have very many devices and very short response time requirements, I don't think this should be a problem.

    The problem with a pure Broadcaster/Observer setup is the requirement to send a query to the device, as you don't have control over the contents of the Scan Request that the Observer sends. Its contents are defined in the Core Specification, and there is no room for user data. There is hence no way to transfer the value of the query to the Broadcaster without establishing a connection.

    I would not describe the GAP layer of the BLE specification as stateless, but it might make sense to talk about GATT as stateless. This is the layer at which data transfers happen once in a connection, but even here there is in some sense a state (for example if you're in the middle of a Long Writes, or if have enabled notifications).

Reply
  • I can't really see any way to solve your use case except to let each device connect, run the query and then disconnect. This will cause small periods of lockout for the other devices, but these should be short (i.e. < 1 s), so unless you have very many devices and very short response time requirements, I don't think this should be a problem.

    The problem with a pure Broadcaster/Observer setup is the requirement to send a query to the device, as you don't have control over the contents of the Scan Request that the Observer sends. Its contents are defined in the Core Specification, and there is no room for user data. There is hence no way to transfer the value of the query to the Broadcaster without establishing a connection.

    I would not describe the GAP layer of the BLE specification as stateless, but it might make sense to talk about GATT as stateless. This is the layer at which data transfers happen once in a connection, but even here there is in some sense a state (for example if you're in the middle of a Long Writes, or if have enabled notifications).

Children
No Data
Related