Zephyr API
4.4.99
A Scalable Open Source RTOS
Toggle main menu visibility
Loading...
Searching...
No Matches
data.h
Go to the documentation of this file.
1
5
6
/*
7
* Copyright (c) 2017 Nordic Semiconductor ASA
8
* Copyright (c) 2015-2016 Intel Corporation
9
*
10
* SPDX-License-Identifier: Apache-2.0
11
*/
12
#ifndef ZEPHYR_INCLUDE_BLUETOOTH_DATA_H_
13
#define ZEPHYR_INCLUDE_BLUETOOTH_DATA_H_
14
15
#include <stddef.h>
16
#include <
stdint.h
>
17
18
#ifdef __cplusplus
19
extern
"C"
{
20
#endif
21
31
#define BT_DATA_SERIALIZED_SIZE(data_len) ((data_len) + 2)
32
40
struct
bt_data
{
42
uint8_t
type
;
44
uint8_t
data_len
;
46
const
uint8_t
*
data
;
47
};
48
59
#define BT_DATA(_type, _data, _data_len) \
60
{ \
61
.type = (_type), \
62
.data_len = (_data_len), \
63
.data = (const uint8_t *)(_data), \
64
}
65
75
#define BT_DATA_BYTES(_type, _bytes...) \
76
BT_DATA(_type, ((uint8_t []) { _bytes }), \
77
sizeof((uint8_t []) { _bytes }))
78
91
size_t
bt_data_get_len
(
const
struct
bt_data
data[],
size_t
data_count);
92
106
size_t
bt_data_serialize
(
const
struct
bt_data
*input,
uint8_t
*output);
107
108
#ifdef __cplusplus
109
}
110
#endif
111
112
#endif
/* ZEPHYR_INCLUDE_BLUETOOTH_DATA_H_ */
bt_data_serialize
size_t bt_data_serialize(const struct bt_data *input, uint8_t *output)
Serialize a bt_data struct into an advertising structure (a flat array).
bt_data_get_len
size_t bt_data_get_len(const struct bt_data data[], size_t data_count)
Get the total size (in octets) of a given set of bt_data structures.
stdint.h
uint8_t
__UINT8_TYPE__ uint8_t
Definition
stdint.h:88
bt_data
Bluetooth data.
Definition
data.h:40
bt_data::type
uint8_t type
Type of scan response data or advertisement data.
Definition
data.h:42
bt_data::data_len
uint8_t data_len
Length of scan response data or advertisement data.
Definition
data.h:44
bt_data::data
const uint8_t * data
Pointer to Scan response or advertisement data.
Definition
data.h:46
zephyr
bluetooth
data.h
Generated on
for Zephyr API by
1.17.0