In the UART BLE projects, the devices (central and peripheral) is getting connected automatically by checking the scan response data (manufacture specific data). Not by checking the BLE device name of peripheral.
Check the comparison done in CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT event. If the data matches, we are setting a flag peerDeviceFound true and is sending connect request if the flag sets.
Thanks & Regards,
I have changed the 'Device Name' to something different in the GAP Settings tab for the peripheral server workspace.
However, I also still see 'BLE_Serial' shown during CySmart connecting as well as when scanning using LightBlue Explorer iOS app from PunchThrough Design.
Where is this text string defined and how can it be changed?
Not sure if this string is cached somewhere on the iPhone since the module was probably called 'BLE_Serial' at one point in time.
iOS does cache the name. Basically, the internal CoreBluetooth APIs provides a ".name" property on a peripheral device object that appears in the scan. This value will be:
- Whatever is in the "Device Name" GATT characteristic if the peripheral has connected before, OR
- Whatever is in the advertisement/scan response data if the peripheral has not connected before but has a Name field in the adv/scanrsp data, OR
- Empty if the peripheral has never been connected and has not provided any Name data in advertisements yet
...in that order. However, scan result structures also provide direct access to the advertised name value separately, which will contain whatever is actually in the advertisement or scan response data even if it is not the same as what's in the (cached) GATT structure. Usually mobile apps use what is in the .name property on the object for simplicity. It is possible to write code that pulls the name from advertisement data first (if possible), but usually this is overkill since most production apps don't need to worry about a dynamically changing name.
In your case, you should be able to clear the iOS cache for that device by (1) cycling Bluetooth off and back on again, and/or (2) removing that device's bond info from the phone in Bluetooth Settings, if it has bonded before.
I already tried cycling the BT capability in the iOS Settings GUI. I don't remember if I ever bonded it since I used the BLE UART demo workspace verbatim which doesn't have ANCS. But, I might have bonded it during a modification test a few months ago. In any event, I would have removed it from iOS 'My Devices' list.... and it is not listed anymore.
So, not sure what's happening here. Using CySmart does indeed show the new device name in the advertised list, but when clicking on the device,,, a splash shows up with the nagging "BLE_Serial" name listed as the device being connected instead of the new device name listed in the advertised list.
You're correct that if the device isn't in the list, then there's no current bond data stored. I just searched for additional relevant info online, and this Apple Developer Forum post indicates that you actually have to reset the iOS device in order to clear the cache that includes the name:
Someone on staff at Apple said so in the confirmed answer. So, I would try rebooting and see if that takes care of it.
hello jrow And Anjana Murlidharan
I Have Problem Related with Write And Read Data From App Using BLE CYBL-10161
In My Project I use The Third Party App, When I Connect The BLE to App It Get Connected Successfully,And After That App Shows "" Reading System Please Wait.."".
This means that App Asking For Or Wants To Read Some Attributes From BLE( I'm Replacing Previous BLE with CYBL-10161 BLE With Same App),
So Can I know that Exactly Which Attribute App Ask Or Want's To Read.
And I Also Wants To Know Exactly Which Event Occur When App Ask Or Wants To Read Attribute
My Project Stuck Here
""When BLE Wants To Write Data On App And When App Wants To Read Data From BLE"".
I'm New To Cypress BLE's.
Please Give Your Valuable Response To me.
Look under the BLE_Stack.h file for the event CYBLE_EVT_GATTC_READ_ events, as those will be related with the different methods of the app reading data from the chip.
When one of the events occurs, they will have associated event parameters that will describe what is being read/requested, and other related information.