This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to develop a GATT Client application?

I have a central device , that acting as a gatt server. the service is customize, and 128bit- primary serivice UUID ,its characteristics' UUIDs(128bit) are all known, how to discovery the service and characteristics in nrf51822 peripheral? I don't find any examples that has above function.

  • Hi,

    Thanks for clear response. One further question for same use case.

    How can you subscribe to GATT Servers discovered characteristic with "Indicate" or "Notify" ?

    I saw the Message Sequence Charts "GATTC Handle Value Indication" and "Notification", but missing the part how to enable GATT Server to send this values. I could not see any GATTC function to do it.

    Best Regards.

  • Hi Joe,

    You will need to enable notifications and/or indications by writing to the remote device's Client Characteristic Configuration Descriptor (CCCD) for the relevant Characteristic, setting a "1" in the relevant bits.

    Before that of course, you will have to discover the service, characteristic and descriptors that are of interest to you, so the procedure would be a sequence of the following in the Message Sequence Chart procedures:

    GATTC Primary Service Discovery GATTC Characteristic Discovery GATTC Descriptor Discovery GATTC Characteristic or Descriptor Value Write

    You can find example code in the SDK that implements this is ble_ans_c.c (see function cccd_configure() )

    Hope that helps.

    Regards,

    Carles

Related