How to read generic access profile

Been asked for a last minute change to a nrf project that is a the nrf being a client (central device)  that connects to a server and gets info to and from said server. All fine and working. 

However, we now need to access some info in the generic access profile of the server. 

Are there functions for extracting this information or do you have to write your own code to do this. So, along the lines of:

#define SERVICE_GENERIC_ACCESS 0x1800
#define UUID_CHARACTERISTIC_DEVICE_NAME 0x2A00

#define GAP_SERIVCE_VAL BT_UUID_16_ENCODE(SERVICE_GENERIC_ACCESS)
#define DEVICE_NAME_VAL BT_UUID_16_ENCODE(UUID_CHARACTERISTIC_DEVICE_NAME)

#define THE_GAP_SERVICE BT_UUID_DECLARE_16(GAP_SERIVCE_VAL)
#define DEVICE_NAME_CHARARCERISTIC BT_UUID_DECLARE_16(DEVICE_NAME_VAL)

bt_gatt_dm_start
(conn, THE_GAP_SERVICE, &gap_discovery_cb, &gap_struct
);

With gap_struct having to set up all the generic values in GAP.
Then in the gap_discovery_cb callback functions read the information out?

I was expecting and hoping that there would be existing functions to extract this kind of information,
but having spent hours ploughing through loads of info and grepping source code I can't see anything.



Thanks. 

Parents
  • Hello,

    As far as I know, we don't have any samples that reads the generic access profile. I would recommend that you check one of the central samples, such as the central_uart sample, that does service discovery. You can also call bt_gatt_dm_start() with the second parameter = NULL, so that it will report all services that it discovers, and not just the one that you specify.

    Best regards,

    Edvin

Reply
  • Hello,

    As far as I know, we don't have any samples that reads the generic access profile. I would recommend that you check one of the central samples, such as the central_uart sample, that does service discovery. You can also call bt_gatt_dm_start() with the second parameter = NULL, so that it will report all services that it discovers, and not just the one that you specify.

    Best regards,

    Edvin

Children
Related