2016-02-17 11:21:58 +02:00
|
|
|
/** @file
|
|
|
|
* @brief Attribute Protocol handling.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Intel Corporation
|
|
|
|
*
|
2017-01-18 17:01:01 -08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2016-02-17 11:21:58 +02:00
|
|
|
*/
|
2018-09-14 10:43:44 -07:00
|
|
|
#ifndef ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_
|
|
|
|
#define ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_
|
2016-02-17 11:21:58 +02:00
|
|
|
|
2019-08-12 12:54:12 -05:00
|
|
|
#include <sys/slist.h>
|
|
|
|
|
2016-02-17 11:21:58 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Error codes for Error response PDU */
|
2020-09-23 13:55:48 -05:00
|
|
|
#define BT_ATT_ERR_SUCCESS 0x00
|
2016-02-17 11:21:58 +02:00
|
|
|
#define BT_ATT_ERR_INVALID_HANDLE 0x01
|
|
|
|
#define BT_ATT_ERR_READ_NOT_PERMITTED 0x02
|
|
|
|
#define BT_ATT_ERR_WRITE_NOT_PERMITTED 0x03
|
|
|
|
#define BT_ATT_ERR_INVALID_PDU 0x04
|
|
|
|
#define BT_ATT_ERR_AUTHENTICATION 0x05
|
|
|
|
#define BT_ATT_ERR_NOT_SUPPORTED 0x06
|
|
|
|
#define BT_ATT_ERR_INVALID_OFFSET 0x07
|
|
|
|
#define BT_ATT_ERR_AUTHORIZATION 0x08
|
|
|
|
#define BT_ATT_ERR_PREPARE_QUEUE_FULL 0x09
|
|
|
|
#define BT_ATT_ERR_ATTRIBUTE_NOT_FOUND 0x0a
|
|
|
|
#define BT_ATT_ERR_ATTRIBUTE_NOT_LONG 0x0b
|
|
|
|
#define BT_ATT_ERR_ENCRYPTION_KEY_SIZE 0x0c
|
|
|
|
#define BT_ATT_ERR_INVALID_ATTRIBUTE_LEN 0x0d
|
|
|
|
#define BT_ATT_ERR_UNLIKELY 0x0e
|
|
|
|
#define BT_ATT_ERR_INSUFFICIENT_ENCRYPTION 0x0f
|
|
|
|
#define BT_ATT_ERR_UNSUPPORTED_GROUP_TYPE 0x10
|
|
|
|
#define BT_ATT_ERR_INSUFFICIENT_RESOURCES 0x11
|
2019-01-31 15:31:09 +02:00
|
|
|
#define BT_ATT_ERR_DB_OUT_OF_SYNC 0x12
|
|
|
|
#define BT_ATT_ERR_VALUE_NOT_ALLOWED 0x13
|
2016-02-17 11:21:58 +02:00
|
|
|
|
2016-02-17 14:20:46 +02:00
|
|
|
/* Common Profile Error Codes (from CSS) */
|
2017-01-13 12:57:56 +02:00
|
|
|
#define BT_ATT_ERR_WRITE_REQ_REJECTED 0xfc
|
2016-02-17 14:20:46 +02:00
|
|
|
#define BT_ATT_ERR_CCC_IMPROPER_CONF 0xfd
|
|
|
|
#define BT_ATT_ERR_PROCEDURE_IN_PROGRESS 0xfe
|
|
|
|
#define BT_ATT_ERR_OUT_OF_RANGE 0xff
|
|
|
|
|
2020-07-24 17:06:34 +02:00
|
|
|
/* Version 5.2, Vol 3, Part F, 3.2.9 defines maximum attribute length to 512 */
|
|
|
|
#define BT_ATT_MAX_ATTRIBUTE_LEN 512
|
|
|
|
|
2021-04-06 14:20:47 +02:00
|
|
|
/* Handle 0x0000 is reserved for future use */
|
2021-10-21 11:40:03 +02:00
|
|
|
#define BT_ATT_FIRST_ATTRIBUTE_HANDLE 0x0001
|
|
|
|
#define BT_ATT_FIRST_ATTTRIBUTE_HANDLE __DEPRECATED_MACRO BT_ATT_FIRST_ATTRIBUTE_HANDLE
|
2021-04-06 14:20:47 +02:00
|
|
|
/* 0xffff is defined as the maximum, and thus last, valid attribute handle */
|
2021-10-21 11:40:03 +02:00
|
|
|
#define BT_ATT_LAST_ATTRIBUTE_HANDLE 0xffff
|
|
|
|
#define BT_ATT_LAST_ATTTRIBUTE_HANDLE __DEPRECATED_MACRO BT_ATT_LAST_ATTRIBUTE_HANDLE
|
2021-04-06 14:20:47 +02:00
|
|
|
|
2021-08-09 10:38:27 +02:00
|
|
|
#if defined(CONFIG_BT_TESTING)
|
|
|
|
int bt_eatt_disconnect_one(struct bt_conn *conn);
|
|
|
|
#endif /* CONFIG_BT_TESTING */
|
|
|
|
|
2016-02-17 11:21:58 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-09-14 10:43:44 -07:00
|
|
|
#endif /* ZEPHYR_INCLUDE_BLUETOOTH_ATT_H_ */
|