nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches

◆ bt_gatt_dm_start()

int bt_gatt_dm_start ( struct bt_conn * conn,
const struct bt_uuid * svc_uuid,
const struct bt_gatt_dm_cb * cb,
void * context )

#include <include/bluetooth/gatt_dm.h>

Start service discovery.

This function is asynchronous. Discovery results are passed through the supplied callback.

Note
Only one discovery procedure can be started simultaneously. To start another one, wait for the result of the previous procedure to finish and call bt_gatt_dm_data_release if it was successful.
Parameters
[in]connConnection object.
[in]svc_uuidUUID of target service or NULL if any service should be discovered.
[in]cbCallback structure.
[in,out]contextContext argument to be passed to callback functions.
Note
If svc_uuid is set to NULL, all services may be discovered. To process the next service, call bt_gatt_dm_continue.

If svc_uuid is set to the service UUID, all service instances may be discovered. Call bt_gatt_dm_continue to discover the next service instance.

Return values
0If the operation was successful. Otherwise, a (negative) error code is returned.