FreeRTOS: BLE
BLE
Return to main page ↑
bt_hal_manager_adapter_classic.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  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * http://aws.amazon.com/freertos
23  * http://www.FreeRTOS.org
24  */
25 
37 #ifndef _BT_HAL_MANAGER_ADAPTER_CLASSIC_
38 #define _BT_HAL_MANAGER_ADAPTER_CLASSIC_
39 
40 #include "bt_hal_manager.h"
41 
45 typedef enum
46 {
50 } BTScanMode_t;
51 
52 
56 typedef enum
57 {
61 
62 
66 typedef enum
67 {
71 
75 typedef enum
76 {
79 } BTaclState_t;
80 
81 
85 typedef struct
86 {
87  BTUuid_t xUuid;
88  uint16_t usChannel;
89  char * cName; /* what's the maximum length */
91 
95 typedef struct
96 {
97  uint32_t ulVvendor;
98  uint32_t ulProduct;
100 
104 typedef struct
105 {
106  uint32_t ulVendor;
107  uint32_t ulProduct;
108  uint32_t ulUuid;
110 
114 typedef enum
115 {
118 } BTScanType_t;
119 
123 typedef enum
124 {
131 
138 
145 
152 
159 
166 
173  /* Properties unique to adapter */
174 
181  /* Properties unique to manufacturer and device */
182 
189  /* Properties unique to remove */
190 
197 
204 
211 
219 
223 typedef struct
224 {
226  size_t xLen;
227  void * pvVal;
229 
240  uint32_t ulNumProperties,
241  BTClassicProperty_t * pxProperties );
242 
254  BTBdaddr_t * pxBdAddr,
255  uint32_t ulNumProperties,
256  BTClassicProperty_t * pxProperties );
257 
266 typedef void (* BTDeviceFoundCallback_t)( uint32_t ulNumProperties,
267  BTClassicProperty_t * pxProperties );
268 
276 
284 typedef void (* BTaclStateChangedCallback_t)( BTStatus_t xStatus,
285  BTBdaddr_t * pxRemoteBdAddr,
286  BTaclState_t xState );
287 
289 typedef struct
290 {
291  BTClassicDevicePropertiesCallback_t pxDevProperties_cb;
292  BTClassicRemoteDevicePropertiesCallback_t pxRemoteDevProperties_cb;
293  BTDeviceFoundCallback_t pxDeviceFound_cb;
294  BTDiscoveryStateChangedCallback_t pxDiscoveryStateChanged_cb;
295  BTaclStateChangedCallback_t pxAclStateChanged_cb;
297 
298 
300 typedef struct
301 {
308  BTStatus_t ( * pxInit )( BTClassicCallbacks_t * pxCallbacks );
309 
316  BTStatus_t ( * pxCleanup )();
317 
326  BTStatus_t ( * pxGetClassicDeviceProperty )( BTClassicPropertyType_t xType );
327 
334  BTStatus_t ( * pxSetClassicDeviceProperty )( const BTClassicProperty_t * pxProperty );
335 
344  BTStatus_t ( * pxGetAllRemoteClassicDeviceProperties )( BTBdaddr_t * pxRemote_addr );
345 
354  BTStatus_t ( * pxGetRemoteClassicDeviceProperty )( BTBdaddr_t * pxRemote_addr,
355  BTClassicPropertyType_t xType );
356 
362  BTStatus_t ( * pxSetRemoteClassicDeviceProperty )( BTBdaddr_t * pxRemote_addr,
363  const BTClassicProperty_t * pxProperty );
364 
370  BTStatus_t ( * pxGetRemoteServiceRecord )( BTBdaddr_t * pxRemote_addr,
371  BTUuid_t * pxUuid );
372 
377  BTStatus_t ( * pxGetRemoteService )( BTBdaddr_t * pxRemote_addr );
378 
383  BTStatus_t ( * pxStartDiscovery )();
384 
389  BTStatus_t ( * pxStopDiscovery )();
390 
396  const void * ( *ppvGetProfileInterface )( BTProfile_t xProfile );
398 
399 const BTClassicInterface_t * BT_GetClassicAdapter();
400 
401 #endif /* _BT_HAL_MANAGER_ADAPTER_CLASSIC_ */
402 
Definition: bt_hal_manager_adapter_classic.h:188
Definition: bt_hal_manager_adapter_classic.h:49
void(* BTDiscoveryStateChangedCallback_t)(BTDiscoveryState_t xState)
Callback invoked in response to pxStartDiscovery and pxStopDiscovery.
Definition: bt_hal_manager_adapter_classic.h:275
Definition: bt_hal_manager_adapter_classic.h:165
Definition: bt_hal_manager_adapter_classic.h:172
Definition: bt_hal_manager_adapter_classic.h:77
BTDiscoveryState_t
Bluetooth Adapter Discovery state.
Definition: bt_hal_manager_adapter_classic.h:66
Definition: bt_hal_manager_adapter_classic.h:144
void(* BTDeviceFoundCallback_t)(uint32_t ulNumProperties, BTClassicProperty_t *pxProperties)
Callback invoked in response to device discovery If EIR data is not present, then BD_NAME and RSSI sh...
Definition: bt_hal_manager_adapter_classic.h:266
BTScanType_t
Bluetooth Scan types.
Definition: bt_hal_manager_adapter_classic.h:114
Definition: bt_hal_manager_adapter_classic.h:289
Classic Device Property.
Definition: bt_hal_manager_adapter_classic.h:223
Definition: bt_hal_manager_adapter_classic.h:158
BTClassicPropertyType_t
Classic Device Property Types.
Definition: bt_hal_manager_adapter_classic.h:123
Definition: bt_hal_manager_adapter_classic.h:47
Definition: bt_hal_manager_adapter_classic.h:203
Definition: bt_hal_manager_adapter_classic.h:116
void(* BTClassicDevicePropertiesCallback_t)(BTStatus_t xStatus, uint32_t ulNumProperties, BTClassicProperty_t *pxProperties)
Callback invoked in response to pxGetClassicDeviceProperty and pxSetClassicDeviceProperty.
Definition: bt_hal_manager_adapter_classic.h:239
Definition: bt_hal_manager_adapter_classic.h:151
Definition: bt_hal_manager_adapter_classic.h:69
Definition: bt_hal_manager_adapter_classic.h:196
Definition: bt_hal_manager_adapter_classic.h:48
void(* BTaclStateChangedCallback_t)(BTStatus_t xStatus, BTBdaddr_t *pxRemoteBdAddr, BTaclState_t xState)
Callback invoked in response to ACL connection state change.
Definition: bt_hal_manager_adapter_classic.h:284
Definition: bt_hal_manager_adapter_classic.h:117
UUID.
Definition: bt_hal_manager_types.h:83
manufacturer information EIR data
Definition: bt_hal_manager_adapter_classic.h:95
Definition: bt_hal_manager_adapter_classic.h:78
BTProfile_t
Definition: bt_hal_manager_types.h:115
gadget manufacturer information EIR data
Definition: bt_hal_manager_adapter_classic.h:104
Definition: bt_hal_manager_adapter_classic.h:210
Definition: bt_hal_manager_adapter_classic.h:300
BTStatus_t
Bluetooth Error Status .
Definition: bt_hal_manager_types.h:97
Definition: bt_hal_manager_adapter_classic.h:68
Definition: bt_hal_manager_adapter_classic.h:130
Definition: bt_hal_manager_adapter_classic.h:59
Definition: bt_hal_manager_adapter_classic.h:180
Definition: bt_hal_manager_adapter_classic.h:217
BT/BLE address.
Definition: bt_hal_manager_types.h:66
Definition: bt_hal_manager_adapter_classic.h:137
Bluetooth SDP service record.
Definition: bt_hal_manager_adapter_classic.h:85
BTaclState_t
Bluetooth ACL connection state.
Definition: bt_hal_manager_adapter_classic.h:75
BTScanMode_t
Bluetooth Adapter Visibility Modes.
Definition: bt_hal_manager_adapter_classic.h:45
void(* BTClassicRemoteDevicePropertiesCallback_t)(BTStatus_t xStatus, BTBdaddr_t *pxBdAddr, uint32_t ulNumProperties, BTClassicProperty_t *pxProperties)
Callback invoked in response to pxGetRemoteClassicDeviceProperty and pxSetRemoteClassicDeviceProperty...
Definition: bt_hal_manager_adapter_classic.h:253
BTScanParam_t
Bluetooth scan parameters.
Definition: bt_hal_manager_adapter_classic.h:56
Definition: bt_hal_manager_adapter_classic.h:58