Skip to content

Commit

Permalink
[spinel] fix OPENTHREAD_ENABLE_SPINEL_VENDOR_HOOK (openthread#9718)
Browse files Browse the repository at this point in the history
`OPENTHREAD_ENABLE_SPINEL_VENDOR_HOOK` was not consistent with the
intended `OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK`.

Rename `OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK` to
`OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE` for consistency with
other configs.
  • Loading branch information
jwhui authored Dec 18, 2023
1 parent 5ceb587 commit 8243591
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/lib/spinel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ set(COMMON_SOURCES
set(OT_SPINEL_VENDOR_HOOK_SOURCE "" CACHE STRING "set vendor hook source file for Spinel")
set(OT_SPINEL_VENDOR_HOOK_HEADER "" CACHE STRING "set vendor hook header file for Spinel")
if(OT_SPINEL_VENDOR_HOOK_SOURCE)
target_compile_definitions(openthread-spinel-rcp PUBLIC "OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK=1")
target_compile_definitions(openthread-spinel-ncp PUBLIC "OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK=1")
target_compile_definitions(openthread-spinel-rcp PUBLIC "OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE=1")
target_compile_definitions(openthread-spinel-ncp PUBLIC "OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE=1")
target_compile_definitions(openthread-spinel-rcp PUBLIC "OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_HEADER=\"${OT_SPINEL_VENDOR_HOOK_HEADER}\"")
target_compile_definitions(openthread-spinel-ncp PUBLIC "OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_HEADER=\"${OT_SPINEL_VENDOR_HOOK_HEADER}\"")
list(APPEND COMMON_SOURCES ${OT_SPINEL_VENDOR_HOOK_SOURCE_DIR}${OT_SPINEL_VENDOR_HOOK_SOURCE})
Expand Down
4 changes: 2 additions & 2 deletions src/lib/spinel/example_vendor_hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* This file shows how to implement the Radio Spinel vendor hook.
*/

#if OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK
#if OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE

#include OPENTRHEAD_SPINEL_CONFIG_VENDOR_HOOK_HEADER
#include "common/log.hpp"
Expand Down Expand Up @@ -64,4 +64,4 @@ otError RadioSpinel::VendorHandleValueIs(spinel_prop_key_t aPropKey)

extern ot::Spinel::RadioSpinel &GetRadioSpinel(void);

#endif // OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK
#endif // OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE
4 changes: 2 additions & 2 deletions src/lib/spinel/example_vendor_hook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#ifndef SPINEL_EXTENSION_H
#define SPINEL_EXTENSION_H

#if OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK
#if OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE

#include <openthread/thread_ftd.h>
#include "lib/spinel/radio_spinel.hpp"
Expand All @@ -55,5 +55,5 @@ class VendorRadioSpinel : public ot::Spinel::RadioSpinel
} // namespace Spinel
} // namespace ot

#endif // OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK
#endif // OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE
#endif // SPINEL_EXTENSION_H
6 changes: 3 additions & 3 deletions src/lib/spinel/openthread-spinel-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@
#endif

/**
* @def OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK
* @def OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE
*
* Enables compilation of vendor specific code for Spinel
*
*/
#ifndef OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK
#define OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK 0
#ifndef OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE
#define OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE 0
#endif

/**
Expand Down
2 changes: 1 addition & 1 deletion src/lib/spinel/radio_spinel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ void RadioSpinel::HandleValueIs(spinel_prop_key_t aKey, const uint8_t *aBuffer,
break;
}
}
#if OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK
#if OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE
else if (aKey >= SPINEL_PROP_VENDOR__BEGIN && aKey < SPINEL_PROP_VENDOR__END)
{
error = VendorHandleValueIs(aKey);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/spinel/radio_spinel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ class RadioSpinel
*/
void RestoreProperties(void);
#endif
#if OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK
#if OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE
/**
* Defines a vendor "set property handler" hook to process vendor spinel properties.
*
Expand Down
4 changes: 2 additions & 2 deletions src/posix/platform/radio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "posix/platform/radio_url.hpp"
#include "posix/platform/spi_interface.hpp"
#include "posix/platform/vendor_interface.hpp"
#if OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK
#if OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE
#ifdef OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_HEADER
#include OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_HEADER
#endif
Expand Down Expand Up @@ -110,7 +110,7 @@ class Radio
#endif

RadioUrl mRadioUrl;
#if OPENTHREAD_ENABLE_SPINEL_VENDOR_HOOK
#if OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE
Spinel::VendorRadioSpinel mRadioSpinel;
#else
Spinel::RadioSpinel mRadioSpinel;
Expand Down

0 comments on commit 8243591

Please sign in to comment.