nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
gattp.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef BT_GATTP_H_
8#define BT_GATTP_H_
9
18#include <zephyr/bluetooth/gatt.h>
19#include <zephyr/bluetooth/conn.h>
20#include <bluetooth/gatt_dm.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
29 uint16_t start_handle;
30
32 uint16_t end_handle;
33};
34
35struct bt_gattp;
36
44typedef void (*bt_gattp_indicate_cb)(
45 struct bt_gattp *gattp,
46 const struct bt_gattp_handle_range *handle_range,
47 int err);
48
50struct bt_gattp {
52 struct bt_conn *conn;
53
55 uint16_t handle_sc;
56
58 uint16_t handle_sc_ccc;
59
61 struct bt_gatt_subscribe_params indicate_params;
62
65
67 atomic_t state;
68};
69
77int bt_gattp_init(struct bt_gattp *gattp);
78
92int bt_gattp_handles_assign(struct bt_gatt_dm *dm,
93 struct bt_gattp *gattp);
94
105
114
115#ifdef __cplusplus
116}
117#endif
118
123#endif /* BT_GATTP_H_ */
int bt_gattp_init(struct bt_gattp *gattp)
Initialize the GATT profile instance.
void(* bt_gattp_indicate_cb)(struct bt_gattp *gattp, const struct bt_gattp_handle_range *handle_range, int err)
Service Changed Indication callback function.
Definition: gattp.h:44
int bt_gattp_handles_assign(struct bt_gatt_dm *dm, struct bt_gattp *gattp)
Assign handles to the GATT profile instance.
int bt_gattp_unsubscribe_service_changed(struct bt_gattp *gattp)
Unsubscribe from the Service Changed indication.
int bt_gattp_subscribe_service_changed(struct bt_gattp *gattp, bt_gattp_indicate_cb func)
Subscribe to the Service Changed indication.
uint16_t end_handle
Definition: gattp.h:32
uint16_t start_handle
Definition: gattp.h:29
Structure for Service Changed handle range.
Definition: gattp.h:27
struct bt_gatt_subscribe_params indicate_params
Definition: gattp.h:61
struct bt_conn * conn
Definition: gattp.h:52
atomic_t state
Definition: gattp.h:67
uint16_t handle_sc
Definition: gattp.h:55
uint16_t handle_sc_ccc
Definition: gattp.h:58
bt_gattp_indicate_cb indicate_cb
Definition: gattp.h:64
GATT profile instance.
Definition: gattp.h:50