Custom Client, looking for a good place to start | Cypress Semiconductor
Custom Client, looking for a good place to start
I am hoping to get create a custom client that will be able to handle data that it receives from a server/peripheral device. The server is sending data via notifications. I have already written the server side and was really pleased with all the good example projects that were helpful in development. Now that I am writing the client code, I am finding it slightly more difficult.
At this point, I have opened up the PSoC_4_Central_IAS example project in order to get a starting point for develping the client program that I need. The first thing that I did was call a few API's that I added to bleApplications.c in order to discover attribute. I called CyBle_GattcDiscoverAllPrimaryServices(), CyBle_GattcDiscoverAllCharacteristics(), and CyBle_GattcDiscoverAllCharacteristicDescriptors(). These all have returned with no error. Now that I have done that, I assume that my next step is to enable notifications to come from the server, and then log the data that the server gives me.
The main questions I have here are, what API do I call to do this? I was thinking about using GattcWriteCharacteristicDescriptors() and writing a 0x01 to UUUID 2902 which is the CCCD handle. Does this seem to make sense?
Then I am wondering what else I need to do on the client side to start getting the data that the server sends assuming I have successfully enabled notifications. Do I need to add all the services, characteristics, and descriptors that the server has to be identicle in the client Macro BLE block? At this point, I just mirrored the attributes of the server including all the same UUUID's. Is this necessary?
The final thing I am wondering, which sort of relates to the other questions I have asked, is where all the data that the server sends can be found. Is there a function that I should call that returns the value of the data being sent? Or is there some variable or struct that exists which holds the notification data?
I realize there are a lot of questions posed above and I am hoping that someone may have some insight or recommendations of places to go to get some more information, or perhaps an example project that would have some helpful examples.
Thanks for the input, I can clarify any questions you have in response to the above.