mirror of
https://github.com/espressif/openthread.git
synced 2026-08-04 09:57:47 +00:00
[clang-tidy] apply readability-make-member-function-const (#5675)
This commit is contained in:
@@ -44,7 +44,7 @@ namespace ot {
|
||||
const TimerScheduler::AlarmApi TimerMilliScheduler::sAlarmMilliApi = {&otPlatAlarmMilliStartAt, &otPlatAlarmMilliStop,
|
||||
&otPlatAlarmMilliGetNow};
|
||||
|
||||
bool Timer::DoesFireBefore(const Timer &aSecondTimer, Time aNow)
|
||||
bool Timer::DoesFireBefore(const Timer &aSecondTimer, Time aNow) const
|
||||
{
|
||||
bool retval;
|
||||
bool isBeforeNow = (GetFireTime() < aNow);
|
||||
|
||||
@@ -132,7 +132,7 @@ protected:
|
||||
* @retval FALSE If the fire time of this timer object is the same or after aTimer's fire time.
|
||||
*
|
||||
*/
|
||||
bool DoesFireBefore(const Timer &aSecondTimer, Time aNow);
|
||||
bool DoesFireBefore(const Timer &aSecondTimer, Time aNow) const;
|
||||
|
||||
void Fired(void) { mHandler(*this); }
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ private:
|
||||
|
||||
struct JoinerEntrustMetadata
|
||||
{
|
||||
otError AppendTo(Message &aMessage) { return aMessage.Append(*this); }
|
||||
otError AppendTo(Message &aMessage) const { return aMessage.Append(*this); }
|
||||
void ReadFrom(const Message &aMessage);
|
||||
|
||||
Ip6::MessageInfo mMessageInfo; // Message info of the message to send.
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
* @returns The MPL Seed Id Length value.
|
||||
*
|
||||
*/
|
||||
SeedIdLength GetSeedIdLength(void) { return static_cast<SeedIdLength>(mControl & kSeedIdLengthMask); }
|
||||
SeedIdLength GetSeedIdLength(void) const { return static_cast<SeedIdLength>(mControl & kSeedIdLengthMask); }
|
||||
|
||||
/**
|
||||
* This method sets the MPL Seed Id Length value.
|
||||
|
||||
@@ -151,7 +151,7 @@ void CslTxScheduler::RescheduleCslTx(void)
|
||||
mCslTxChild = bestChild;
|
||||
}
|
||||
|
||||
uint32_t CslTxScheduler::GetNextCslTransmissionDelay(const Child &aChild, uint64_t aRadioNow)
|
||||
uint32_t CslTxScheduler::GetNextCslTransmissionDelay(const Child &aChild, uint64_t aRadioNow) const
|
||||
{
|
||||
uint32_t delay;
|
||||
uint16_t period_offset = (aRadioNow / kUsPerTenSymbols) % aChild.GetCslPeriod();
|
||||
|
||||
@@ -190,7 +190,7 @@ private:
|
||||
void InitFrameRequestAhead(void);
|
||||
void RescheduleCslTx(void);
|
||||
|
||||
uint32_t GetNextCslTransmissionDelay(const Child &aChild, uint64_t aRadioNow);
|
||||
uint32_t GetNextCslTransmissionDelay(const Child &aChild, uint64_t aRadioNow) const;
|
||||
|
||||
// Callbacks from `Mac`
|
||||
otError HandleFrameRequest(Mac::TxFrame &aFrame);
|
||||
|
||||
@@ -1011,7 +1011,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
otError Mle::AppendSourceAddress(Message &aMessage)
|
||||
otError Mle::AppendSourceAddress(Message &aMessage) const
|
||||
{
|
||||
return Tlv::AppendUint16Tlv(aMessage, Tlv::kSourceAddress, GetRloc16());
|
||||
}
|
||||
|
||||
@@ -935,7 +935,7 @@ protected:
|
||||
* @retval OT_ERROR_NO_BUFS Insufficient buffers available to append the Source Address TLV.
|
||||
*
|
||||
*/
|
||||
otError AppendSourceAddress(Message &aMessage);
|
||||
otError AppendSourceAddress(Message &aMessage) const;
|
||||
|
||||
/**
|
||||
* This method appends a Mode TLV to a message.
|
||||
|
||||
@@ -963,7 +963,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
otError Leader::AllocateServiceId(uint8_t &aServiceId)
|
||||
otError Leader::AllocateServiceId(uint8_t &aServiceId) const
|
||||
{
|
||||
otError error = OT_ERROR_NOT_FOUND;
|
||||
uint8_t serviceId;
|
||||
|
||||
@@ -215,7 +215,7 @@ private:
|
||||
otError AddService(const ServiceTlv &aService, ChangedFlags &aChangedFlags);
|
||||
otError AddServer(const ServerTlv &aServer, ServiceTlv &aDstService, ChangedFlags &aChangedFlags);
|
||||
|
||||
otError AllocateServiceId(uint8_t &aServiceId);
|
||||
otError AllocateServiceId(uint8_t &aServiceId) const;
|
||||
|
||||
otError AllocateContextId(uint8_t &aConextId);
|
||||
void FreeContextId(uint8_t aContextId);
|
||||
|
||||
@@ -202,7 +202,7 @@ void ChannelMonitor::LogResults(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
Mac::ChannelMask ChannelMonitor::FindBestChannels(const Mac::ChannelMask &aMask, uint16_t &aOccupancy)
|
||||
Mac::ChannelMask ChannelMonitor::FindBestChannels(const Mac::ChannelMask &aMask, uint16_t &aOccupancy) const
|
||||
{
|
||||
uint8_t channel;
|
||||
Mac::ChannelMask bestMask;
|
||||
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
* channel with the same occupancy rate value.
|
||||
*
|
||||
*/
|
||||
Mac::ChannelMask FindBestChannels(const Mac::ChannelMask &aMask, uint16_t &aOccupancy);
|
||||
Mac::ChannelMask FindBestChannels(const Mac::ChannelMask &aMask, uint16_t &aOccupancy) const;
|
||||
|
||||
private:
|
||||
enum
|
||||
|
||||
Reference in New Issue
Block a user