mirror of
https://github.com/espressif/openthread.git
synced 2026-11-12 09:21:07 +00:00
Introduce NCP related configuration options (#983)
This commits add a set of `OPENTHREAD_CONFIG_NCP` configuration parameters to specify size of different NCP related buffers (for both `NcpUart` and `NcpSpi`).
This commit is contained in:
committed by
Jonathan Hui
parent
257e418b21
commit
ad1c66e887
@@ -372,4 +372,44 @@
|
||||
#define OPENTHREAD_CONFIG_NUM_SLAAC_ADDRESSES 4
|
||||
#endif // OPENTHREAD_CONFIG_NUM_SLAAC_ADDRESSES
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE
|
||||
*
|
||||
* The size of NCP message buffer in bytes
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE
|
||||
#define OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE 512
|
||||
#endif // OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_NCP_UART_TX_CHUNK_SIZE
|
||||
*
|
||||
* The size of NCP UART TX chunk in bytes
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_NCP_UART_TX_CHUNK_SIZE
|
||||
#define OPENTHREAD_CONFIG_NCP_UART_TX_CHUNK_SIZE 128
|
||||
#endif // OPENTHREAD_CONFIG_NCP_UART_TX_CHUNK_SIZE
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE
|
||||
*
|
||||
* The size of NCP UART RX buffer in bytes
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE
|
||||
#define OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE 1500
|
||||
#endif // OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE
|
||||
|
||||
/**
|
||||
* @def OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE
|
||||
*
|
||||
* The size of NCP SPI (RX/TX) buffer in bytes
|
||||
*
|
||||
*/
|
||||
#ifndef OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE
|
||||
#define OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE 1500
|
||||
#endif // OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE
|
||||
|
||||
#endif // OPENTHREAD_CORE_DEFAULT_CONFIG_H_
|
||||
|
||||
+10
-3
@@ -33,6 +33,12 @@
|
||||
#ifndef NCP_SPI_HPP_
|
||||
#define NCP_SPI_HPP_
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_FILE
|
||||
#include OPENTHREAD_CONFIG_FILE
|
||||
#else
|
||||
#include <openthread-config.h>
|
||||
#endif
|
||||
|
||||
#include <ncp/ncp_base.hpp>
|
||||
#include <ncp/ncp_buffer.hpp>
|
||||
|
||||
@@ -61,9 +67,10 @@ public:
|
||||
private:
|
||||
enum
|
||||
{
|
||||
kSpiBufferSize = 1500, // Spi buffer size (should be large enough to fit a max length frame + spi header).
|
||||
kTxBufferSize = 512, // Tx Buffer size (used by mTxFrameBuffer).
|
||||
kSpiHeaderLength = 5, // Size of spi header.
|
||||
kSpiBufferSize = OPENTHREAD_CONFIG_NCP_SPI_BUFFER_SIZE, // Spi buffer size (should be large enough to fit a
|
||||
// max length frame + spi header).
|
||||
kTxBufferSize = OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE, // Tx Buffer size (used by mTxFrameBuffer).
|
||||
kSpiHeaderLength = 5, // Size of spi header.
|
||||
};
|
||||
|
||||
uint16_t OutboundFrameSize(void);
|
||||
|
||||
+10
-3
@@ -33,6 +33,12 @@
|
||||
#ifndef NCP_UART_HPP_
|
||||
#define NCP_UART_HPP_
|
||||
|
||||
#ifdef OPENTHREAD_CONFIG_FILE
|
||||
#include OPENTHREAD_CONFIG_FILE
|
||||
#else
|
||||
#include <openthread-config.h>
|
||||
#endif
|
||||
|
||||
#include <ncp/ncp_base.hpp>
|
||||
#include <ncp/flen.hpp>
|
||||
#include <ncp/hdlc.hpp>
|
||||
@@ -118,9 +124,10 @@ private:
|
||||
|
||||
enum
|
||||
{
|
||||
kUartTxBufferSize = 128, // Uart tx buffer size.
|
||||
kTxBufferSize = 512, // Tx Buffer size (used by mTxFrameBuffer).
|
||||
kRxBufferSize = 1500, // Rx buffer size (should be large enough to fit one whole (decoded) received frame).
|
||||
kUartTxBufferSize = OPENTHREAD_CONFIG_NCP_UART_TX_CHUNK_SIZE, // Uart tx buffer size.
|
||||
kTxBufferSize = OPENTHREAD_CONFIG_NCP_TX_BUFFER_SIZE, // Tx Buffer size (used by mTxFrameBuffer).
|
||||
kRxBufferSize = OPENTHREAD_CONFIG_NCP_UART_RX_BUFFER_SIZE, // Rx buffer size (should be large enough to fit
|
||||
// one whole (decoded) received frame).
|
||||
};
|
||||
|
||||
enum UartTxState
|
||||
|
||||
Reference in New Issue
Block a user