class RadioSpinel

Defined at line 138 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

The class for providing a OpenThread radio interface by talking with a radio-only

co-processor(RCP).

Public Methods

uint8_t GetChannel ()

Gets the current receiving channel.

Defined at line 369 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

void Init (bool aSkipRcpVersionCheck, bool aSoftwareReset, SpinelDriver * aSpinelDriver, otRadioCaps aRequiredRadioCaps, bool aEnableRcpTimeSync)

Initialize this radio transceiver.

Parameters

aSkipRcpVersionCheck [in] TRUE to skip RCP version check, FALSE to perform the check.
aSoftwareReset [in] When doing RCP recovery, TRUE to try software reset first, FALSE to directly do a hardware reset.
aSpinelDriver [in] A pointer to the spinel driver instance that this object depends on.
aRequiredRadioCaps [in] The required radio capabilities. RadioSpinel will check if RCP has the required capabilities during initialization.
aEnableRcpTimeSync [in] TRUE to enable RCP time sync, FALSE to not enable.
void Deinit ()

Deinitialize this radio transceiver.

otError GetIeeeEui64 (uint8_t * aIeeeEui64)

Gets the factory-assigned IEEE EUI-64 for this transceiver.

Parameters

aInstance [in] The OpenThread instance structure.
aIeeeEui64 [out] A pointer to the factory-assigned IEEE EUI-64.
otRadioCaps GetRadioCaps ()

Returns the radio capabilities.

Defined at line 337 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

int8_t GetReceiveSensitivity ()

Returns the radio receive sensitivity value.

Defined at line 355 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

otError GetTransmitPower (int8_t & aPower)

Gets the radio's transmit power in dBm.

Parameters

aPower [out] The transmit power in dBm.
otError GetCcaEnergyDetectThreshold (int8_t & aThreshold)

Gets the radio's CCA ED threshold in dBm.

Parameters

aThreshold [out] The CCA ED threshold in dBm.
otError GetFemLnaGain (int8_t & aGain)

Gets the FEM's Rx LNA gain in dBm.

Parameters

aGain [out] The FEM's Rx LNA gain in dBm.
int8_t GetRssi ()

Gets the most recent RSSI measurement.

otRadioState GetState ()

Gets current state of the radio.

Returns

Current state of the radio.

otRadioFrame & GetTransmitFrame ()

Returns a reference to the transmit buffer.

The caller forms the IEEE 802.15.4 frame in this buffer then calls otPlatRadioTransmit() to request transmission.

Defined at line 446 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

bool IsCoexEnabled ()

Check whether radio coex is enabled or not.

Parameters

aInstance [in] The OpenThread instance structure.
otError GetCoexMetrics (otRadioCoexMetrics & aCoexMetrics)

Retrieves the radio coexistence metrics.

Parameters

aCoexMetrics [out] A reference to the coexistence metrics structure.
otError GetMultipanActiveInterface (spinel_iid_t * aIid)

Get currently active interface.

Parameters

aIid [out] IID of the interface that owns the radio.
otError EnableSrcMatch (bool aEnable)

Enables or disables source address match feature.

Parameters

aEnable [in] Enable/disable source address match feature.
otError AddSrcMatchShortEntry (uint16_t aShortAddress)

Adds a short address to the source address match table.

Parameters

aInstance [in] The OpenThread instance structure.
aShortAddress [in] The short address to be added.
otError ClearSrcMatchShortEntry (uint16_t aShortAddress)

Removes a short address from the source address match table.

Parameters

aInstance [in] The OpenThread instance structure.
aShortAddress [in] The short address to be removed.
otError ClearSrcMatchShortEntries ()

Clear all short addresses from the source address match table.

Parameters

aInstance [in] The OpenThread instance structure.
otError AddSrcMatchExtEntry (const otExtAddress & aExtAddress)

Add an extended address to the source address match table.

Parameters

aInstance [in] The OpenThread instance structure.
aExtAddress [in] The extended address to be added stored in little-endian byte order.
otError ClearSrcMatchExtEntry (const otExtAddress & aExtAddress)

Remove an extended address from the source address match table.

Parameters

aInstance [in] The OpenThread instance structure.
aExtAddress [in] The extended address to be removed stored in little-endian byte order.
otError ClearSrcMatchExtEntries ()

Clear all the extended/long addresses from source address match table.

Parameters

aInstance [in] The OpenThread instance structure.
otError EnergyScan (uint8_t aScanChannel, uint16_t aScanDuration)

Begins the energy scan sequence on the radio.

Parameters

aScanChannel [in] The channel to perform the energy scan on.
aScanDuration [in] The duration, in milliseconds, for the channel to be scanned.
bool IsPromiscuous ()

Gets the status of promiscuous mode.

Defined at line 186 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

bool IsEnabled ()

Checks whether radio is enabled or not.

Defined at line 616 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

bool IsTransmitting ()

Indicates whether there is a pending transmission.

Defined at line 624 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

bool IsTransmitDone ()

Indicates whether a transmit has just finished.

Defined at line 632 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

uint64_t GetTxRadioEndUs ()

Returns the timeout timepoint for the pending transmission.

