nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
throughput.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_THROUGHPUT_H_
8#define BT_THROUGHPUT_H_
9
17#include <zephyr/bluetooth/uuid.h>
18#include <zephyr/bluetooth/conn.h>
19#include <bluetooth/gatt_dm.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
27
29 uint32_t write_count;
30
32 uint32_t write_len;
33
35 uint32_t write_rate;
36};
37
50 uint8_t (*data_read)(const struct bt_throughput_metrics *met);
51
59 void (*data_received)(const struct bt_throughput_metrics *met);
60
68 void (*data_send)(const struct bt_throughput_metrics *met);
69};
70
74 uint16_t char_handle;
75
77 struct bt_gatt_read_params read_params;
78
81
83 struct bt_conn *conn;
84};
85
87#define BT_UUID_THROUGHPUT_CHAR BT_UUID_DECLARE_16(0x1524)
88
89#define BT_UUID_THROUGHPUT_VAL \
90 BT_UUID_128_ENCODE(0x0483dadd, 0x6c9d, 0x6ca9, 0x5d41, 0x03ad4fff4abb)
91
93#define BT_UUID_THROUGHPUT \
94 BT_UUID_DECLARE_128(BT_UUID_THROUGHPUT_VAL)
95
104int bt_throughput_init(struct bt_throughput *throughput,
105 const struct bt_throughput_cb *cb);
106
123int bt_throughput_handles_assign(struct bt_gatt_dm *dm,
124 struct bt_throughput *throughput);
125
135int bt_throughput_read(struct bt_throughput *throughput);
136
146int bt_throughput_write(struct bt_throughput *throughput,
147 const uint8_t *data, uint16_t len);
148
149#ifdef __cplusplus
150}
151#endif
152
157#endif /* BT_THROUGHPUT_H_ */
int bt_throughput_read(struct bt_throughput *throughput)
Read data from the server.
int bt_throughput_write(struct bt_throughput *throughput, const uint8_t *data, uint16_t len)
Write data to the server.
int bt_throughput_handles_assign(struct bt_gatt_dm *dm, struct bt_throughput *throughput)
Assign handles to the Throughput Service instance.
int bt_throughput_init(struct bt_throughput *throughput, const struct bt_throughput_cb *cb)
Initialize the GATT Throughput Service.
uint8_t(* data_read)(const struct bt_throughput_metrics *met)
Data read callback.
Definition: throughput.h:50
void(* data_send)(const struct bt_throughput_metrics *met)
Data send callback.
Definition: throughput.h:68
void(* data_received)(const struct bt_throughput_metrics *met)
Data received callback.
Definition: throughput.h:59
Throughput callback structure.
Definition: throughput.h:39
uint32_t write_count
Definition: throughput.h:29
uint32_t write_rate
Definition: throughput.h:35
uint32_t write_len
Definition: throughput.h:32
Throughput metrics.
Definition: throughput.h:26
struct bt_throughput_cb * cb
Definition: throughput.h:80
struct bt_gatt_read_params read_params
Definition: throughput.h:77
uint16_t char_handle
Definition: throughput.h:74
struct bt_conn * conn
Definition: throughput.h:83
Throughput structure.
Definition: throughput.h:72