I'm struggling to make sense of how a GATT client discovers (custom) services supported by a connected GATT server.
What I'm seeing:
I have used Project #013 Client and server as a basis for what I'm doing. I've modified main.c of the peripheral (client) project to print services discovered by CyBle_GattcStartDiscovery(). The resulting list is accurate as long as services listed in the profiles tab of BLE component settings for each project match up.
If I add a service to the other (server) device the service is not in my list of discovered services although it is picked up in CySmart.
If I add a service to the client role of the peripheral device then this appears in my list (regardless of whether that service exists on the server).
Basically, My list of discovered services contains only those services contained in the client role section of the BLE component settings (profiles tab).
What I expected:
Well, I thought any services offered by the server would be detected by the client and appear in my list. I was hoping to have the ability to detect (and work with) custom services that were not pre-configured in the client device.
So, do I have to have any service added to the GATT client before I can expect it to play with a GATT server supporting that service?
I hope this question makes sense, I would appreciate if anyone could help clear this up for me. I feel like I've done a lot of reading but some areas of how all this works seem illusive.
A client does not need to have all the services that are present in the server. It can still discover the services in the server.
Please create a Tech support case and share the project with the changes you made. our engineers would review it and update you.
- Madhu Sudhan