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

How to set the device to non connectable advertising mode?

Hi, We modified the ble_app_hrs code to work with accelerometer peripheral, and we have created some custom characteristics with custom uuid's. Now we need to set the device in non connectable advertisement mode, and after completing some operation we need to convert it to connectable advertisement mode. I tried with BLE_GAP_ADV_TYPE_ADV_NONCONN_IND, but it is not at all giving advertisement. Is there any other way to put the device non connectable advertisement mode? my logic is something like as below,

advertising_start(BLE_GAP_ADV_TYPE_ADV_NONCONN_IND);

Do_Some_Operation();

advertising_start(BLE_GAP_ADV_TYPE_ADV_IND);

Please suggest us how to implement this.

Regards, Balaji

Parents
  • You don't give a lot of information, but setting the .type of a ble_gap_adv_params_t structure to BLE_GAP_ADV_TYPE_ADV_NONCONN_IND is the correct way to advertise non-connectable. I assume that you check the error code of your adv_start call. What error do you get back?

    You should also be aware that there are further limitations on the allowed advertising intervals when advertising non-connectable, mainly that the interval must be at least 100 ms.

Reply
  • You don't give a lot of information, but setting the .type of a ble_gap_adv_params_t structure to BLE_GAP_ADV_TYPE_ADV_NONCONN_IND is the correct way to advertise non-connectable. I assume that you check the error code of your adv_start call. What error do you get back?

    You should also be aware that there are further limitations on the allowed advertising intervals when advertising non-connectable, mainly that the interval must be at least 100 ms.

Children
No Data
Related