BLE
This module includes the platform abstraction for BLE Host communication.
Summary
The platform needs to implement Bluetooth LE 4.2 or higher.
Typedefs |
|
---|---|
otBleLinkCapabilities
|
typedefstruct otBleLinkCapabilities
Represent BLE link capabilities. |
otBleRadioPacket
|
typedefstruct otBleRadioPacket
Represents a BLE packet. |
Functions |
|
---|---|
otPlatBleDisable(otInstance *aInstance)
|
Disable the Bluetooth Low Energy radio.
|
otPlatBleEnable(otInstance *aInstance)
|
Enable the Bluetooth Low Energy radio.
|
otPlatBleGapAdvSetData(otInstance *aInstance, uint8_t *aAdvertisementData, uint16_t aAdvertisementLen)
|
Sets BLE Advertising data.
|
otPlatBleGapAdvStart(otInstance *aInstance, uint16_t aInterval)
|
Starts BLE Advertising procedure.
|
otPlatBleGapAdvStop(otInstance *aInstance)
|
Stops BLE Advertising procedure.
|
otPlatBleGapDisconnect(otInstance *aInstance)
|
Disconnects BLE connection.
|
otPlatBleGapOnConnected(otInstance *aInstance, uint16_t aConnectionId)
|
void
The BLE driver calls this method to notify OpenThread that a BLE Central Device has been connected.
|
otPlatBleGapOnDisconnected(otInstance *aInstance, uint16_t aConnectionId)
|
void
The BLE driver calls this method to notify OpenThread that the BLE Central Device has been disconnected.
|
otPlatBleGattMtuGet(otInstance *aInstance, uint16_t *aMtu)
|
Reads currently use value of ATT_MTU.
|
otPlatBleGattOnMtuUpdate(otInstance *aInstance, uint16_t aMtu)
|
void
The BLE driver calls this method to notify OpenThread that ATT_MTU has been updated.
|
otPlatBleGattServerIndicate(otInstance *aInstance, uint16_t aHandle, const otBleRadioPacket *aPacket)
|
Sends ATT Handle Value Indication.
|
otPlatBleGattServerOnWriteRequest(otInstance *aInstance, uint16_t aHandle, const otBleRadioPacket *aPacket)
|
void
The BLE driver calls this method to notify OpenThread that an ATT Write Request packet has been received.
|
otPlatBleGetAdvertisementBuffer(otInstance *aInstance, uint8_t **aAdvertisementBuffer)
|
Gets BLE Advertising buffer.
|
otPlatBleGetLinkCapabilities(otInstance *aInstance, otBleLinkCapabilities *aBleLinkCapabilities)
|
void
Function to retrieve from platform BLE link capabilities.
|
otPlatBleSupportsMultiRadio(otInstance *aInstance)
|
bool
Function to retrieve from platform multiradio support of BLE and IEEE.
|
Macros |
|
---|---|
OT_BLE_ADV_INTERVAL_DEFAULT 100
|
Default interval for advertising packet (ms).
|
OT_BLE_ADV_INTERVAL_MAX 0x4000
|
Maximum allowed interval for advertising packet in OT_BLE_ADV_INTERVAL_UNIT units (10.24s).
|
OT_BLE_ADV_INTERVAL_MIN 0x0020
|
Minimum allowed interval for advertising packet in OT_BLE_ADV_INTERVAL_UNIT units (20ms).
|
OT_BLE_ADV_INTERVAL_UNIT OT_BLE_TIMESLOT_UNIT
|
Unit used to calculate interval duration (0.625ms).
|
OT_BLE_ATT_MTU_MAX 67
|
Maximum allowed ATT MTU size (must be >= 23).
|
OT_BLE_DEFAULT_POWER 0
|
Default power value for BLE.
|
OT_BLE_TIMESLOT_UNIT 625
|
Time slot duration on PHY layer in microseconds (0.625ms).
|
OT_TOBLE_SERVICE_UUID 0xfffb
|
TOBLE service UUID.
|
Structs |
|
---|---|
otBleLinkCapabilities |
Represent BLE link capabilities. |
otBleRadioPacket |
Represents a BLE packet. |
Typedefs
otBleLinkCapabilities
struct otBleLinkCapabilities otBleLinkCapabilities
Represent BLE link capabilities.
Functions
otPlatBleDisable
otError otPlatBleDisable( otInstance *aInstance )
Disable the Bluetooth Low Energy radio.
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.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otPlatBleEnable
otError otPlatBleEnable( otInstance *aInstance )
Enable the Bluetooth Low Energy radio.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otPlatBleGapAdvSetData
otError otPlatBleGapAdvSetData( otInstance *aInstance, uint8_t *aAdvertisementData, uint16_t aAdvertisementLen )
Sets BLE Advertising data.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otPlatBleGapAdvStart
otError otPlatBleGapAdvStart( otInstance *aInstance, uint16_t aInterval )
Starts BLE Advertising procedure.
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).
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otPlatBleGapAdvStop
otError otPlatBleGapAdvStop( otInstance *aInstance )
Stops BLE Advertising procedure.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otPlatBleGapDisconnect
otError otPlatBleGapDisconnect( otInstance *aInstance )
Disconnects BLE connection.
The BLE device shall use the Remote User Terminated Connection (0x13) reason code when disconnecting from the peer BLE device..
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
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.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
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.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otPlatBleGattMtuGet
otError otPlatBleGattMtuGet( otInstance *aInstance, uint16_t *aMtu )
Reads currently use value of ATT_MTU.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Return Values |
|
otPlatBleGattOnMtuUpdate
void otPlatBleGattOnMtuUpdate( otInstance *aInstance, uint16_t aMtu )
The BLE driver calls this method to notify OpenThread that ATT_MTU has been updated.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otPlatBleGattServerIndicate
otError otPlatBleGattServerIndicate( otInstance *aInstance, uint16_t aHandle, const otBleRadioPacket *aPacket )
Sends ATT Handle Value Indication.
Details | |||||||||
---|---|---|---|---|---|---|---|---|---|
Parameters |
|
||||||||
Return Values |
|
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.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
otPlatBleGetAdvertisementBuffer
otError otPlatBleGetAdvertisementBuffer( otInstance *aInstance, uint8_t **aAdvertisementBuffer )
Gets BLE Advertising buffer.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Return Values |
|
otPlatBleGetLinkCapabilities
void otPlatBleGetLinkCapabilities( otInstance *aInstance, otBleLinkCapabilities *aBleLinkCapabilities )
Function to retrieve from platform BLE link capabilities.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
otPlatBleSupportsMultiRadio
bool otPlatBleSupportsMultiRadio( otInstance *aInstance )
Function to retrieve from platform multiradio support of BLE and IEEE.
Details | |||
---|---|---|---|
Parameters |
|
Macros
OT_BLE_ADV_INTERVAL_DEFAULT
OT_BLE_ADV_INTERVAL_DEFAULT 100
Default interval for advertising packet (ms).
OT_BLE_ADV_INTERVAL_MAX
OT_BLE_ADV_INTERVAL_MAX 0x4000
Maximum allowed interval for advertising packet in OT_BLE_ADV_INTERVAL_UNIT units (10.24s).
OT_BLE_ADV_INTERVAL_MIN
OT_BLE_ADV_INTERVAL_MIN 0x0020
Minimum allowed interval for advertising packet in OT_BLE_ADV_INTERVAL_UNIT units (20ms).
OT_BLE_ADV_INTERVAL_UNIT
OT_BLE_ADV_INTERVAL_UNIT OT_BLE_TIMESLOT_UNIT
Unit used to calculate interval duration (0.625ms).
OT_BLE_ATT_MTU_MAX
OT_BLE_ATT_MTU_MAX 67
Maximum allowed ATT MTU size (must be >= 23).
OT_BLE_DEFAULT_POWER
OT_BLE_DEFAULT_POWER 0
Default power value for BLE.
OT_BLE_TIMESLOT_UNIT
OT_BLE_TIMESLOT_UNIT 625
Time slot duration on PHY layer in microseconds (0.625ms).
OT_TOBLE_SERVICE_UUID
OT_TOBLE_SERVICE_UUID 0xfffb
TOBLE service UUID.
Resources
OpenThread API Reference topics originate from the source code, available on GitHub. For more information, or to contribute to our documentation, refer to Resources.