[csl] update CSL methods to use core MAC address types (#11306)

This commit updates `SubMac::UpdateCsl()` and related methods to use
the core types `Mac::ExtAddress` and `Mac::ShortAddress` instead of
C-style public/platform types. The extended address input is also
changed from a pointer to a reference.
This commit is contained in:
Abtin Keshavarzian
2025-02-28 07:16:19 -08:00
committed by GitHub
parent 6e0755bd1b
commit 31f2897951
5 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -2429,7 +2429,7 @@ void Mac::UpdateCsl(void)
uint8_t channel = GetCslChannel() ? GetCslChannel() : mRadioChannel;
if (mLinks.UpdateCsl(period, channel, Get<Mle::Mle>().GetParent().GetRloc16(),
&Get<Mle::Mle>().GetParent().GetExtAddress()))
Get<Mle::Mle>().GetParent().GetExtAddress()))
{
if (Get<Mle::Mle>().IsChild())
{
+1 -1
View File
@@ -471,7 +471,7 @@ public:
* @retval TRUE if CSL Period or CSL Channel changed.
* @retval FALSE if CSL Period and CSL Channel did not change.
*/
bool UpdateCsl(uint16_t aPeriod, uint8_t aChannel, otShortAddress aShortAddr, const otExtAddress *aExtAddr)
bool UpdateCsl(uint16_t aPeriod, uint8_t aChannel, ShortAddress aShortAddr, const ExtAddress &aExtAddr)
{
bool retval = false;
+1 -1
View File
@@ -386,7 +386,7 @@ public:
* @retval TRUE if CSL Period or CSL Channel changed.
* @retval FALSE if CSL Period and CSL Channel did not change.
*/
bool UpdateCsl(uint16_t aPeriod, uint8_t aChannel, otShortAddress aShortAddr, const otExtAddress *aExtAddr);
bool UpdateCsl(uint16_t aPeriod, uint8_t aChannel, ShortAddress aShortAddr, const ExtAddress &aExtAddr);
/**
* Returns parent CSL accuracy (clock accuracy and uncertainty).
+1 -1
View File
@@ -107,7 +107,7 @@ exit:
return;
}
bool SubMac::UpdateCsl(uint16_t aPeriod, uint8_t aChannel, otShortAddress aShortAddr, const otExtAddress *aExtAddr)
bool SubMac::UpdateCsl(uint16_t aPeriod, uint8_t aChannel, ShortAddress aShortAddr, const ExtAddress &aExtAddr)
{
bool diffPeriod = aPeriod != mCslPeriod;
bool diffChannel = aChannel != mCslChannel;
+4 -4
View File
@@ -540,7 +540,7 @@ public:
* @retval kErrorFailed Other platform specific errors.
* @retval kErrorNone Successfully enabled or disabled CSL.
*/
Error EnableCsl(uint32_t aCslPeriod, otShortAddress aShortAddr, const otExtAddress *aExtAddr);
Error EnableCsl(uint32_t aCslPeriod, Mac::ShortAddress aShortAddr, const Mac::ExtAddress &aExtAddr);
/**
* Resets CSL receiver in radio.
@@ -980,9 +980,9 @@ inline void Radio::UpdateCslSampleTime(uint32_t aCslSampleTime)
otPlatRadioUpdateCslSampleTime(GetInstancePtr(), aCslSampleTime);
}
inline Error Radio::EnableCsl(uint32_t aCslPeriod, otShortAddress aShortAddr, const otExtAddress *aExtAddr)
inline Error Radio::EnableCsl(uint32_t aCslPeriod, Mac::ShortAddress aShortAddr, const Mac::ExtAddress &aExtAddr)
{
return otPlatRadioEnableCsl(GetInstancePtr(), aCslPeriod, aShortAddr, aExtAddr);
return otPlatRadioEnableCsl(GetInstancePtr(), aCslPeriod, aShortAddr, &aExtAddr);
}
inline Error Radio::ResetCsl(void) { return otPlatRadioResetCsl(GetInstancePtr()); }
@@ -1087,7 +1087,7 @@ inline Error Radio::ReceiveAt(uint8_t, uint32_t, uint32_t) { return kErrorNone;
#if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE
inline void Radio::UpdateCslSampleTime(uint32_t) {}
inline Error Radio::EnableCsl(uint32_t, otShortAddress aShortAddr, const otExtAddress *)
inline Error Radio::EnableCsl(uint32_t, Mac::ShortAddress aShortAddr, const Mac::ExtAddress &)
{
return kErrorNotImplemented;
}