Network Co-Processor#
This module includes functions that control the Thread stack's execution.
Typedefs#
This function pointer is called to send HDLC encoded NCP data.
Defines delegate (function pointer) type to control behavior of peek/poke operation.
Functions#
This function is called after NCP send finished.
This function is called after HDLC encoded NCP data received.
Initialize the NCP based on HDLC framing.
Initialize the NCP based on SPI framing.
Send data to the host via a specific stream.
Writes OpenThread Log using otNcpStreamWrite
.
This method registers peek/poke delegate functions with NCP module.
Typedef Documentation#
otNcpHdlcSendCallback#
typedef int(* otNcpHdlcSendCallback) (const uint8_t *aBuf, uint16_t aBufLength) )(const uint8_t *aBuf, uint16_t aBufLength)
This function pointer is called to send HDLC encoded NCP data.
[in] | aBuf | A pointer to a buffer with an output. |
[in] | aBufLength | A length of the output data stored in the buffer. |
Returns
Number of bytes processed by the callback.
66
of file include/openthread/ncp.h
otNcpDelegateAllowPeekPoke#
typedef bool(* otNcpDelegateAllowPeekPoke) (uint32_t aAddress, uint16_t aCount) )(uint32_t aAddress, uint16_t aCount)
Defines delegate (function pointer) type to control behavior of peek/poke operation.
[in] | aAddress | Start address of memory region. |
[in] | aCount | Number of bytes to peek or poke. |
This delegate function is called to decide whether to allow peek or poke of a specific memory region. It is used if NCP support for peek/poke commands is enabled.
Returns
TRUE to allow peek/poke of the given memory region, FALSE otherwise.
149
of file include/openthread/ncp.h
Function Documentation#
otNcpHdlcSendDone#
void otNcpHdlcSendDone (void )
This function is called after NCP send finished.
N/A |
72
of file include/openthread/ncp.h
otNcpHdlcReceive#
void otNcpHdlcReceive (const uint8_t * aBuf, uint16_t aBufLength)
This function is called after HDLC encoded NCP data received.
[in] | aBuf | A pointer to a buffer. |
[in] | aBufLength | The length of the data stored in the buffer. |
81
of file include/openthread/ncp.h
otNcpHdlcInit#
void otNcpHdlcInit (otInstance * aInstance, otNcpHdlcSendCallback aSendCallback)
Initialize the NCP based on HDLC framing.
[in] | aInstance | The OpenThread instance structure. |
[in] | aSendCallback | The function pointer used to send NCP data. |
90
of file include/openthread/ncp.h
otNcpSpiInit#
void otNcpSpiInit (otInstance * aInstance)
Initialize the NCP based on SPI framing.
[in] | aInstance | The OpenThread instance structure. |
98
of file include/openthread/ncp.h
otNcpStreamWrite#
otError otNcpStreamWrite (int aStreamId, const uint8_t * aDataPtr, int aDataLen)
Send data to the host via a specific stream.
[in] | aStreamId | A numeric identifier for the stream to write to. If set to '0', will default to the debug stream. |
[in] | aDataPtr | A pointer to the data to send on the stream. If aDataLen is non-zero, this param MUST NOT be NULL. |
[in] | aDataLen | The number of bytes of data from aDataPtr to send. |
This function attempts to send the given data to the host using the given aStreamId. This is useful for reporting error messages, implementing debug/diagnostic consoles, and potentially other types of datastreams.
The write either is accepted in its entirety or rejected. Partial writes are not attempted.
122
of file include/openthread/ncp.h
otNcpPlatLogv#
void otNcpPlatLogv (otLogLevel aLogLevel, otLogRegion aLogRegion, const char * aFormat, va_list aArgs)
Writes OpenThread Log using otNcpStreamWrite
.
[in] | aLogLevel | The log level. |
[in] | aLogRegion | The log region. |
[in] | aFormat | A pointer to the format string. |
[in] | aArgs | va_list matching aFormat. |
132
of file include/openthread/ncp.h
otNcpRegisterPeekPokeDelegates#
void otNcpRegisterPeekPokeDelegates (otNcpDelegateAllowPeekPoke aAllowPeekDelegate, otNcpDelegateAllowPeekPoke aAllowPokeDelegate)
This method registers peek/poke delegate functions with NCP module.
[in] | aAllowPeekDelegate | Delegate function pointer for peek operation. |
[in] | aAllowPokeDelegate | Delegate function pointer for poke operation. |
The delegate functions are called by NCP module to decide whether to allow peek or poke of a specific memory region. If the delegate pointer is set to NULL, it allows peek/poke operation for any address.
161
of file include/openthread/ncp.h