Defined at line 639 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

bool IsDiagEnabled ()

Indicates whether or not factory diagnostics mode is enabled.

Defined at line 661 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

bool HasPendingFrame ()

Checks whether there is pending frame in the buffer.

Defined at line 814 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

uint64_t GetNextRadioTimeRecalcStart ()

Returns the next timepoint to recalculate RCP time offset.

Defined at line 821 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

const char * GetVersion ()

Returns the co-processor sw version string.

Defined at line 856 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

const otRadioSpinelMetrics & GetRadioSpinelMetrics ()

Returns the radio Spinel metrics.

Defined at line 956 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

void RadioSpinel ()

Initializes the spinel based OpenThread transceiver.

void SetCallbacks (const struct RadioSpinelCallbacks & aCallbacks)

This method sets the notification callbacks.

Parameters

aCallbacks [in] A pointer to structure with notification callbacks.
otError SetPromiscuous (bool aEnable)

Sets the status of promiscuous mode.

Parameters

aEnable [in] Whether to enable or disable promiscuous mode.
otError SetRxOnWhenIdle (bool aEnable)

Sets the status of RxOnWhenIdle mode.

Parameters

aEnable [in] Whether to enable or disable RxOnWhenIdle mode.
otError SetShortAddress (uint16_t aAddress)

Sets the Short Address for address filtering.

Parameters

aShortAddress [in] The IEEE 802.15.4 Short Address.
otError SetAlternateShortAddress (uint16_t aAddress)

Sets the alternate short address.

Parameters

aShortAddress [in] The alternate short address.
otError SetExtendedAddress (const otExtAddress & aExtAddress)

Sets the Extended Address for address filtering.

Parameters

aExtAddress [in] A pointer to the IEEE 802.15.4 Extended Address stored in little-endian byte order.
otError SetPanId (uint16_t aPanId)

Sets the PAN ID for address filtering.

Parameters

aPanId [in] The IEEE 802.15.4 PAN ID.
otError SetTransmitPower (int8_t aPower)

Sets the radio's transmit power in dBm.

Parameters

aPower [in] The transmit power in dBm.
otError SetCcaEnergyDetectThreshold (int8_t aThreshold)

Sets the radio's CCA ED threshold in dBm.

Parameters

aThreshold [in] The CCA ED threshold in dBm.
otError SetFemLnaGain (int8_t aGain)

Sets the FEM's Rx LNA gain in dBm.

Parameters

aGain [in] The FEM's Rx LNA gain in dBm.
otError SetCoexEnabled (bool aEnabled)

Enable the radio coex.

Parameters

aInstance [in] The OpenThread instance structure.
aEnabled [in] TRUE to enable the radio coex, FALSE otherwise.
otError SetMultipanActiveInterface (spinel_iid_t aIid, bool aCompletePending)

Sets specified radio interface active

This function allows selecting currently active radio interface on platforms that do not support parallel

communication on multiple interfaces. I.e. if more than one interface is in receive state calling

SetMultipanActiveInterface guarantees that specified interface will not be losing frames. This function

returns if the request was received properly. After interface switching is complete SwitchoverDone callback is

Invoked. Switching interfaces may take longer if aCompletePending is set true.

Parameters

aIid [in] IID of the interface to set active.
aCompletePending [in] Set true if pending radio operation should complete first(Soft switch) or false if ongoing operations should be interrupted (Force switch).
otError Transmit (otRadioFrame & aFrame)

Switches the radio state from Receive to Transmit.

Parameters

aFrame [in] A reference to the transmitted frame.
otError Receive (uint8_t aChannel)

Switches the radio state from Sleep to Receive.

Parameters

aChannel [in] The channel to use for receiving.
otError ReceiveAt (uint64_t aWhen, uint32_t aDuration, uint8_t aChannel)

Schedule a radio reception window at a specific time and duration.

Parameters

aWhen [in] The receive window start time in the local radio clock, see `otPlatRadioGetNow`. The radio receiver SHALL be on and ready to receive the first symbol of a frame's SHR at the window start time.
aDuration [in] The receive window duration, in microseconds, as measured by the local radio clock.
aChannel [in] The channel to use for receiving.
otError Sleep ()

Switches the radio state from Receive to Sleep.

otError Enable (otInstance * aInstance)

Enable the radio.

Parameters

aInstance [in] A pointer to the OpenThread instance.
otError Disable ()

Disable the radio.

void Process (const void * aContext)

Processes any pending the I/O data.

Parameters

aContext [in] The process context.
otError RadioSpinelDiagProcess (char *[] aArgs, uint8_t aArgsLength)

Processes RadioSpinel - specific diagnostics commands.

Parameters

aArgsLength [in] The number of arguments in
aArgs [in] The arguments of diagnostics command line.
otError PlatDiagProcess (const char * aString)

Processes platform diagnostics commands.

Parameters

aString [in] A null-terminated input string.
void SetDiagOutputCallback (otPlatDiagOutputCallback aCallback, void * aContext)

Sets the diag output callback.

Parameters

aCallback [in] A pointer to a function that is called on outputting diag messages.
aContext [in] A pointer to the user context.
void GetDiagOutputCallback (otPlatDiagOutputCallback & aCallback, void *& aContext)

