FreeRTOS:
BLE
BLE
|
Return to main page ↑ |
BLE adapter API. More...
#include <bt_hal_manager_adapter_ble.h>
Data Fields | |
BTStatus_t(* | pxRegisterBleApp )(BTUuid_t *pxAppUuid) |
Registers a BLE application with the stack. More... | |
BTStatus_t(* | pxUnregisterBleApp )(uint8_t ucAdapterIf) |
Unregister a BLE application from the stack. More... | |
BTStatus_t(* | pxBleAdapterInit )(const BTBleAdapterCallbacks_t *pxCallbacks) |
Initializes the interface and provides callback routines. More... | |
BTStatus_t(* | pxGetBleAdapterProperty )(BTBlePropertyType_t xType) |
Get Bluetooth LE Adapter property of 'type'. More... | |
BTStatus_t(* | pxSetBleAdapterProperty )(const BTBleProperty_t *pxProperty) |
Set Bluetooth LE Adapter property of 'type'. More... | |
BTStatus_t(* | pxGetallBleRemoteDeviceProperties )(BTBdaddr_t *pxRremoteAddr) |
Get all Remote Device properties. More... | |
BTStatus_t(* | pxGetBleRemoteDeviceProperty )(BTBdaddr_t *pxRemoteAddr, BTBleProperty_t xType) |
Get Remote Device property of 'type'. More... | |
BTStatus_t(* | pxSetBleRemoteDeviceProperty )(BTBdaddr_t *pxRemoteAddr, const BTBleProperty_t *pxProperty) |
Set Remote Device property of 'type' . More... | |
BTStatus_t(* | pxScan )(bool bStart) |
Start or stop LE device scanning. More... | |
BTStatus_t(* | pxConnect )(uint8_t ucAdapterIf, const BTBdaddr_t *pxBdAddr, bool bIsDirect, BTTransport_t ulTransport) |
Create a connection to a remote LE or dual-mode device. More... | |
BTStatus_t(* | pxDisconnect )(uint8_t ucAdapterIf, const BTBdaddr_t *pxBdAddr, uint16_t usConnId) |
Disconnect a remote device or cancel a pending connection. More... | |
BTStatus_t(* | pxStartAdv )(uint8_t ucAdapterIf) |
Start advertisements to listen for incoming connections. More... | |
BTStatus_t(* | pxStopAdv )(uint8_t ucAdapterIf) |
Stop advertisements to listen for incoming connections. More... | |
BTStatus_t(* | pxReadRemoteRssi )(uint8_t ucAdapterIf, const BTBdaddr_t *pxBdAddr) |
Request RSSI for a given remote device. More... | |
BTStatus_t(* | pxScanFilterParamSetup )(BTGattFiltParamSetup_t xFiltParam) |
Setup scan filter params. More... | |
BTStatus_t(* | pxScanFilterAddRemove )(uint8_t ucAdapterIf, uint32_t ulAction, uint32_t ulFiltType, uint32_t ulFiltIndex, uint32_t ulCompanyId, uint32_t ulCompanyIdMask, const BTUuid_t *pxUuid, const BTUuid_t *pxUuidMask, const BTBdaddr_t *pxBdAddr, char cAddrType, size_t xDataLen, char *pcData, size_t xMaskLen, char *pcMask) |
Configure a scan filter condition. More... | |
BTStatus_t(* | pxScanFilterClear )(uint8_t ucAdapterIf, uint32_t ulFiltIndex) |
Clear all scan filter conditions for specific filter index. More... | |
BTStatus_t(* | pxScanFilterEnable )(uint8_t ucAdapterIf, bool bEnable) |
Enable / disable scan filter feature. More... | |
BTTransport_t(* | pxGetDeviceType )(const BTBdaddr_t *pxBdAddr) |
Determine the type of the remote device (LE, BR/EDR, Dual-mode). More... | |
BTStatus_t(* | pxSetAdvData )(uint8_t ucAdapterIf, BTGattAdvertismentParams_t *pxParams, uint16_t usManufacturerLen, char *pcManufacturerData, uint16_t usServiceDataLen, char *pcServiceData, BTUuid_t *pxServiceUuid, size_t xNbServices) |
Set the advertising data or scan response data. More... | |
BTStatus_t(* | pxSetAdvRawData )(uint8_t ucAdapterIf, uint8_t *pucData, uint8_t ucLen) |
Set the advertising data of complete 31 bytes or scan response data. More... | |
BTStatus_t(* | pxConnParameterUpdateRequest )(const BTBdaddr_t *pxBdAddr, uint32_t ulMinInterval, uint32_t ulMaxInterval, uint32_t ulLatency, uint32_t ulTimeout) |
BTStatus_t(* | pxSetScanParameters )(uint8_t ucAdapterIf, uint32_t ulScanInterval, uint32_t ulScanWindow) |
Sets the LE scan interval and window in units of N*0.625 msec. More... | |
BTStatus_t(* | pxMultiAdvEnable )(uint8_t ucAdapterIf, BTGattAdvertismentParams_t *xAdvParams) |
Setup the parameters as per spec, user manual specified values and enable multi ADV. More... | |
BTStatus_t(* | pxMultiAdvUpdate )(uint8_t ucAdapterIf, BTGattAdvertismentParams_t *advParams) |
Update the parameters as per spec, user manual specified values and restart multi ADV. More... | |
BTStatus_t(* | pxMultiAdvSetInstData )(uint8_t ucAdapterIf, bool bSetScanRsp, bool bIncludeName, bool bInclTxpower, uint32_t ulAppearance, size_t xManufacturerLen, char *pcManufacturerData, size_t xServiceDataLen, char *pcServiceData, BTUuid_t *pxServiceUuid, size_t xNbServices) |
Setup the data for the specified instance. More... | |
BTStatus_t(* | pxMultiAdvDisable )(uint8_t ucAdapterIf) |
Disable the multi adv instance. More... | |
BTStatus_t(* | pxBatchscanCfgStorage )(uint8_t ucAdapterIf, uint32_t ulBatchScanFullMax, uint32_t ulBatchScanTruncMax, uint32_t ulBatchScanNotifyThreshold) |
Configure the batchscan storage. More... | |
BTStatus_t(* | pxBatchscanEndBatchScan )(uint8_t ucAdapterIf, uint32_t ulScanMode, uint32_t ulScanInterval, uint32_t ulScanWindow, uint32_t ulAddrType, uint32_t ulDiscardRule) |
Enable batchscan. More... | |
BTStatus_t(* | pxBatchscanDisBatchScan )(uint8_t ucAdapterIf) |
Disable batchscan. More... | |
BTStatus_t(* | pxBatchscanReadReports )(uint8_t ucAdapterIf, uint32_t ulScanMode) |
Read out batchscan reports. More... | |
BTStatus_t(* | pxSetPreferredPhy )(uint16_t usConnId, uint8_t ucTxPhy, uint8_t ucRxPhy, uint16_t usPhyOptions) |
BTStatus_t(* | pxReadPhy )(uint16_t usConnId, BTReadClientPhyCallback_t xCb) |
const void *(* | ppvGetGattClientInterface )() |
returns the GATT client interface, see bt_hal_gatt_client.h | |
const void *(* | ppvGetGattServerInterface )() |
returns the GATT server interface, see bt_hal_gatt_server.h | |
BTStatus_t(* | pxMultiAdvSetInstRawData )(uint8_t ucAdapterIf, bool bSetScanRsp, uint8_t *pucData, size_t xDataLen) |
Setup the raw data for the specified instance. More... | |
BTStatus_t(* | pxSetBgScanParameters )(uint8_t ucAdapterIf, uint32_t ulScanIntervalTime, uint32_t ulScanWindowTime) |
Sets the LE background scan interval and window in units of N*0.625 msec. More... | |
BLE adapter API.
Represents the standard BT-GATT client interface.
BTStatus_t( * BTBleAdapter_t::pxRegisterBleApp) (BTUuid_t *pxAppUuid) |
Registers a BLE application with the stack.
Triggers BTRegisterBleAdapterCallback_t.
[in] | pxAppUuid | APP UUID |
BTStatus_t( * BTBleAdapter_t::pxUnregisterBleApp) (uint8_t ucAdapterIf) |
Unregister a BLE application from the stack.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
BTStatus_t( * BTBleAdapter_t::pxBleAdapterInit) (const BTBleAdapterCallbacks_t *pxCallbacks) |
Initializes the interface and provides callback routines.
[in] | pxCallbacks | Callbacks initializer for BLE adapter. |
BTStatus_t( * BTBleAdapter_t::pxGetBleAdapterProperty) (BTBlePropertyType_t xType) |
Get Bluetooth LE Adapter property of 'type'.
Triggers BTRegisterBleAdapterCallback_t.
[in] | xType | Property type. |
BTStatus_t( * BTBleAdapter_t::pxSetBleAdapterProperty) (const BTBleProperty_t *pxProperty) |
Set Bluetooth LE Adapter property of 'type'.
Triggers BTBleDevicePropertiesCallback_t.
[in] | pxProperty | Property type. |
BTStatus_t( * BTBleAdapter_t::pxGetallBleRemoteDeviceProperties) (BTBdaddr_t *pxRremoteAddr) |
Get all Remote Device properties.
[in] | pxRremoteAddr | Remote device address. |
BTStatus_t( * BTBleAdapter_t::pxGetBleRemoteDeviceProperty) (BTBdaddr_t *pxRemoteAddr, BTBleProperty_t xType) |
Get Remote Device property of 'type'.
[in] | pxRemoteAddr | Remote device address. |
[in] | xType |
BTStatus_t( * BTBleAdapter_t::pxSetBleRemoteDeviceProperty) (BTBdaddr_t *pxRemoteAddr, const BTBleProperty_t *pxProperty) |
Set Remote Device property of 'type' .
[in] | pxRemoteAddr | Remote device address. |
[in] | pxProperty | Remote device property |
BTStatus_t( * BTBleAdapter_t::pxScan) (bool bStart) |
Start or stop LE device scanning.
[in] | bStart |
BTStatus_t( * BTBleAdapter_t::pxConnect) (uint8_t ucAdapterIf, const BTBdaddr_t *pxBdAddr, bool bIsDirect, BTTransport_t ulTransport) |
Create a connection to a remote LE or dual-mode device.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | pxBdAddr | Address of the Remote device |
[in] | bIsDirect | True if a direct connection is desired. |
[in] | xTransport | Specify if BLE and BT classic is being used. |
BTStatus_t( * BTBleAdapter_t::pxDisconnect) (uint8_t ucAdapterIf, const BTBdaddr_t *pxBdAddr, uint16_t usConnId) |
Disconnect a remote device or cancel a pending connection.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | pxBdAddr | Address of the Remote device |
[in] | usConnId | Connection ID return from BTConnectCallback_t |
BTStatus_t( * BTBleAdapter_t::pxStartAdv) (uint8_t ucAdapterIf) |
Start advertisements to listen for incoming connections.
Triggers BTAdvStatusCallback_t with bStart = true.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
BTStatus_t( * BTBleAdapter_t::pxStopAdv) (uint8_t ucAdapterIf) |
Stop advertisements to listen for incoming connections.
Triggers BTAdvStatusCallback_t with bStart = false.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
BTStatus_t( * BTBleAdapter_t::pxReadRemoteRssi) (uint8_t ucAdapterIf, const BTBdaddr_t *pxBdAddr) |
Request RSSI for a given remote device.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
[in] | pxBdAddr | Address of the Remote device. |
BTStatus_t( * BTBleAdapter_t::pxScanFilterParamSetup) (BTGattFiltParamSetup_t xFiltParam) |
Setup scan filter params.
[in] | xFiltParam |
BTStatus_t( * BTBleAdapter_t::pxScanFilterAddRemove) (uint8_t ucAdapterIf, uint32_t ulAction, uint32_t ulFiltType, uint32_t ulFiltIndex, uint32_t ulCompanyId, uint32_t ulCompanyIdMask, const BTUuid_t *pxUuid, const BTUuid_t *pxUuidMask, const BTBdaddr_t *pxBdAddr, char cAddrType, size_t xDataLen, char *pcData, size_t xMaskLen, char *pcMask) |
Configure a scan filter condition.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
[in] | ulAction | |
[in] | ulFiltType | |
[in] | ulFiltIndex | |
[in] | ulCompanyId | |
[in] | ulCompanyIdMask | |
[in] | pxUuid | UUID of the attribute. |
[in] | pxUuidMask | |
[in] | pxBdAddr | Address of the Remote device. |
[in] | cAddrType | |
[in] | xDataLen | |
[in] | pcData | |
[in] | xMaskLen | |
[in] | pcMask |
BTStatus_t( * BTBleAdapter_t::pxScanFilterClear) (uint8_t ucAdapterIf, uint32_t ulFiltIndex) |
Clear all scan filter conditions for specific filter index.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | ulFiltIndex |
BTStatus_t( * BTBleAdapter_t::pxScanFilterEnable) (uint8_t ucAdapterIf, bool bEnable) |
Enable / disable scan filter feature.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | bEnable | Set to true to enable the scan filter, false to disable. |
BTTransport_t( * BTBleAdapter_t::pxGetDeviceType) (const BTBdaddr_t *pxBdAddr) |
Determine the type of the remote device (LE, BR/EDR, Dual-mode).
[in] | pxBdAddr | Address of the Remote device, |
BTStatus_t( * BTBleAdapter_t::pxSetAdvData) (uint8_t ucAdapterIf, BTGattAdvertismentParams_t *pxParams, uint16_t usManufacturerLen, char *pcManufacturerData, uint16_t usServiceDataLen, char *pcServiceData, BTUuid_t *pxServiceUuid, size_t xNbServices) |
Set the advertising data or scan response data.
Triggers BTSetAdvDataCallback_t.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
[in] | pxParams | Advertisement parameters. |
[in] | usManufacturerLen | Length of Advertisement type Manufacturer data |
[in] | pcManufacturerData | Advertisement type Manufacturer data |
[in] | usServiceDataLen | Length of Advertisement type service data |
[in] | pcServiceData | Advertisement type service data. UUIDs used in this service data can be only be 16bit. If longer UUIDs are needed, use pxSetAdvRawData() instead. |
[in] | pxServiceUuid | Array of UUIDs of advertised services. At most one UUID of each size (16 bit, 32 bit, 128 bit) can be included in the advertisement packet. |
[in] | xNbServices | Number of services. |
BTStatus_t( * BTBleAdapter_t::pxSetAdvRawData) (uint8_t ucAdapterIf, uint8_t *pucData, uint8_t ucLen) |
Set the advertising data of complete 31 bytes or scan response data.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
[in] | pucData | Ad Types serialized. |
[in] | ucLen | Ad types serialized array len. |
BTStatus_t( * BTBleAdapter_t::pxConnParameterUpdateRequest) (const BTBdaddr_t *pxBdAddr, uint32_t ulMinInterval, uint32_t ulMaxInterval, uint32_t ulLatency, uint32_t ulTimeout) |
a connection parameter update. If the request is accepted, it will trigger BTConnParameterUpdateRequestCallback_t.
[in] | pxBdAddr | Address of the Remote device. |
[in] | ulMinInterval | Minimum connection interval. |
[in] | ulMaxInterval | Maximum connection interval. |
[in] | ulLatency | Slave latency. |
[in] | ulTimeout | Connection timeout. |
BTStatus_t( * BTBleAdapter_t::pxSetScanParameters) (uint8_t ucAdapterIf, uint32_t ulScanInterval, uint32_t ulScanWindow) |
Sets the LE scan interval and window in units of N*0.625 msec.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
[in] | ulScanInterval | |
[in] | ulScanWindow |
BTStatus_t( * BTBleAdapter_t::pxMultiAdvEnable) (uint8_t ucAdapterIf, BTGattAdvertismentParams_t *xAdvParams) |
Setup the parameters as per spec, user manual specified values and enable multi ADV.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | xAdvParams | Advertisement parameters. |
BTStatus_t( * BTBleAdapter_t::pxMultiAdvUpdate) (uint8_t ucAdapterIf, BTGattAdvertismentParams_t *advParams) |
Update the parameters as per spec, user manual specified values and restart multi ADV.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | advParams |
BTStatus_t( * BTBleAdapter_t::pxMultiAdvSetInstData) (uint8_t ucAdapterIf, bool bSetScanRsp, bool bIncludeName, bool bInclTxpower, uint32_t ulAppearance, size_t xManufacturerLen, char *pcManufacturerData, size_t xServiceDataLen, char *pcServiceData, BTUuid_t *pxServiceUuid, size_t xNbServices) |
Setup the data for the specified instance.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | bSetScanRsp | |
[in] | bIncludeName | |
[in] | bInclTxpower | |
[in] | ulAppearance | |
[in] | xManufacturerLen | |
[in] | pcManufacturerData | |
[in] | xServiceDataLen | |
[in] | pcServiceData | |
[in] | pxServiceUuid | |
[in] | xNbServices |
BTStatus_t( * BTBleAdapter_t::pxMultiAdvDisable) (uint8_t ucAdapterIf) |
Disable the multi adv instance.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
BTStatus_t( * BTBleAdapter_t::pxBatchscanCfgStorage) (uint8_t ucAdapterIf, uint32_t ulBatchScanFullMax, uint32_t ulBatchScanTruncMax, uint32_t ulBatchScanNotifyThreshold) |
Configure the batchscan storage.
ucAdapterIf | |
ulBatchScanFullMax | |
ulBatchScanTruncMax | |
ulBatchScanNotifyThreshold |
BTStatus_t( * BTBleAdapter_t::pxBatchscanEndBatchScan) (uint8_t ucAdapterIf, uint32_t ulScanMode, uint32_t ulScanInterval, uint32_t ulScanWindow, uint32_t ulAddrType, uint32_t ulDiscardRule) |
Enable batchscan.
!TODO enum for addrType
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
[in] | ulScanMode | |
[in] | ulScanInterval | |
[in] | ulScanWindow | |
[in] | ulAddrType | |
[in] | ulDiscardRule |
BTStatus_t( * BTBleAdapter_t::pxBatchscanDisBatchScan) (uint8_t ucAdapterIf) |
Disable batchscan.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
BTStatus_t( * BTBleAdapter_t::pxBatchscanReadReports) (uint8_t ucAdapterIf, uint32_t ulScanMode) |
Read out batchscan reports.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
[in] | ulScanMode |
BTStatus_t( * BTBleAdapter_t::pxSetPreferredPhy) (uint16_t usConnId, uint8_t ucTxPhy, uint8_t ucRxPhy, uint16_t usPhyOptions) |
[in] | usConnId | Connection ID return from BTConnectCallback_t. |
[in] | ucTxPhy | |
[in] | ucRxPhy | |
[in] | usPhyOptions |
BTStatus_t( * BTBleAdapter_t::pxReadPhy) (uint16_t usConnId, BTReadClientPhyCallback_t xCb) |
[in] | usConnId | Connection ID return from BTConnectCallback_t. |
[in] | xCb |
BTStatus_t( * BTBleAdapter_t::pxMultiAdvSetInstRawData) (uint8_t ucAdapterIf, bool bSetScanRsp, uint8_t *pucData, size_t xDataLen) |
Setup the raw data for the specified instance.
Triggers BTMultiAdvDataCallback_t.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp |
[in] | pucData | raw data serialized |
[in] | xDataLen | serialized data length |
[in] | bSetScanRsp |
BTStatus_t( * BTBleAdapter_t::pxSetBgScanParameters) (uint8_t ucAdapterIf, uint32_t ulScanIntervalTime, uint32_t ulScanWindowTime) |
Sets the LE background scan interval and window in units of N*0.625 msec.
[in] | ucAdapterIf | Adapter interface ID. Returned from BTRegisterBleAdapterCallback_t after calling pxRegisterBleApp. |
[in] | ulScanIntervalTime | scan interval time in units of 0.625Ms |
[in] | ulScanWindowTime | scan window time in units of 0.625Ms |