mirror of
https://github.com/espressif/openthread.git
synced 2026-09-18 15:10:12 +00:00
[uptime] new feature to track OT instance uptime (in msec) (#6968)
This commit adds a new module `Uptime` which tracks the number of milliseconds since OpenThread stack initialization as an `uint64_t` value. It also adds public OT APIs to get the current uptime value (either as the number of milliseconds or in human-readable string format like "2 days 12:45:12.762"). A CLI `uptime` command is also added. This feature can be enabled using the newly added config option `OPENTHREAD_CONFIG_UPTIME_ENABLE` (or the related CMake `OT_UPTIME` option).
This commit is contained in:
committed by
Jonathan Hui
parent
0f73466897
commit
ca3830fac2
@@ -65,3 +65,4 @@ This page lists the available common switches with description. Unless stated ot
|
||||
| TIME_SYNC | OT_TIME_SYNC | Enables the time synchronization service feature. **Note: Enabling this feature breaks conformance to the Thread Specification.** | |
|
||||
| TREL | OT_TREL | Enables TREL radio link for Thread over Infrastructure feature. |
|
||||
| UDP_FORWARD | OT_UDP_FORWARD | Enables support for UDP forward. | Enable this switch on the Border Router device (running on the NCP design) with External Commissioning support to service Thread Commissioner packets on the NCP side. |
|
||||
| UPTIME | OT_UPTIME | Enables support for tracking OpenThread instance's uptime. |
|
||||
|
||||
@@ -87,6 +87,7 @@ THREAD_VERSION ?= 1.2
|
||||
TIME_SYNC ?= 0
|
||||
TREL ?= 0
|
||||
UDP_FORWARD ?= 0
|
||||
UPTIME ?= 0
|
||||
RCP_RESTORATION_MAX_COUNT ?= 0
|
||||
|
||||
|
||||
@@ -332,6 +333,10 @@ ifeq ($(UDP_FORWARD),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_UDP_FORWARD_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(UPTIME),1)
|
||||
COMMONCFLAGS += -DOPENTHREAD_CONFIG_UPTIME_ENABLE=1
|
||||
endif
|
||||
|
||||
ifeq ($(DISABLE_BUILTIN_MBEDTLS),1)
|
||||
configure_OPTIONS += --disable-builtin-mbedtls
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user