nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches
gatt_dm.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef BT_GATT_DM_H_
8#define BT_GATT_DM_H_
9
17#include <zephyr/bluetooth/gatt.h>
18#include <zephyr/bluetooth/uuid.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
28struct bt_gatt_dm;
29
39 struct bt_uuid *uuid;
41 uint16_t handle;
43 uint8_t perm;
44};
45
63 void (*completed)(struct bt_gatt_dm *dm,
64 void *context);
65
74 void (*service_not_found)(struct bt_conn *conn,
75 void *context);
76
86 void (*error_found)(struct bt_conn *conn,
87 int err,
88 void *context);
89};
90
104struct bt_gatt_service_val *bt_gatt_dm_attr_service_val(
105 const struct bt_gatt_dm_attr *attr);
106
121struct bt_gatt_chrc *bt_gatt_dm_attr_chrc_val(
122 const struct bt_gatt_dm_attr *attr);
123
133struct bt_conn *bt_gatt_dm_conn_get(struct bt_gatt_dm *dm);
134
144size_t bt_gatt_dm_attr_cnt(const struct bt_gatt_dm *dm);
145
156 const struct bt_gatt_dm *dm);
157
172 const struct bt_gatt_dm *dm,
173 const struct bt_gatt_dm_attr *prev);
174
192 const struct bt_gatt_dm *dm,
193 const struct bt_uuid *uuid);
194
206 const struct bt_gatt_dm *dm, uint16_t handle);
207
221 const struct bt_gatt_dm *dm,
222 const struct bt_gatt_dm_attr *prev);
223
224
237 const struct bt_gatt_dm *dm,
238 const struct bt_gatt_dm_attr *attr_chrc,
239 const struct bt_uuid *uuid);
240
259 const struct bt_gatt_dm *dm,
260 const struct bt_gatt_dm_attr *prev);
261
289int bt_gatt_dm_start(struct bt_conn *conn,
290 const struct bt_uuid *svc_uuid,
291 const struct bt_gatt_dm_cb *cb,
292 void *context);
293
306int bt_gatt_dm_continue(struct bt_gatt_dm *dm, void *context);
307
318int bt_gatt_dm_data_release(struct bt_gatt_dm *dm);
319
326#ifdef CONFIG_BT_GATT_DM_DATA_PRINT
327void bt_gatt_dm_data_print(const struct bt_gatt_dm *dm);
328#else
329static inline void bt_gatt_dm_data_print(const struct bt_gatt_dm *dm)
330{
331}
332#endif
333
334#ifdef __cplusplus
335}
336#endif
337
342#endif /* BT_GATT_DM_H_ */
struct bt_conn * bt_gatt_dm_conn_get(struct bt_gatt_dm *dm)
Get the connection object.
static void bt_gatt_dm_data_print(const struct bt_gatt_dm *dm)
Print service discovery data.
Definition gatt_dm.h:329
int bt_gatt_dm_continue(struct bt_gatt_dm *dm, void *context)
Continue service discovery.
int bt_gatt_dm_start(struct bt_conn *conn, const struct bt_uuid *svc_uuid, const struct bt_gatt_dm_cb *cb, void *context)
Start service discovery.
const struct bt_gatt_dm_attr * bt_gatt_dm_attr_next(const struct bt_gatt_dm *dm, const struct bt_gatt_dm_attr *prev)
Get next attribute.
int bt_gatt_dm_data_release(struct bt_gatt_dm *dm)
Release data associated with service discovery.
const struct bt_gatt_dm_attr * bt_gatt_dm_char_by_uuid(const struct bt_gatt_dm *dm, const struct bt_uuid *uuid)
Get the characteristic by its UUID.
const struct bt_gatt_dm_attr * bt_gatt_dm_desc_next(const struct bt_gatt_dm *dm, const struct bt_gatt_dm_attr *prev)
Get next descriptor.
size_t bt_gatt_dm_attr_cnt(const struct bt_gatt_dm *dm)
Get total number of attributes decoded.
struct bt_gatt_service_val * bt_gatt_dm_attr_service_val(const struct bt_gatt_dm_attr *attr)
Access service value saved with service attribute.
const struct bt_gatt_dm_attr * bt_gatt_dm_service_get(const struct bt_gatt_dm *dm)
Get service value.
const struct bt_gatt_dm_attr * bt_gatt_dm_desc_by_uuid(const struct bt_gatt_dm *dm, const struct bt_gatt_dm_attr *attr_chrc, const struct bt_uuid *uuid)
Search the descriptor by UUID.
struct bt_gatt_chrc * bt_gatt_dm_attr_chrc_val(const struct bt_gatt_dm_attr *attr)
Access characteristic value saved with characteristic attribute.
const struct bt_gatt_dm_attr * bt_gatt_dm_attr_by_handle(const struct bt_gatt_dm *dm, uint16_t handle)
Get attribute by handle.
const struct bt_gatt_dm_attr * bt_gatt_dm_char_next(const struct bt_gatt_dm *dm, const struct bt_gatt_dm_attr *prev)
Get next characteristic.
uint8_t perm
Definition gatt_dm.h:43
uint16_t handle
Definition gatt_dm.h:41
struct bt_uuid * uuid
Definition gatt_dm.h:39
Discovery Manager GATT attribute.
Definition gatt_dm.h:37
void(* completed)(struct bt_gatt_dm *dm, void *context)
Discovery completed callback.
Definition gatt_dm.h:63
void(* error_found)(struct bt_conn *conn, int err, void *context)
Discovery error found callback.
Definition gatt_dm.h:86
void(* service_not_found)(struct bt_conn *conn, void *context)
Service not found callback.
Definition gatt_dm.h:74
Discovery callback structure.
Definition gatt_dm.h:50