mirror of
https://github.com/espressif/openthread.git
synced 2026-07-09 05:40:27 +00:00
9e26a5deab
This commit adds a new common `Timestamp::Compare()` methods which compares two given `Timestamp` pointers (determines whether they are equal or one is ahead or behind the other one). The new method allows either input (or even both) to be `nullptr`. A null timestamp is used to indicate when there is no timestamp. In terms of comparison result, a non-null timestamp is considered to be ahead of (or larger then) a null one and two null timestamps are considered equal. The new method is used in all different places where the `Timestamp`s are compared. This commit also adds a unit test to verify the `Timestamp` class (the existing `test_steering_data` is renamed to `test_meshcop` which is now used to include unit tests for all MeshCoP related definitions).