[spinel] merge spinel config files (#10468)

This commit removes `spinel-config.h` and moves the configs to
`openthread-spinel-config.h` so that the definitions can also be
overridden by definitions in customized lib config file.
This commit is contained in:
Li Cao
2024-07-03 11:23:00 -07:00
committed by GitHub
parent 41ded02814
commit 5a9c768d44
4 changed files with 34 additions and 70 deletions
+2 -1
View File
@@ -28,6 +28,8 @@
#include "logger.hpp"
#include "openthread-spinel-config.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
@@ -36,7 +38,6 @@
#include <openthread/logging.h>
#include <openthread/platform/radio.h>
#include "lib/spinel/spinel-config.h"
#include "lib/spinel/spinel.h"
#include "lib/utils/math.hpp"
#include "lib/utils/utils.hpp"
+31
View File
@@ -42,6 +42,37 @@
#include OPENTHREAD_PROJECT_LIB_CONFIG_FILE
#endif
/**
* @def OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE
*
* Specifies the rx frame buffer size used by `SpinelInterface` in RCP host (posix) code. This is applicable/used when
* `RadioSpinel` platform is used.
*
*/
#ifndef OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE
#define OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE 8192
#endif
/**
* @def OPENTHREAD_LIB_SPINEL_LOG_MAX_SIZE
*
* The maximum log string size (number of chars).
*
*/
#ifndef OPENTHREAD_LIB_SPINEL_LOG_MAX_SIZE
#define OPENTHREAD_LIB_SPINEL_LOG_MAX_SIZE 1024
#endif
/**
* @def OPENTHREAD_LIB_SPINEL_NCP_LOG_MAX_SIZE
*
* The maximum OpenThread log string size (number of chars) supported by NCP using Spinel `StreamWrite`.
*
*/
#ifndef OPENTHREAD_LIB_SPINEL_NCP_LOG_MAX_SIZE
#define OPENTHREAD_LIB_SPINEL_NCP_LOG_MAX_SIZE 150
#endif
/**
* @def OPENTHREAD_SPINEL_CONFIG_OPENTHREAD_MESSAGE_ENABLE
*
-68
View File
@@ -1,68 +0,0 @@
/*
* Copyright (c) 2024, The OpenThread Authors.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file
* This file includes compile-time configuration constants for lib spinel.
*/
#ifndef SPINEL_CONFIG_H_
#define SPINEL_CONFIG_H_
/**
* @def OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE
*
* Specifies the rx frame buffer size used by `SpinelInterface` in RCP host (posix) code. This is applicable/used when
* `RadioSpinel` platform is used.
*
*/
#ifndef OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE
#define OPENTHREAD_LIB_SPINEL_RX_FRAME_BUFFER_SIZE 8192
#endif
/**
* @def OPENTHREAD_LIB_SPINEL_LOG_MAX_SIZE
*
* The maximum log string size (number of chars).
*
*/
#ifndef OPENTHREAD_LIB_SPINEL_LOG_MAX_SIZE
#define OPENTHREAD_LIB_SPINEL_LOG_MAX_SIZE 1024
#endif
/**
* @def OPENTHREAD_LIB_SPINEL_NCP_LOG_MAX_SIZE
*
* The maximum OpenThread log string size (number of chars) supported by NCP using Spinel `StreamWrite`.
*
*/
#ifndef OPENTHREAD_LIB_SPINEL_NCP_LOG_MAX_SIZE
#define OPENTHREAD_LIB_SPINEL_NCP_LOG_MAX_SIZE 150
#endif
#endif // SPINEL_CONFIG_H_
+1 -1
View File
@@ -35,7 +35,7 @@
#ifndef SPINEL_SPINEL_INTERFACE_HPP_
#define SPINEL_SPINEL_INTERFACE_HPP_
#include "spinel-config.h"
#include "openthread-spinel-config.h"
#include "lib/spinel/multi_frame_buffer.hpp"
#include "lib/spinel/radio_spinel_metrics.h"