How to tell a central device that a peripheral's name has changed?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DeCo_1926091
Level 4
Level 4
First like received

As I understand it, in order to force an iOS central device to use a new device name when an old one has been stored in it's BLE cash, the peripheral must tell it that a new name exists or that the name has been changed.  Can anyone please explain exactly how to do this?

Thanks,

Dennis

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi Dennis,

You can do this using a notification from peripheral to central. Before doing that you have to perform the following steps:

1. You have a create a custom characteristic in your GATT server (peripheral) with number of bytes greater than or equal to the maximum length of your name.

2. Once the peripheral changes its name, you have to update this new name characteristic and you can send the notification to the central sending the new name. The API for sending notification is:

CYBLE_API_RESULT_T CyBle_GattsNotification (CYBLE_CONN_HANDLE_T connHandle, CYBLE_GATTS_HANDLE_VALUE_NTF_T *ntfParam)

Please go through the structure CYBLE_GATTS_HANDLE_VALUE_NTF_T to understand what does a notification packet contain.

You can find this API in the BLE component datasheet. You can refer the attached project to know how the above API can be used.

By this way you can actually inform the name change to central.

Thanks

Ganesh

View solution in original post

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
VenkataD_41
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi Dennis,

You can do this using a notification from peripheral to central. Before doing that you have to perform the following steps:

1. You have a create a custom characteristic in your GATT server (peripheral) with number of bytes greater than or equal to the maximum length of your name.

2. Once the peripheral changes its name, you have to update this new name characteristic and you can send the notification to the central sending the new name. The API for sending notification is:

CYBLE_API_RESULT_T CyBle_GattsNotification (CYBLE_CONN_HANDLE_T connHandle, CYBLE_GATTS_HANDLE_VALUE_NTF_T *ntfParam)

Please go through the structure CYBLE_GATTS_HANDLE_VALUE_NTF_T to understand what does a notification packet contain.

You can find this API in the BLE component datasheet. You can refer the attached project to know how the above API can be used.

By this way you can actually inform the name change to central.

Thanks

Ganesh

0 Likes