mirror of
https://github.com/espressif/openthread.git
synced 2026-08-05 02:17:47 +00:00
[ncp] update static checking for diag output buffer size (#3891)
This commit is contained in:
committed by
Jonathan Hui
parent
bc8e3e31a9
commit
782ce52a6e
@@ -62,6 +62,12 @@ namespace Ncp {
|
||||
class NcpBase
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
kSpinelCmdHeaderSize = 2, ///< Size of spinel command header (in bytes).
|
||||
kSpinelPropIdSize = 3, ///< Size of spinel property identifier (in bytes).
|
||||
};
|
||||
|
||||
/**
|
||||
* This constructor creates and initializes an NcpBase instance.
|
||||
*
|
||||
@@ -400,7 +406,8 @@ protected:
|
||||
otError HandlePropertySet_SPINEL_PROP_HOST_POWER_STATE(uint8_t aHeader);
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
OT_STATIC_ASSERT(OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE <= OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE,
|
||||
OT_STATIC_ASSERT(OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE <=
|
||||
OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE - kSpinelCmdHeaderSize - kSpinelPropIdSize,
|
||||
"diag output buffer should be smaller than NCP UART tx buffer");
|
||||
|
||||
otError HandlePropertySet_SPINEL_PROP_NEST_STREAM_MFG(uint8_t aHeader);
|
||||
|
||||
+3
-1
@@ -47,7 +47,9 @@
|
||||
#if OPENTHREAD_ENABLE_NCP_SPI
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
OT_STATIC_ASSERT(OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE <= OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE,
|
||||
OT_STATIC_ASSERT(OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE <=
|
||||
OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE - ot::Ncp::NcpBase::kSpinelCmdHeaderSize -
|
||||
ot::Ncp::NcpBase::kSpinelPropIdSize - ot::Ncp::SpiFrame::kHeaderSize,
|
||||
"diag output should be smaller than NCP SPI tx buffer");
|
||||
OT_STATIC_ASSERT(OPENTHREAD_CONFIG_DIAG_CMD_LINE_BUFFER_SIZE <= OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE,
|
||||
"diag command line should be smaller than NCP SPI rx buffer");
|
||||
|
||||
@@ -50,6 +50,11 @@
|
||||
#if OPENTHREAD_ENABLE_NCP_UART
|
||||
|
||||
#if OPENTHREAD_ENABLE_DIAG
|
||||
OT_STATIC_ASSERT(OPENTHREAD_CONFIG_DIAG_OUTPUT_BUFFER_SIZE <= OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE -
|
||||
ot::Ncp::NcpBase::kSpinelCmdHeaderSize -
|
||||
ot::Ncp::NcpBase::kSpinelPropIdSize,
|
||||
"diag output should be smaller than NCP UART rx buffer");
|
||||
|
||||
OT_STATIC_ASSERT(OPENTHREAD_CONFIG_DIAG_CMD_LINE_BUFFER_SIZE <= OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE,
|
||||
"diag command line should be smaller than NCP UART rx buffer");
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user