COMMON IO-BLE v1.0.0
Hardware abstraction layer for Bluetooth
 
Loading...
Searching...
No Matches
bt_hal_gatt_types.h
Go to the documentation of this file.
1/*
2 * FreeRTOS BLE HAL V5.1.0
3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 *
5 * SPDX-License-Identifier: MIT
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy of
8 * this software and associated documentation files (the "Software"), to deal in
9 * the Software without restriction, including without limitation the rights to
10 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11 * the Software, and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * http://aws.amazon.com/freertos
25 * http://www.FreeRTOS.org
26 */
27
36#ifndef _BT_HAL_GATT_TYPES_H_
37#define _BT_HAL_GATT_TYPES_H_
38
39#include <stdint.h>
40#include <stdbool.h>
41
42#include "bt_hal_manager.h"
44
50#define btGATT_MAX_ATTR_LEN 600
51
58typedef enum
59{
85
92enum
93{
94 eBTPropNone = 0x0000,
95 eBTPropBroadcast = 0x0001,
96 eBTPropRead = 0x0002,
97 eBTPropWriteNoResponse = 0x0004,
98 eBTPropWrite = 0x0008,
99 eBTPropNotify = 0x0010,
100 eBTPropIndicate = 0x0020,
101 eBTPropSignedWrite = 0x0040,
102 eBTPropExtendedProps = 0x0080,
103};
104typedef uint16_t BTCharProperties_t;
112enum
113{
114 eBTPermNone = 0x0000,
115 eBTPermRead = 0x0001,
118 eBTPermWrite = 0x0010,
123};
124typedef uint16_t BTCharPermissions_t;
130typedef enum
131{
137
138
143typedef enum
144{
148
153typedef struct
154{
156 uint8_t ucInstId;
158
163typedef struct
164{
168
169
174typedef struct
175{
176 uint8_t ucClientIf;
177 uint8_t ucFiltIndex;
180 uint8_t ucAddrType;
181 uint8_t ucTxPower;
182 int8_t cRssiValue;
183 uint16_t usTimeStamp;
185 uint8_t ucAdvPktLen;
186 uint8_t * pucAdvPktData;
187 size_t xScanRspLen;
188 uint8_t * pucScanRspData;
190
195typedef enum
196{
204
205typedef struct BTService BTService_t;
206
211typedef struct
212{
217
222typedef struct
223{
227
232typedef struct
233{
235 BTService_t * pxPtrToService;
237
243
248typedef struct
249{
251 union
252 {
257 };
259
273{
274 uint8_t ucInstId;
277 uint16_t * pusHandlesBuffer;
279};
280
285typedef struct
286{
287 uint16_t usId;
292 /*
293 * If |type| is |btDB_PRIMARY_SERVICE|, or
294 * |btDB_SECONDARY_SERVICE|, this contains the start and end attribute
295 * handles.
296 */
297 uint16_t usStartHandle;
298 uint16_t usEndHandle;
300 /*
301 * If |type| is |btDB_CHARACTERISTIC|, this contains the properties of
302 * the characteristic.
303 */
304 uint8_t ucProperties;
306
308typedef void ( * BTConnectCallback_t)( uint16_t usConnId,
309 BTGattStatus_t xStatus,
310 uint8_t ucClientIf,
311 BTBdaddr_t * pxBda );
312
314typedef void ( * BTDisconnectCallback_t)( uint16_t usConnId,
315 BTGattStatus_t xStatus,
316 uint8_t ucClientIf,
317 BTBdaddr_t * pxBda );
318
319
321typedef void ( * BTReadRemoteRssiCallback_t)( uint8_t ucClientIf,
322 BTBdaddr_t * pxBda,
323 uint32_t ulRssi,
324 BTStatus_t xStatus );
325
331typedef void ( * BTCongestionCallback_t)( uint16_t usConnId,
332 bool bCongested );
333
334#endif /* _BT_HAL_GATT_TYPES_H_ */
void(* BTConnectCallback_t)(uint16_t usConnId, BTGattStatus_t xStatus, uint8_t ucClientIf, BTBdaddr_t *pxBda)
Definition: bt_hal_gatt_types.h:308
void(* BTDisconnectCallback_t)(uint16_t usConnId, BTGattStatus_t xStatus, uint8_t ucClientIf, BTBdaddr_t *pxBda)
Definition: bt_hal_gatt_types.h:314
void(* BTReadRemoteRssiCallback_t)(uint8_t ucClientIf, BTBdaddr_t *pxBda, uint32_t ulRssi, BTStatus_t xStatus)
Definition: bt_hal_gatt_types.h:321
uint16_t BTCharProperties_t
Definition: bt_hal_gatt_types.h:104
uint16_t BTCharPermissions_t
Definition: bt_hal_gatt_types.h:124
void(* BTCongestionCallback_t)(uint16_t usConnId, bool bCongested)
Definition: bt_hal_gatt_types.h:331
BT provides the interfaces to control the Bluetooth device. ,local device control and device discover...
This BT HAL provides the interfaces to control the Bluetooth power states ,local device control and d...
BTStatus_t
Bluetooth Error Status .
Definition: bt_hal_manager_types.h:111
BTGattServiceTypes_t
GATT Service types.
Definition: bt_hal_gatt_types.h:144
BTAttrWriteRequests_t
Write request type.
Definition: bt_hal_gatt_types.h:131
BTDbAttributeType_t
Attribute types.
Definition: bt_hal_gatt_types.h:196
BTGattStatus_t
GATT Status Codes.
Definition: bt_hal_gatt_types.h:59
@ eBTServiceTypeSecondary
Definition: bt_hal_gatt_types.h:146
@ eBTServiceTypePrimary
Definition: bt_hal_gatt_types.h:145
@ eBTWriteTypeDefault
Definition: bt_hal_gatt_types.h:133
@ eBTWriteTypeNoResponse
Definition: bt_hal_gatt_types.h:132
@ eBTWriteTypePrepare
Definition: bt_hal_gatt_types.h:134
@ eBTWriteTypeSigned
Definition: bt_hal_gatt_types.h:135
@ eBTPermWriteEncryptedMitm
Definition: bt_hal_gatt_types.h:120
@ eBTPermWrite
Definition: bt_hal_gatt_types.h:118
@ eBTPermReadEncryptedMitm
Definition: bt_hal_gatt_types.h:117
@ eBTPermReadEncrypted
Definition: bt_hal_gatt_types.h:116
@ eBTPermRead
Definition: bt_hal_gatt_types.h:115
@ eBTPermWriteEncrypted
Definition: bt_hal_gatt_types.h:119
@ eBTPermWriteSigned
Definition: bt_hal_gatt_types.h:121
@ eBTPermWriteSignedMitm
Definition: bt_hal_gatt_types.h:122
@ eBTDbCharacteristic
Definition: bt_hal_gatt_types.h:201
@ eBTDbPrimaryService
Definition: bt_hal_gatt_types.h:197
@ eBTDbCharacteristicDecl
Definition: bt_hal_gatt_types.h:200
@ eBTDbIncludedService
Definition: bt_hal_gatt_types.h:199
@ eBTDbSecondaryService
Definition: bt_hal_gatt_types.h:198
@ eBTDbDescriptor
Definition: bt_hal_gatt_types.h:202
@ eBTGattStatusInvalidOffset
Definition: bt_hal_gatt_types.h:67
@ eBTGattStatusConnectionCongested
Definition: bt_hal_gatt_types.h:80
@ eBTGattStatusInsufficientResources
Definition: bt_hal_gatt_types.h:77
@ eBTGattStatusInternalError
Definition: bt_hal_gatt_types.h:78
@ eBTGattStatusInvalidAttributeLength
Definition: bt_hal_gatt_types.h:73
@ eBTGattStatusInsufficientEncryption
Definition: bt_hal_gatt_types.h:75
@ eBTGattStatusPrepareQueueFull
Definition: bt_hal_gatt_types.h:69
@ eBTGattStatusErrorConnTimeout
Definition: bt_hal_gatt_types.h:82
@ eBTGattStatusAttributeNotFound
Definition: bt_hal_gatt_types.h:70
@ eBTGattStatusSuccess
Definition: bt_hal_gatt_types.h:60
@ eBTGattStatusWriteNotPermitted
Definition: bt_hal_gatt_types.h:63
@ eBTGattStatusAttributeNotLong
Definition: bt_hal_gatt_types.h:71
@ eBTGattStatusInsufficientAuthorization
Definition: bt_hal_gatt_types.h:68
@ eBTGattStatusRequestNotSupported
Definition: bt_hal_gatt_types.h:66
@ eBTGattStatusInsufficientKeySize
Definition: bt_hal_gatt_types.h:72
@ eBTGattStatusInsufficientAuthentication
Definition: bt_hal_gatt_types.h:65
@ eBTGattStatusUnlikelyError
Definition: bt_hal_gatt_types.h:74
@ eBTGattStatusReadNotPermitted
Definition: bt_hal_gatt_types.h:62
@ eBTInvalidHandle
Definition: bt_hal_gatt_types.h:61
@ eBTGattStatusLocalHostTerminatedConnection
Definition: bt_hal_gatt_types.h:83
@ eBTGattStatusError
Definition: bt_hal_gatt_types.h:79
@ eBTGattStatusInvalidPDU
Definition: bt_hal_gatt_types.h:64
@ eBTGattStatusErrorConnEstFail
Definition: bt_hal_gatt_types.h:81
@ eBTGattStatusUnsupportedGroupType
Definition: bt_hal_gatt_types.h:76
BTUuid_t BTServiceUUID_t
Structure describing a service UUID.
Definition: bt_hal_gatt_types.h:242
Generic BLE attribute.
Definition: bt_hal_gatt_types.h:249
BTDbAttributeType_t xAttributeType
Definition: bt_hal_gatt_types.h:250
BTCharacteristicDescr_t xCharacteristicDescr
Definition: bt_hal_gatt_types.h:255
BTIncludedService_t xIncludedService
Definition: bt_hal_gatt_types.h:256
BTCharacteristic_t xCharacteristic
Definition: bt_hal_gatt_types.h:254
BTServiceUUID_t xServiceUUID
Definition: bt_hal_gatt_types.h:253
BT/BLE address.
Definition: bt_hal_manager_types.h:77
Structure describing a characteristic.
Definition: bt_hal_gatt_types.h:212
BTCharProperties_t xProperties
Definition: bt_hal_gatt_types.h:214
BTUuid_t xUuid
Definition: bt_hal_gatt_types.h:213
BTCharPermissions_t xPermissions
Definition: bt_hal_gatt_types.h:215
Structure describing a characteristic descriptor.
Definition: bt_hal_gatt_types.h:223
BTUuid_t xUuid
Definition: bt_hal_gatt_types.h:224
BTCharPermissions_t xPermissions
Definition: bt_hal_gatt_types.h:225
BLE GATT Db element.
Definition: bt_hal_gatt_types.h:286
uint16_t usStartHandle
Definition: bt_hal_gatt_types.h:297
uint16_t usEndHandle
Definition: bt_hal_gatt_types.h:298
uint16_t usId
Definition: bt_hal_gatt_types.h:287
uint8_t ucProperties
Definition: bt_hal_gatt_types.h:304
uint16_t usAttributeHandle
Definition: bt_hal_gatt_types.h:290
BTDbAttributeType_t xType
Definition: bt_hal_gatt_types.h:289
BTUuid_t xUuid
Definition: bt_hal_gatt_types.h:288
GATT service instance ID.
Definition: bt_hal_gatt_types.h:154
BTUuid_t xUuid
Definition: bt_hal_gatt_types.h:155
uint8_t ucInstId
Definition: bt_hal_gatt_types.h:156
GATT Service ID.
Definition: bt_hal_gatt_types.h:164
BTGattServiceTypes_t xServiceType
Definition: bt_hal_gatt_types.h:166
BTGattInstanceId_t xId
Definition: bt_hal_gatt_types.h:165
Structure that contains all advertisements info. Used to compress parameters in BTTrackAdvEventCallba...
Definition: bt_hal_gatt_types.h:175
BTBdaddr_t xBdAddr
Definition: bt_hal_gatt_types.h:184
uint8_t ucAdvertiserInfoPresent
Definition: bt_hal_gatt_types.h:179
uint8_t * pucAdvPktData
Definition: bt_hal_gatt_types.h:186
uint16_t usTimeStamp
Definition: bt_hal_gatt_types.h:183
size_t xScanRspLen
Definition: bt_hal_gatt_types.h:187
uint8_t ucAdvertiserState
Definition: bt_hal_gatt_types.h:178
int8_t cRssiValue
Definition: bt_hal_gatt_types.h:182
uint8_t ucTxPower
Definition: bt_hal_gatt_types.h:181
uint8_t * pucScanRspData
Definition: bt_hal_gatt_types.h:188
uint8_t ucClientIf
Definition: bt_hal_gatt_types.h:176
uint8_t ucAdvPktLen
Definition: bt_hal_gatt_types.h:185
uint8_t ucFiltIndex
Definition: bt_hal_gatt_types.h:177
uint8_t ucAddrType
Definition: bt_hal_gatt_types.h:180
Structure describing an included service.
Definition: bt_hal_gatt_types.h:233
BTService_t * pxPtrToService
Definition: bt_hal_gatt_types.h:235
BTUuid_t xUuid
Definition: bt_hal_gatt_types.h:234
Structure describing a service. Note, handles are allocated separately so the attribute array can be ...
Definition: bt_hal_gatt_types.h:273
uint16_t * pusHandlesBuffer
Definition: bt_hal_gatt_types.h:277
size_t xNumberOfAttributes
Definition: bt_hal_gatt_types.h:276
uint8_t ucInstId
Definition: bt_hal_gatt_types.h:274
BTAttribute_t * pxBLEAttributes
Definition: bt_hal_gatt_types.h:278
BTGattServiceTypes_t xType
Definition: bt_hal_gatt_types.h:275
UUID.
Definition: bt_hal_manager_types.h:96