mirror of
https://github.com/espressif/openthread.git
synced 2026-07-05 20:00:23 +00:00
[uptime] move otConvertDurationInSecondsToString to FTD/MTD block (#12336)
The fix moves the necessary includes outside the FTD/MTD conditional block: - Added explicit include: #include "common/uptime.hpp" is now included when OPENTHREAD_CONFIG_UPTIME_ENABLE is defined, regardless of FTD/MTD mode. - Extended namespace usage: The using namespace ot; directive now applies when either FTD/MTD is enabled OR uptime is enabled, ensuring the namespace is available for the uptime functions. This ensures that when OPENTHREAD_CONFIG_UPTIME_ENABLE is enabled, the required headers are included even in RADIO mode, allowing the uptime functionality to work correctly across all device types.
This commit is contained in:
@@ -527,8 +527,6 @@ otError otThreadWakeup(otInstance *aInstance,
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // OPENTHREAD_FTD || OPENTHREAD_MTD
|
||||
|
||||
#if OPENTHREAD_CONFIG_UPTIME_ENABLE
|
||||
void otConvertDurationInSecondsToString(uint32_t aDuration, char *aBuffer, uint16_t aSize)
|
||||
{
|
||||
@@ -538,3 +536,5 @@ void otConvertDurationInSecondsToString(uint32_t aDuration, char *aBuffer, uint1
|
||||
UptimeToString(uptime, writer, /* aIncludeMsec */ false);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // OPENTHREAD_FTD || OPENTHREAD_MTD
|
||||
|
||||
Reference in New Issue
Block a user