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

ble_gap_cfg_device_name_t USAGE

Hi,

We have a requirement of reading the BLE Advertising name from flash instead of predefining it in as a MACRO.  I saw in the notes it says to use ble_gap_cfg_device_name_t. But I don't know the actual usage of it. Can you please direct me to an example where this API has been used.  

I have seen the structure reference for this but I am still not sure where and how to use it. 

Shall I remove SVCALL(SD_BLE_GAP_DEVICE_NAME_SET, uint32_t, sd_ble_gap_device_name_set(ble_gap_conn_sec_mode_t const *p_write_perm, uint8_t const *p_dev_name, uint16_t len)); from my code and add ble_gap_cfg_device_name_t ?? 

using nrf52840 and SDK 15.0.0

Please suggest!!

Thanks

Parents Reply
  • Hi,

    We are storing our serial number in flash and we want the device to advertise by that serial number.

    uint8_t * adv_address = 0x40000;

    ble_cfg_t* p_ble_cfg;
    ble_gap_cfg_device_name_t device_name;
    device_name.p_value = adv_address;

    Now can you tell me how to change the gap_params_init():

    static void gap_params_init(void) {

    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&sec_mode);

    err_code = sd_ble_gap_device_name_set(&sec_mode,
    (const uint8_t *)DEVICE_NAME,
    strlen(DEVICE_NAME));

    }

     Thanks,

Children
No Data
Related