BLE#
This module includes the platform abstraction for BLE Host communication.
The platform needs to implement Bluetooth LE 4.2 or higher.
Modules#
Typedefs#
Represent BLE link capabilities.
Represents a BLE packet.
Functions#
Enable the Bluetooth Low Energy radio.
Disable the Bluetooth Low Energy radio.
Gets BLE Advertising buffer.
Sets BLE Advertising data.
Starts BLE Advertising procedure.
Stops BLE Advertising procedure.
The BLE driver calls this method to notify OpenThread that a BLE Central Device has been connected.
The BLE driver calls this method to notify OpenThread that the BLE Central Device has been disconnected.
Disconnects BLE connection.
Reads currently use value of ATT_MTU.
The BLE driver calls this method to notify OpenThread that ATT_MTU has been updated.
Sends ATT Handle Value Indication.
The BLE driver calls this method to notify OpenThread that an ATT Write Request packet has been received.
Function to retrieve from platform BLE link capabilities.
Function to retrieve from platform multiradio support of BLE and IEEE.
Macros#
Time slot duration on PHY layer in microseconds (0.625ms).
Minimum allowed interval for advertising packet in OT_BLE_ADV_INTERVAL_UNIT units (20ms).
Maximum allowed interval for advertising packet in OT_BLE_ADV_INTERVAL_UNIT units (10.24s).
Default interval for advertising packet (ms).
Unit used to calculate interval duration (0.625ms).
Maximum allowed ATT MTU size (must be >= 23).
Default power value for BLE.
TOBLE service UUID.
Typedef Documentation#
otBleLinkCapabilities#
typedef struct otBleLinkCapabilities otBleLinkCapabilities
Represent BLE link capabilities.
Function Documentation#
otPlatBleEnable#
otError otPlatBleEnable (otInstance * aInstance)
Enable the Bluetooth Low Energy radio.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
Note
BLE Device should use the highest ATT_MTU supported that does not exceed OT_BLE_ATT_MTU_MAX octets.
otPlatBleDisable#
otError otPlatBleDisable (otInstance * aInstance)
Disable the Bluetooth Low Energy radio.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
When disabled, the BLE stack will flush event queues and not generate new events. The BLE peripheral is turned off or put into a low power sleep state. Any dynamic memory used by the stack should be released, but static memory may remain reserved.
otPlatBleGetAdvertisementBuffer#
otError otPlatBleGetAdvertisementBuffer (otInstance * aInstance, uint8_t ** aAdvertisementBuffer, aAdvertisementLen)
Gets BLE Advertising buffer.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
uint8_t ** | [in] | aAdvertisementBuffer | The formatted TCAT advertisement frame. |
[in] | aAdvertisementLen | The TCAT advertisement frame length. |
Note
This function shall be used only for BLE Peripheral role. Returned buffer should have enough space to fit max advertisement defined by specification.
otPlatBleGapAdvSetData#
otError otPlatBleGapAdvSetData (otInstance * aInstance, uint8_t * aAdvertisementData, uint16_t aAdvertisementLen)
Sets BLE Advertising data.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
uint8_t * | [in] | aAdvertisementData | The formatted TCAT advertisement frame. |
uint16_t | [in] | aAdvertisementLen | The TCAT advertisement frame length. |
Note
This function shall be used only for BLE Peripheral role.
otPlatBleGapAdvStart#
otError otPlatBleGapAdvStart (otInstance * aInstance, uint16_t aInterval)
Starts BLE Advertising procedure.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
uint16_t | [in] | aInterval | The interval between subsequent advertising packets in OT_BLE_ADV_INTERVAL_UNIT units. Shall be within OT_BLE_ADV_INTERVAL_MIN and OT_BLE_ADV_INTERVAL_MAX range or OT_BLE_ADV_INTERVAL_DEFAULT for a default value set at compile time. |
The BLE device shall use undirected advertising with no filter applied. A single BLE Advertising packet must be sent on all advertising channels (37, 38 and 39).
Note
This function shall be used only for BLE Peripheral role.
otPlatBleGapAdvStop#
otError otPlatBleGapAdvStop (otInstance * aInstance)
Stops BLE Advertising procedure.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
Note
This function shall be used only for BLE Peripheral role.
otPlatBleGapOnConnected#
void otPlatBleGapOnConnected (otInstance * aInstance, uint16_t aConnectionId)
The BLE driver calls this method to notify OpenThread that a BLE Central Device has been connected.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
uint16_t | [in] | aConnectionId | The identifier of the open connection. |
otPlatBleGapOnDisconnected#
void otPlatBleGapOnDisconnected (otInstance * aInstance, uint16_t aConnectionId)
The BLE driver calls this method to notify OpenThread that the BLE Central Device has been disconnected.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
uint16_t | [in] | aConnectionId | The identifier of the closed connection. |
otPlatBleGapDisconnect#
otError otPlatBleGapDisconnect (otInstance * aInstance)
Disconnects BLE connection.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
The BLE device shall use the Remote User Terminated Connection (0x13) reason code when disconnecting from the peer BLE device..
otPlatBleGattMtuGet#
otError otPlatBleGattMtuGet (otInstance * aInstance, uint16_t * aMtu)
Reads currently use value of ATT_MTU.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
uint16_t * | [out] | aMtu | A pointer to output the current ATT_MTU value. |
otPlatBleGattOnMtuUpdate#
void otPlatBleGattOnMtuUpdate (otInstance * aInstance, uint16_t aMtu)
The BLE driver calls this method to notify OpenThread that ATT_MTU has been updated.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
uint16_t | [in] | aMtu | The updated ATT_MTU value. |
otPlatBleGattServerIndicate#
otError otPlatBleGattServerIndicate (otInstance * aInstance, uint16_t aHandle, const otBleRadioPacket * aPacket)
Sends ATT Handle Value Indication.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
uint16_t | [in] | aHandle | The handle of the attribute to be indicated. |
const otBleRadioPacket * | [in] | aPacket | A pointer to the packet contains value to be indicated. |
Note
This function shall be used only for GATT Server.
otPlatBleGattServerOnWriteRequest#
void otPlatBleGattServerOnWriteRequest (otInstance * aInstance, uint16_t aHandle, const otBleRadioPacket * aPacket)
The BLE driver calls this method to notify OpenThread that an ATT Write Request packet has been received.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
uint16_t | [in] | aHandle | The handle of the attribute to be written. |
const otBleRadioPacket * | [in] | aPacket | A pointer to the packet contains value to be written to the attribute. |
Note
This function shall be used only for GATT Server.
otPlatBleGetLinkCapabilities#
void otPlatBleGetLinkCapabilities (otInstance * aInstance, otBleLinkCapabilities * aBleLinkCapabilities)
Function to retrieve from platform BLE link capabilities.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |
otBleLinkCapabilities * | [out] | aBleLinkCapabilities | The pointer to retrieve the BLE ling capabilities. |
otPlatBleSupportsMultiRadio#
bool otPlatBleSupportsMultiRadio (otInstance * aInstance)
Function to retrieve from platform multiradio support of BLE and IEEE.
Type | Direction | Argument Name | Description |
---|---|---|---|
otInstance * | [in] | aInstance | The OpenThread instance structure. |