![]() |
![]() |
|
OpenThread
1.05.03.02
|
This module includes the platform abstraction for radio operations. More...
Collaboration diagram for Radio Operation:This module includes the platform abstraction for radio operations.
| 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. |
References RadioSpinel< InterfaceType, ProcessContextType >::GetState(), OT_RADIO_STATE_INVALID, and OT_UNUSED_VARIABLE.
Referenced by Radio::GetPreferredChannelMask().
| 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. |
References RadioSpinel< InterfaceType, ProcessContextType >::Enable().
Referenced by Radio::GetPreferredChannelMask().
| otError otPlatRadioDisable | ( | otInstance * | aInstance | ) |
Disable the radio.
| [in] | aInstance | The OpenThread instance structure. |
| OT_ERROR_NONE | Successfully transitioned to Disabled. |
| OT_ERROR_INVALID_STATE | The radio was not in sleep state. |
References RadioSpinel< InterfaceType, ProcessContextType >::Disable(), and OT_UNUSED_VARIABLE.
Referenced by Radio::GetPreferredChannelMask().
| bool otPlatRadioIsEnabled | ( | otInstance * | aInstance | ) |
Check whether radio is enabled or not.
| [in] | aInstance | The OpenThread instance structure. |
References RadioSpinel< InterfaceType, ProcessContextType >::IsEnabled(), and OT_UNUSED_VARIABLE.
Referenced by Radio::GetPreferredChannelMask().
| 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. |
References OT_UNUSED_VARIABLE, and RadioSpinel< InterfaceType, ProcessContextType >::Sleep().
Referenced by Radio::GetPreferredChannelMask().
| otError otPlatRadioReceive | ( | otInstance * | aInstance, |
| uint8_t | aChannel | ||
| ) |
Transition 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. |
References OT_UNUSED_VARIABLE, RadioSpinel< InterfaceType, ProcessContextType >::Receive(), and SuccessOrExit.
Referenced by Radio::GetPreferredChannelMask().
| otError otPlatRadioReceiveAt | ( | otInstance * | aInstance, |
| uint8_t | aChannel, | ||
| uint32_t | aStart, | ||
| uint32_t | aDuration | ||
| ) |
Schedule a radio reception window at a specific time and duration.
| [in] | aChannel | The radio channel on which to receive. |
| [in] | aStart | The receive window start time, in microseconds. |
| [in] | aDuration | The receive window duration, in microseconds |
| OT_ERROR_NONE | Successfully scheduled receive window. |
| OT_ERROR_FAILED | The receive window could not be scheduled. |
References ot::kErrorNotImplemented, OT_ERROR_NOT_IMPLEMENTED, and OT_UNUSED_VARIABLE.
Referenced by Radio::GetPreferredChannelMask().
| 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. |
Referenced by RadioSpinel< InterfaceType, ProcessContextType >::RadioReceive().
| void otPlatDiagRadioReceiveDone | ( | otInstance * | aInstance, |
| otRadioFrame * | aFrame, | ||
| otError | aError | ||
| ) |
The radio driver calls this method to notify OpenThread diagnostics module of a received frame.
This function is used when diagnostics is enabled.
| [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. |
Referenced by otPlatRadioEnergyScanDone(), and RadioSpinel< InterfaceType, ProcessContextType >::RadioReceive().
| otRadioFrame* otPlatRadioGetTransmitBuffer | ( | otInstance * | aInstance | ) |
Get the radio transmit frame buffer.
OpenThread forms the IEEE 802.15.4 frame in this buffer then calls otPlatRadioTransmit() to request transmission.
| [in] | aInstance | The OpenThread instance structure. |
References RadioSpinel< InterfaceType, ProcessContextType >::GetTransmitFrame(), and OT_UNUSED_VARIABLE.
Referenced by Radio::GetPreferredChannelMask(), and Radio::GetTransmitBuffer().
| otError otPlatRadioTransmit | ( | otInstance * | aInstance, |
| otRadioFrame * | aFrame | ||
| ) |
Begin 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 frame to be transmitted. |
| OT_ERROR_NONE | Successfully transitioned to Transmit. |
| OT_ERROR_INVALID_STATE | The radio was not in the Receive state. |
References OT_UNUSED_VARIABLE, and RadioSpinel< InterfaceType, ProcessContextType >::Transmit().
| 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. |
Referenced by RadioSpinel< InterfaceType, ProcessContextType >::Transmit().
| 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.
When radio provides OT_RADIO_CAPS_TRANSMIT_SEC capability, radio platform layer updates aFrame with the security frame counter and key index values maintained by the radio.
| [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 tx could not take place due to activity on the channel, OT_ERROR_ABORT when transmission was aborted for other reasons. |
Referenced by RadioSpinel< InterfaceType, ProcessContextType >::TransmitDone().
| void otPlatDiagRadioTransmitDone | ( | otInstance * | aInstance, |
| otRadioFrame * | aFrame, | ||
| otError | aError | ||
| ) |
The radio driver calls this method to notify OpenThread diagnostics module that the transmission has completed.
This function is used when diagnostics is enabled.
| [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 tx could not take place due to activity on the channel, OT_ERROR_ABORT when transmission was aborted for other reasons. |
Referenced by otPlatRadioEnergyScanDone(), and RadioSpinel< InterfaceType, ProcessContextType >::TransmitDone().
| int8_t otPlatRadioGetRssi | ( | otInstance * | aInstance | ) |
Get the most recent RSSI measurement.
| [in] | aInstance | The OpenThread instance structure. |
References RadioSpinel< InterfaceType, ProcessContextType >::GetRssi(), and OT_UNUSED_VARIABLE.
Referenced by Radio::GetPreferredChannelMask(), and NcpBase::HandlePropertyGet().
| otError otPlatRadioEnergyScan | ( | otInstance * | aInstance, |
| uint8_t | aScanChannel, | ||
| uint16_t | aScanDuration | ||
| ) |
Begin the energy scan sequence on the radio.
This function is used when radio provides OT_RADIO_CAPS_ENERGY_SCAN capability.
| [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_BUSY | The radio is performing enery scanning. |
| OT_ERROR_NOT_IMPLEMENTED | The radio doesn't support energy scanning. |
References RadioSpinel< InterfaceType, ProcessContextType >::EnergyScan(), and OT_UNUSED_VARIABLE.
Referenced by Radio::GetPreferredChannelMask().
| void otPlatRadioEnergyScanDone | ( | otInstance * | aInstance, |
| int8_t | aEnergyScanMaxRssi | ||
| ) |
The radio driver calls this method to notify OpenThread that the energy scan is complete.
This function is used when radio provides OT_RADIO_CAPS_ENERGY_SCAN capability.
| [in] | aInstance | The OpenThread instance structure. |
| [in] | aEnergyScanMaxRssi | The maximum RSSI encountered on the scanned channel. |
References otPlatDiagRadioReceiveDone(), and otPlatDiagRadioTransmitDone().
Referenced by RadioSpinel< InterfaceType, ProcessContextType >::HandleValueIs().
| 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. |
References RadioSpinel< InterfaceType, ProcessContextType >::EnableSrcMatch(), OT_UNUSED_VARIABLE, and SuccessOrDie.
Referenced by Radio::GetPreferredChannelMask().
| otError otPlatRadioAddSrcMatchShortEntry | ( | otInstance * | aInstance, |
| otShortAddress | 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. |
References RadioSpinel< InterfaceType, ProcessContextType >::AddSrcMatchShortEntry(), and OT_UNUSED_VARIABLE.
Referenced by Radio::GetPreferredChannelMask().
| 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. |
References RadioSpinel< InterfaceType, ProcessContextType >::AddSrcMatchExtEntry(), otExtAddress::m8, and OT_UNUSED_VARIABLE.
Referenced by Radio::GetPreferredChannelMask().
| otError otPlatRadioClearSrcMatchShortEntry | ( | otInstance * | aInstance, |
| otShortAddress | 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. |
References RadioSpinel< InterfaceType, ProcessContextType >::ClearSrcMatchShortEntry(), and OT_UNUSED_VARIABLE.
Referenced by Radio::GetPreferredChannelMask().
| 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. |
References RadioSpinel< InterfaceType, ProcessContextType >::ClearSrcMatchExtEntry(), otExtAddress::m8, and OT_UNUSED_VARIABLE.
Referenced by Radio::GetPreferredChannelMask().
| void otPlatRadioClearSrcMatchShortEntries | ( | otInstance * | aInstance | ) |
Clear all short addresses from the source address match table.
| [in] | aInstance | The OpenThread instance structure. |
References RadioSpinel< InterfaceType, ProcessContextType >::ClearSrcMatchShortEntries(), OT_UNUSED_VARIABLE, and SuccessOrDie.
Referenced by Radio::GetPreferredChannelMask().
| void otPlatRadioClearSrcMatchExtEntries | ( | otInstance * | aInstance | ) |
Clear all the extended/long addresses from source address match table.
| [in] | aInstance | The OpenThread instance structure. |
References RadioSpinel< InterfaceType, ProcessContextType >::ClearSrcMatchExtEntries(), OT_UNUSED_VARIABLE, and SuccessOrDie.
Referenced by Radio::GetPreferredChannelMask().
| uint32_t otPlatRadioGetSupportedChannelMask | ( | otInstance * | aInstance | ) |
Get the radio supported channel mask that the device is allowed to be on.
| [in] | aInstance | The OpenThread instance structure. |
References RadioSpinel< InterfaceType, ProcessContextType >::GetRadioChannelMask(), and OT_UNUSED_VARIABLE.
Referenced by Radio::GetSupportedChannelMask(), NcpBase::HandlePropertyGet(), otPlatRadioGetPreferredChannelMask(), and Interpreter::SetUserCommands().
| uint32_t otPlatRadioGetPreferredChannelMask | ( | otInstance * | aInstance | ) |
Gets the radio preferred channel mask that the device prefers to form on.
| [in] | aInstance | The OpenThread instance structure. |
References RadioSpinel< InterfaceType, ProcessContextType >::GetRadioChannelMask(), OT_UNUSED_VARIABLE, and otPlatRadioGetSupportedChannelMask().
Referenced by Radio::GetPreferredChannelMask(), NcpBase::HandlePropertyGet(), and Interpreter::SetUserCommands().
| otError otPlatRadioSetCoexEnabled | ( | otInstance * | aInstance, |
| bool | aEnabled | ||
| ) |
Enable the radio coex.
This function is used when feature OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE is enabled.
| [in] | aInstance | The OpenThread instance structure. |
| [in] | aEnabled | TRUE to enable the radio coex, FALSE otherwise. |
| OT_ERROR_NONE | Successfully enabled. |
| OT_ERROR_FAILED | The radio coex could not be enabled. |
Referenced by NcpBase::HandlePropertyGet(), otPlatRadioGetReceiveSensitivity(), and Interpreter::SetUserCommands().
| bool otPlatRadioIsCoexEnabled | ( | otInstance * | aInstance | ) |
Check whether radio coex is enabled or not.
This function is used when feature OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE is enabled.
| [in] | aInstance | The OpenThread instance structure. |
Referenced by NcpBase::HandlePropertyGet(), otPlatRadioGetReceiveSensitivity(), and Interpreter::SetUserCommands().
| otError otPlatRadioGetCoexMetrics | ( | otInstance * | aInstance, |
| otRadioCoexMetrics * | aCoexMetrics | ||
| ) |
Get the radio coexistence metrics.
This function is used when feature OPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE is enabled.
| [in] | aInstance | The OpenThread instance structure. |
| [out] | aCoexMetrics | A pointer to the coexistence metrics structure. |
| OT_ERROR_NONE | Successfully retrieved the coex metrics. |
| OT_ERROR_INVALID_ARGS | aCoexMetrics was NULL. |
Referenced by NcpBase::HandlePropertyGet(), otPlatRadioGetReceiveSensitivity(), and Interpreter::SetUserCommands().
| otError otPlatRadioEnableCsl | ( | otInstance * | aInstance, |
| uint32_t | aCslPeriod, | ||
| otShortAddress | aShortAddr, | ||
| const otExtAddress * | aExtAddr | ||
| ) |
Enable or disable CSL receiver.
| [in] | aInstance | The OpenThread instance structure. |
| [in] | aCslPeriod | CSL period, 0 for disabling CSL. |
| [in] | aShortAddr | The short source address of CSL receiver's peer. |
| [in] | aExtAddr | The extended source address of CSL receiver's peer. |
| kErrorNotImplemented | Radio driver doesn't support CSL. |
| kErrorFailed | Other platform specific errors. |
| kErrorNone | Successfully enabled or disabled CSL. |
Referenced by Radio::GetPreferredChannelMask().
| void otPlatRadioUpdateCslSampleTime | ( | otInstance * | aInstance, |
| uint32_t | aCslSampleTime | ||
| ) |
Update CSL sample time in radio driver.
Sample time is stored in radio driver as a copy to calculate phase when sending ACK with CSL IE.
| [in] | aInstance | The OpenThread instance structure. |
| [in] | aCslSampleTime | The latest sample time. |
Referenced by Radio::GetPreferredChannelMask().
| uint8_t otPlatRadioGetCslAccuracy | ( | otInstance * | aInstance | ) |
Get the current accuracy, in units of ± ppm, of the clock used for scheduling CSL operations.
| [in] | aInstance | A pointer to an OpenThread instance. |
References OT_UNUSED_VARIABLE.
Referenced by Radio::GetPreferredChannelMask(), NcpBase::HandlePropertySet(), and otPlatRadioGetBusSpeed().
| uint8_t otPlatRadioGetCslUncertainty | ( | otInstance * | aInstance | ) |
The fixed uncertainty of the Device for scheduling CSL Transmissions in units of 10 microseconds.
| [in] | aInstance | A pointer to an OpenThread instance. |
References OT_UNUSED_VARIABLE.
Referenced by Radio::GetPreferredChannelMask(), NcpBase::HandlePropertySet(), and otPlatRadioGetBusSpeed().
| otError otPlatRadioSetChannelMaxTransmitPower | ( | otInstance * | aInstance, |
| uint8_t | aChannel, | ||
| int8_t | aMaxPower | ||
| ) |
Set the max transmit power for a specific channel.
| [in] | aInstance | The OpenThread instance structure. |
| [in] | aChannel | The radio channel. |
| [in] | aMaxPower | The max power in dBm, passing OT_RADIO_RSSI_INVALID will disable this channel. |
| OT_ERROR_NOT_IMPLEMENTED | The feature is not implemented |
| OT_ERROR_INVALID_ARGS | The specified channel is not valid. |
| OT_ERROR_FAILED | Other platform specific errors. |
| OT_ERROR_NONE | Successfully set max transmit power. |
References ot::kErrorNotImplemented, OT_UNUSED_VARIABLE, and RadioSpinel< InterfaceType, ProcessContextType >::SetChannelMaxTransmitPower().
Referenced by NcpBase::HandlePropertySet().
| otError otPlatRadioSetRegion | ( | otInstance * | aInstance, |
| uint16_t | aRegionCode | ||
| ) |
Set the region code.
The radio region format is the 2-bytes ascii representation of the ISO 3166 alpha-2 code.
| [in] | aInstance | The OpenThread instance structure. |
| [in] | aRegionCode | The radio region. |
| OT_ERROR_FAILED | Other platform specific errors. |
| OT_ERROR_NONE | Successfully set region code. |
References ot::kErrorNotImplemented, OT_UNUSED_VARIABLE, and RadioSpinel< InterfaceType, ProcessContextType >::SetRadioRegion().
Referenced by NcpBase::HandlePropertySet(), and Interpreter::SetUserCommands().
| otError otPlatRadioGetRegion | ( | otInstance * | aInstance, |
| uint16_t * | aRegionCode | ||
| ) |
Get the region code.
The radio region format is the 2-bytes ascii representation of the ISO 3166 alpha-2 code.
| [in] | aInstance | The OpenThread instance structure. |
| [out] | aRegionCode | The radio region. |
| OT_ERROR_INVALID_ARGS | aRegionCode is nullptr. |
| OT_ERROR_FAILED | Other platform specific errors. |
| OT_ERROR_NONE | Successfully got region code. |
References RadioSpinel< InterfaceType, ProcessContextType >::GetRadioRegion(), ot::kErrorNotImplemented, OT_UNUSED_VARIABLE, and otPlatRadioConfigureEnhAckProbing().
Referenced by NcpBase::HandlePropertyGet(), and Interpreter::SetUserCommands().
| otError otPlatRadioConfigureEnhAckProbing | ( | otInstance * | aInstance, |
| otLinkMetrics | aLinkMetrics, | ||
| otShortAddress | aShortAddress, | ||
| const otExtAddress * | aExtAddress | ||
| ) |
Enable/disable or update Enhanced-ACK Based Probing in radio for a specific Initiator.
After Enhanced-ACK Based Probing is configured by a specific Probing Initiator, the Enhanced-ACK sent to that node should include Vendor-Specific IE containing Link Metrics data. This method informs the radio to start/stop to collect Link Metrics data and include Vendor-Specific IE that containing the data in Enhanced-ACK sent to that Probing Initiator.
| [in] | aInstance | The OpenThread instance structure. |
| [in] | aLinkMetrics | This parameter specifies what metrics to query. Per spec 4.11.3.4.4.6, at most 2 metrics can be specified. The probing would be disabled if is bitwise 0. |
| [in] | aShortAddress | The short address of the Probing Initiator. |
| [in] | aExtAddress | The extended source address of the Probing Initiator. aExtAddr MUST NOT be NULL. |
| OT_ERROR_NONE | Successfully configured the Enhanced-ACK Based Probing. |
| OT_ERROR_INVALID_ARGS | aExtAddress is NULL. |
| OT_ERROR_NOT_FOUND | The Initiator indicated by aShortAddress is not found when trying to clear. |
| OT_ERROR_NO_BUFS | No more Initiator can be supported. |
Referenced by otPlatRadioGetRegion(), and Radio::SetMacFrameCounter().