Zephyr Project API  3.1.0
A Scalable Open Source RTOS
att.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 2016 Intel Corporation
7 *
8 * SPDX-License-Identifier: Apache-2.0
9 */
10#ifndef ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_
11#define ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_
12
13#include <zephyr/sys/slist.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
20/* Error codes for Error response PDU */
21#define BT_ATT_ERR_SUCCESS 0x00
22#define BT_ATT_ERR_INVALID_HANDLE 0x01
23#define BT_ATT_ERR_READ_NOT_PERMITTED 0x02
24#define BT_ATT_ERR_WRITE_NOT_PERMITTED 0x03
25#define BT_ATT_ERR_INVALID_PDU 0x04
26#define BT_ATT_ERR_AUTHENTICATION 0x05
27#define BT_ATT_ERR_NOT_SUPPORTED 0x06
28#define BT_ATT_ERR_INVALID_OFFSET 0x07
29#define BT_ATT_ERR_AUTHORIZATION 0x08
30#define BT_ATT_ERR_PREPARE_QUEUE_FULL 0x09
31#define BT_ATT_ERR_ATTRIBUTE_NOT_FOUND 0x0a
32#define BT_ATT_ERR_ATTRIBUTE_NOT_LONG 0x0b
33#define BT_ATT_ERR_ENCRYPTION_KEY_SIZE 0x0c
34#define BT_ATT_ERR_INVALID_ATTRIBUTE_LEN 0x0d
35#define BT_ATT_ERR_UNLIKELY 0x0e
36#define BT_ATT_ERR_INSUFFICIENT_ENCRYPTION 0x0f
37#define BT_ATT_ERR_UNSUPPORTED_GROUP_TYPE 0x10
38#define BT_ATT_ERR_INSUFFICIENT_RESOURCES 0x11
39#define BT_ATT_ERR_DB_OUT_OF_SYNC 0x12
40#define BT_ATT_ERR_VALUE_NOT_ALLOWED 0x13
41
42/* Common Profile Error Codes (from CSS) */
43#define BT_ATT_ERR_WRITE_REQ_REJECTED 0xfc
44#define BT_ATT_ERR_CCC_IMPROPER_CONF 0xfd
45#define BT_ATT_ERR_PROCEDURE_IN_PROGRESS 0xfe
46#define BT_ATT_ERR_OUT_OF_RANGE 0xff
47
48/* Version 5.2, Vol 3, Part F, 3.2.9 defines maximum attribute length to 512 */
49#define BT_ATT_MAX_ATTRIBUTE_LEN 512
50
51/* Handle 0x0000 is reserved for future use */
52#define BT_ATT_FIRST_ATTRIBUTE_HANDLE 0x0001
53#define BT_ATT_FIRST_ATTTRIBUTE_HANDLE __DEPRECATED_MACRO BT_ATT_FIRST_ATTRIBUTE_HANDLE
54/* 0xffff is defined as the maximum, and thus last, valid attribute handle */
55#define BT_ATT_LAST_ATTRIBUTE_HANDLE 0xffff
56#define BT_ATT_LAST_ATTTRIBUTE_HANDLE __DEPRECATED_MACRO BT_ATT_LAST_ATTRIBUTE_HANDLE
57
58#if defined(CONFIG_BT_EATT)
59#if defined(CONFIG_BT_TESTING)
60
61int bt_eatt_disconnect_one(struct bt_conn *conn);
62
63/* Reconfigure all EATT channels on connection */
64int bt_eatt_reconfigure(struct bt_conn *conn, uint16_t mtu);
65
66#endif /* CONFIG_BT_TESTING */
67
84int bt_eatt_connect(struct bt_conn *conn, size_t num_channels);
85
93size_t bt_eatt_count(struct bt_conn *conn);
94
95#endif /* CONFIG_BT_EATT */
96
97#ifdef __cplusplus
98}
99#endif
100
101#endif /* ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_ */
Bluetooth connection handling.
Single-linked list implementation.
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89