otConvertDurationInSecondsToString() function
Converts an `uint32_t` duration (in seconds) to a human-readable string. Requires `OPENTHREAD_CONFIG_UPTIME_ENABLE` to be enabled. The string follows the format "::" for hours, minutes, seconds (if duration is shorter than one day) or "d.::" (if longer than a day). If the resulting string does not fit in @p aBuffer (within its @p aSize characters), the string will be truncated but the outputted string is always null-terminated. Is intended for use with `mAge` or `mConnectionTime` in `otNeighborInfo` or `otChildInfo` structures.
Arguments
aDuration
A duration interval in seconds.
aBuffer
A pointer to a char array to output the string.
aSize
The size of @p aBuffer (in bytes). Recommended to use `OT_DURATION_STRING_SIZE`.
![]()
otConvertDurationInSecondsToString(neighborInfo.mAge, string, sizeof(string));![]()
otConvertDurationInSecondsToString(neighborInfo.mConnectionTime, string, sizeof(string));![]()
otConvertDurationInSecondsToString(peerBrEntry.mAge, ageString, sizeof(ageString));![]()
otConvertDurationInSecondsToString(minAge, ageString, sizeof(ageString));![]()
otConvertDurationInSecondsToString(aEntry.mAge, ageString, sizeof(ageString));
otConvertDurationInSecondsToString() is called by 5 functions and calls 3 functions:
![]()
otConvertDurationInSecondsToString()
otConvertDurationInSecondsToString():
![]()
otConvertDurationInSecondsToString()