I am trying to figure out how to configure my peripheral such that when a central client tires to enable the service changed characteristic that it succeeds. I am desperately looking for an example since GATT and GAP service databases are configured internally. So I search the documentation and get this example
I find the example to see this
@details This file contains the main source code for a sample server application that uses the
GATT Service. This client can be used to send Service Changed indications. This is
needed if your application changes its GATT tables by removing or adding
services. If we send a Service Changed indication, a typical action is for the peer
device to rediscover the services of our GATT database.
For more information about the GATT Service, see "Defined Generic Attribute Profile Service"
in Bluetooth Specification Version 5.0 Vol 3, Part G Section 7.
Client? a sample server application that uses the
GATT Service? which is it, a server peripheral or a client central? Why do they call this server a client? Why does this example SCAN and not advertise? How many times does a central support services?
I have a heart rate peripheral and I want the central to enable indications on the Service Changed characteristic and then I want to send a service changed indication on a reconnect. The Android central sees the characteristic and tries to enable indications. It fails. I don't know why. I have not done anything special in the hr monitor to allow the characteristic descriptor to be configured, but I didn't think that was necessary. The GATT services are configured under the hood, not by me.
So I was hoping there would be some documentation or example that would explain how this is done. I have found neither, and the documentation/example has left me in a further state of confusion. Appreciate any one who has managed to navigate though this (not sure what to call it) and has been able to implement a peripheral whose service changed can be configured to send indications by a central and then actually send a service changed event (if I could do step one, step two seems easy ... just a single call, unless there are twists there I have not yet stumbled on).
It would also be great if I could understand what the documentation writers mean when they use the word 'server' and 'client' and why 'servers' scan and not advertise.The use of these terminologies have made reading the documentation very difficult. I have to rely just looking at the API references and go from there.