45 Commits

Author SHA1 Message Date
Jonathan Hui 8b9d39cdbf [github-actions] remove android-ndk platform and CI job (#12654)
This commit removes the `android-ndk` platform support from the
`script/cmake-build` script and deletes the associated CI job from
the GitHub Actions workflow.

The `android-ndk` build was used to verify OpenThread compatibility
with the Android NDK. However, since OpenThread is now officially
included in the Android platform, maintaining a separate NDK-based
build in this repository is no longer necessary.

Changes:
- Remove `android-ndk` from `OT_PLATFORMS` in `script/cmake-build`.
- Remove NDK-specific configuration logic in `script/cmake-build`.
- Remove the `android-ndk` job from `.github/workflows/build.yml`.
2026-03-09 20:04:35 -05:00
Yakun Xu f38c0a6774 [build] clean intermediates on GitHub actions (#12204)
This commit enhances the build process by introducing a mechanism to
automatically clean intermediate build artifacts. Specifically, it
configures the build script to remove object and archive files, a
process that is conditionally activated, primarily within GitHub
Actions workflows, to optimize build environments and manage disk
space more efficiently.
2025-12-17 08:05:00 -08:00
Jason Zhang 5e04b4e261 [cmake] fix SRP server fast start mode option typo (#11798)
fix misspelled `OT_SRP_SERVER_FAST_START_MODE` build option
2025-08-08 10:36:55 -07:00
Abtin Keshavarzian babbccd4c6 [srp-server] introduce "fast start mode" feature (#11305)
This commit adds "Fast Start Mode" feature for SRP server. This
feature is designed for scenarios where a device, often a mobile
device, needs to act as a provisional SRP server (e.g., functioning
as a temporary Border Router). The SRP server function is enabled
only if no other Border Routers are already providing the SRP
service within the Thread network. A common use case is a mobile
device joining a Thread network where it may be the first, or only,
BR. Importantly, Fast Start Mode allows the device to quickly start
its SRP server functionality upon joining the network, allowing other
Thread devices to quickly connect and register their services without
the typical delays associated with standard Border Router
initialization and SRP server startup (using NetData Publisher).
2025-02-28 13:49:30 -08:00
Yakun Xu c0690e78fc [build] set default Thread version to 1.4 (#10690)
This commit updates the default Thread version to 1.4, so that most
latest features will be enabled by default. This commit also explicitly
enable the epskc feature just like other features in the build script.
2024-09-10 13:39:38 -07:00
Przemysław Bida 3ae275f1ac [simulation] add simulation tests framework for tcat (#9724)
This commit adds simulation framework for tcat based on posix udp
sockets.
2024-03-22 10:30:59 -07:00
parag-silabs 6e7135e4e1 [spinel] make kTxWaitUs configurable during compile time (#9687)
It is useful in case RCP needs to wait for longer than the hardcoded
value in kTxWaitUs.
2023-12-06 14:42:37 -08:00
Abtin Keshavarzian 8f5d4376c6 [build] delete the removed child supervision config in cmake-build (#9111) 2023-05-31 13:26:39 -07:00
Mason Tran f86d560e0a [build] add CMake Android NDK support (#9010) 2023-05-09 11:01:51 -07:00
Kangping 874b6beca8 [border-agent] fix BorderAgentId compile and enable it in CI tests (#9030) 2023-05-08 09:09:46 -07:00
Yakun Xu 30b79ccee8 [test] migrate tests to cmake (#8929)
This commit migrate tests not targeting autotool to cmake.

* removed openthread-test-driver
* removed functional tests from autotool based check
* corrected file permission of python scripts
* added --run-directory to specify directory to collect logs and captures
* get test-ot-test-srp-server pass on POSIX platform
2023-05-04 09:59:24 -07:00
Abtin Keshavarzian 0f94f26a20 [net-diag] introduce Server and Client classes (#8936)
This commit introduces `Server` and `Client` classes breaking the
`NetworkDiagnostic` module into two components. The `Server` responds
to queries and requests (handling Net Diag TMF commands), while
`Client` issues queries/requests and processes responses. The
`Server` is available under both FTD and MTD (which follows the
requirement of Thread spec). The client is enabled using newly added
`OPENTHREAD_CONFIG_TMF_NETDIAG_CLIENT_ENABLE` config option which is
also available as `OT_NETDIAG_CLIENT` CMake option or the autoconf
build switch `NETDIAG_CLIENT`. The client functionality is by default
enabled on Border Routers (tied to `CONFIG_BORDER_ROUTING_ENABLE`
config).

The previous `TMF_NETWORK_DIAG_MTD_ENABLE` config is now removed
along with its CMake `OT_MTD_NETDIAG` and autoconf switch. This
commit adds checks to trigger build error if the previous config
and/or its related CMake option are used.
2023-04-07 15:58:07 -07:00
Przemysław Bida 89d5799d76 [dns] implement DNS query over TCP (#8474)
This commit introduces DNS query over TCP protocol.
2023-03-17 09:44:26 -07:00
Abtin Keshavarzian 091f68ed70 [child-supervision] mechanism to inform interval from child to parent (#7993)
This commit contains changes to child supervision feature. It adds a
new mechanism for a child to inform its desired supervision interval
to its parent. A new optional MLE TLV is added with type 27 and value
of `uint16_t` indicating the supervision interval in seconds. This
TLV is included in MLE Child ID Request and MLE Child Update Request
(sent from the child). The parent echoes back this TLV in the
corresponding responses to indicate that it supports supervision. This
commit changes the parent implementation to track the supervision
interval per child.

This commit also updates the OT public APIs along with the related
CLI commands:
- API now allows the supervision interval to be set on a child.
- New field in `otChildInfo` to indicate the child's supervision
  interval.
- New counter is added to track the number of supervision check
  timeouts failures on a child (intended for testing and debugging).

This commit adds a test `test_child_supervision` to cover behavior of
child supervision and its new behaviors.

This change allows backward compatibility: If the parent does not
support child supervision, it ignores the new TLV in the MLE messages
and the child would fall back to periodically exchanging MLE Child
Update Request with parent. If the child does not support supervision
and/or does not indicate its desired child supervision interval, the
parent will fall back to use the configured default interval.
2023-02-28 23:01:43 -08:00
Yakun Xu 6e6a2ae145 [ncp] remove legacy network support (#8723)
This commit removes legacy network support as it's not used anymore.
2023-02-08 22:36:53 -08:00
Jonathan Hui 48c0582e4e [shellcheck] fix SC2155 warning (#8490)
Declare and assign separately to avoid masking return values.
2022-12-07 16:23:20 -08:00
Yakun Xu 74cc79d7a2 [cmake-build] allow specify multiple targets (#8264)
This commit allows using OT_CMAKE_NINJA_TARGET to specify multiple
targets.
2022-10-12 13:09:04 -07:00
Jonathan Hui 2cab708443 [cc2538] move to openthread/ot-cc2538 (#8169) 2022-09-16 09:03:28 -07:00
Yakun Xu f113eb4b71 [script] support cmake-build in different dir (#7344)
This commit allows calling this cmake-build script from a different
directory. Currently it only supports root of OpenThread source.
2022-01-23 22:12:22 -08:00
Abtin Keshavarzian 95fa6220d7 [tmf] add AnycastLocator module (#6513)
This commit adds a new class `AnycastLocator` which can be used to
locate the closest destination of an anycast IPv6 address (i.e., find
the related mesh local EID and RLOC16). The closest destination is
determined based on the the current routing table and path costs
within the Thread mesh.

The implementation uses a CoAP confirmable post request to a newly
added URI path ("a/yl"). The destination IPv6 address of such as
request message is set to the anycast address to be located. The
receiver of the request message sends a CoAP response which includes
the "Mesh Local EID"  and "Thread RLOC16" TLVs.

This commit also adds support this new feature in CLI (adding a new
`locate <anycast-addr>` command).

Finally this commit adds `test_anycast_locator.py` to test behavior of
the new feature.
2021-09-17 08:04:44 -07:00
Abtin Keshavarzian ca3830fac2 [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).
2021-09-02 13:44:40 -07:00
Abtin Keshavarzian 2798cc9c05 [utils] adding HistoryTracker module (#6807)
This commit adds History Tracker feature and its CLI support. This
feature records history of different events as the Thread network
operates (e.g., history of RX and TX IPv6 messages or network info
changes).

Recorded entries are timestamped. When the history list is read, the
timestamps are given as the entry age relative to the time the list
is being read. For example in CLI a timestamp can be shown as
`02:31:50.628 ago` indicating the entry was recorded 2 hours, 31 min,
50 sec, and 628 msec ago. Number of days is added for events that are
older than 24 hours, e.g., `31 days 03:00:23.931 ago`. Timestamps use
millisecond accuracy and are tacked up to 49 days. If an event is
older than 49 days, the entry is still tracked in the list but the
timestamp is shown as old or `more than 49 days ago`.

The `HistoryTracker` currently maintains 3 lists. The Network Info
history tracks changes to Device Role, Mode, RLOC16 and Partition ID.
The RX/TX history list records information about the received/sent
IPv6 messages:
- Message type (UDP, TCP, ICMP6 (and its subtype), etc.)
- Source and destination IPv6 addresses and port numbers
- IPv6 payload length
- The message checksum (for UDP, TCP, or ICMP6).
- Whether or not the link-layer security was used
- Message priority: low, norm, high, net (for control messages)
- Short address (RLOC16) of neighbor who send/received the msg
- Received Signal Strength (in dBm) for RX only
- Radio link info (15.4/TREL) on which msg was sent/received
  (useful when `OPENTHREAD_CONFIG_MULTI_RADIO` is enabled)

Config `HISTORY_TRACKER_EXCLUDE_THREAD_CONTROL_MESSAGES` can be used
to configure `HistoryTracker` to exclude Thread Control message
(e.g., MLE, TMF) from TX and RX history.

The number of entries recorded for each history list is configurable
through a set of OpenThread config options, e.g., number of entries
in Network Info history list is specified by OpenThread config option
`OPENTHREAD_CONFIG_HISTORY_TRACKER_NET_INFO_LIST_SIZE`. The
`HistoryTracker` will keep the most recent entries overwriting oldest
ones when the list gets full.

This commit also adds support for `HistoryTracker` in CLI. The CLI
commands provide two style for printing the history information: A
table format (more human-readable) and list style (better suited for
parsing by machine/code). `README_HISTORY.md` is added to document
the commands and the info provided by each history list entry.

This commit also adds `test_history_tracker.py` test-case which
covers the behavior of `HistoryTracker`.
2021-08-12 15:47:26 -07:00
Abtin Keshavarzian 2e625bfe39 [netdata] adding NetworkData::Publisher (#6768)
This commit implements a new feature "Network Data Publisher" which
provides mechanisms to limit the number of similar entries (service
and/or prefix) in the Thread Network Data by monitoring the Network
Data and managing if or when to add or remove entries. This feature is
enabled using `OPENTHREAD_CONFIG_NETDATA_PUBLISHER_ENABLE` config, or
`NETDATA_PUBLISHER` in autoconf, or `OT_NETDATA_PUBLISHER` cmake
option.

This commit adds support for publishing DNS/SRP anycast/unicast
service, on-mesh prefix, and external route prefix entries.

When there is a request to publish an entry, the `Publisher` monitors
the Network Data and counts the number of similar entries. If there
are fewer entries than a desired target number, the entry is added
after a short random delay.

If there are too many similar entries, `Publisher` starts the process
of removing its own entry (again after some random wait time). When
removing entries, certain entries are preferred over others (e.g., an
entry from a router over one from an end-device or if they are from
the same type of node, the one with smaller RLOC16). If `Publisher`
determines that its own entry is a preferred one, it adds an extra
wait time before removing its entry. This gives higher chance for a
non-preferred entry from another device to be removed before removing
a preferred entry which helps towards quicker convergence of the
process to the desired number of entries.

On-mesh prefix and external route entries have a "preference" field.
When publishing such an entry, a matching entry in the network data is
counted only if its preference is same or higher than the entry's
preference. This ensures that a device with a higher preference entry
publishes its entry even when there are many lower preference similar
entries in the network data (potentially causing a lower preference
entry to be removed).

This commit also adds `test_netdata_publisher.py` to verify the
behavior of the `Publisher`.
2021-08-10 22:32:33 -07:00
Jonathan Hui 550c2056de [nrf528xx] move to openthread/ot-nrf528xx (#6585) 2021-05-11 16:53:13 -07:00
Jonathan Hui 5078323d35 [efr32] move to openthread/ot-efr32 (#6403) 2021-05-06 14:28:28 -07:00
Yakun Xu 3fa6fd7b52 [cmake] export compile commands (#6451)
This commit adds the option CMAKE_EXPORT_COMPILE_COMMANDS=ON to export
compile commands which is helpful for editors/IDEs.
2021-04-15 13:36:08 -07:00
Jonathan Hui fa99680f02 [mesh-forwarder] add support for Neighbor Discovery Agent Anycast (#6423) 2021-04-13 21:12:41 -07:00
Jonathan Hui b7751460e0 [cc2650] remove example platform (#6398) 2021-04-02 18:50:37 -07:00
Jonathan Hui e360c63779 [cc13x2-cc26x2] move to openthread/ot-cc13x2-cc26x2 (#6389) 2021-04-02 08:37:37 -07:00
Jonathan Hui 5b5a3f6d9e [kw41z] move to openthread/ot-kw41z (#6386) 2021-04-01 08:12:12 -07:00
Jonathan Hui 71097eeb0f [qorvo] move to openthread/ot-qorvo (#6382) 2021-03-31 16:30:07 -07:00
Jonathan Hui f81eebeb48 [samr21] move to openthread/ot-samr21 (#6369) 2021-03-30 21:59:21 -07:00
Mason Tran 7b3c2ae66b [efr32] add CMake support (#6302)
This commit adds CMake support for the efr32 platforms and Silicon
Labs gecko_sdk_suite. It also adds the option to build the efr32
sleepy-demo apps.

Other changes:
- jlinkrtt: remove NordicSemi specific options/definitions/includes
  from default build
- Remove old include dirs that don't exist anymore from efr32 automake
  files
2021-03-19 16:06:54 -07:00
Abtin Keshavarzian 06ca5d855c [utils] add 'Utils::PingSender' (#6284)
This commit adds a new module `Utils::PingSender`. This module
is then used by CLI to support ping command.
2021-03-19 16:04:55 -07:00
nikita-s-wrk a67c42811c [examples] add cmake for gp712, qpg6100, qpg7015m (#6238) 2021-03-11 09:59:44 -08:00
Łukasz Maciejończyk 8bbbe194f1 [cmake] add support for nrf528xx (#6109) 2021-01-27 13:29:49 -08:00
Aurelio Schellenbaum 02d6d49a5e [coap] add CoAP(s) block-wise transfer support to CoAP(s) client and server (#4247)
Implemented CoAP/-s block-wise transfer according to RFC 7959. The
implementation includes methods and functions available to the
application layer to add Block1 and Block2 option values to a coap
message and an automatic block-wise transfer enabled by the compile
switch "COAP_BLOCK".
2021-01-26 13:27:32 -08:00
Abtin Keshavarzian 966baf5e6b [net] SRP client implementation (#6038)
This commit adds support for SRP (Service Registration Protocol)
client in OpenThread. The implementation allows a user to provide host
info (host name and a list of host IPv6 addresses) along with a list
of services to be registered with an SRP server. Services and/or host
addresses can be added or removed during operation of client.

Users can get the list of services and host info and their current
state (indicating, for example, if service is registered with server,
being registered or being removed, etc). Users can also provide a
callback to get notified whenever there is change or an error.

When there is a new request (e.g., a new service is added/removed)
that requires an update, the SRP client will wait for a short delay
before preparing and sending an SRP update message to server. This
allows user to provide more changes that are then all sent in the same
update message. The implementation handles retries in case of
different errors and failures. An exponentially increasing retry wait
interval (with configurable min, max, and growth factor) is
implemented.

The implementation also manages the lease renew time for each service
and refreshes (re-registers) services with server before lease is
expired. It supports "opportunistic early refresh" mechanism such that
when sending an SRP update, the services that are not yet expired but
are close, are allowed to refresh early and are included in the SRP
update. This helps place more services on the same lease refresh
schedule reducing number of messages sent to the SRP server. This
behavior (whether to allow early refresh or not, and its related
parameters) can be controlled through a set of OT config definitions.
2021-01-22 13:19:21 -08:00
Moandor 9d9646afaa [spinel] RCP restoration on failures (#5694)
This commit implements the RCP restoration on failure feature. It
keeps the host process running while resetting and initializing the
RCP.
2020-11-26 08:57:13 -08:00
Abtin Keshavarzian 1cac116526 [utils] adding 'DatasetUpdater' (#5807)
This commit adds a new module `DatasetUpdater` which provides
easy-to-use APIs for user to request an update to any component (a
subset of components) in Operational Dataset of the Thread network.
The change can be requested from any node in the network. The
implementation uses `MGMT_PENDING_SET` command and takes care of
preparing the Pending Dataset and updating timestamps and monitoring
for the Dataset to be updated and possibly retrying. It reports the
outcome (success or failure status) back to the user in a callback.

This commit also updates the `ChannelManager` module is to use the
`DatasetUpdater` to change the channel.
2020-11-23 16:27:54 -08:00
Yakun Xu d1981e04ae [cmake] no target_link_options in cmake 3.10 (#5706) 2020-10-27 09:00:02 -07:00
kangping 3de6b9a86a [build] fix warning of clearing non-trivial type (#5710) 2020-10-27 08:10:56 -07:00
Yakun Xu 9cfe25993a [cmake] use init flags in toolchain files (#5705)
From https://cmake.org/cmake/help/v3.10/variable/CMAKE_LANG_FLAGS_INIT.html,
`CMAKE_<LANG>_FLAGS_INIT` should be used instead of `CMAKE_<LANG>_FLAGS' in
toolchain files so that CMake can prepend or append content based on the
environment or target platform.
2020-10-26 08:24:45 -07:00
Abtin Keshavarzian d98f935131 [cmake-build] ensure cc2538 uses 'CMAKE_BUILD_TYPE=Release' (#5669)
This change ensures the cc2538 cmake build uses the release build type
and the compile option `-Os` (optimize for size). This harmonizes the
cmake build with automake version. It also helps address an issue with
recent PRs failing on cc2538 cmake build with arm-gcc-5 due to
reaching flash size limit (without `-Os` option).
2020-10-19 21:54:45 -07:00
Zhanglong Xia c5aff31327 [cmake] add a cmake build script to build OpenThread (#4969)
This commit adds a bash script to compile the platform that supports
cmake.

Usage examples:
    ./script/cmake-build cc1352
    ./script/cmake-build posix -DOT_MAC_FILTER=ON
2020-05-29 08:33:50 -07:00