From 8edc081fdc7dd6546181fb2470b0472014761a1d Mon Sep 17 00:00:00 2001 From: sarveshkumarv3 <86755931+sarveshkumarv3@users.noreply.github.com> Date: Wed, 14 Aug 2024 08:12:30 -0700 Subject: [PATCH] [spinel] make `SendCommand` public to allow calling without variable arguments (#10602) Changed access of SendCommand to public to allow calling without variable arguments. This is to address compilation error in ot-br-posix repo NcpSpinel::ThreadErasePersistentInfo (while building for OpenWrt v23.05.4 for a mips target)(error: 'args' may be used uninitialized [-Werror=maybe-uninitialized]) --- src/lib/spinel/spinel_driver.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/lib/spinel/spinel_driver.hpp b/src/lib/spinel/spinel_driver.hpp index 0c3657f6ff1..7372ad16669 100644 --- a/src/lib/spinel/spinel_driver.hpp +++ b/src/lib/spinel/spinel_driver.hpp @@ -180,6 +180,20 @@ class SpinelDriver : public otSpinelDriver, public Logger const char *aFormat, va_list aArgs); + /* + * Sends a spinel command without arguments to the co-processor. + * + * @param[in] aCommand The spinel command. + * @param[in] aKey The spinel property key. + * @param[in] aTid The spinel transaction id. + * + * @retval OT_ERROR_NONE Successfully sent the command through spinel interface. + * @retval OT_ERROR_INVALID_STATE The spinel interface is in an invalid state. + * @retval OT_ERROR_NO_BUFS The spinel interface doesn't have enough buffer. + * + */ + otError SendCommand(uint32_t aCommand, spinel_prop_key_t aKey, spinel_tid_t aTid); + /* * Sets the handler to process the received spinel frame. * @@ -291,8 +305,6 @@ class SpinelDriver : public otSpinelDriver, public Logger void *aContext); void HandleInitialFrame(const uint8_t *aFrame, uint16_t aLength, uint8_t aHeader, bool &aSave); - otError SendCommand(uint32_t aCommand, spinel_prop_key_t aKey, spinel_tid_t aTid); - otError CheckSpinelVersion(void); otError GetCoprocessorVersion(void); otError GetCoprocessorCaps(void);