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

what will happen if somebody will connect to peripheral which has already 1 BLE connection established

What is expected behaviour of s132 device (4.0.2) if peripheral is initialized with periph_role_count=1 and somebody tries to connect when BLE connection is already establsihed? How this is handled from the point of view of  BLE standart?

Parents
  • Hi,

    This is a bit of an odd case. I am not aware of anything that covers this specifically in the Bluetooth specification, but that is probably because it is in itself invalid to use connectable advertising in a state where you cannot accept the connection.

    In practice, the SoftDevice will stop advertising when a central connects. If the application only supports a single connection, it will wait and not start connectable advertising until after a disconnect occurred. In this case, the scenario you have described never happens. You should get a NRF_ERROR_CONN_COUNT error returned from the call to sd_ble_gap_adv_start() in case you try to stat connectable advertising while in a connection with periph_role_count=1.

  • I agree with you but in my case after the  first connect I change advertising type to BLE_GAP_ADV_TYPE_ADV_NONCONN_IND. So I guess that this problem may be a problem of mobile ble framework that  does not detect type of adverts in such case.
    But anyway such scenario can happen.
    Let we have 2 ios devices.
    Both made discovering of the BLE peripheral, so CBPeriperal object is created on both devices.
    Let 1 device then connected to peripheral. After some time second device tries to connect when first connection is established.

    So what will be behavior of S132 stack in such case? Will peripheral receive nothing from central in such case on second connect?

  • The SoftDevice will not accept (or even listen for) a connection request if it advertises with non-connectable advertising (BLE_GAP_ADV_TYPE_ADV_NONCONN_IND), so nothing will happen in case the seconds device sends a connect request. I will simply be ignored.

Reply Children
No Data
Related