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.
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?
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).
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