1#ifndef BLUETOE_CODES_HPP
2#define BLUETOE_CODES_HPP
9 static constexpr std::uint16_t default_att_mtu_size = 23;
10 static constexpr std::uint16_t default_lesc_mtu_size = 65;
12 enum class att_opcodes : std::uint8_t {
13 error_response = 0x01,
14 exchange_mtu_request = 0x02,
15 exchange_mtu_response = 0x03,
16 find_information_request = 0x04,
17 find_information_response = 0x05,
18 find_by_type_value_request = 0x06,
19 find_by_type_value_response = 0x07,
20 read_by_type_request = 0x08,
21 read_by_type_response = 0x09,
24 read_blob_request = 0x0C,
25 read_blob_response = 0x0D,
26 read_multiple_request = 0x0E,
27 read_multiple_response = 0x0F,
28 read_by_group_type_request = 0x10,
29 read_by_group_type_response = 0x11,
31 write_response = 0x13,
32 prepare_write_request = 0x16,
33 prepare_write_response = 0x17,
34 execute_write_request = 0x18,
35 execute_write_response = 0x19,
43 constexpr std::uint8_t bits( att_opcodes c )
45 return static_cast< std::uint8_t
>( c );
68 constexpr std::uint8_t bits( att_error_codes c )
70 return static_cast< std::uint8_t
>( c );
73 enum class att_uuid_format : std::uint8_t {
78 constexpr std::uint8_t bits( att_uuid_format c )
80 return static_cast< std::uint8_t
>( c );
83 enum class gatt_uuids : std::uint16_t {
84 primary_service = 0x2800,
85 secondary_service = 0x2801,
87 characteristic = 0x2803,
88 characteristic_user_description = 0x2901,
89 client_characteristic_configuration = 0x2902,
91 internal_128bit_uuid = 1
94 constexpr std::uint16_t bits( gatt_uuids c )
96 return static_cast< std::uint16_t
>( c );
99 enum class gatt_characteristic_properties : std::uint8_t {
101 write_without_response = 0x04,
107 constexpr std::uint8_t bits( gatt_characteristic_properties c )
109 return static_cast< std::uint8_t
>( c );
112 enum class gap_types : std::uint8_t {
114 incomplete_service_uuids_16 = 0x02,
115 complete_service_uuids_16 = 0x03,
116 incomplete_service_uuids_128 = 0x06,
117 complete_service_uuids_128 = 0x07,
118 complete_local_name = 0x09,
119 shortened_local_name = 0x08,
120 tx_power_level = 0x0a,
124 constexpr std::uint8_t bits( gap_types c )
126 return static_cast< std::uint8_t
>( c );
130 client_characteristic_configuration_notification_enabled = 1,
131 client_characteristic_configuration_indication_enabled = 2
134 inline std::uint8_t* write_opcode( std::uint8_t* out, details::att_opcodes opcode )
136 *out = bits( opcode );
att_error_codes
error codes that are used by the bootloader on the ATT layer
Definition: bootloader.hpp:124
error_codes
Error codes to be returned by read and write handlers for characteristic values.
Definition: codes.hpp:150
@ insufficient_resources
Definition: codes.hpp:240
@ insufficient_authentication
Definition: codes.hpp:179
@ prepare_queue_full
Definition: codes.hpp:199
@ request_not_supported
Definition: codes.hpp:184
@ insufficient_encryption_key_size
Definition: codes.hpp:214
@ unlikely_error
Definition: codes.hpp:225
@ invalid_offset
Definition: codes.hpp:189
@ out_of_range
Definition: codes.hpp:256
@ invalid_pdu
Definition: codes.hpp:174
@ success
Definition: codes.hpp:154
@ attribute_not_found
Definition: codes.hpp:204
@ insufficient_authorization
Definition: codes.hpp:194
@ write_not_permitted
Definition: codes.hpp:169
@ attribute_not_long
Definition: codes.hpp:209
@ procedure_already_in_progress
Definition: codes.hpp:262
@ unsupported_group_type
Definition: codes.hpp:235
@ invalid_handle
Definition: codes.hpp:159
@ application_error_start
Definition: codes.hpp:245
@ invalid_attribute_value_length
Definition: codes.hpp:219
@ cccd_improperly_configured
Definition: codes.hpp:269
@ application_error_end
Definition: codes.hpp:250
@ read_not_permitted
Definition: codes.hpp:164
@ insufficient_encryption
Definition: codes.hpp:230