Network Co-Processor#
This module includes functions that control the Thread stack's execution.
Typedefs#
Pointer is called to send HDLC encoded NCP data.
Defines delegate (function pointer) type to control behavior of peek/poke operation.
Functions#
Is called after NCP send finished.
Is called after HDLC encoded NCP data received.
Initialize the NCP based on HDLC framing.
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
.
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)
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.
64
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.
151
of file include/openthread/ncp.h
Function Documentation#
otNcpHdlcSendDone#
void otNcpHdlcSendDone (void )
Is called after NCP send finished.
N/A |
69
of file include/openthread/ncp.h
otNcpHdlcReceive#
void otNcpHdlcReceive (const uint8_t * aBuf, uint16_t aBufLength)
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. |
77
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. |
85
of file include/openthread/ncp.h
otNcpHdlcInitMulti#
void otNcpHdlcInitMulti (otInstance ** aInstance, uint8_t aCount, otNcpHdlcSendCallback aSendCallback)
Initialize the NCP based on HDLC framing.
[in] | aInstance | The OpenThread instance pointers array. |
[in] | aCount | Number of elements in the array. |
[in] | aSendCallback | The function pointer used to send NCP data. |
94
of file include/openthread/ncp.h
otNcpSpiInit#
void otNcpSpiInit (otInstance * aInstance)
Initialize the NCP based on SPI framing.
[in] | aInstance | The OpenThread instance structure. |
101
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. |
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.
125
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. |
135
of file include/openthread/ncp.h
otNcpRegisterPeekPokeDelegates#
void otNcpRegisterPeekPokeDelegates (otNcpDelegateAllowPeekPoke aAllowPeekDelegate, otNcpDelegateAllowPeekPoke aAllowPokeDelegate)
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.
162
of file include/openthread/ncp.h