This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Discovering CHAR and services in central role.

Hi guys,

I would like to understand someting:

After have received GAP_LINK_ESTABLISHED event in my callback, I call the following service:

GAPCentralRole_StartDiscovery( DEFAULT_DISCOVERY_MODE,
DEFAULT_DISCOVERY_ACTIVE_SCAN,
DEFAULT_DISCOVERY_WHITE_LIST );

and then get the following response:

if ( pMsg->method == ATT_FIND_BY_TYPE_VALUE_RSP &&
pMsg->msg.findByTypeValueRsp.numInfo > 0 )
{
simpleBLESvcStartHdl = pMsg->msg.findByTypeValueRsp.handlesInfo[0].handle;
simpleBLESvcEndHdl = pMsg->msg.findByTypeValueRsp.handlesInfo[0].grpEndHandle;
}

(with pMsg->method realy equal to ATT_FIND_BY_TYPE_VALUE_RSP).

Someone can explain me what these values (pMsg->msg.findByTypeValueRsp.handlesInfo[0].handle and pMsg->msg.findByTypeValueRsp.handlesInfo[0].grpEndHandle) represent ? I didn't find any clear explanation.

Thanks

Mikael

  • Hey Mikael,

    What is happening is the central device is using a Find By Type Value to figure out the range of attribute handles that are included with the SIMPLEPROFILE_SERV on the peripheral side. The central device knows the UUID of this service so the find by type value request is sent using the type primary service and value of UUID. The request will then receive a handle and an end group handle (these are the two values you are asking about). These values give you the range of handles on the peripheral that are associated with the primary service with the value of SIMPLEPROFILE_SERV.

    After getting a range of handles the devices performs a read by type request over that range with the UUID of SIMPLEPROFILE_CHAR1_UUID. This will return the value of the characteristic with that particular UUID within the handle ranges (which in this case is the simple profile service).

    -Matt

  • OK Matt, thank you...

    I didnt found any details on this API in the datasheet ...

    so let me try now to read the characteristics through those handles... 

    Thank you very much.

    Mikael

  • Hey Mikael,

    I don't know how helpful it will be but we do have some API documentation. If you go into your install directory for the BLE stack (something like ./BLE-CC254x-1.4.0) and go to Documents and then BLE_API_Guide_main.htm. That should open an API guide. It doesn't have the most details of any API guide I've ever used but might give you some insight. ATT_ReadybyTypeRequest() is in BLE GATT API -> Modules -> ATT Client API Functions.

    -Matt