mirror of
https://github.com/espressif/openthread.git
synced 2026-07-27 06:17:47 +00:00
[cli] add OutputUint64() for 64-bit integer value in decimal format (#8354)
This commit also adds a helper `Uint64ToString()` method to convert a `uint64_t` to decimal format string. The new methods allow us to output `uint64_t` values without needing to cast to `unsigned long long` and/or use of `%llu` (which may not be provided by certain embedded libraries).
This commit is contained in:
@@ -51,12 +51,14 @@ otError Dataset::Print(otOperationalDataset &aDataset)
|
||||
{
|
||||
if (aDataset.mComponents.mIsPendingTimestampPresent)
|
||||
{
|
||||
OutputLine("Pending Timestamp: %lu", aDataset.mPendingTimestamp.mSeconds);
|
||||
OutputFormat("Pending Timestamp: ");
|
||||
OutputUint64Line(aDataset.mPendingTimestamp.mSeconds);
|
||||
}
|
||||
|
||||
if (aDataset.mComponents.mIsActiveTimestampPresent)
|
||||
{
|
||||
OutputLine("Active Timestamp: %lu", aDataset.mActiveTimestamp.mSeconds);
|
||||
OutputFormat("Active Timestamp: ");
|
||||
OutputUint64Line(aDataset.mActiveTimestamp.mSeconds);
|
||||
}
|
||||
|
||||
if (aDataset.mComponents.mIsChannelPresent)
|
||||
@@ -264,7 +266,7 @@ template <> otError Dataset::Process<Cmd("activetimestamp")>(Arg aArgs[])
|
||||
{
|
||||
if (sDataset.mComponents.mIsActiveTimestampPresent)
|
||||
{
|
||||
OutputLine("%lu", sDataset.mActiveTimestamp.mSeconds);
|
||||
OutputUint64Line(sDataset.mActiveTimestamp.mSeconds);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -666,7 +668,7 @@ template <> otError Dataset::Process<Cmd("pendingtimestamp")>(Arg aArgs[])
|
||||
{
|
||||
if (sDataset.mComponents.mIsPendingTimestampPresent)
|
||||
{
|
||||
OutputLine("%lu", sDataset.mPendingTimestamp.mSeconds);
|
||||
OutputUint64Line(sDataset.mPendingTimestamp.mSeconds);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user