- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm trying to get data from a custom GAP peripheral, GATT server.
The peripheral sent data, and I can read GATT DB from CySmart, of course the services are unknown, but the data can be read and write.
Now, starting from PSoC_4_BLE_Central_IAS example, I try to read the same data.
• After the call back function initialization CyBle_Start(StackEventHandler) and CyBle_ProcessEvents(); I manage the events I scan for device CyBle_GapcStartScan(CYBLE_SCANNING_FAST);
• and after the CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT I get advertising data from evetparameter pointer.
• Found my device, I connect it by CyBle_GapcConnectDevice(&connectPeriphDevice);
• did this, I start GATT discovery calling CyBle_GattcStartDiscovery(connHandle) that does not return any event parameter (the documentation says this) and
• I need to discover my GATT services and attributes. I've used CyBle_GattcDiscoverAllPrimaryServices(connHandle); and CYBLE_EVT_GATTC_DISCOVERY_COMPLETEe event are generated
from here I'm not understand how continue.
Where are the discovered services?
Does CYBLE_EVT_GATTC_DISCOVERY_COMPLETE returns an evetparameter? (reading the BLE documentation, this is not clear).
The examples on central function are very few, Can I have some help?
Thanks, Fabrizio
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
After you call the GattcDiscoverAllPrimaryServices API, you will get the discovery data in chunks called (group) from the peripheral. Each time you receive a group, you will get the CYBLE_EVT_GATTC_READ_BY_GROUP_TYPE_RSP. You can obtain the data from the event parameter when you get this event. After all the discovery data is sent in multiple CYBLE_EVT_GATTC_READ_BY_GROUP_TYPE_RSP events, you will finally get the CYBLE_EVT_GATTC_DISCOVERY_COMPLETE event.
I have attached a Central / Clinet project which discovers all primary services and characteristics from a server and displays them.
Please find it attached. Use a UART Serial terminal (Like teraterm / coolterm) to test the project.
Regards,
- Madhu Sudhan