mirror of
https://github.com/espressif/openthread.git
synced 2026-08-05 10:27:49 +00:00
[multi-radio] fix clang-tidy warnings (#6821)
- enable TREL in clang-tidy check - add explicit keyword to constructors - fix inconsistent parameter names - remove redundant initializer - use nullptr
This commit is contained in:
@@ -115,6 +115,7 @@ readonly OT_CLANG_TIDY_BUILD_OPTS=(
|
||||
'-DOT_SNTP_CLIENT=ON'
|
||||
'-DOT_SRP_CLIENT=ON'
|
||||
'-DOT_THREAD_VERSION=1.2'
|
||||
'-DOT_TREL=ON'
|
||||
'-DOT_COVERAGE=ON'
|
||||
'-DOT_LOG_LEVEL_DYNAMIC=ON'
|
||||
'-DOT_COMPILE_WARNING_AS_ERROR=ON'
|
||||
|
||||
@@ -47,7 +47,7 @@ using namespace ot;
|
||||
|
||||
otError otMultiRadioGetNeighborInfo(otInstance * aInstance,
|
||||
const otExtAddress * aExtAddress,
|
||||
otMultiRadioNeighborInfo *aInfo)
|
||||
otMultiRadioNeighborInfo *aNeighborInfo)
|
||||
{
|
||||
Error error = kErrorNone;
|
||||
Instance &instance = *static_cast<Instance *>(aInstance);
|
||||
@@ -55,9 +55,9 @@ otError otMultiRadioGetNeighborInfo(otInstance * aInstance,
|
||||
|
||||
neighbor = instance.Get<NeighborTable>().FindNeighbor(*static_cast<const Mac::ExtAddress *>(aExtAddress),
|
||||
Neighbor::kInStateAnyExceptInvalid);
|
||||
VerifyOrExit(neighbor != NULL, error = kErrorNotFound);
|
||||
VerifyOrExit(neighbor != nullptr, error = kErrorNotFound);
|
||||
|
||||
neighbor->PopulateMultiRadioInfo(*aInfo);
|
||||
neighbor->PopulateMultiRadioInfo(*aNeighborInfo);
|
||||
|
||||
exit:
|
||||
return error;
|
||||
|
||||
@@ -51,9 +51,6 @@ TxFrames::TxFrames(Instance &aInstance)
|
||||
#if OPENTHREAD_CONFIG_RADIO_LINK_TREL_ENABLE
|
||||
, mTxFrameTrel(aInstance.Get<Trel::Link>().GetTransmitFrame())
|
||||
#endif
|
||||
#if OPENTHREAD_CONFIG_MULTI_RADIO
|
||||
, mSelectedRadioTypes()
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -671,7 +671,7 @@ public:
|
||||
* @param[in] aMask A bit-mask representing the radio types (the first bit corresponds to radio type 0, and so on)
|
||||
*
|
||||
*/
|
||||
RadioTypes(uint8_t aMask)
|
||||
explicit RadioTypes(uint8_t aMask)
|
||||
: mBitMask(aMask)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -116,14 +116,14 @@ void Packet::Init(uint8_t *aBuffer, uint16_t aLength)
|
||||
mLength = aLength;
|
||||
}
|
||||
|
||||
void Packet::Init(Header::Type aType, uint8_t *mPayload, uint16_t mPayloadLength)
|
||||
void Packet::Init(Header::Type aType, uint8_t *aPayload, uint16_t aPayloadLength)
|
||||
{
|
||||
uint16_t headerSize = Header::GetSize(aType);
|
||||
|
||||
// The payload buffer should reserve enough bytes for
|
||||
// header (depending on type) before the payload.
|
||||
|
||||
Init(mPayload - headerSize, mPayloadLength + headerSize);
|
||||
Init(aPayload - headerSize, aPayloadLength + headerSize);
|
||||
GetHeader().Init(aType);
|
||||
}
|
||||
|
||||
|
||||
@@ -284,7 +284,6 @@ public:
|
||||
* @param[in] aPayloadLength The length (number of bytes) in the payload only (not including the header).
|
||||
*
|
||||
*/
|
||||
|
||||
void Init(Header::Type aType, uint8_t *aPayload, uint16_t aPayloadLength);
|
||||
|
||||
/**
|
||||
|
||||
@@ -314,11 +314,11 @@ public:
|
||||
* on the radio link.
|
||||
*
|
||||
* @param[in] aNeighbor The neighbor for which the deferred ack status is being reported.
|
||||
* @param[in] aTxError The deferred ack error status: `kErrorNone` to indicate a deferred ack was received,
|
||||
* @param[in] aError The deferred ack error status: `kErrorNone` to indicate a deferred ack was received,
|
||||
* `kErrorNoAck` to indicate an ack timeout.
|
||||
*
|
||||
*/
|
||||
void HandleDeferredAck(Neighbor &aNeighbor, Error aTxError);
|
||||
void HandleDeferredAck(Neighbor &aNeighbor, Error aError);
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
* @param[in] aInstance A reference to the OpenThread instance.
|
||||
*
|
||||
*/
|
||||
RadioSelector(Instance &aInstance);
|
||||
explicit RadioSelector(Instance &aInstance);
|
||||
|
||||
/**
|
||||
* This method updates the neighbor info (for multi radio support) on a received frame event.
|
||||
@@ -173,13 +173,13 @@ public:
|
||||
* The `aTxFrames` will also be updated to indicate which radio links are to be used.
|
||||
*
|
||||
* @param[inout] aMessage The message to send.
|
||||
* @param[in] aDest The MAC destination address.
|
||||
* @param[in] aMacDest The MAC destination address.
|
||||
* @param[inout] aTxFrames The set of TxFrames for all radio links.
|
||||
*
|
||||
* @returns A reference to `mTxFrame` to use when preparing the frame for tx.
|
||||
*
|
||||
*/
|
||||
Mac::TxFrame &SelectRadio(Message &aMessage, const Mac::Address &aDest, Mac::TxFrames &aTxFrames);
|
||||
Mac::TxFrame &SelectRadio(Message &aMessage, const Mac::Address &aMacDest, Mac::TxFrames &aTxFrames);
|
||||
|
||||
private:
|
||||
enum
|
||||
|
||||
Reference in New Issue
Block a user