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>'
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.
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
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.
- 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).
- 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.
The otci reports warning `DeprecationWarning: setDaemon() is
deprecated, set the daemon attribute instead`. This commit updates
the otci to fix this warning.
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>
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.
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.
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>
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).
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.
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.
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`.
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.
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
A route in network data's output may have more than one flag. For
example, a NAT64 route can have `sn` as its flags. The previous
`__parse_routes` would crash when processing such a route.