class SpinelDriver

Defined at line 58 of file ../../third_party/openthread/src/lib/spinel/spinel_driver.hpp

Public Methods

void ClearRxBuffer ()

Clear the rx frame buffer.

Defined at line 96 of file ../../third_party/openthread/src/lib/spinel/spinel_driver.hpp

void SpinelDriver ()

Constructor of the SpinelDriver.

CoprocessorType Init (SpinelInterface & aSpinelInterface, bool aSoftwareReset, const spinel_iid_t * aIidList, uint8_t aIidListLength)

Initialize this SpinelDriver Instance.

Parameters

aSpinelInterface [in] A reference to the Spinel interface.
aSoftwareReset [in] TRUE to reset on init, FALSE to not reset on init.
aIidList [in] A Pointer to the list of IIDs to receive spinel frame from. First entry must be the IID of the Host Application.
aIidListLength [in] The Length of the
void Deinit ()

Deinitialize this SpinelDriver Instance.

otError SendReset (uint8_t aResetType)

Send a reset command to the co-processor.

[in] aResetType The reset type, SPINEL_RESET_PLATFORM, SPINEL_RESET_STACK, or SPINEL_RESET_BOOTLOADER.

void ResetCoprocessor (bool aSoftwareReset)

Reset the co-processor.

This method will reset the co-processor and wait until the co-process is ready (receiving SPINEL_PROP_LAST_STATUS

from the it). The reset will be either a software or hardware reset. If `aSoftwareReset` is `true`, then the

method will first try a software reset. If the software reset succeeds, the method exits. Otherwise the method

will then try a hardware reset. If `aSoftwareReset` is `false`, then method will directly try a hardware reset.

Parameters

aSoftwareReset [in] TRUE to try SW reset first, FALSE to directly try HW reset.
void Process (const void * aContext)

Processes any pending the I/O data.

The method should be called by the system loop to process received spinel frames.

Parameters

aContext [in] The process context.
void SetCoprocessorReady ()

Set the internal state of co-processor as ready.

This method is used to skip a reset.

Defined at line 103 of file ../../third_party/openthread/src/lib/spinel/spinel_driver.hpp

bool HasPendingFrame ()

Checks whether there is pending frame in the buffer.

The method is required by the system loop to update timer fd.

Defined at line 143 of file ../../third_party/openthread/src/lib/spinel/spinel_driver.hpp

const char * GetVersion ()

Returns the co-processor sw version string.

Defined at line 150 of file ../../third_party/openthread/src/lib/spinel/spinel_driver.hpp

SpinelInterface * GetSpinelInterface ()

Returns the spinel interface.

Defined at line 200 of file ../../third_party/openthread/src/lib/spinel/spinel_driver.hpp

bool CoprocessorHasCap (unsigned int aCapability)

Returns if the co-processor has some capability

Parameters

aCapability [in] The capability queried.

Defined at line 209 of file ../../third_party/openthread/src/lib/spinel/spinel_driver.hpp

spinel_iid_t GetIid ()

Returns the spinel interface id.

Defined at line 216 of file ../../third_party/openthread/src/lib/spinel/spinel_driver.hpp

otError SendCommand (uint32_t aCommand, spinel_prop_key_t aKey, spinel_tid_t aTid, const char * aFormat, va_list aArgs)

Sends a spinel command to the co-processor.

Parameters

aCommand [in] The spinel command.
aKey [in] The spinel property key.
aTid [in] The spinel transaction id.
aFormat [in] The format string of the arguments to send.
aArgs [in] The argument list.
otError SendCommand (uint32_t aCommand, spinel_prop_key_t aKey, spinel_tid_t aTid)

Sends a spinel command without arguments to the co-processor.

Parameters

aCommand [in] The spinel command.
aKey [in] The spinel property key.
aTid [in] The spinel transaction id.
void SetFrameHandler (ReceivedFrameHandler aReceivedFrameHandler, SavedFrameHandler aSavedFrameHandler, void * aContext)

Sets the handler to process the received spinel frame.

Parameters

aReceivedFrameHandler [in] The handler to process received spinel frames.
aSavedFrameHandler [in] The handler to process saved spinel frames.
aContext [in] The context to call the handler.

Records