Commit Graph

402 Commits

Author SHA1 Message Date
Przemysław Bida bfcfc3f2b8 [tcat] add TCAT advertisement parsing in client (#10863)
Commit adds TCAT advertisement pars and display during scan operation
perormed in python client.
2024-11-20 18:49:28 -08:00
Zhanglong Xia cc8f078586 [test] test whether the RCP supports tx/rx 154 frames of all formats (#10912)
This commit add a command `--frame-format` to the `cp-caps` to test
whether the RCP supports sending and receiving 802.15.4 frames of all
formats.
2024-11-13 10:46:53 -08:00
Zhanglong Xia 0fb1c22d24 [otci] add the parameter wakeup channel to the method create_dataset (#10898)
The parameters of the method dataset_set_buffer() has been updated, but the
method create_dataset() still use previous defination of dataset_set_buffer().
It causes the crash when calling the method create_dataset().
2024-11-07 10:24:15 +01:00
Jakub Uliarczyk 68c78d357e [tcat] feat: extend dataset hex command (#10831)
This commit extends the 'dataset hex' command in the bbtc.py script by
allowing dataset TLVs to be set using a hex-encoded format.

Till now the 'dataset hex' command was only printing the
'ThreadDataset' object values in hex-encoded format, there was no
functionality to set the TLVs using hex-encoded format.

The 'dataset hex' command has been modified so the user can pass
dataset TLVs in hex-encoded format as an argument to this
command. This enables the script to set desired dataset TLVs in one
command, instead of calling dataset commands individually.

Example usage: 'dataset hex <hex-encoded TLVs>'
2024-10-14 11:06:16 -07:00
Jakub Uliarczyk ed14eb19bd [tcat] feat: add dataset clear command (#10812)
Added 'clear' command to the 'dataset' command tree. This allows to
remove all entries in the 'ThreadDataset' object used by the script to
store the dataset values.

The reason behind this feature is that in the current implementation
of the script, the 'ThreadDataset' object entries are always
initialized by 'initial_dataset' when running the script.

No command allows to clear/remove the particular entry, which makes
this script unable to send an active dataset to the target device
without specific dataset values(custom dataset).

To make this possible, the 'clear' command has been added to the
'dataset' command tree, which removes all entries from the
'ThreadDataset' object and, by using existing commands, sets the
desired entries in the 'ThreadDataset' object from scratch.

This enables the script to send custom active dataset values to the
target device.
2024-10-10 21:48:26 -07:00
Jakub Uliarczyk 52d3f49ffe [tcat] feat: add 'adapter' argument and use 'BLEDevice' for scanning (#10657)
Added '-a', '--adapter' arguments to the bbtc.py arguments
parser. This allows the selection of the HCI adapter for the scanning
procedure.

According to 'Bleak' documentation of the 'BleakClient'
class(https://bleak.readthedocs.io/en/latest/api/client.html#bleakclient-class),
it's better to use the 'BLEDevice' object in 'BleakClient' during the
object instantiation, therefore it has been changed for the scanning
2024-10-07 08:55:20 -07:00
Przemysław Bida 213665cce0 [tcat] implementation of TCAT general class commands (#10700)
Commit introduces implementation of missing general class commands:
- PresentPskdHash
- PresentPskcHash
- PresentInstallCodeHash
- RequestRandomNumChallenge
- RequestPskdHash

Also include minor fixes in Tcat python client and refactoring of expect
tests for tcat.
2024-10-02 11:10:16 -07:00
Eduardo Montoya 596c5aa6a2 [dataset] add support for wake-up channel (#10736)
- Add Wake-up Channel TLV to the dataset.
- Add CLI support to handle the wake-up channel.
- Add MAC support for wake-up channel (to be used for sending
  and receiving wake-up frames).
2024-09-26 14:01:46 -07:00
Jonathan Hui c182933979 [doxygen] remove empty line at end of block (#10748) 2024-09-24 09:51:34 -07:00
Zhanglong Xia c0b5a54e10 [test] add version command to cp-caps (#10734)
This commit adds a version command to cp-caps to get the current version.
And we release the current version of cp-caps as 0.1.0.
2024-09-24 08:05:04 -07:00
Yakun Xu ba3bce2b62 [otci] update package info (#10706) 2024-09-18 08:11:02 -07:00
Esko Dijk 4459c54069 [tcat][ble] fixes to connection state mgmt and Disconnect cmd (#10619)
- Fixes to connection state management and handling of Disconnect
  command TLV
  - specifically, this now ensures that TCAT remains on (started)
    after a commissioner disconnects. Earlier, there was the problem
    that the 2nd commissioner couldn't connect anymore.
  - specifically, in ble_secure.cpp the check for if
    (mTcatAgent.IsEnabled()) is removed, since the err =
    mTcatAgent.Connected(mTls) will already check this and raise an
    error if not enabled. If not enabled, the Device is in a wrong
    state to handle TCAT Commissioner commands so now it closes the
    connection right away. That's better than to leave the
    Commissioner in limbo on the TLS connection. The Commissioner can
    now retry again and all will be well again.
- timeout of at most 10 seconds on UDP write operation in simulation
  mode (if longer, the TCAT device isn't reachable and the
  Commissioner now shows the error to the user.) Earlier, it got stuck
  forever.
- Corrects some copy/paste errors in API definitions in comments; adds
  comments where needed to explain.
  - adds whitespace at some places to align format with rest of code
- improved some of the --debug output for the UDP simulation mode of
  the TCAT Commissioner.
2024-09-05 19:59:39 -07:00
Przemyslaw Bida db6393251a [tcat] Add timeout while connecting over BLE. (#10597)
Adding timeout while handling ble connection establishement in TCAT.
2024-09-04 07:49:33 -07:00
Przemyslaw Bida 12cf1207d2 [tcat] Fix handling certificate path in tcat client. (#10597)
Commit fixes propagation of certificate path from `cert-path` option
to `scan` command.
2024-09-04 07:49:33 -07:00
Przemysław Bida 8a0ea2b692 [tcat] implement new tcat General commands (#10526)
New General TLV's implemented:
- Get network name
- Get device id
- Get ext pan ID
- get provisioning URL
2024-08-21 19:21:10 -07:00
Zhanglong Xia df757ba0cf [test] test whether the RCP supports the Link Metrics (#10592)
This commit adds a test case to `cp-tests` to test whether the RCP
supports the Link Metrics.
2024-08-09 16:50:42 -06:00
Zhanglong Xia cc16fc2d67 [otci] add link metrics commands to otci (#10580) 2024-08-07 21:08:33 -06:00
Zhanglong Xia fba922ebe2 [test] test the Thread network 1 hop throughput (#10552)
This commit adds a test case to the `cp-tests` to test the Thread network 1 hop
throughput.
2024-08-01 08:27:35 -07:00
Zhanglong Xia 70969285f9 [otci] add iperf3 commands support to otci (#10519)
This commit adds the iperf3 commands to `otci` for testing Thread
network throughput.
2024-07-26 10:44:22 -07:00
Zhanglong Xia 20c9bcbc41 [test] test whether the RCP supports data poll (#10494)
This commit adds a test case to the `cp-tests` to test whether the RCP
supports data poll transmitter and receiver.
2024-07-12 08:59:28 -07:00
Zhanglong Xia fbb715baa7 [test] test whether the RCP support CSL transmitter (#10495)
This commit adds a test case to `cp-tests` to test whether the RCP
supports the CSL transmitter.
2024-07-11 10:37:15 -07:00
Przemysław Bida bf5ddb908e [tcat] implementation of tcat Ping command (#10484)
Commit implements Tcat ping command `kTlvPing`.

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2024-07-09 10:11:39 -07:00
Zhanglong Xia b6d46327f4 [otci] add network management API to otci (#10482)
This commit adds high level Thread network management API
'create_dataset()', 'join()', 'leave()' and 'wait_for()' to otci.
2024-07-08 14:58:38 -07:00
Zhanglong Xia 71dd8a2d3a [test] add script to test which diag commands RCP supports (#10463)
This commit implements a test script tools/cp-caps/rcp_caps_test.py to
test which diag commands RCP supports using the DUT and reference
device.
2024-07-05 09:56:41 -07:00
Przemysław Bida 6aa6f45606 [tcat] implement decommissioning in tcat_agent (#10415)
Commits adds handling of TCAT TLV 0x60 `kTlvDecommission`.
2024-07-01 19:14:53 -07:00
Zhanglong Xia 34484f4293 [otci] add diag commands support to otci (#10450) 2024-07-01 08:13:38 -07:00
Zhanglong Xia 3345af0780 [otci] fix the setDaemon() is deprecated warning (#10409)
The otci reports warning `DeprecationWarning: setDaemon() is
deprecated, set the daemon attribute instead`.  This commit updates
the otci to fix this warning.
2024-06-19 16:41:09 -07:00
Zhanglong Xia 4978e58e5c [otci] add ADB USB connection support for OTCI (#10406) 2024-06-19 16:40:17 -07:00
Konrad Derda 8a8a4d8e31 [netif] remove multicast promiscuous mode configuration (#10338)
Since 74c833b623 was introduced all IPv6
multicast packets are passed to the host. Previously used promiscuous
mode configuration is now unused. This commit removes the dead code and
corresponding elements as there is no use case for them at the moment
(and they can confuse a user).

Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
2024-06-14 10:08:44 -07:00
Esko Dijk 3873c6fcd5 [tcat] add TCAT Commissioner / Device certs for Thread certification testing (#10211) 2024-06-06 11:27:44 -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
Maciej Baczmański 33574ad417 [tools] add missing tcat ble client files (#9857)
Some files were missing during repo migration, this commit adds them.

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
Co-authored-by: Piotr Jasinski <piotr.jasinski990@gmail.com>
Co-authored-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2024-02-16 11:12:57 -08:00
dependabot[bot] f94f824988 Bump grpcio from 1.53.0 to 1.53.2 in /tools/harness-simulation/harness (#9842)
Bumps [grpcio](https://github.com/grpc/grpc) from 1.53.0 to 1.53.2.
- [Release notes](https://github.com/grpc/grpc/releases)
- [Changelog](https://github.com/grpc/grpc/blob/master/doc/grpc_release_schedule.md)
- [Commits](https://github.com/grpc/grpc/compare/v1.53.0...v1.53.2)

---
updated-dependencies:
- dependency-name: grpcio
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-12 08:57:11 -08:00
Piotr Jasinski 905a22e0c7 [tools] add tcat ble client (#9739)
Adds TCAT client implementation for BLE transport.

Signed-off-by: Piotr Jasinski <piotr.jasinski990@gmail.com>
Co-authored-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2024-02-07 13:13:12 -08:00
Abtin Keshavarzian b28bb1d1e0 [srp] update config for auto-start mode to be enabled by default (#9738)
Config `OPENTHREAD_CONFIG_SRP_CLIENT_AUTO_START_DEFAULT_MODE` is
changed to use `1` by default (unless explicitly overridden in
project configs).

It also updates related test scripts to utilize auto-start mode or
explicitly disable it for manual SRP client control, reflecting this
default change.
2024-01-10 10:37:03 -08:00
Abtin Keshavarzian 28f30b3ce8 [nedata] add API to retrieve Commissioning Dataset (#9551)
This commit adds `otNetDataGetCommissioningDataset()` as a public
API to retrieve the Commissioning Dataset from the Network Data.

It also updates CLI `netdata show` command to output the Commissioning
Dataset information. The documentation in `README_NETDATA.md` and
in `cli_network_data` are also updated. The test scripts that parse
`netdata show` output are also updated.
2023-10-23 05:17:51 -07:00
Maciej Baczmański dc97b87376 [thci] fix for ncs thci issues (#9328)
After recent reference device release, two THCI issues
have been found.

This commit adds `"` around command arguments that have
escapable characters (like `ot networkname aa\ bb`),
and skips lines containing only ANSI escape codes
in commissioning logs.

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2023-07-31 10:18:08 -07:00
Abtin Keshavarzian 5fc0e7774c [csl] update CSL public APIs to use microseconds unit for period (#9285)
This commit updates public APIs for getting and setting CSL period to
use microseconds unit instead of the internal ten symbols unit. This
makes the APIs easier to use.

The CSL APIs have been renamed to follow the `otLinkGet/SetCsl{Item}()`
pattern, which is the common naming style of OpenThread. This
renaming will make the APIs more consistent and avoid potential
confusion with the now-removed APIs, which used a different unit for
CSL period.

This commit also updates the related CLI CSL commands:
- The `csl period` expects the given period to be in microseconds.
- The `csl` command (which outputs all CSL parameter) shows the CSL
  period in microsecond unit (e.g., "Period: 160000us").

The NCP spinel `SPINEL_PROP_THREAD_CSL_PERIOD` is also updated to use
microsecond unit for CSL period.

The related test script are updated to use the new unit, in particular
the test harness `setCSLperiod()` in `harness-thci/OpenThread.py` is
updated (no need to convert from msec).
2023-07-19 13:21:29 -07:00
dependabot[bot] 6fe8b6f380 Bump grpcio from 1.20.1 to 1.53.0 in /tools/harness-simulation/harness (#9257)
Bumps [grpcio](https://github.com/grpc/grpc) from 1.20.1 to 1.53.0.
- [Release notes](https://github.com/grpc/grpc/releases)
- [Changelog](https://github.com/grpc/grpc/blob/master/doc/grpc_release_schedule.md)
- [Commits](https://github.com/grpc/grpc/compare/v1.20.1...v1.53.0)

---
updated-dependencies:
- dependency-name: grpcio
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-06 20:27:18 -07:00
Abtin Keshavarzian ef8deb506f [mle] delay router role downgrade on security policy change (#9187)
This commit adds a mechanism to delay the downgrade of routers or
leader when the security policy TLV changes in the Active Operational
Dataset such that the device is no longer eligible to act as a
router.

If the decision to become a child is made due to a security policy
change, the device first delays a random period up to the "router
selection jitter" before downgrading. If the device is the leader, an
additional fixed delay of 10 seconds is added to the random period.

If the security policy changes again while the device is waiting to
downgrade such that it becomes router-eligible again, the downgrade
is cancelled and the device remains in its current role.

This commit adds a `test_router_downgrade_on_sec_policy_change` to
validate the behavior of newly added mechanism.

This commit also updates the CLI `dataset` sub-commands to allow
getting and setting the "version threshold for routing" (VR) field in
security policy.
2023-06-30 15:09:50 -07:00
Yakun Xu 11a38a63de [build] remove autotools (#9027)
This commit removes autotools support from OpenThread project.
2023-06-28 08:54:23 -07:00
Jonathan Hui dad7754752 [otci] properly configure operational dataset (#9190) 2023-06-21 10:44:42 -07:00
Przemysław Bida 5ffdab8302 [thci] revert spellcheck in THCI method names (#9175)
Reverting name change intialize -> initalize. To fix thread harness
issues.
2023-06-16 10:12:44 -07:00
Jonathan Hui 73ce42c6e6 [docs] remove redundant "This method" and "This function" (#9096)
- "This method "
- "This static method "
- "This function "
- "This structure "
- "This enumeration "
- "This class "
- "This methods "
- "This constructor "
- "This struct "
- "This type "
- "This template method "
- "This template class "
- "This const method "
- "This macro "
2023-05-29 10:11:10 -07:00
Zhanglong Xia f64b7cc73c [test] add code spell check and correct wrong spelling (#9066) 2023-05-22 18:04:09 -07:00
Yakun Xu 674cbfaa5c [otci] fix some style issues (#8996)
This commit fixes some style issues of otci. Also includes some minor
changes:
* added pytype check in otci
* exported `OTCommandHandler`
2023-04-27 20:05:02 -07:00
Abtin Keshavarzian af031f3b50 [netdata] new API to get lowpan context IDs (#8870)
This commit adds `otNetDataGetNextLowpanContextInfo()` to iterate
through the list of LoWPAN Context entries in Thread Network Data
providing info about the prefix, its LoWPAN Context ID and Compress
flag (relating to `ContextTlv` sub-TLVs of `PrefixTlv`s in Network
Data).

This commit also updates CLI command `netdata show` to list the
context IDs in addition to prefixes, routes, and services.
2023-03-17 21:39:59 -07:00
Abtin Keshavarzian 2caa934410 [routing-manager] new APIs to get state and new CLI commands (#8784)
This commit adds new public OT APIs in `border_routing.h` to get the
current state of `RoutingManager` and to get the current favored
on-link prefix.

This commit also updates CLI `br` commands:
- It moves the CLI `br` implementation into own `cli_br` module.
- It adds `br state` to get the current state
- It changes `br omrprefix`, `br onlinkprefix`, and `br nat64prefix`
  to output both local and favored prefixes when no additional arg
  is provided and allow the use of `local` or `favored` extra arg to
  specify the type.
- It updates the documentation of `br` related commands in the source
  code and also adding `cli/README_BR.md`.
2023-02-27 19:03:29 -08:00
Jiachen Dong 242c7cc7c3 [harness-simulation] keep capture files in sync at runtime (#8138)
This commit keeps capture files in sync at runtime. Therefore, Harness
can obtain the addresses directly from the capture files in manual DUT
mode without having to enter the addresses manually.
2023-02-14 19:08:02 -08:00
Zhanglong Xia 8b59f4d31e [posix] add power calibration support (#8293)
The actual output power of the Thread device may be determined by both
the Thread radio chip and the FEM. Consider the output power error of
the Thread radio chip and the gain error of the FEM, the actual output
power is inconsistent with the expected output power.  To guarantee
that the actual output power is accurate and meet the regulatory
requirements, the output power should be calibrated in the factory if
the output power is not accurate.

This commit contains the following changes:

- Adds a power calibration implementation
- Adds a config file to configure the target power for different
  countries
- Adds a tool for the factory to persist the power calibration data
2022-12-21 10:15:48 -08:00