How to print or display BLE GATT NAME and ADVERTISING NAME?

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

In trying to troubleshoot a problem it would be helpful if I could confirm what values are in the BLE GATT NAME and ADVERTISING NAME.  Could someone please tell me how to display or print them, say to Tera Term?

Thanks,

Dennis

0 Likes
1 Solution

Hi Ganesh,

Dev Tech Support said, "A BLE device has two locations where a name can be designated. One is the advertisement, and that’s the advertised name. The other one is in the GATT table, and that is the GATT Name."  

i'm trying to confirm that the device name is the same in both places. 

Ultimately, I want to be able to change the remote device's name and have iOS update its cash so that it displays the new name in the pairing request alert.  According to Argun Tekant at Dev Support the only way to do this (other than completely resetting the iOS device) is to force it to re-read the GATT services and characteristics by implementing the "Services changed characteristic" and setting it to indicate that the GATT table has changed.

Since I don't know how to do this I'm taking a step-wise approach to be sure everything is right before I tell it the services have changed...when I finally find out how to do that. 

(In keeping with the forum rules of only dealing with one subject at a time, I've split my questions up into three posts).

Thanks,

Dennis

View solution in original post

0 Likes
3 Replies
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 refer the attached document which explains the procedure to enable printing through UART.

You can use the followin syntax to print the device advertisement name in your UART terminal. Please note that you have to use the following code after you have followed the attached document.

char devicename[20];

CyBle_GapGetLocalName(devicename);

printf("The device name is %s \r\n",devicename);

Also I have attached example projects for central and peripheral which helps in your development.

Can you please elaborate more on what do you mean by GATT name?

Thanks

Ganesh

0 Likes

Hi Ganesh,

Dev Tech Support said, "A BLE device has two locations where a name can be designated. One is the advertisement, and that’s the advertised name. The other one is in the GATT table, and that is the GATT Name."  

i'm trying to confirm that the device name is the same in both places. 

Ultimately, I want to be able to change the remote device's name and have iOS update its cash so that it displays the new name in the pairing request alert.  According to Argun Tekant at Dev Support the only way to do this (other than completely resetting the iOS device) is to force it to re-read the GATT services and characteristics by implementing the "Services changed characteristic" and setting it to indicate that the GATT table has changed.

Since I don't know how to do this I'm taking a step-wise approach to be sure everything is right before I tell it the services have changed...when I finally find out how to do that. 

(In keeping with the forum rules of only dealing with one subject at a time, I've split my questions up into three posts).

Thanks,

Dennis

0 Likes
lock attach
Attachments are accessible only for community members.

Hi Dennis,

By GATT name do you mean the BLE profile name? In case you mean profile name as GATT name please note that they would not be same.

The better way to change the local name would be to use another characteristic which stores String data and change it from your peer device using Notification/Write event. Based on the event triggered NOTIFY/WRITE the API SetLocalname() can be called.

You can see the attached code examples to manage the data transfer between Client and Server devices based on their role.

Thanks and regards

Ganesh

0 Likes