Commit Graph

429 Commits

Author SHA1 Message Date
arnulfrupp bb5585d412 [tcat] add tcat implementations and bug fixes (#11402)
Commit adds check if commissioning is possible and if the tcat device is already commissioned.
Adds advertisement update on disconnected and role change.
Fixes key handling for key references.
Fixes the authorization processing.
Implements recent changes of the application TLVs.
2025-07-30 12:27:10 -07:00
Yakun Xu 38cfb2fddc [cert-test] support parsing multiple keys (#11618) 2025-06-30 08:48:40 -07:00
Yakun Xu 41320dc809 [license] fix typo (#11608) 2025-06-18 23:09:47 +09:00
Yakun Xu 6191d3b139 [otci] support reliable transport (#11575)
This commit adds reliable transport in OTCI and switch the OTCI tests to
use the reliable simulation transport.
2025-06-06 09:11:34 -07:00
Yakun Xu 2ae5522bed [style] avoid deprecated setDaemon (#11565) 2025-06-03 22:33:17 -07:00
Jason Zhang de8974aca4 [docs] add guide on using python venv for cp-caps test (#11520)
Added comprehensive Python virtual environment setup guide to the
cp-caps README.md file.

This includes detailed sections for creation, activation, dependency
installation, and deactivation of virtual environments to help users
properly set up their testing environment and avoid package conflicts.
2025-05-23 09:52:38 -07:00
Thomas f42af4e2ee [otci] add support for IPv4, vendor commands, networkdiagnostics (#11397)
With Thread 1.4 the cli application not can also (dns) resolve
IPv4 addresses. This commit adds the same support in otci

* dns_resolve4

Implements support for vendor operations in otci get/set

* vendor_name
* vendor_model
* vendor_sw_version

Implements network diagnostic commands

* get
* reset
* non_preferred_channels

Various other (small changes)"

* allow setting read timeout on serial connections
* allow replacing read routine filter
* expose latest thread versions in the public module api
* expand the definition of dns_get_config
* replaces mgmtget/mgmtset with the correct mgmtgetcommand and mgmtsetcommand
* replaces addressmode with the correct addrmode
* adds an `ignore_result` option to `execute_command`
* adds a missing `diag` command
* removes some unexisting getters
2025-04-21 14:49:58 -07:00
arnulfrupp d9d5b2e2c6 [tcat] implement get diagnostic tlvs in command class commissioning (#11163)
Adds implementation of Tcat TLV 0x26 Get Diagnostic TLVs.
It also adds support for long BleSecure messages >1280 bytes in BleSecure::Flush(void).
2025-04-14 09:22:58 -06:00
Kamil Kasperczyk 52ebf6f821 [cp-caps] replace nrfjprog with nrfutil in docs (#11356)
Nrfjprog is not longer recommended and was replaced
by the nrfutil. Replaced documentation occurrences mentioning
nrfjprog with nrfutil.
2025-03-24 08:47:21 -07:00
Thomas ba6a803ed5 [otci] update to support more commands (#11015)
* otci now supports all commands the Thread Test Harness requires
* improve typehinting across the board
* fixes some typos
2025-03-18 22:53:22 -05:00
Zhanglong Xia aee0ba47e8 [cp-caps] use unittest to refactor the cp-caps test (#11213)
This commit refactors the cp-caps test as follows:
1. uses the unittest framework to refactor the cp-caps.
2. all tests are sorted alphabetically
3. all test names are changed to long names.
2025-02-18 08:28:06 -08:00
Zhanglong Xia a516a86209 [tests] do not retry when failed to receive specified number of frames (#11229)
When running the command `diag receive 1 rlp`, the DUT may fail to
receive the frame, then the otci will try the command again and
again. These retries are useless, and they will take lots of time
before timeout.

This commit sets the number of retry to 0 before executing the
command, and restore the number of retry after the command is
executed. This commit also captures the timeout exception from the
adb_shell.
2025-02-12 10:23:37 -08:00
Jason Zhang f7080a9343 [otci] normalize ADB shell output for consistent line splitting (#11231)
This commit adds compatibility to support these kinds of devices, so
that the shell() function can always return expected split lines in
list.
2025-02-11 07:51:47 -08:00
Zhanglong Xia 5d2d77e74e [cp-caps] test the mTxInfo of the radio frame (#11169) 2025-01-22 13:52:52 -08:00
Przemysław Bida 4d6def38a5 [tcat] implement extraction of active dataset and commissioner cert (#10991)
Commit adds implementation of:
	- 0x40 Tcat tlv extraction of active dataset,
	- 0x25 Tcat tlv extraction of commissioner certificate.

Includes also refactoring of `BleCommand` adds new method `process_response`.
This simplifies:
- `GetPskdHash`
- `GetRandomNumberChallenge`
2025-01-21 08:43:19 -08:00
Zhanglong Xia 09bdd1893e [cp-caps] compare the send and received frames (#11162)
The original code counts the number of received frames to check
whether the specified frame format is supported. It doesn't check
whether the sent and the received frames are the same. The test
results may have some deviation.

This commit compares the sent and received frame to check whether the
specified frame format is supported. This commit also add a case to
test the wake-up frame format.
2025-01-15 13:56:42 -08:00
Zhanglong Xia 0e16655211 [otci] add adb key support for adb interface (#11149)
This commit adds an option for users to set the adb key when connecting
devices via the adb interface.
2025-01-10 09:39:18 -08:00
Maciej Baczmański d7a266856f [diag] handle errors of TransmitPacket() (#11076)
`TransmitPacket()` should return an error from platform Radio
implementation, as for example Radio can be in incorrect state.

If error occurs, increase `mSentErrorInvalidStatePackets` stat.

Add wrong state case to tests and fix `diag repeat stop` called
too lata.

Signed-off-by: Maciej Baczmanski <maciej.baczmanski@nordicsemi.no>
2025-01-09 10:47:40 -08:00
Zhanglong Xia 70d315af23 [diag] add diag send async command support (#11111)
The original `diag send` command is an asynchronous command. Users
must wait for a certain period of time and then run the `diag stats`
command to query how many packets have been sent to know whether all
packets have been sent. This is very inefficient, and it is not
convenient for scripts to process this command.

This commit changes the command `diag send` from an asynchronous
command to a synchronous command, and add the asynchronous command
`diag send async`.
2025-01-08 11:21:13 -08:00
Jakub Uliarczyk 9942b98a4a [tcat] add tlv command tree (#11077)
This commit adds 'tlv' command tree to the BBTC CLI.
The 'tlv' command has two subcommands: 'list' and 'send'.
The 'tlv list' prints available TLVs types that can be used in the 'send' subcommand.
The 'tlv send <TLV_TYPE> <TLV_PAYLOAD>' allows sending specific TLV with arbitrary payloads.

Example:
`tlv send a 1234`
Send ping TLV(0x0a) with payload '1234'

The 'tlv' command tree is to gain the ability to send the TLV with any payload at any time.
This feature allows to check the behavior of TCAT device against:
- receiving of unexpected TLV
- receiving of TLV with corrupted payload
- receiving of TLVs sent in custom order
2025-01-08 10:49:32 -08:00
Zhanglong Xia 3470934f74 [diag] remove redundant messages output by the diag module (#11118) 2025-01-06 21:36:57 -08:00
Ashish fdb8190f50 [ot-fct] fix access file from path defined in build parameter (#11080)
When configuration file defined in build parameter(command line argument),
ot-fct is wound't take into an account and accessed default path.

This commit fixes to access configuration file from path which is
defined from build command line parameter. Also, it fixes some
compilation issues while building from ot-br-posix.

Signed-off-by: ashish <ashish.vara@nxp.com>
2025-01-06 09:35:07 -08:00
Zhanglong Xia 69b91f9e62 [otci] add diag radio related commands support (#11112) 2025-01-06 08:56:10 -08:00
Zhanglong Xia 173cb61379 [diag] count the number of packets that are sent succeed and failed (#11108)
When using the `diag frame -c xxxx` command to enable the CSMA-CA when
transmitting the frame, the command `diag send` won't output any message
the CCA failure happens. It is difficult for users to know whether
the CSMA-CA is actually effective via diag commands.

This commit counts the number of packets that are sent succeed and failed,
outputs the transmision failure reason and do not re-transmit the frame
after it fails to send.
2025-01-03 16:44:02 -08:00
Yakun Xu f0d6007cc3 [style] converge some common utils (#10982)
This commit converges common utils in core and lib to avoid duplicate
code and conflicts caused by two common utils are included by some
units.
2024-12-04 08:39:44 -08:00
Jakub Uliarczyk 9ae7de563c [tcat] fix: use normalize_uuid_str() on BBTC_SERVICE_UUID (#10879)
This commit adds 'normalize_uuid_str()' in 'scan_tcat_devices()'.
It fixes an issue finding TCAT devices in newer versions of the 'bleak' module.
2024-11-21 09:04:28 -08:00
Przemysław Bida efa6f9fbc6 [tcat] implementation of tcat disconnect command (#10859)
Implementation of tcat disconnect command in python client.
2024-11-20 19:46:19 -08:00
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