![]() |
0.01.00
|
This module includes the platform abstraction for radio operations. More...
Functions | |
otRadioState | otPlatRadioGetState (otInstance *aInstance) |
Get current state of the radio. More... | |
otError | otPlatRadioEnable (otInstance *aInstance) |
Enable the radio. More... | |
otError | otPlatRadioDisable (otInstance *aInstance) |
Disable the radio. More... | |
bool | otPlatRadioIsEnabled (otInstance *aInstance) |
Check whether radio is enabled or not. More... | |
otError | otPlatRadioSleep (otInstance *aInstance) |
Transition the radio from Receive to Sleep. More... | |
otError | otPlatRadioReceive (otInstance *aInstance, uint8_t aChannel) |
Transitioning the radio from Sleep to Receive. More... | |
void | otPlatRadioEnableSrcMatch (otInstance *aInstance, bool aEnable) |
Enable/Disable source address match feature. More... | |
otError | otPlatRadioAddSrcMatchShortEntry (otInstance *aInstance, const uint16_t aShortAddress) |
Add a short address to the source address match table. More... | |
otError | otPlatRadioAddSrcMatchExtEntry (otInstance *aInstance, const otExtAddress *aExtAddress) |
Add an extended address to the source address match table. More... | |
otError | otPlatRadioClearSrcMatchShortEntry (otInstance *aInstance, const uint16_t aShortAddress) |
Remove a short address from the source address match table. More... | |
otError | otPlatRadioClearSrcMatchExtEntry (otInstance *aInstance, const otExtAddress *aExtAddress) |
Remove an extended address from the source address match table. More... | |
void | otPlatRadioClearSrcMatchShortEntries (otInstance *aInstance) |
Clear all short addresses from the source address match table. More... | |
void | otPlatRadioClearSrcMatchExtEntries (otInstance *aInstance) |
Clear all the extended/long addresses from source address match table. More... | |
void | otPlatRadioReceiveDone (otInstance *aInstance, otRadioFrame *aFrame, otError aError) |
The radio driver calls this method to notify OpenThread of a received frame. More... | |
otRadioFrame * | otPlatRadioGetTransmitBuffer (otInstance *aInstance) |
The radio transitions from Transmit to Receive. More... | |
otError | otPlatRadioTransmit (otInstance *aInstance, otRadioFrame *aFrame) |
This method begins the transmit sequence on the radio. More... | |
void | otPlatRadioTxStarted (otInstance *aInstance, otRadioFrame *aFrame) |
The radio driver calls this method to notify OpenThread that the transmission has started. More... | |
void | otPlatRadioTxDone (otInstance *aInstance, otRadioFrame *aFrame, otRadioFrame *aAckFrame, otError aError) |
The radio driver calls this function to notify OpenThread that the transmit operation has completed, providing both the transmitted frame and, if applicable, the received ack frame. More... | |
int8_t | otPlatRadioGetRssi (otInstance *aInstance) |
Get the most recent RSSI measurement. More... | |
otRadioCaps | otPlatRadioGetCaps (otInstance *aInstance) |
Get the radio capabilities. More... | |
void | otPlatRadioSetDefaultTxPower (otInstance *aInstance, int8_t aPower) |
Set the radio Tx power used for auto-generated frames. More... | |
bool | otPlatRadioGetPromiscuous (otInstance *aInstance) |
Get the status of promiscuous mode. More... | |
void | otPlatRadioSetPromiscuous (otInstance *aInstance, bool aEnable) |
Enable or disable promiscuous mode. More... | |
void | otPlatDiagRadioTransmitDone (otInstance *aInstance, otRadioFrame *aFrame, otError aError) |
The radio driver calls this method to notify OpenThread diagnostics module that the transmission has completed. More... | |
void | otPlatDiagRadioReceiveDone (otInstance *aInstance, otRadioFrame *aFrame, otError aError) |
The radio driver calls this method to notify OpenThread diagnostics module of a received frame. More... | |
otError | otPlatRadioEnergyScan (otInstance *aInstance, uint8_t aScanChannel, uint16_t aScanDuration) |
This method begins the energy scan sequence on the radio. More... | |
void | otPlatRadioEnergyScanDone (otInstance *aInstance, int8_t aEnergyScanMaxRssi) |
The radio driver calls this method to notify OpenThread that the energy scan is complete. More... | |
int8_t | otPlatRadioGetReceiveSensitivity (otInstance *aInstance) |
Get the radio receive sensitivity value. More... | |
This module includes the platform abstraction for radio operations.
void otPlatDiagRadioReceiveDone | ( | otInstance * | aInstance, |
otRadioFrame * | aFrame, | ||
otError | aError | ||
) |
The radio driver calls this method to notify OpenThread diagnostics module of a received frame.
[in] | aInstance | The OpenThread instance structure. |
[in] | aFrame | A pointer to the received frame or NULL if the receive operation failed. |
[in] | aError | OT_ERROR_NONE when successfully received a frame, OT_ERROR_ABORT when reception was aborted and a frame was not received, OT_ERROR_NO_BUFS when a frame could not be received due to lack of rx buffer space. |
void otPlatDiagRadioTransmitDone | ( | otInstance * | aInstance, |
otRadioFrame * | aFrame, | ||
otError | aError | ||
) |
The radio driver calls this method to notify OpenThread diagnostics module that the transmission has completed.
[in] | aInstance | The OpenThread instance structure. |
[in] | aFrame | A pointer to the frame that was transmitted. |
[in] | aError | OT_ERROR_NONE when the frame was transmitted, OT_ERROR_CHANNEL_ACCESS_FAILURE when the transmission could not take place due to activity on the channel, OT_ERROR_ABORT when transmission was aborted for other reasons. |
otError otPlatRadioAddSrcMatchExtEntry | ( | otInstance * | aInstance, |
const otExtAddress * | aExtAddress | ||
) |
Add an extended address to the source address match table.
[in] | aInstance | The OpenThread instance structure. |
[in] | aExtAddress | The extended address to be added stored in little-endian byte order. |
OT_ERROR_NONE | Successfully added extended address to the source match table. |
OT_ERROR_NO_BUFS | No available entry in the source match table. |
otError otPlatRadioAddSrcMatchShortEntry | ( | otInstance * | aInstance, |
const uint16_t | aShortAddress | ||
) |
Add a short address to the source address match table.
[in] | aInstance | The OpenThread instance structure. |
[in] | aShortAddress | The short address to be added. |
OT_ERROR_NONE | Successfully added short address to the source match table. |
OT_ERROR_NO_BUFS | No available entry in the source match table. |
void otPlatRadioClearSrcMatchExtEntries | ( | otInstance * | aInstance | ) |
Clear all the extended/long addresses from source address match table.
[in] | aInstance | The OpenThread instance structure. |
otError otPlatRadioClearSrcMatchExtEntry | ( | otInstance * | aInstance, |
const otExtAddress * | aExtAddress | ||
) |
Remove an extended address from the source address match table.
[in] | aInstance | The OpenThread instance structure. |
[in] | aExtAddress | The extended address to be removed stored in little-endian byte order. |
OT_ERROR_NONE | Successfully removed the extended address from the source match table. |
OT_ERROR_NO_ADDRESS | The extended address is not in source address match table. |
void otPlatRadioClearSrcMatchShortEntries | ( | otInstance * | aInstance | ) |
Clear all short addresses from the source address match table.
[in] | aInstance | The OpenThread instance structure. |
otError otPlatRadioClearSrcMatchShortEntry | ( | otInstance * | aInstance, |
const uint16_t | aShortAddress | ||
) |
Remove a short address from the source address match table.
[in] | aInstance | The OpenThread instance structure. |
[in] | aShortAddress | The short address to be removed. |
OT_ERROR_NONE | Successfully removed short address from the source match table. |
OT_ERROR_NO_ADDRESS | The short address is not in source address match table. |
otError otPlatRadioDisable | ( | otInstance * | aInstance | ) |
Disable the radio.
[in] | aInstance | The OpenThread instance structure. |
OT_ERROR_NONE | Successfully transitioned to Disabled. |
otError otPlatRadioEnable | ( | otInstance * | aInstance | ) |
Enable the radio.
[in] | aInstance | The OpenThread instance structure. |
OT_ERROR_NONE | Successfully enabled. |
OT_ERROR_FAILED | The radio could not be enabled. |
void otPlatRadioEnableSrcMatch | ( | otInstance * | aInstance, |
bool | aEnable | ||
) |
Enable/Disable source address match feature.
The source address match feature controls how the radio layer decides the "frame pending" bit for acks sent in response to data request commands from children.
If disabled, the radio layer must set the "frame pending" on all acks to data request commands.
If enabled, the radio layer uses the source address match table to determine whether to set or clear the "frame pending" bit in an ack to a data request command.
The source address match table provides the list of children for which there is a pending frame. Either a short address or an extended/long address can be added to the source address match table.
[in] | aInstance | The OpenThread instance structure. |
[in] | aEnable | Enable/disable source address match feature. |
otError otPlatRadioEnergyScan | ( | otInstance * | aInstance, |
uint8_t | aScanChannel, | ||
uint16_t | aScanDuration | ||
) |
This method begins the energy scan sequence on the radio.
[in] | aInstance | The OpenThread instance structure. |
[in] | aScanChannel | The channel to perform the energy scan on. |
[in] | aScanDuration | The duration, in milliseconds, for the channel to be scanned. |
OT_ERROR_NONE | Successfully started scanning the channel. |
OT_ERROR_NOT_IMPLEMENTED | The radio doesn't support energy scanning. |
void otPlatRadioEnergyScanDone | ( | otInstance * | aInstance, |
int8_t | aEnergyScanMaxRssi | ||
) |
The radio driver calls this method to notify OpenThread that the energy scan is complete.
[in] | aInstance | The OpenThread instance structure. |
[in] | aEnergyScanMaxRssi | The maximum RSSI encountered on the scanned channel. |
otRadioCaps otPlatRadioGetCaps | ( | otInstance * | aInstance | ) |
Get the radio capabilities.
[in] | aInstance | The OpenThread instance structure. |
bool otPlatRadioGetPromiscuous | ( | otInstance * | aInstance | ) |
Get the status of promiscuous mode.
[in] | aInstance | The OpenThread instance structure. |
true | Promiscuous mode is enabled. |
false | Promiscuous mode is disabled. |
int8_t otPlatRadioGetReceiveSensitivity | ( | otInstance * | aInstance | ) |
Get the radio receive sensitivity value.
[in] | aInstance | The OpenThread instance structure. |
int8_t otPlatRadioGetRssi | ( | otInstance * | aInstance | ) |
Get the most recent RSSI measurement.
[in] | aInstance | The OpenThread instance structure. |
otRadioState otPlatRadioGetState | ( | otInstance * | aInstance | ) |
Get current state of the radio.
This function is not required by OpenThread. It may be used for debugging and/or application-specific purposes.
[in] | aInstance | The OpenThread instance structure. |
otRadioFrame* otPlatRadioGetTransmitBuffer | ( | otInstance * | aInstance | ) |
The radio transitions from Transmit to Receive.
This method returns a pointer to the transmit buffer.
The caller forms the IEEE 802.15.4 frame in this buffer then calls otPlatRadioTransmit() to request transmission.
[in] | aInstance | The OpenThread instance structure. |
bool otPlatRadioIsEnabled | ( | otInstance * | aInstance | ) |
Check whether radio is enabled or not.
[in] | aInstance | The OpenThread instance structure. |
otError otPlatRadioReceive | ( | otInstance * | aInstance, |
uint8_t | aChannel | ||
) |
Transitioning the radio from Sleep to Receive.
Turn on the radio.
[in] | aInstance | The OpenThread instance structure. |
[in] | aChannel | The channel to use for receiving. |
OT_ERROR_NONE | Successfully transitioned to Receive. |
OT_ERROR_INVALID_STATE | The radio was disabled or transmitting. |
void otPlatRadioReceiveDone | ( | otInstance * | aInstance, |
otRadioFrame * | aFrame, | ||
otError | aError | ||
) |
The radio driver calls this method to notify OpenThread of a received frame.
[in] | aInstance | The OpenThread instance structure. |
[in] | aFrame | A pointer to the received frame or NULL if the receive operation failed. |
[in] | aError | OT_ERROR_NONE when successfully received a frame, OT_ERROR_ABORT when reception was aborted and a frame was not received, OT_ERROR_NO_BUFS when a frame could not be received due to lack of rx buffer space. |
void otPlatRadioSetDefaultTxPower | ( | otInstance * | aInstance, |
int8_t | aPower | ||
) |
Set the radio Tx power used for auto-generated frames.
[in] | aInstance | The OpenThread instance structure. |
[in] | aPower | The Tx power to use in dBm. |
void otPlatRadioSetPromiscuous | ( | otInstance * | aInstance, |
bool | aEnable | ||
) |
Enable or disable promiscuous mode.
[in] | aInstance | The OpenThread instance structure. |
[in] | aEnable | A value to enable or disable promiscuous mode. |
otError otPlatRadioSleep | ( | otInstance * | aInstance | ) |
Transition the radio from Receive to Sleep.
Turn off the radio.
[in] | aInstance | The OpenThread instance structure. |
OT_ERROR_NONE | Successfully transitioned to Sleep. |
OT_ERROR_BUSY | The radio was transmitting |
OT_ERROR_INVALID_STATE | The radio was disabled |
otError otPlatRadioTransmit | ( | otInstance * | aInstance, |
otRadioFrame * | aFrame | ||
) |
This method begins the transmit sequence on the radio.
The caller must form the IEEE 802.15.4 frame in the buffer provided by otPlatRadioGetTransmitBuffer() before requesting transmission. The channel and transmit power are also included in the otRadioFrame structure.
The transmit sequence consists of:
[in] | aInstance | The OpenThread instance structure. |
[in] | aFrame | A pointer to the transmitted frame. |
OT_ERROR_NONE | Successfully transitioned to Transmit. |
OT_ERROR_INVALID_STATE | The radio was not in the Receive state. |
void otPlatRadioTxDone | ( | otInstance * | aInstance, |
otRadioFrame * | aFrame, | ||
otRadioFrame * | aAckFrame, | ||
otError | aError | ||
) |
The radio driver calls this function to notify OpenThread that the transmit operation has completed, providing both the transmitted frame and, if applicable, the received ack frame.
[in] | aInstance | The OpenThread instance structure. |
[in] | aFrame | A pointer to the frame that was transmitted. |
[in] | aAckFrame | A pointer to the ACK frame, NULL if no ACK was received. |
[in] | aError | OT_ERROR_NONE when the frame was transmitted, OT_ERROR_NO_ACK when the frame was transmitted but no ACK was received, OT_ERROR_CHANNEL_ACCESS_FAILURE when the transmission could not take place due to activity on the channel, OT_ERROR_ABORT when transmission was aborted for other reasons. |
void otPlatRadioTxStarted | ( | otInstance * | aInstance, |
otRadioFrame * | aFrame | ||
) |
The radio driver calls this method to notify OpenThread that the transmission has started.
[in] | aInstance | A pointer to the OpenThread instance structure. |
[in] | aFrame | A pointer to the frame that is being transmitted. |