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

For nrf52840 need to be change the BLE device name and set the Password example code!!

Dear !!

Good day!!

I want to change the device name using command from mobile along wither after setting the device name i want update the Password, so can you share any example code.

Regards

Chandru

Parents
  • Hi Chandru,

    Assuming you use the nRF5 SDK you can change the device name using sd_ble_gap_device_name_set(), for instance as suggested here. Note that the advertising data also needs to be generated again as you can see in the end of the snippet. This snippet shows how to do this from the nRF isolated. You can also write to the device name characteristic (UUID 0x2A00) from the phone as you suggest if you only use Android, but for iOS this is not possible. So another option would be to use another mechanism (typically another custom service) to set the device name from a mobile phone, and then use the code indicated above.

    Regarding password I am not sure what you refer to there. Can you elaborate?

    Einar

Reply
  • Hi Chandru,

    Assuming you use the nRF5 SDK you can change the device name using sd_ble_gap_device_name_set(), for instance as suggested here. Note that the advertising data also needs to be generated again as you can see in the end of the snippet. This snippet shows how to do this from the nRF isolated. You can also write to the device name characteristic (UUID 0x2A00) from the phone as you suggest if you only use Android, but for iOS this is not possible. So another option would be to use another mechanism (typically another custom service) to set the device name from a mobile phone, and then use the code indicated above.

    Regarding password I am not sure what you refer to there. Can you elaborate?

    Einar

Children
No Data
Related