Gets the diag output callback.

Parameters

aCallback [out] A reference to a function that is called on outputting diag messages.
aContext [out] A reference to the user context.
uint32_t GetRadioChannelMask (bool aPreferred)

Returns the radio channel mask.

Parameters

aPreferred [in] TRUE to get preferred channel mask, FALSE to get supported channel mask.
otError SetMacKey (uint8_t aKeyIdMode, uint8_t aKeyId, const otMacKeyMaterial * aPrevKey, const otMacKeyMaterial * aCurrKey, const otMacKeyMaterial * aNextKey)

Sets MAC key and key index to RCP.

Parameters

aKeyIdMode [in] The key ID mode.
aKeyId [in] The key index.
aPrevKey [in] Pointer to previous MAC key.
aCurrKey [in] Pointer to current MAC key.
aNextKey [in] Pointer to next MAC key.
otError SetMacFrameCounter (uint32_t aMacFrameCounter, bool aSetIfLarger)

Sets the current MAC Frame Counter value.

Parameters

aMacFrameCounter [in] The MAC Frame Counter value.
aSetIfLarger [in] If `true`, set only if the new value is larger than the current value. If `false`, set the new value independent of the current value.
otError SetRadioRegion (uint16_t aRegionCode)

Sets the radio region code.

Parameters

aRegionCode [in] The radio region code.
otError GetRadioRegion (uint16_t * aRegionCode)

Gets the radio region code.

Parameters

aRegionCode [out] The radio region code.
otError ConfigureEnhAckProbing (otLinkMetrics aLinkMetrics, const 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.

Parameters

aLinkMetrics [in] 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.
aShortAddress [in] The short address of the Probing Initiator.
aExtAddress [in] The extended source address of the Probing Initiator. MUST NOT be nullptr.
uint8_t GetCslAccuracy ()

Get the current accuracy, in units of ± ppm, of the clock used for scheduling CSL operations.

uint8_t GetCslUncertainty ()

Get the current uncertainty, in units of 10 us, of the clock used for scheduling CSL operations.

uint64_t GetNow ()

Gets the current estimated time on RCP.

uint32_t GetBusSpeed ()

Returns the bus speed between the host and the radio.

uint32_t GetBusLatency ()

Returns the bus latency between the host and the radio.

void SetBusLatency (uint32_t aBusLatency)

Sets the bus latency between the host and the radio.

Parameters

aBusLatency [in] Bus latency in microseconds.
otError SetChannelMaxTransmitPower (uint8_t aChannel, int8_t aMaxPower)

Sets the max transmit power.

Parameters

aChannel [in] The radio channel.
aMaxPower [in] The max transmit power in dBm.
otError Get (spinel_prop_key_t aKey, const char * aFormat)

Tries to retrieve a spinel property from OpenThread transceiver.

Parameters

aKey [in] Spinel property key.
aFormat [in] Spinel formatter to unpack property value.
... [out] Variable arguments list.
otError GetWithParam (spinel_prop_key_t aKey, const uint8_t * aParam, spinel_size_t aParamSize, const char * aFormat)

Tries to retrieve a spinel property from OpenThread transceiver with parameter appended.

Parameters

aKey [in] Spinel property key.
aParam [in] Parameter appended to spinel command.
aParamSize [in] Size of parameter appended to spinel command
aFormat [in] Spinel formatter to unpack property value.
... [out] Variable arguments list.
otError Set (spinel_prop_key_t aKey, const char * aFormat)

Tries to update a spinel property of OpenThread transceiver.

Parameters

aKey [in] Spinel property key.
aFormat [in] Spinel formatter to pack property value.
... [in] Variable arguments list.
otError Insert (spinel_prop_key_t aKey, const char * aFormat)

Tries to insert a item into a spinel list property of OpenThread transceiver.

Parameters

aKey [in] Spinel property key.
aFormat [in] Spinel formatter to pack the item.
... [in] Variable arguments list.
otError Remove (spinel_prop_key_t aKey, const char * aFormat)

Tries to remove a item from a spinel list property of OpenThread transceiver.

Parameters

aKey [in] Spinel property key.
aFormat [in] Spinel formatter to pack the item.
... [in] Variable arguments list.
otError SendReset (uint8_t aResetType)

Sends a reset command to the RCP.

Parameters

aResetType [in] The reset type, SPINEL_RESET_PLATFORM, SPINEL_RESET_STACK, or SPINEL_RESET_BOOTLOADER.
void ~RadioSpinel ()

Deinitializes the spinel based OpenThread transceiver.

Defined at line 149 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

void SetDiagEnabled (bool aMode)

Enables/disables the factory diagnostics mode.

Parameters

aMode [in] TRUE to enable diagnostics mode, FALSE otherwise.

Defined at line 654 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp

void SetTimeSyncState (bool aOn)

Enables or disables the time synchronization between the host and RCP.

Parameters

aOn [in] TRUE to turn on the time synchronization, FALSE otherwise.

Defined at line 1074 of file ../../third_party/openthread/src/lib/spinel/radio_spinel.hpp