FreeRTOS:
BLE
BLE
|
Return to main page ↑ |
BT provides the interfaces to control the Bluetooth device. ,local device control and device discovery functionalities. More...
Data Structures | |
struct | BTAvsrcCallbacks_t |
struct | BTAvsrcInterface_t |
struct | BTGattUnformattedValue_t |
Buffer type for unformatted reads/writes. More... | |
struct | BTGattReadParams_t |
Parameters for GATT read operations. More... | |
struct | BTGattWriteParams_t |
Parameters for GATT write operations. More... | |
struct | BTGattNotifyParams_t |
Parameters for attribute change notifications. More... | |
struct | BTGattTestParams_t |
Parameters for test command interface. More... | |
struct | BTGattClientCallbacks_t |
struct | BTGattClientInterface_t |
struct | BTGattValue_t |
GATT value type used in response to remote read/Write requests. More... | |
union | BTGattResponse_t |
GATT response to read and write. More... | |
struct | BTGattServerCallbacks_t |
Callback structure for GATT server. More... | |
struct | BTGattServerInterface_t |
struct | BTGattInstanceId_t |
GATT service instance ID. More... | |
struct | BTGattSrvcId_t |
GATT Service ID. More... | |
struct | BTGattTrackAdvInfo_t |
Structure that contains all advertisements info. Used to compress parameters in BTTrackAdvEventCallback_t. More... | |
struct | BTCharacteristic_t |
Structure describing a characteristic. More... | |
struct | BTCharacteristicDescr_t |
Structure describing a characteristic descriptor. More... | |
struct | BTIncludedService_t |
Structure describing an included service. More... | |
struct | BTAttribute_t |
Generic BLE attribute. More... | |
struct | BTService_t |
Structure describing a service. Note, handles are allocated separately so the attribute array can be allocated in ROM. pxHandlesBuffer has to dimensions: x and y [x][y] . x : Number of copies of the service y : needs to be equal to xNumberOfAttributes. More... | |
struct | BTGattDbElement_t |
struct | BTPinCode_t |
Bluetooth PinKey Code, Valid only for BT legacy. More... | |
struct | BTProperty_t |
Bluetooth Adapter Property data structure. More... | |
struct | BTOutOfBandData_t |
Bluetooth Out Of Band data for bonding. More... | |
struct | BTActivityEnergyInfo |
Energy info. More... | |
struct | BTUidTraffic_t |
UUID traffic info. More... | |
struct | BTCallbacks_t |
Bluetooth DM callback structure. More... | |
struct | BTInterface_t |
Represents the standard SAL device management interface. More... | |
struct | BTGattFiltParamSetup_t |
Scan Filter Parameters. More... | |
struct | BTGattAdvName_t |
Advertising Name Format. More... | |
struct | BTGattAdvertismentParams_t |
Advertising Parameters. More... | |
struct | BTLocalLeFeatures_t |
Local supported LE features. More... | |
struct | BTBleProperty_t |
BLE Device Property. More... | |
struct | BTBleAdapterCallbacks_t |
Callback structure for BLE adapter. More... | |
struct | BTBleAdapter_t |
BLE adapter API. More... | |
struct | BTServiceRecord_t |
Bluetooth SDP service record. More... | |
struct | BTEirManfInfo_t |
manufacturer information EIR data More... | |
struct | BTGadgetEirManfInfo_t |
gadget manufacturer information EIR data More... | |
struct | BTClassicProperty_t |
Classic Device Property. More... | |
struct | BTClassicCallbacks_t |
struct | BTClassicInterface_t |
struct | BTBdaddr_t |
BT/BLE address. More... | |
struct | BTBdname_t |
Device Name. More... | |
struct | BTUuid_t |
UUID. More... | |
Macros | |
#define | btGATT_MAX_ATTR_LEN 600 |
#define | btMAJOR_VERSION 5 |
Incompatible API changes without backward compatibility. | |
#define | btMINOR_VERSION 1 |
Add new functionality with backward compatibility. | |
#define | btPATCH_VERSION 0 |
Make changes in the API with backward compatibility. | |
#define | btSTR_HELPER(x, y, z) # x "." # y "." # z |
Help functions to convert version to string. | |
#define | btSTR(x, y, z) btSTR_HELPER( x, y, z ) |
#define | btSTRING_VERSION btSTR( btMAJOR_VERSION, btMINOR_VERSION, btPATCH_VERSION ) |
Stringified version number. | |
#define | btBLE_ADD_BLOB_SERVICE_SUPPORTED_BIT 0x0001 /** Support GATT server database decleration as a blob. */ |
#define | btBLE_ADD_BLE_DYNAMIC_PRIVACY 0x0002 /** Stack can dynamicall enable or disable privacy. */ |
#define | btBLE_BLE_CENTRAL_WHITELISTING 0x0004 /** Provide a mechanism to manage whitelist for Gatt server. */ |
#define | BT_HAL_BLE_ADV_TX_PWR_ULTRA_LOW 0 /* Ultra Low Adv Tx Power */ |
#define | BT_HAL_BLE_ADV_TX_PWR_LOW 1 /* Low Adv Tx Power */ |
#define | BT_HAL_BLE_ADV_TX_PWR_MEDIUM 2 /* Medium Adv Tx Power */ |
#define | BT_HAL_BLE_ADV_TX_PWR_HIGH 3 /* High Adv Tx Power */ |
#define | BT_HAL_BLE_ADV_TX_PWR_ULTRA_HIGH 4 /* Ultra High Adv Tx Power */ |
#define | bt128BIT_UUID_LEN 16 |
Size in byte of 128bits UUID. | |
#define | btADDRESS_LEN 6 |
Size in byte of BT/BLE addresses. | |
#define | btKEY_MAX_LEN 16 |
Typedefs | |
typedef void(* | BTAvsrcConnectionStateCallback_t) (BTAvConnectionState_t xState, BTBdaddr_t *pxBdAddr) |
Callback invoked in to notify AV connection state change. More... | |
typedef void(* | BTAvsrcAudioStateCallback_t) (BTAvAudioState_t xState, BTBdaddr_t *pxBdAddr) |
Callback invoked in to notify AV Audio state change. More... | |
typedef void(* | BTAvsrcAclPriorityCallback_t) (BTAvsrcAclPriority_t xPriority, BTBdaddr_t *pxBdAddr) |
Callback invoked when ACL priority changes Priority can change when the stack enables/disables silent A2DP data while A2DP keepalive feature is enabled. More... | |
typedef void(* | BTRegisterClientCallback_t) (BTGattStatus_t xStatus, uint8_t ucClientIf, BTUuid_t *pxAppUuid) |
Callback invoked in response pxRegisterClient when the GATT client registration has been completed. More... | |
typedef void(* | BTSearchCompleteCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus) |
Callback invoked in response to pxSearchService when the GATT service search has been completed. More... | |
typedef void(* | BTRegisterForNotificationCallback_t) (uint16_t usConnId, bool bRegistered, BTGattStatus_t xStatus, uint16_t usHandle) |
Callback invoked in response to pxRegisterForNotification and pxUnregisterForNotification. More... | |
typedef void(* | BTNotifyCallback_t) (uint16_t usConnId, BTGattNotifyParams_t *pxData) |
Remote device notification callback, invoked when a remote device sends a notification or indication that a client has registered for. More... | |
typedef void(* | BTReadCharacteristicCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus, BTGattReadParams_t *pxData) |
Reports result of a GATT read operation. Triggered by pxReadCharacteristic. More... | |
typedef void(* | BTWriteCharacteristicCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus, uint16_t usHandle) |
GATT write characteristic operation callback. Triggered by pxWriteCharacteristic. More... | |
typedef void(* | BTExecuteWriteCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus) |
GATT execute prepared write callback. Triggered by pxExecuteWrite. More... | |
typedef void(* | BTReadDescriptorCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus, BTGattReadParams_t *pxData) |
Callback invoked in response to pxReadDescriptor. More... | |
typedef void(* | BTWriteDescriptorCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus, uint16_t usHandle) |
Callback invoked in response to pxWriteDescriptor. More... | |
typedef void(* | BTListenCallback_t) (BTGattStatus_t xStatus, uint32_t ulServerIf) |
Callback indicating the status of a listen() operation. More... | |
typedef void(* | BTConfigureMtuCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus, uint32_t ulMtu) |
Callback invoked when the MTU for a given connection changes. Triggered by pxConfigureMtu. More... | |
typedef void(* | BTGetGattDbCallback_t) (uint16_t usConnId, BTGattDbElement_t *pxDb, uint32_t ulCount) |
GATT get database callback. Triggered by pxGetGattDb. More... | |
typedef void(* | BTServicesRemovedCallback_t) (uint16_t usConnId, uint16_t usStartHandle, uint16_t usEndHandle) |
GATT services between startHandle and endHandle were removed. More... | |
typedef void(* | BTServicesAddedCallback_t) (uint16_t usConnId, BTGattDbElement_t *pxAdded, uint32_t ulAddedCount) |
GATT services were added. More... | |
typedef void(* | BTRegisterServerCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTUuid_t *pxAppUuid) |
Callback invoked in response to pxRegisterServer. More... | |
typedef void(* | BTUnregisterServerCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf) |
Callback invoked in response to pxUnregisterServer. More... | |
typedef void(* | BTConnectionCallback_t) (uint16_t usConnId, uint8_t ucServerIf, bool bConnected, BTBdaddr_t *pxBda) |
Callback invoked on a connection event. More... | |
typedef void(* | BTServiceAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTGattSrvcId_t *pxSrvcId, uint16_t usServiceHandle) |
Callback invoked in response to pxAddService. More... | |
typedef void(* | BTIncludedServiceAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle, uint16_t usInclSrvcHandle) |
Callback invoked in response to pxAddIncludedService. More... | |
typedef void(* | BTCharacteristicAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTUuid_t *pxUuid, uint16_t usServiceHandle, uint16_t usCharHandle) |
Callback invoked in response to pxAddCharacteristic. More... | |
typedef void(* | BTSetValCallback_t) (BTStatus_t xStatus, uint16_t usAttrHandle) |
Callback invoked in response to pxSetVal. More... | |
typedef void(* | BTDescriptorAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTUuid_t *pxUuid, uint16_t usServiceHandle, uint16_t usDescrHandle) |
Callback invoked in response to pxAddDescriptor. More... | |
typedef void(* | BTServiceStartedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle) |
Callback invoked in response to pxStartService. More... | |
typedef void(* | BTServiceStoppedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle) |
Callback invoked in response to pxStopService. More... | |
typedef void(* | BTServiceDeletedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle) |
Callback invoked in response to pxDeleteService. More... | |
typedef void(* | BTRequestReadCallback_t) (uint16_t usConnId, uint32_t ulTransId, BTBdaddr_t *pxBda, uint16_t usAttrHandle, uint16_t usOffset) |
Callback invoked on read event. More... | |
typedef void(* | BTRequestWriteCallback_t) (uint16_t usConnId, uint32_t ulTransId, BTBdaddr_t *pxBda, uint16_t usAttrHandle, uint16_t usOffset, size_t xLength, bool bNeedRsp, bool bIsPrep, uint8_t *pucValue) |
Callback invoked on write event. More... | |
typedef void(* | BTRequestExecWriteCallback_t) (uint16_t usConnId, uint32_t ulTransId, BTBdaddr_t *pxBda, bool bExecWrite) |
Callback invoked on execute write event. More... | |
typedef void(* | BTResponseConfirmationCallback_t) (BTStatus_t xStatus, uint16_t usHandle) |
Callback triggered in response to sendResponse if the remote device sends a confirmation. More... | |
typedef void(* | BTIndicationSentCallback_t) (uint16_t usConnId, BTStatus_t xStatus) |
Callback on confirmation device from the remote device to an indication. Or confirm a Notification as been sent. More... | |
typedef void(* | BTMtuChangedCallback_t) (uint16_t usConnId, uint16_t usMtu) |
Callback invoked when the MTU for a given connection changes. More... | |
typedef void(* | BTWhiteListChangedCallback_t) (const BTBdaddr_t *pxBdAddr, bool bIsAdded) |
Callback for notifying modification in white list. More... | |
typedef uint16_t | BTCharProperties_t |
typedef uint16_t | BTCharPermissions_t |
typedef BTUuid_t | BTServiceUUID_t |
Structure describing a service UUID. | |
typedef void(* | BTConnectCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus, uint8_t ucClientIf, BTBdaddr_t *pxBda) |
typedef void(* | BTDisconnectCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus, uint8_t ucClientIf, BTBdaddr_t *pxBda) |
typedef void(* | BTReadRemoteRssiCallback_t) (uint8_t ucClientIf, BTBdaddr_t *pxBda, uint32_t ulRssi, BTStatus_t xStatus) |
typedef void(* | BTCongestionCallback_t) (uint16_t usConnId, bool bCongested) |
typedef uint8_t | BTSecurityLevel_t |
typedef uint8_t | BTAuthReq_t |
typedef void(* | BTDeviceStateChangedCallback_t) (BTState_t xState) |
Bluetooth state change Callback. Invoked on pxEnable/pxDisable. More... | |
typedef void(* | BTDevicePropertiesCallback_t) (BTStatus_t xStatus, uint32_t ulNumProperties, BTProperty_t *pxProperties) |
GET/SET local device Properties callback. More... | |
typedef void(* | BTRemoteDevicePropertiesCallback_t) (BTStatus_t xStatus, BTBdaddr_t *pxBdAddr, uint32_t ulNumProperties, BTProperty_t *pxProperties) |
GET/SET Remote Device Properties callback. Invoked on pxGetRemoteDeviceProperty, pxSetRemoteDeviceProperty, pxGetAllRemoteDeviceProperties. More... | |
typedef void(* | BTPinRequestCallback_t) (BTBdaddr_t *pxRemoteBdAddr, BTBdname_t *pxBdName, uint32_t ulCod, uint8_t ucMin16Digit) |
Callback Invoked on Pin Request. More... | |
typedef void(* | BTSspRequestCallback_t) (BTBdaddr_t *pxRemoteBdAddr, BTBdname_t *pxRemoteBdName, uint32_t ulCod, BTSspVariant_t xPairingVariant, uint32_t ulPassKey) |
Callback Invoked on SSP event. More... | |
typedef void(* | BTPairingStateChangedCallback_t) (BTStatus_t xStatus, BTBdaddr_t *pxRemoteBdAddr, BTBondState_t xState, BTSecurityLevel_t xSecurityLevel, BTAuthFailureReason_t xReason) |
Bluetooth pairing state changed event callback. Invoked in response to create_bond, cancel_bond or remove_bond reason field is valid only in case of xStatus == eBTStatusFail. Invoked on pairing event. More... | |
typedef void(* | BTEnergyInfoCallback_t) (BTActivityEnergyInfo *pxEnergyInfo, BTUidTraffic_t *pxUidData) |
Callback invoked on pxReadEnergyInfo. Invoked on pxReadEnergyInfo. More... | |
typedef void(* | BTDutModeRecvCallback_t) (uint16_t usOpcode, uint8_t *pucBuf, size_t xLen) |
Bluetooth Test Mode Callback. Invoked when remote device uses pxDutModeSend. More... | |
typedef void(* | BTLeTestModeCallback_t) (BTStatus_t xStatus, uint16_t usNumPackets) |
LE Test mode callbacks. Invoked on pxLeTestMode. More... | |
typedef void(* | BTReadRssiCallback_t) (BTBdaddr_t *pxBda, uint32_t ulRssi, BTStatus_t xStatus) |
Read RSSI Callback. Invoked on pxReadRssi. More... | |
typedef void(* | BTSlaveSecurityRequestCallBack_t) (BTBdaddr_t *pxBda, BTSecurityLevel_t xSecurityLevel, bool bBonding) |
Security request callback. Invoked on master from remote slave security request event. More... | |
typedef void(* | BTTxPowerCallback_t) (BTBdaddr_t *pxBda, BTTransport_t xTransport, uint8_t ucTxPowerValue, BTStatus_t xStatus) |
TX power Callback. Invoked on pxGetTxpower. More... | |
typedef void(* | BTBondedCallback_t) (BTStatus_t xStatus, BTBdaddr_t *pxRemoteBdAddr, bool bIsBonded) |
typedef void(* | BTAclStateChangedCallback_t) (BTStatus_t xStatus, const BTBdaddr_t *pxRemoteBdAddr, BTAclState_t xState, BTTransport_t xTransport, BTAclDisconnectReason_t xReason) |
Callback invoked in response to ACL connection state change. More... | |
typedef void(* | BTRegisterBleAdapterCallback_t) (BTStatus_t xStatus, uint8_t ucAdapterIf, BTUuid_t *pxAppUuid) |
Callback invoked in response pxRegisterBleApp. More... | |
typedef void(* | BTBleDevicePropertiesCallback_t) (BTStatus_t xStatus, uint32_t ulNumProperties, BTBleProperty_t *pxProperties) |
Callback invoked in response to pxGetBleAdapterProperty and pxSetBleAdapterProperty. More... | |
typedef void(* | BTBleRemoteDevicePropertiesCallback_t) (BTStatus_t xStatus, BTBdaddr_t *pxBdAddr, uint32_t ulNumProperties, BTBleProperty_t *pxProperties) |
Callback invoked in response to pxGetBleRemoteDeviceProperty and pxSetBleRemoteDeviceProperty. More... | |
typedef void(* | BTScanResultCallback_t) (BTBdaddr_t *pxBda, uint32_t ulRssi, uint8_t *pucAdvData) |
Callback invoked in response to pxScan. More... | |
typedef void(* | BTAdvStatusCallback_t) (BTStatus_t xStatus, uint8_t ucAdapterIf, bool bStart) |
Callback invoked on pxStartAdv and stop advertisement. More... | |
typedef void(* | BTSetAdvDataCallback_t) (BTStatus_t xStatus) |
Callback invoked on pxSetAdvData. More... | |
typedef void(* | BTConnParameterUpdateCallback_t) (BTStatus_t xStatus, const BTBdaddr_t *pxBdAddr, uint32_t ulMinInterval, uint32_t ulMaxInterval, uint32_t ulLatency, uint32_t usConnInterval, uint32_t ulTimeout) |
Callback invoked on when a peer device makes a request. The callback is triggered by pxConnParameterUpdateRequest. More... | |
typedef void(* | BTScanFilterCfgCallback_t) (uint32_t ulAction, uint8_t ucAdapterIf, BTStatus_t xStatus, uint32_t ulFiltType, uint32_t ulAvblSpace) |
Callback invoked when a scan filter configuration command has completed. More... | |
typedef void(* | BTScanFilterParamCallback_t) (uint32_t ulAction, uint8_t ucAdapterIf, BTStatus_t xStatus, uint32_t ulAvblSpace) |
Callback invoked on pxScanFilterParamSetup. More... | |
typedef void(* | BTScanFilterStatusCallback_t) (bool bEnable, uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked on pxScanFilterEnable. More... | |
typedef void(* | BTMultiAdvEnableCallback_t) (uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked on pxMultiAdvEnable. More... | |
typedef void(* | BTMultiAdvUpdateCallback_t) (uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked on pxMultiAdvUpdate. More... | |
typedef void(* | BTMultiAdvDataCallback_t) (uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked on pxMultiAdvSetInstData and pxMultiAdvSetInstRawData. More... | |
typedef void(* | BTMultiAdvDisableCallback_t) (uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked on pxMultiAdvDisable. More... | |
typedef void(* | BTBatchscanCfgStorageCallback_t) (uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked on pxBatchscanCfgStorage. More... | |
typedef void(* | BTBatchscanEnableDisableCallback_t) (uint32_t ulAction, uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked on pxBatchscanDisBatchScan and TBD. More... | |
typedef void(* | BTBatchscanReportsCallback_t) (uint8_t ucAdapterIf, BTStatus_t xStatus, uint32_t ulReportFormat, uint32_t ulNumRecords, size_t XDataLen, uint8_t *pucRepData) |
Callback invoked on pxBatchscanReadReports. More... | |
typedef void(* | BTBatchscanThresholdCallback_t) (uint8_t ucAdapterIf) |
Callback invoked when batchscan storage threshold limit is crossed. More... | |
typedef void(* | BTTrackAdvEventCallback_t) (BTGattTrackAdvInfo_t *pxTrackAdvInfo) |
Track ADV VSE callback invoked when tracked device is found or lost. More... | |
typedef void(* | BTScanParameterSetupCompletedCallback_t) (uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked when scan parameter setup has completed. More... | |
typedef void(* | BTPhyUpdatedCallback_t) (uint16_t usConnId, uint8_t ucTxPhy, uint8_t ucRxPhy, BTStatus_t xStatus) |
Callback invoked on pxSetPreferredPhy. More... | |
typedef void(* | BTReadClientPhyCallback_t) (uint16_t usConnId, uint8_t ucTxPhy, uint8_t ucRxPhy, BTStatus_t xStatus) |
Callback invoked on pxReadPhy. More... | |
typedef void(* | BTClassicDevicePropertiesCallback_t) (BTStatus_t xStatus, uint32_t ulNumProperties, BTClassicProperty_t *pxProperties) |
Callback invoked in response to pxGetClassicDeviceProperty and pxSetClassicDeviceProperty. More... | |
typedef void(* | BTClassicRemoteDevicePropertiesCallback_t) (BTStatus_t xStatus, BTBdaddr_t *pxBdAddr, uint32_t ulNumProperties, BTClassicProperty_t *pxProperties) |
Callback invoked in response to pxGetRemoteClassicDeviceProperty and pxSetRemoteClassicDeviceProperty. More... | |
typedef 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 shall be NULL and -1 respectively. More... | |
typedef void(* | BTDiscoveryStateChangedCallback_t) (BTDiscoveryState_t xState) |
Callback invoked in response to pxStartDiscovery and pxStopDiscovery. More... | |
typedef void(* | BTaclStateChangedCallback_t) (BTStatus_t xStatus, BTBdaddr_t *pxRemoteBdAddr, BTaclState_t xState) |
Callback invoked in response to ACL connection state change. More... | |
Functions | |
const BTAvsrcInterface_t * | BT_GetAvsrcInterface () |
const BTInterface_t * | BTGetBluetoothInterface (void) |
const BTClassicInterface_t * | BT_GetClassicAdapter () |
BT provides the interfaces to control the Bluetooth device. ,local device control and device discovery functionalities.
This BT HAL provides the interfaces to control the Bluetooth power states ,local device control and device discovery functionalities
BT Classic Adapter provides the interfaces to control Bluetooth classic (BR/EDR) functionalities of local device control and device discovery functionalities
BT manager BLE adapter, provide GAP API functions that are specific to BLE.
Before calling any GATT client function, the Generic Access Profile needs to be initialized (see bt_hal_manager.h and bt_hal_manager_adapter.h). After GAP has been initialized, pxGattClientInit must be called to register callbacks. After this, pxConnect can be called to connect to a GATT server.
Before calling any GATT server function, the Generic Access Profile needs to be initialized (see bt_hal_manager.h and bt_hal_manager_adapter*.h). bt_hal_manager.h give the starting point. After GAP has been initialized, the functions need to be called in that order:
The common generique access profile is the starting point of Bluetooth API. The flow is the following:
Before calling pxRegisterBleApp, common GAP need to be enabled and started. Flow of the functions:
#define btGATT_MAX_ATTR_LEN 600 |
Buffer sizes for maximum attribute length and maximum read/write operation buffer size.
#define btBLE_ADD_BLOB_SERVICE_SUPPORTED_BIT 0x0001 /** Support GATT server database decleration as a blob. */ |
Stack feature support bit mask
typedef void(* BTAvsrcConnectionStateCallback_t) (BTAvConnectionState_t xState, BTBdaddr_t *pxBdAddr) |
Callback invoked in to notify AV connection state change.
Audio callback structure
[in] | xState | Connection state |
[in] | pxBdAddr | Address of the Remote device |
typedef void(* BTAvsrcAudioStateCallback_t) (BTAvAudioState_t xState, BTBdaddr_t *pxBdAddr) |
Callback invoked in to notify AV Audio state change.
[in] | xState | Audio state |
[in] | pxBdAddr | Address of the Remote device |
typedef void(* BTAvsrcAclPriorityCallback_t) (BTAvsrcAclPriority_t xPriority, BTBdaddr_t *pxBdAddr) |
Callback invoked when ACL priority changes Priority can change when the stack enables/disables silent A2DP data while A2DP keepalive feature is enabled.
[in] | xPriority | Acl Priority |
[in] | pxBdAddr | Address of the Remote device |
typedef void( * BTRegisterClientCallback_t) (BTGattStatus_t xStatus, uint8_t ucClientIf, BTUuid_t *pxAppUuid) |
Callback invoked in response pxRegisterClient when the GATT client registration has been completed.
BT-GATT Client callback structure.
[in] | xStatus | returns eBTStatusSuccess if operation succeeded. |
[in] | ucClientIf | Client interface. |
[in] | pxAppUuid | GATT client UUID. |
typedef void( * BTSearchCompleteCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus) |
Callback invoked in response to pxSearchService when the GATT service search has been completed.
[in] | usConnId | Connection Identifier, created and returned on connection event, when BTConnectionCallback_t is invoked. |
[in] | xStatus | returns eBTGattStatusSuccess if operation succeeded. |
typedef void( * BTRegisterForNotificationCallback_t) (uint16_t usConnId, bool bRegistered, BTGattStatus_t xStatus, uint16_t usHandle) |
Callback invoked in response to pxRegisterForNotification and pxUnregisterForNotification.
[in] | usConnId | Connection Identifier, created and returned on connection event, when BTConnectionCallback_t is invoked. |
[in] | bRegistered | Set to True if attribute id registered for notifications, set to False otherwise. |
[in] | xStatus | returns eBTGattStatusSuccess if operation succeeded. |
[in] | usHandle | Handle number of attribute [de]registered for notification. |
typedef void( * BTNotifyCallback_t) (uint16_t usConnId, BTGattNotifyParams_t *pxData) |
Remote device notification callback, invoked when a remote device sends a notification or indication that a client has registered for.
[in] | usConnId | Connection Identifier, created and returned on connection event, when BTConnectionCallback_t is invoked. |
[in] | pxData | Parameters for attribute change notifications. |
typedef void( * BTReadCharacteristicCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus, BTGattReadParams_t *pxData) |
Reports result of a GATT read operation. Triggered by pxReadCharacteristic.
[in] | usConnId | Connection Identifier, created and returned on connection event, when BTConnectionCallback_t is invoked. |
[in] | xStatus | returns eBTGattStatusSuccess if operation succeeded. |
[in] | pxData | Parameters for GATT read operation. |
typedef void( * BTWriteCharacteristicCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus, uint16_t usHandle) |
GATT write characteristic operation callback. Triggered by pxWriteCharacteristic.
[in] | usConnId | Connection Identifier, created and returned on connection event, when BTConnectionCallback_t is invoked. |
[in] | xStatus | returns eBTGattStatusSuccess if operation succeeded. |
[in] | usHandle | Handle of the attribute written to. |
typedef void( * BTExecuteWriteCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus) |
GATT execute prepared write callback. Triggered by pxExecuteWrite.
[in] | usConnId | Connection Identifier, created and returned on connection event, when BTConnectionCallback_t is invoked. |
[in] | xStatus | returns eBTGattStatusSuccess if operation succeeded. |
typedef void( * BTReadDescriptorCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus, BTGattReadParams_t *pxData) |
Callback invoked in response to pxReadDescriptor.
[in] | usConnId | Connection Identifier, created and returned on connection event, when BTConnectionCallback_t is invoked. |
[in] | xStatus | returns eBTGattStatusSuccess if operation succeeded. |
[in] | pxData | Parameters for GATT read operation. |
typedef void( * BTWriteDescriptorCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus, uint16_t usHandle) |
Callback invoked in response to pxWriteDescriptor.
[in] | usConnId | Connection Identifier, created and returned on connection event, when BTConnectionCallback_t is invoked. |
[in] | xStatus | returns eBTGattStatusSuccess if operation succeeded. |
[in] | usHandle | Handle of the attribute written to. |
typedef void( * BTListenCallback_t) (BTGattStatus_t xStatus, uint32_t ulServerIf) |
Callback indicating the status of a listen() operation.
Callback has been deprecated, use BTAdvStatusCallback_t in BTBleAdapterCallbacks_t instead.
typedef void( * BTConfigureMtuCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus, uint32_t ulMtu) |
Callback invoked when the MTU for a given connection changes. Triggered by pxConfigureMtu.
[in] | usConnId | Connection Identifier, created and returned on connection event, when BTConnectionCallback_t is invoked. |
[in] | xStatus | returns eBTGattStatusSuccess if operation succeeded. |
[in] | ulMtu | MTU size. |
typedef void( * BTGetGattDbCallback_t) (uint16_t usConnId, BTGattDbElement_t *pxDb, uint32_t ulCount) |
GATT get database callback. Triggered by pxGetGattDb.
[in] | usConnId | Connection Identifier, created and returned on connection event, when BTConnectionCallback_t is invoked. |
[in] | pxDb | GATT database elements |
[in] | ulCount | Number of elements in GATT database. |
typedef void( * BTServicesRemovedCallback_t) (uint16_t usConnId, uint16_t usStartHandle, uint16_t usEndHandle) |
GATT services between startHandle and endHandle were removed.
[in] | usConnId | Connection Identifier, created and returned on connection event, when BTConnectionCallback_t is invoked. |
[in] | usStartHandle | First service handle removed from server. |
[in] | usEndHandle | Last service handle removed from server. |
typedef void( * BTServicesAddedCallback_t) (uint16_t usConnId, BTGattDbElement_t *pxAdded, uint32_t ulAddedCount) |
GATT services were added.
[in] | usConnId | Connection Identifier, created and returned on connection event, when BTConnectionCallback_t is invoked. |
[in] | pxAdded | GATT database elements added. |
[in] | ulAddedCount | Number of GATT database elements added. |
typedef void(* BTRegisterServerCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTUuid_t *pxAppUuid) |
Callback invoked in response to pxRegisterServer.
BT-GATT Server callback structure.
[in] | xStatus | returns eBTStatusSuccess if operation succeeded. |
[in] | ucServerIf | Server interface. |
[in] | pxAppUuid | GATT server UUID. |
typedef void(* BTUnregisterServerCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf) |
Callback invoked in response to pxUnregisterServer.
[in] | xStatus | returns eBTStatusSuccess if operation succeeded. |
[in] | ucServerIf | Server interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call. |
typedef void(* BTConnectionCallback_t) (uint16_t usConnId, uint8_t ucServerIf, bool bConnected, BTBdaddr_t *pxBda) |
Callback invoked on a connection event.
[in] | usConnId | Connection Identifier. Uniquely identify a connection. |
[in] | ucServerIf | Server interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call. |
[in] | bConnected | Flag set to true on a connect and to false on a disconnect. |
[in] | pxBda | Address of the remote device. |
typedef void(* BTServiceAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTGattSrvcId_t *pxSrvcId, uint16_t usServiceHandle) |
Callback invoked in response to pxAddService.
[in] | xStatus | returns eBTStatusSuccess if operation succeeded. |
[in] | ucServerIf | Server interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call. |
[in] | pxSrvcId | Service ID, returned on BTServiceAddedCallback_t after calling pxAddService. |
[in] | usServiceHandle | Handle of the service containing the attribute. |
typedef void(* BTIncludedServiceAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle, uint16_t usInclSrvcHandle) |
Callback invoked in response to pxAddIncludedService.
[in] | xStatus | returns eBTStatusSuccess if operation succeeded. |
[in] | ucServerIf | Server interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call. |
[in] | usServiceHandle | Handle of the service containing the attribute. |
[in] | usInclSrvcHandle | Handle of the Attribute "included service". |
typedef void(* BTCharacteristicAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTUuid_t *pxUuid, uint16_t usServiceHandle, uint16_t usCharHandle) |
Callback invoked in response to pxAddCharacteristic.
[in] | xStatus | returns eBTStatusSuccess if operation succeeded. |
[in] | ucServerIf | Server interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call. |
[in] | pxUuid | UUID of the characteristic. |
[in] | usServiceHandle | Handle of the service containing the attribute. |
[in] | usCharHandle | Handle of the characteristic being added. |
typedef void(* BTSetValCallback_t) (BTStatus_t xStatus, uint16_t usAttrHandle) |
Callback invoked in response to pxSetVal.
[in] | xStatus | returns eBTStatusSuccess if operation succeeded. |
[in] | usAttrHandle | Handle of the attribute. |
typedef void(* BTDescriptorAddedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, BTUuid_t *pxUuid, uint16_t usServiceHandle, uint16_t usDescrHandle) |
Callback invoked in response to pxAddDescriptor.
[in] | xStatus | returns eBTStatusSuccess if operation succeeded. |
[in] | ucServerIf | Server interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call. |
[in] | pxUuid | UUID of the descriptor. |
[in] | usServiceHandle | Handle of the service containing the attribute. |
[in] | usDescrHandle | Handle of the descriptor being added. |
typedef void(* BTServiceStartedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle) |
Callback invoked in response to pxStartService.
[in] | xStatus | returns eBTStatusSuccess if operation succeeded. |
[in] | ucServerIf | Server interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call. |
[in] | usServiceHandle | Handle of the service containing the attribute. |
typedef void(* BTServiceStoppedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle) |
Callback invoked in response to pxStopService.
[in] | xStatus | returns eBTStatusSuccess if operation succeeded. |
[in] | ucServerIf | Server interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call. |
[in] | usServiceHandle | Handle of the service containing the attribute. |
typedef void(* BTServiceDeletedCallback_t) (BTStatus_t xStatus, uint8_t ucServerIf, uint16_t usServiceHandle) |
Callback invoked in response to pxDeleteService.
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | ucServerIf | Server interface, return on the callback BTRegisterServerCallback_t after successful pxRegisterServer call. |
[in] | usServiceHandle | Handle of the service containing the attribute. |
typedef void(* BTRequestReadCallback_t) (uint16_t usConnId, uint32_t ulTransId, BTBdaddr_t *pxBda, uint16_t usAttrHandle, uint16_t usOffset) |
Callback invoked on read event.
Callback invoked when a remote device has requested to read a characteristic or descriptor. The application must respond by calling sendResponse.
[in] | usConnId | Connection Identifier, created and return on connection event, when BTConnectionCallback_t is invoked. |
[in] | ulTransId | Transaction ID. |
[in] | pxBda | Remote device address. |
[in] | usAttrHandle | Handle of the attribute. |
[in] | usOffset | Index of read. |
typedef void(* BTRequestWriteCallback_t) (uint16_t usConnId, uint32_t ulTransId, BTBdaddr_t *pxBda, uint16_t usAttrHandle, uint16_t usOffset, size_t xLength, bool bNeedRsp, bool bIsPrep, uint8_t *pucValue) |
Callback invoked on write event.
Callback invoked when a remote device has requested to write to a characteristic or descriptor.
[in] | usConnId | Connection Identifier, created and return on connection event, when BTConnectionCallback_t is invoked. |
[in] | ulTransId | Transaction ID. |
[in] | pxBda | Remote device address. |
[in] | usAttrHandle | Handle of the attribute. |
[in] | usOffset | Index of write. |
[in] | xLength | Length of pucValue to write. |
[in] | bNeedRsp | True if a response is needed. |
[in] | bIsPrep | True if it is a prepare write command. |
[in] | pucValue | Data to write. |
typedef void(* BTRequestExecWriteCallback_t) (uint16_t usConnId, uint32_t ulTransId, BTBdaddr_t *pxBda, bool bExecWrite) |
Callback invoked on execute write event.
Callback invoked when a remote device that has done prepare write is now executing the command.
[in] | usConnId | Connection Identifier, created and return on connection event, when BTConnectionCallback_t is invoked. |
[in] | ulTransId | Transaction ID. |
[in] | pxBda | Remote device address. |
[in] | bExecWrite | True is the write order needs to be executed. |
typedef void(* BTResponseConfirmationCallback_t) (BTStatus_t xStatus, uint16_t usHandle) |
Callback triggered in response to sendResponse if the remote device sends a confirmation.
[in] | xStatus | returns eBTStatusSuccess if operation succeeded. |
[in] | usHandle | Handle of the attribute. |
typedef void(* BTIndicationSentCallback_t) (uint16_t usConnId, BTStatus_t xStatus) |
Callback on confirmation device from the remote device to an indication. Or confirm a Notification as been sent.
[in] | usConnId | Connection Identifier, created and return on connection event, when BTConnectionCallback_t is invoked. |
[in] | xStatus | returns eBTStatusSuccess if operation succeeded. |
typedef void(* BTMtuChangedCallback_t) (uint16_t usConnId, uint16_t usMtu) |
Callback invoked when the MTU for a given connection changes.
[in] | usConnId | Connection Identifier, created and return on connection event, when BTConnectionCallback_t is invoked. |
[in] | usMtu | MTU size. |
typedef void(* BTWhiteListChangedCallback_t) (const BTBdaddr_t *pxBdAddr, bool bIsAdded) |
Callback for notifying modification in white list.
[in] | pxBdAddr | Address of the Remote device. |
[in] | bIsAdded | true if device added false if device not in white list |
typedef void( * BTConnectCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus, uint8_t ucClientIf, BTBdaddr_t *pxBda) |
GATT open callback invoked in response to open
typedef void( * BTDisconnectCallback_t) (uint16_t usConnId, BTGattStatus_t xStatus, uint8_t ucClientIf, BTBdaddr_t *pxBda) |
Callback invoked in response to close
typedef void( * BTReadRemoteRssiCallback_t) (uint8_t ucClientIf, BTBdaddr_t *pxBda, uint32_t ulRssi, BTStatus_t xStatus) |
Callback triggered in response to readRemoteRssi
typedef void( * BTCongestionCallback_t) (uint16_t usConnId, bool bCongested) |
Callback notifying an application that a remote device connection is currently congested and cannot receive any more data. An application should avoid sending more data until a further callback is received indicating the congestion status has been cleared.
typedef void( * BTDeviceStateChangedCallback_t) (BTState_t xState) |
Bluetooth state change Callback. Invoked on pxEnable/pxDisable.
[in] | xState | Device event, triggered on state change. (switched on or off). |
typedef void( * BTDevicePropertiesCallback_t) (BTStatus_t xStatus, uint32_t ulNumProperties, BTProperty_t *pxProperties) |
GET/SET local device Properties callback.
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | ulNumProperties | Number of properties returned. |
[in] | pxProperties | Array of properties. |
typedef void( * BTRemoteDevicePropertiesCallback_t) (BTStatus_t xStatus, BTBdaddr_t *pxBdAddr, uint32_t ulNumProperties, BTProperty_t *pxProperties) |
GET/SET Remote Device Properties callback. Invoked on pxGetRemoteDeviceProperty, pxSetRemoteDeviceProperty, pxGetAllRemoteDeviceProperties.
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | pxBdAddr | Address of the Remote device. |
[in] | ulNumProperties | Number of properties returned. |
[in] | pxProperties | Array of properties. |
typedef void(* BTPinRequestCallback_t) (BTBdaddr_t *pxRemoteBdAddr, BTBdname_t *pxBdName, uint32_t ulCod, uint8_t ucMin16Digit) |
Callback Invoked on Pin Request.
[in] | pxRemoteBdAddr | remote Device address |
[in] | pxBdName | remote Device name |
[in] | ulCod | cod |
[in] | ucMin16Digit | pinBluetooth Legacy PinKey Request callback |
typedef void( * BTSspRequestCallback_t) (BTBdaddr_t *pxRemoteBdAddr, BTBdname_t *pxRemoteBdName, uint32_t ulCod, BTSspVariant_t xPairingVariant, uint32_t ulPassKey) |
Callback Invoked on SSP event.
Bluetooth SSP Request callback - Just Works & Numeric Comparison pass_key - Shall be 0 for eBTSspPairingVariantConsent & eBTSspPairingPasskeyEntry.
[in] | pxRemoteBdAddr | Remote device Address. |
[in] | pxRemoteBdName | Remote device Name (NULL if not available. |
[in] | ulCod | Class Of Device. |
[in] | xPairingVariant | Paring variant. |
[in] | ulPassKey | Pass Key. |
typedef void( * BTPairingStateChangedCallback_t) (BTStatus_t xStatus, BTBdaddr_t *pxRemoteBdAddr, BTBondState_t xState, BTSecurityLevel_t xSecurityLevel, BTAuthFailureReason_t xReason) |
Bluetooth pairing state changed event callback. Invoked in response to create_bond, cancel_bond or remove_bond reason field is valid only in case of xStatus == eBTStatusFail. Invoked on pairing event.
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | pxRemoteBdAddr | Remote device Address. |
[in] | xState | Bonded state value. |
[in] | xReason | Authentication failure status. |
[in] | xSecurityLevel | Security level (mode 1, level 1, 2 ,3 ,4). |
typedef void( * BTEnergyInfoCallback_t) (BTActivityEnergyInfo *pxEnergyInfo, BTUidTraffic_t *pxUidData) |
Callback invoked on pxReadEnergyInfo. Invoked on pxReadEnergyInfo.
Ctrl_state-Current controller state-Active-1,scan-2,or idle-3 state as defined by HCI spec. If the ctrl_state value is 0, it means the API call failed Time values-In milliseconds as returned by the controller Energy used-Value as returned by the controller Status-Provides the status of the read_energy_info API call uid_data provides an array of BTUidTraffic_t, where the array is terminated by an element withapp_uid set to -1.
[in] | pxEnergyInfo | Energy information. |
[in] | pxUidData | UID data traffic. |
typedef void( * BTDutModeRecvCallback_t) (uint16_t usOpcode, uint8_t *pucBuf, size_t xLen) |
Bluetooth Test Mode Callback. Invoked when remote device uses pxDutModeSend.
[in] | usOpcode | |
[in] | pucBuf | |
[in] | xLen |
typedef void( * BTLeTestModeCallback_t) (BTStatus_t xStatus, uint16_t usNumPackets) |
LE Test mode callbacks. Invoked on pxLeTestMode.
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | usNumPackets |
typedef void( * BTReadRssiCallback_t) (BTBdaddr_t *pxBda, uint32_t ulRssi, BTStatus_t xStatus) |
Read RSSI Callback. Invoked on pxReadRssi.
[in] | pxBda | Remote device address. |
[in] | ulRssi | |
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
typedef void( * BTSlaveSecurityRequestCallBack_t) (BTBdaddr_t *pxBda, BTSecurityLevel_t xSecurityLevel, bool bBonding) |
Security request callback. Invoked on master from remote slave security request event.
[in] | pxBda | Remote device address. |
[in] | xSecurityLevel | Request security |
[in] | bBonding | True is bonding is requested |
typedef void( * BTTxPowerCallback_t) (BTBdaddr_t *pxBda, BTTransport_t xTransport, uint8_t ucTxPowerValue, BTStatus_t xStatus) |
TX power Callback. Invoked on pxGetTxpower.
[in] | pxBda | Remote device address. |
[in] | xTransport | Specify if BLE and BT classic is being used. |
[in] | ucTxPowerValue | Tx Power value. |
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
typedef void( * BTBondedCallback_t) (BTStatus_t xStatus, BTBdaddr_t *pxRemoteBdAddr, bool bIsBonded) |
typedef void(* BTAclStateChangedCallback_t) (BTStatus_t xStatus, const BTBdaddr_t *pxRemoteBdAddr, BTAclState_t xState, BTTransport_t xTransport, BTAclDisconnectReason_t xReason) |
Callback invoked in response to ACL connection state change.
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | pxRemoteBdAddr | Address of the remote device. |
[in] | xState | ACL connection state. |
[in] | xTransport | Transport type as in BTTransport_t. If transport type is unknown, use BTTransportAuto. |
[in] | xReason | Contains ACL disconnect reason when xState is eBTaclStateDisconnected. |
typedef void(* BTRegisterBleAdapterCallback_t) (BTStatus_t xStatus, uint8_t ucAdapterIf, BTUuid_t *pxAppUuid) |
Callback invoked in response pxRegisterBleApp.
BLE Adapter callback structure.
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
[in] | pxAppUuid | UUID of the adapter. |
typedef void(* BTBleDevicePropertiesCallback_t) (BTStatus_t xStatus, uint32_t ulNumProperties, BTBleProperty_t *pxProperties) |
Callback invoked in response to pxGetBleAdapterProperty and pxSetBleAdapterProperty.
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | ulNumProperties | Number of BLE specific properties. |
[in] | pxProperties | Properties array. |
typedef void(* BTBleRemoteDevicePropertiesCallback_t) (BTStatus_t xStatus, BTBdaddr_t *pxBdAddr, uint32_t ulNumProperties, BTBleProperty_t *pxProperties) |
Callback invoked in response to pxGetBleRemoteDeviceProperty and pxSetBleRemoteDeviceProperty.
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | pxBdAddr | Address of the Remote device |
[in] | ulNumProperties | Number of BLE specific properties. |
[in] | pxProperties | Properties array. |
typedef void(* BTScanResultCallback_t) (BTBdaddr_t *pxBda, uint32_t ulRssi, uint8_t *pucAdvData) |
Callback invoked in response to pxScan.
[in] | pxBda | Remote device address. |
[in] | ulRssi | |
[in] | pucAdvData |
typedef void(* BTAdvStatusCallback_t) (BTStatus_t xStatus, uint8_t ucAdapterIf, bool bStart) |
Callback invoked on pxStartAdv and stop advertisement.
GATT open callback invoked in response to open
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
[in] | bStarted | True for start advertisement, flase for stop |
typedef void(* BTSetAdvDataCallback_t) (BTStatus_t xStatus) |
Callback invoked on pxSetAdvData.
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
typedef void( * BTConnParameterUpdateCallback_t) (BTStatus_t xStatus, const BTBdaddr_t *pxBdAddr, uint32_t ulMinInterval, uint32_t ulMaxInterval, uint32_t ulLatency, uint32_t usConnInterval, uint32_t ulTimeout) |
Callback invoked on when a peer device makes a request. The callback is triggered by pxConnParameterUpdateRequest.
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | pxBdAddr | Address of the Remote device. |
[in] | ulMinInterval | Minimum connection interval. |
[in] | ulMaxInterval | Max connection interval. |
[in] | ulLatency | Slave latency. |
[in] | usConnInterval | Actual connection interval. |
[in] | ulTimeout | Connection timeout. |
typedef void(* BTScanFilterCfgCallback_t) (uint32_t ulAction, uint8_t ucAdapterIf, BTStatus_t xStatus, uint32_t ulFiltType, uint32_t ulAvblSpace) |
Callback invoked when a scan filter configuration command has completed.
[in] | ulAction | |
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | ulFiltType | |
[in] | ulAvblSpace |
typedef void(* BTScanFilterParamCallback_t) (uint32_t ulAction, uint8_t ucAdapterIf, BTStatus_t xStatus, uint32_t ulAvblSpace) |
Callback invoked on pxScanFilterParamSetup.
[in] | ulAction | |
[in] | ucAdapterIf | |
[in] | xStatus | |
[in] | ulAvblSpace |
typedef void(* BTScanFilterStatusCallback_t) (bool bEnable, uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked on pxScanFilterEnable.
[in] | bEnable | True if filter is enabled. |
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
typedef void(* BTMultiAdvEnableCallback_t) (uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked on pxMultiAdvEnable.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
typedef void(* BTMultiAdvUpdateCallback_t) (uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked on pxMultiAdvUpdate.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
typedef void(* BTMultiAdvDataCallback_t) (uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked on pxMultiAdvSetInstData and pxMultiAdvSetInstRawData.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
typedef void(* BTMultiAdvDisableCallback_t) (uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked on pxMultiAdvDisable.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
typedef void(* BTBatchscanCfgStorageCallback_t) (uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked on pxBatchscanCfgStorage.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
typedef void(* BTBatchscanEnableDisableCallback_t) (uint32_t ulAction, uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked on pxBatchscanDisBatchScan and TBD.
[in] | ulAction | |
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
typedef void(* BTBatchscanReportsCallback_t) (uint8_t ucAdapterIf, BTStatus_t xStatus, uint32_t ulReportFormat, uint32_t ulNumRecords, size_t XDataLen, uint8_t *pucRepData) |
Callback invoked on pxBatchscanReadReports.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | ulReportFormat | |
[in] | ulNumRecords | |
[in] | XDataLen | |
[in] | pucRepData |
typedef void(* BTBatchscanThresholdCallback_t) (uint8_t ucAdapterIf) |
Callback invoked when batchscan storage threshold limit is crossed.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
typedef void(* BTTrackAdvEventCallback_t) (BTGattTrackAdvInfo_t *pxTrackAdvInfo) |
Track ADV VSE callback invoked when tracked device is found or lost.
[in] | pxTrackAdvInfo |
typedef void(* BTScanParameterSetupCompletedCallback_t) (uint8_t ucAdapterIf, BTStatus_t xStatus) |
Callback invoked when scan parameter setup has completed.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
typedef void(* BTPhyUpdatedCallback_t) (uint16_t usConnId, uint8_t ucTxPhy, uint8_t ucRxPhy, BTStatus_t xStatus) |
Callback invoked on pxSetPreferredPhy.
[in] | usConnId | Connection ID return from BTConnectCallback_t. |
[in] | ucTxPhy | |
[in] | ucRxPhy | |
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
typedef void(* BTReadClientPhyCallback_t) (uint16_t usConnId, uint8_t ucTxPhy, uint8_t ucRxPhy, BTStatus_t xStatus) |
Callback invoked on pxReadPhy.
[in] | usConnId | Connection ID return from BTConnectCallback_t. |
[in] | ucTxPhy | |
[in] | ucRxPhy | |
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
typedef void(* BTClassicDevicePropertiesCallback_t) (BTStatus_t xStatus, uint32_t ulNumProperties, BTClassicProperty_t *pxProperties) |
Callback invoked in response to pxGetClassicDeviceProperty and pxSetClassicDeviceProperty.
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | ulNumProperties | Number of classic specific properties. |
[in] | pxProperties | Properties array. |
typedef void( * BTClassicRemoteDevicePropertiesCallback_t) (BTStatus_t xStatus, BTBdaddr_t *pxBdAddr, uint32_t ulNumProperties, BTClassicProperty_t *pxProperties) |
Callback invoked in response to pxGetRemoteClassicDeviceProperty and pxSetRemoteClassicDeviceProperty.
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | pxBdAddr | Address of the Remote device |
[in] | ulNumProperties | Number of classic specific properties. |
[in] | pxProperties | Properties array. |
typedef 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 shall be NULL and -1 respectively.
[in] | ulNumProperties | Number of classic specific properties |
[in] | pxProperties | Properties array |
typedef void(* BTDiscoveryStateChangedCallback_t) (BTDiscoveryState_t xState) |
Callback invoked in response to pxStartDiscovery and pxStopDiscovery.
[in] | xState | Discovery state |
typedef void(* BTaclStateChangedCallback_t) (BTStatus_t xStatus, BTBdaddr_t *pxRemoteBdAddr, BTaclState_t xState) |
Callback invoked in response to ACL connection state change.
[in] | xStatus | Returns eBTStatusSuccess if operation succeeded. |
[in] | pxRemoteBdAddr | Address of the Remote device |
[in] | xState | ACL connection state |
enum BTAvAudioState_t |
enum BTAvsrcAclPriority_t |
enum BTGattcError_t |
BT GATT client error codes.
enum BTRspErrorStatus_t |
Error status sent inside response to a read or write from the client.
enum BTGattStatus_t |
GATT Status Codes.
anonymous enum |
GATT Characteristic property.
anonymous enum |
GATT permissions.
enum BTGattServiceTypes_t |
enum BTDbAttributeType_t |
anonymous enum |
Security Level.
anonymous enum |
enum BTTransport_t |
enum BTState_t |
Authentication failure reasons.
enum BTPropertyType_t |
Bluetooth local device and Remote Device property types. Properties common to both adapter and remote device.
Enumerator | |
---|---|
eBTpropertyBdname | Description - Bluetooth Device Name Access mode - Adapter name can be GET/SET. Remote device can be GET Data type - BTBdname_teBTpropertyBdname |
eBTpropertyBdaddr | Description - Bluetooth Device Address Access mode - Only GET. Data type - BTBdaddr_teBTpropertyBdaddr |
eBTpropertyTypeOfDevice | Description - Device Type - BREDR, BLE or DUAL Mode Access mode - Only GET. Data type - BTDeviceType_teBTpropertyTypeOfDevice |
eBTpropertyAdapterBondedDevices | Description - List of bonded devices Access mode - Only GET. Data type - Array of BTBdaddr_t of the bonded remote devices (Array size inferred from property length).eBTpropertyAdapterBondedDevices |
eBTpropertyRemoteFriendlyName | Description - User defined friendly name of the remote device Access mode - GET and SET Data type - BTBdname_t.eBTpropertyRemoteFriendlyName |
eBTpropertyRemoteRssi | Description - RSSI value of the inquired remote device Access mode - Only GET. Data type - int32_t.eBTpropertyRemoteRssi |
eBTpropertyRemoteVersionInfo | Description - Remote version info Access mode - SET/GET. Data type - BTRemoteVersion_t.eBTpropertyRemoteVersionInfo |
eBTpropertyLocalMTUSize | Description - MTU size Access mode - SET/GET. Data type - uint32_teBTpropertyLocalMTUSize |
eBTpropertyBondable | Description - Bondable flag Access mode - SET/GET Data type - bool (true for bondable)eBTpropertyBondable |
eBTpropertyIO | Description - I/O flag. : eBTpropertyIO has a dependency on the property eBTpropertySecureConnectionOnly. Only I/O yes/no is compatible with eBTpropertySecureConnectionOnly = 1 Access mode - SET/GET Data type - BTIOtypes_teBTpropertyIO |
eBTpropertyConnectable | Description - Connectable mode flag Access mode - SET/GET Data type - booleBTpropertyConnectable Sets connectable mode. |
eBTpropertySecureConnectionOnly | Description - Secure only mode flag. : Secure connections only has a dependency on the property eBTpropertyIO. Only I/O yes/no is compatible with eBTpropertySecureConnectionOnly = 1 Access mode - SET/GET Data type - booleBTpropertySecureOnly Sets secure connection only mode. |
enum BTDeviceType_t |
enum BTBondState_t |
Bluetooth Bond state
enum BTSspVariant_t |
enum BTAclState_t |
Bluetooth ACL Disconnect Reason From Bluetooth Core Spec 5.0 Vol 2, Part D Error Codes Unknown disconnect reason will be treated as eBTaclUnspecified.
enum BTBlePropertyType_t |
enum BTScanMode_t |
enum BTScanParam_t |
enum BTDiscoveryState_t |
enum BTaclState_t |
enum BTScanType_t |
Classic Device Property Types.
Enumerator | |
---|---|
eBTPropertyBdname | Description - Bluetooth Device Name Access mode - Adapter name can be GET/SET. Remote device can be GET Data type - BTBdname_t |
eBTPropertyBdaddr | Description - Bluetooth Device Address Access mode - Only GET. Data type - BTBdaddr_t |
eBTPropertyTypeOfDevice | Description - Device Type - BREDR, BLE or DUAL Mode Access mode - Only GET. Data type - BTDeviceType_t. |
eBTPropertyUUIDS | Description - Bluetooth Service 128-bit UUIDs Access mode - Only GET. Data type - Array of BTUuid_t (Array size inferred from property length). |
eBTPropertyClassOfDevice | Description - Bluetooth Class of Device as found in Assigned Numbers Access mode - Only GET. Data type - uint32_t. |
eBTPropertyServiceRecord | Description - Bluetooth Service Record Access mode - Only GET. Data type - BTServiceRecord_t |
eBTPropertyAdapterDiscoveryTimeout | Description - Bluetooth Adapter Discovery timeout (in seconds) Access mode - GET and SET Data type - uint32_t |
eBTPropertyAdapterScanMode | Description - Bluetooth Adapter scan mode Access mode - GET and SET Data type - BTScanMode_t. |
eBTPropertyEIRManfInfo | Description - Manufacturer specific info on EIR Access mode - GET Data type - BTEirManfInfo_t. |
eBTPropertyAdapterScanParam | Description - Bluetooth Adapter scan parameters Access mode - SET Data type - BTScanParam_t. |
eBTPropertyConnectability | Description - Bluetooth Adapter's connectability Access mode - GET and SET Data type - 2 * uint32_t |
eBTPropertyScanType | Description - Bluetooth Adapter's scan type (Standard or Interlaced) Access mode - GET and SET Data type - BTScanType_t |
eBTPropertyGadgetEIRManfInfo | Description - Manufacturer gadget specific info on EIR Access mode - GET Data type - BTGadgetEirManfInfo_t. |
enum BTuuidType_t |
enum BTStatus_t |
Bluetooth Error Status .
enum BTProfile_t |
enum BTIOtypes_t |