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

How to restart the ble interface?

I want to restart the radio portion of the softdevice - all of BLE essentially - to update the connection parameters and device name mostly. Is it necessary to re-initialize everything or is there a soft-device call that is more overarching? It just seems like I need to do a lot to accomplish a little and am unsure, at least at first, the correct order to perform all of these initializations:

// Initialize the BLE stack
err_code = sd_ble_enable(&ble_enable_params);
err_code = softdevice_ble_evt_handler_set(DispatchBleEvent);

// Initialize the Device Manager
err_code = dm_init(&init_data);
err_code = dm_register(&comms.app_handle, &register_param);

// Initialize the GAP parameters
err_code = sd_ble_gap_device_name_set(&sec_mode,
                                          (const uint8_t *)MY_DEVICE_NAME,
                                          strlen(MY_DEVICE_NAME));
err_code = sd_ble_gap_ppcp_set(&gap_conn_params);

// Initialize Services


// Initialize Connection Parameters

// Initialize Security Parameters

// Initialize Advertising

For soft-device S110 v8.0.0

Parents
  • Hi la-ble,

    If you simply want to change the device name and the connection preferred parameters you don't really have to disable softdevice and enable it again. You can change it on the fly. As far as I know only when you want to delete or modify a characteristic/service that you already declared, then you would need to re-initialize the softdevice.

Reply
  • Hi la-ble,

    If you simply want to change the device name and the connection preferred parameters you don't really have to disable softdevice and enable it again. You can change it on the fly. As far as I know only when you want to delete or modify a characteristic/service that you already declared, then you would need to re-initialize the softdevice.

Children
No Data
Related