From f64b7cc73c1970113d61799e465788ed78d471cc Mon Sep 17 00:00:00 2001 From: Zhanglong Xia Date: Tue, 23 May 2023 09:04:09 +0800 Subject: [PATCH] [test] add code spell check and correct wrong spelling (#9066) --- .code-spell-ignore | 18 +++++ .github/workflows/build.yml | 19 +++++ doc/Doxyfile.in | 4 +- examples/platforms/utils/link_metrics.cpp | 2 +- examples/platforms/utils/link_metrics.h | 2 +- include/openthread/dns.h | 2 +- include/openthread/instance.h | 2 +- include/openthread/platform/radio.h | 2 +- script/code-spell | 70 +++++++++++++++++++ script/update-makefiles.py | 2 +- src/cli/README.md | 18 ++--- src/cli/README_DATASET.md | 2 +- src/cli/README_HISTORY.md | 26 +++---- src/cli/README_NETDATA.md | 2 +- src/cli/cli_history.cpp | 2 +- src/core/common/message.hpp | 2 +- src/core/net/srp_client.hpp | 2 +- src/core/net/srp_server.cpp | 2 +- src/core/thread/csl_tx_scheduler.cpp | 2 +- src/core/thread/link_quality.hpp | 2 +- src/core/utils/history_tracker.hpp | 2 +- src/ncp/ncp_base_mtd.cpp | 2 +- .../include/openthread/openthread-system.h | 2 +- src/posix/platform/spi_interface.cpp | 2 +- .../thread-cert/Cert_5_3_03_AddressQuery.py | 4 +- .../thread-cert/Cert_5_3_09_AddressQuery.py | 4 +- .../thread-cert/Cert_5_3_10_AddressQuery.py | 2 +- .../Cert_5_7_03_CoapDiagCommands.py | 2 +- .../Cert_5_8_04_SecurityPolicyTLV.py | 2 +- .../scripts/thread-cert/backbone/test_bmlr.py | 2 +- .../thread-cert/backbone/test_dua_routing.py | 2 +- .../nat64/test_single_border_router.py | 2 +- .../test_multi_thread_networks.py | 2 +- tests/scripts/thread-cert/command.py | 2 +- tests/scripts/thread-cert/config.py | 2 +- tests/scripts/thread-cert/ipv6.py | 4 +- tests/scripts/thread-cert/mcast6.py | 2 +- tests/scripts/thread-cert/mle.py | 2 +- tests/scripts/thread-cert/node.py | 2 +- tests/scripts/thread-cert/pktverify/utils.py | 4 +- .../v1_2_test_domain_unicast_address.py | 2 +- ...est_domain_unicast_address_registration.py | 6 +- ..._2_test_multicast_listener_registration.py | 2 +- .../v1_2_test_multicast_registration.py | 2 +- .../cli/test-018-next-hop-and-path-cost.py | 2 +- ...test-601-channel-manager-channel-change.py | 2 +- .../toranj/ncp/test-030-slaac-address-ncp.py | 2 +- tests/toranj/ncp/wpan.py | 2 +- tests/unit/test_aes.cpp | 2 +- tests/unit/test_dns.cpp | 2 +- tests/unit/test_dns_client.cpp | 2 +- tests/unit/test_link_quality.cpp | 2 +- tests/unit/test_lowpan.cpp | 18 ++--- tests/unit/test_spinel_encoder.cpp | 2 +- tests/unit/test_timer.cpp | 2 +- .../Thread_Harness/THCI/OpenThread_Sim.py | 2 +- tools/harness-sniffer/OT_Sniffer.py | 4 +- tools/harness-thci/OpenThread.py | 14 ++-- tools/harness-thci/OpenThread_BR.py | 2 +- tools/harness-thci/OpenThread_WpanCtl.py | 8 +-- tools/otci/otci/otci.py | 6 +- tools/spi-hdlc-adapter/spi-hdlc-adapter.c | 2 +- 62 files changed, 213 insertions(+), 106 deletions(-) create mode 100644 .code-spell-ignore create mode 100755 script/code-spell diff --git a/.code-spell-ignore b/.code-spell-ignore new file mode 100644 index 000000000..fc981f07c --- /dev/null +++ b/.code-spell-ignore @@ -0,0 +1,18 @@ +aanother +acount +addrss +aline +anumber +ans +aother +aparent +apending +asender +asent +ect +nd +ot +shashes +ue +unknwn +unsecure diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b385b3431..3b29bded9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,6 +80,25 @@ jobs: use-verbose-mode: 'yes' max-depth: 3 + spell-check: + runs-on: ubuntu-22.04 + steps: + - name: Harden Runner + uses: step-security/harden-runner@6b3083af2869dc3314a0257a42f4af696cc79ba3 # v2.3.1 + with: + egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs + + - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + with: + submodules: true + - name: Bootstrap + run: | + python -m pip install --upgrade pip + pip install codespell + - name: Check + run: | + script/code-spell check + cmake-version: runs-on: ubuntu-20.04 steps: diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index 014224bfd..0fa2af8aa 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -1144,7 +1144,7 @@ HTML_STYLESHEET = # defined cascading style sheet that is included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. +# standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet file to the output directory. For an example # see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -2029,7 +2029,7 @@ PREDEFINED = __attribute__(x)= EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will -# remove all refrences to function-like macros that are alone on a line, have an +# remove all references to function-like macros that are alone on a line, have an # all uppercase name, and do not end with a semicolon. Such function macros are # typically used for boiler-plate code, and will confuse the parser if not # removed. diff --git a/examples/platforms/utils/link_metrics.cpp b/examples/platforms/utils/link_metrics.cpp index 84be0d7c3..333313b76 100644 --- a/examples/platforms/utils/link_metrics.cpp +++ b/examples/platforms/utils/link_metrics.cpp @@ -49,7 +49,7 @@ class LinkMetricsDataInfo : public LinkedListEntry, public public: /** - * Construtor. + * Constructor. * */ LinkMetricsDataInfo(void) { Clear(); }; diff --git a/examples/platforms/utils/link_metrics.h b/examples/platforms/utils/link_metrics.h index 099d64b44..9eee11487 100644 --- a/examples/platforms/utils/link_metrics.h +++ b/examples/platforms/utils/link_metrics.h @@ -66,7 +66,7 @@ void otLinkMetricsInit(int8_t aNoiseFloor); * @param[in] aShortAddress The short address of the Initiator. * @param[in] aExtAddress A pointer to the extended address of the Initiator. * @param[in] aLinkMetrics Flags specifying what metrics to query (Pdu Count would be omitted). When - * @p aLinkMetrics is eqaul to `0`, this method clears the Initiator. + * @p aLinkMetrics is equal to `0`, this method clears the Initiator. * * @retval OT_ERROR_NONE Successfully configured the Enhanced-ACK Based Probing. * @retval OT_ERROR_INVALID_ARGS @p aExtAddress is `nullptr`. diff --git a/include/openthread/dns.h b/include/openthread/dns.h index 22f3fc2b7..e11855f04 100644 --- a/include/openthread/dns.h +++ b/include/openthread/dns.h @@ -95,7 +95,7 @@ typedef struct otDnsTxtEntry } otDnsTxtEntry; /** - * This structure represents an iterator for TXT record entires (key/value pairs). + * This structure represents an iterator for TXT record entries (key/value pairs). * * The data fields in this structure are intended for use by OpenThread core and caller should not read or change them. * diff --git a/include/openthread/instance.h b/include/openthread/instance.h index 49fd72732..935987f0f 100644 --- a/include/openthread/instance.h +++ b/include/openthread/instance.h @@ -53,7 +53,7 @@ extern "C" { * @note This number versions both OpenThread platform and user APIs. * */ -#define OPENTHREAD_API_VERSION (325) +#define OPENTHREAD_API_VERSION (326) /** * @addtogroup api-instance diff --git a/include/openthread/platform/radio.h b/include/openthread/platform/radio.h index 89e17be88..963f6ee31 100644 --- a/include/openthread/platform/radio.h +++ b/include/openthread/platform/radio.h @@ -895,7 +895,7 @@ int8_t otPlatRadioGetRssi(otInstance *aInstance); * @param[in] aScanDuration The duration, in milliseconds, for the channel to be scanned. * * @retval OT_ERROR_NONE Successfully started scanning the channel. - * @retval OT_ERROR_BUSY The radio is performing enery scanning. + * @retval OT_ERROR_BUSY The radio is performing energy scanning. * @retval OT_ERROR_NOT_IMPLEMENTED The radio doesn't support energy scanning. * */ diff --git a/script/code-spell b/script/code-spell new file mode 100755 index 000000000..5e007fcc0 --- /dev/null +++ b/script/code-spell @@ -0,0 +1,70 @@ +#!/bin/bash +# +# Copyright (c) 2023, The OpenThread Authors. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of the copyright holder nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +# +# The script to correct or check the code spell of OpenThread. +# +# Correct wrong spelling: +# script/code-spell +# +# Check only: +# +# script/code-spell check + +set -euxo pipefail + +OT_SPELL_CHECK_IGNORE_CONFIG_FILE='.code-spell-ignore' +readonly OT_SPELL_CHECK_IGNORE_CONFIG_FILE + +OT_SPELL_CHECK_DIRS=( + 'doc' + 'etc' + 'examples' + 'include' + 'script' + 'src' + 'tests' + 'tools' +) +readonly OT_SPELL_CHECK_DIRS + +main() +{ + if [ $# == 0 ]; then + codespell "${OT_SPELL_CHECK_DIRS[@]}" -w --ignore-words="${OT_SPELL_CHECK_IGNORE_CONFIG_FILE}" + elif [ "$1" == 'check' ]; then + codespell "${OT_SPELL_CHECK_DIRS[@]}" --ignore-words="${OT_SPELL_CHECK_IGNORE_CONFIG_FILE}" + else + echo >&2 "Unsupported option: $1. Supported: check" + # 128 for Invalid arguments + exit 128 + fi +} + +main "$@" diff --git a/script/update-makefiles.py b/script/update-makefiles.py index bbaeca43e..3b16e4df1 100755 --- a/script/update-makefiles.py +++ b/script/update-makefiles.py @@ -28,7 +28,7 @@ # # This script updates different make/build files (CMakeLists.txt, BUILD.gn, -# Andriod.mk, Andriod.bp, auto-make) in OpenThread repo based on the +# Android.mk, Android.bp, auto-make) in OpenThread repo based on the # current files present in `./src/core/` & `./include/openthread/` # folders. This script MUST be called from openthread root folder. diff --git a/src/cli/README.md b/src/cli/README.md index fbaee2053..1f51c47d1 100644 --- a/src/cli/README.md +++ b/src/cli/README.md @@ -1326,7 +1326,7 @@ Done ### dua iid -Get the Interface Identifier mannually specified for Thread Domain Unicast Address on Thread 1.2 device. +Get the Interface Identifier manually specified for Thread Domain Unicast Address on Thread 1.2 device. ```bash > dua iid @@ -1336,7 +1336,7 @@ Done ### dua iid \ -Set the Interface Identifier mannually specified for Thread Domain Unicast Address on Thread 1.2 device. +Set the Interface Identifier manually specified for Thread Domain Unicast Address on Thread 1.2 device. ```bash > dua iid 0004000300020001 @@ -1345,7 +1345,7 @@ Done ### dua iid clear -Clear the Interface Identifier mannually specified for Thread Domain Unicast Address on Thread 1.2 device. +Clear the Interface Identifier manually specified for Thread Domain Unicast Address on Thread 1.2 device. ```bash > dua iid clear @@ -1514,7 +1514,7 @@ fe80:0:0:0:f3d9:2a82:c8d8:fe43 Done ``` -Use `-v` to get more verbose informations about the address. +Use `-v` to get more verbose information about the address. ```bash > ipaddr -v @@ -1690,7 +1690,7 @@ Done ### keysequence guardtime \ -Set Thread Key Switch Guard Time (in hours) 0 means Thread Key Switch imediately if key index match +Set Thread Key Switch Guard Time (in hours) 0 means Thread Key Switch immediately if key index match ```bash > keysequence guardtime 0 @@ -2213,14 +2213,14 @@ Gets the state of NAT64 functions. Possible results for prefix manager are (`OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE` is required): - `Disabled`: NAT64 prefix manager is disabled. -- `NotRunning`: NAT64 prefix manager is enabled, but is not running, probably bacause the routing manager is disabled. +- `NotRunning`: NAT64 prefix manager is enabled, but is not running, probably because the routing manager is disabled. - `Idle`: NAT64 prefix manager is enabled and is running, but is not publishing a NAT64 prefix. Usually when there is another border router publishing a NAT64 prefix with higher priority. - `Active`: NAT64 prefix manager is enabled, running and publishing a NAT64 prefix. Possible results for NAT64 translator are (`OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE` is required): - `Disabled`: NAT64 translator is disabled. -- `NotRunning`: NAT64 translator is enabled, but is not translating packets, probably bacause it is not configued with a NAT64 prefix or a CIDR for NAT64. +- `NotRunning`: NAT64 translator is enabled, but is not translating packets, probably because it is not configured with a NAT64 prefix or a CIDR for NAT64. - `Active`: NAT64 translator is enabled and is translating packets. `OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE` or `OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE` are required. @@ -2696,7 +2696,7 @@ Done ### prefix -Get the prefix list in the local Network Data. Note: For the Thread 1.2 border router with backbone capability, the local Domain Prefix would be listed as well (with flag `D`), with preceeding `-` if backbone functionality is disabled. +Get the prefix list in the local Network Data. Note: For the Thread 1.2 border router with backbone capability, the local Domain Prefix would be listed as well (with flag `D`), with preceding `-` if backbone functionality is disabled. ```bash > prefix @@ -3596,7 +3596,7 @@ Done ### macfilter addr add \ \[rss\] -Add an IEEE 802.15.4 Extended Address to the address filter, and fixed the received singal strength for the messages from the address if rss is specified. +Add an IEEE 802.15.4 Extended Address to the address filter, and fixed the received signal strength for the messages from the address if rss is specified. ```bash > macfilter addr add 0f6127e33af6b403 -95 diff --git a/src/cli/README_DATASET.md b/src/cli/README_DATASET.md index df1b274c8..a1882af40 100644 --- a/src/cli/README_DATASET.md +++ b/src/cli/README_DATASET.md @@ -392,7 +392,7 @@ Usage: `dataset networkname [name]` Get network name. ```bash -> datset networkname +> dataset networkname OpenThread Done ``` diff --git a/src/cli/README_HISTORY.md b/src/cli/README_HISTORY.md index 268cf7d24..3fa681a27 100644 --- a/src/cli/README_HISTORY.md +++ b/src/cli/README_HISTORY.md @@ -475,19 +475,19 @@ Print the latest 5 entries of the IPv6 message RX history as a list: ```bash > history rx list 4 00:00:13.368 - type:UDP len:50 cheksum:0xbd26 sec:no prio:net rss:-20 from:0x4800 radio:15.4 + type:UDP len:50 checksum:0xbd26 sec:no prio:net rss:-20 from:0x4800 radio:15.4 src:[fe80:0:0:0:d03d:d3e7:cc5e:7cd7]:19788 dst:[ff02:0:0:0:0:0:0:1]:19788 00:00:14.991 - type:HopOpts len:44 cheksum:0x0000 sec:yes prio:norm rss:-20 from:0x4800 radio:15.4 + type:HopOpts len:44 checksum:0x0000 sec:yes prio:norm rss:-20 from:0x4800 radio:15.4 src:[fdde:ad00:beef:0:0:ff:fe00:4800]:0 dst:[ff03:0:0:0:0:0:0:2]:0 00:00:15.030 - type:UDP len:12 cheksum:0x3f7d sec:yes prio:net rss:-20 from:0x4800 radio:15.4 + type:UDP len:12 checksum:0x3f7d sec:yes prio:net rss:-20 from:0x4800 radio:15.4 src:[fdde:ad00:beef:0:0:ff:fe00:4800]:61631 dst:[fdde:ad00:beef:0:0:ff:fe00:4801]:61631 00:00:15.032 - type:ICMP6(EchoReqst) len:16 cheksum:0x942c sec:yes prio:norm rss:-20 from:0x4800 radio:15.4 + type:ICMP6(EchoReqst) len:16 checksum:0x942c sec:yes prio:norm rss:-20 from:0x4800 radio:15.4 src:[fdde:ad00:beef:0:ac09:a16b:3204:dc09]:0 dst:[fdde:ad00:beef:0:dc0e:d6b3:f180:b75b]:0 Done @@ -577,23 +577,23 @@ Print the latest 5 entries of the IPv6 message RX history as a list: > history rxtx list 5 00:00:02.100 - type:UDP len:50 cheksum:0xd843 sec:no prio:net rss:-20 from:0x0800 radio:15.4 + type:UDP len:50 checksum:0xd843 sec:no prio:net rss:-20 from:0x0800 radio:15.4 src:[fe80:0:0:0:54d9:5153:ffc6:df26]:19788 dst:[ff02:0:0:0:0:0:0:1]:19788 00:00:15.331 - type:HopOpts len:44 cheksum:0x0000 sec:yes prio:norm rss:-20 from:0x0800 radio:15.4 + type:HopOpts len:44 checksum:0x0000 sec:yes prio:norm rss:-20 from:0x0800 radio:15.4 src:[fdde:ad00:beef:0:0:ff:fe00:800]:0 dst:[ff03:0:0:0:0:0:0:2]:0 00:00:15.354 - type:UDP len:12 cheksum:0x6c6b sec:yes prio:net rss:-20 from:0x0800 radio:15.4 + type:UDP len:12 checksum:0x6c6b sec:yes prio:net rss:-20 from:0x0800 radio:15.4 src:[fdde:ad00:beef:0:0:ff:fe00:800]:61631 dst:[fdde:ad00:beef:0:0:ff:fe00:801]:61631 00:00:15.356 - type:ICMP6(EchoReqst) len:16 cheksum:0xc6a2 sec:yes prio:norm rss:-20 from:0x0800 radio:15.4 + type:ICMP6(EchoReqst) len:16 checksum:0xc6a2 sec:yes prio:norm rss:-20 from:0x0800 radio:15.4 src:[fdde:ad00:beef:0:efe8:4910:cf95:dee9]:0 dst:[fdde:ad00:beef:0:af4c:3644:882a:3698]:0 00:00:15.356 - type:ICMP6(EchoReply) len:16 cheksum:0xc5a2 sec:yes prio:norm tx-success:yes to:0x0800 radio:15.4 + type:ICMP6(EchoReply) len:16 checksum:0xc5a2 sec:yes prio:norm tx-success:yes to:0x0800 radio:15.4 src:[fdde:ad00:beef:0:af4c:3644:882a:3698]:0 dst:[fdde:ad00:beef:0:efe8:4910:cf95:dee9]:0 ``` @@ -633,19 +633,19 @@ Print the IPv6 message TX history as a list: ```bash history tx list 00:00:23.957 - type:ICMP6(EchoReply) len:16 cheksum:0x932c sec:yes prio:norm tx-success:yes to:0x4800 radio:15.4 + type:ICMP6(EchoReply) len:16 checksum:0x932c sec:yes prio:norm tx-success:yes to:0x4800 radio:15.4 src:[fdde:ad00:beef:0:dc0e:d6b3:f180:b75b]:0 dst:[fdde:ad00:beef:0:ac09:a16b:3204:dc09]:0 00:00:23.959 - type:UDP len:50 cheksum:0xce87 sec:yes prio:net tx-success:yes to:0x4800 radio:15.4 + type:UDP len:50 checksum:0xce87 sec:yes prio:net tx-success:yes to:0x4800 radio:15.4 src:[fdde:ad00:beef:0:0:ff:fe00:4801]:61631 dst:[fdde:ad00:beef:0:0:ff:fe00:4800]:61631 00:00:44.658 - type:UDP len:64 cheksum:0xf7ba sec:no prio:net tx-success:yes to:0x4800 radio:15.4 + type:UDP len:64 checksum:0xf7ba sec:no prio:net tx-success:yes to:0x4800 radio:15.4 src:[fe80:0:0:0:a4a5:bbac:a8e:bd07]:19788 dst:[fe80:0:0:0:d03d:d3e7:cc5e:7cd7]:19788 00:00:45.415 - type:UDP len:44 cheksum:0x26d4 sec:no prio:net tx-success:yes to:0xffff radio:15.4 + type:UDP len:44 checksum:0x26d4 sec:no prio:net tx-success:yes to:0xffff radio:15.4 src:[fe80:0:0:0:a4a5:bbac:a8e:bd07]:19788 dst:[ff02:0:0:0:0:0:0:2]:19788 Done diff --git a/src/cli/README_NETDATA.md b/src/cli/README_NETDATA.md index 5fff19f09..618a92b1b 100644 --- a/src/cli/README_NETDATA.md +++ b/src/cli/README_NETDATA.md @@ -47,7 +47,7 @@ Border Router and service information may be stable or temporary. Stable Thread Done ``` -4. Observe IPv6 addresses assigned to the Thread inteface. +4. Observe IPv6 addresses assigned to the Thread interface. ```bash > ipaddr diff --git a/src/cli/cli_history.cpp b/src/cli/cli_history.cpp index 0ea5ebf69..e2fa08753 100644 --- a/src/cli/cli_history.cpp +++ b/src/cli/cli_history.cpp @@ -572,7 +572,7 @@ void History::OutputRxTxEntryListFormat(const otHistoryTrackerMessageInfo &aInfo otHistoryTrackerEntryAgeToString(aEntryAge, ageString, sizeof(ageString)); OutputLine("%s", ageString); - OutputFormat(kIndentSize, "type:%s len:%u cheksum:0x%04x sec:%s prio:%s ", MessageTypeToString(aInfo), + OutputFormat(kIndentSize, "type:%s len:%u checksum:0x%04x sec:%s prio:%s ", MessageTypeToString(aInfo), aInfo.mPayloadLength, aInfo.mChecksum, aInfo.mLinkSecurity ? "yes" : "no", MessagePriorityToString(aInfo.mPriority)); if (aIsRx) diff --git a/src/core/common/message.hpp b/src/core/common/message.hpp index 307383724..a1bf2a87f 100644 --- a/src/core/common/message.hpp +++ b/src/core/common/message.hpp @@ -393,7 +393,7 @@ public: /** * This static method converts a pointer to an `otMessageSettings` to a `Settings`. * - * @param[in] aSettings A pointer to `otMessageSettings` to covert from. + * @param[in] aSettings A pointer to `otMessageSettings` to convert from. * If it is `nullptr`, then the default settings `GetDefault()` will be used. * * @returns A reference to the converted `Settings` or the default if @p aSettings is `nullptr`. diff --git a/src/core/net/srp_client.hpp b/src/core/net/srp_client.hpp index 992940cfd..0aaf632bb 100644 --- a/src/core/net/srp_client.hpp +++ b/src/core/net/srp_client.hpp @@ -858,7 +858,7 @@ private: // will retry after a short interval `kTxFailureRetryInterval` // up to `kMaxTxFailureRetries` attempts. After this, the retry // wait interval will be used (which keeps growing on each failure - // - please see bellow). + // - please see below). // // If the update message is sent successfully but there is no // response from server or if server rejects the update, the diff --git a/src/core/net/srp_server.cpp b/src/core/net/srp_server.cpp index 7125238fa..fc4dbc311 100644 --- a/src/core/net/srp_server.cpp +++ b/src/core/net/srp_server.cpp @@ -1994,7 +1994,7 @@ Error Server::Host::ProcessTtl(uint32_t aTtl) { // This method processes the TTL value received in a resource record. // - // If no TTL value is stored, this method wil set the stored value to @p aTtl and return `kErrorNone`. + // If no TTL value is stored, this method will set the stored value to @p aTtl and return `kErrorNone`. // If a TTL value is stored and @p aTtl equals the stored value, this method returns `kErrorNone`. // Otherwise, this method returns `kErrorRejected`. diff --git a/src/core/thread/csl_tx_scheduler.cpp b/src/core/thread/csl_tx_scheduler.cpp index 9d86408cc..f30f85f7a 100644 --- a/src/core/thread/csl_tx_scheduler.cpp +++ b/src/core/thread/csl_tx_scheduler.cpp @@ -227,7 +227,7 @@ Mac::TxFrame *CslTxScheduler::HandleFrameRequest(Mac::TxFrames &aTxFrames) // in `RescheduleCslTx()` when determining the next CSL delay to // schedule CSL tx with `Mac` but here we calculate the delay with // zero `aAheadUs`. All the timings are in usec but when passing - // delay to `Mac` we divide by `1000` (to covert to msec) which + // delay to `Mac` we divide by `1000` (to convert to msec) which // can round the value down and cause `Mac` to start operation a // bit (some usec) earlier. This is covered by adding the guard // time `kFramePreparationGuardInterval`. diff --git a/src/core/thread/link_quality.hpp b/src/core/thread/link_quality.hpp index 086d74774..9c4bc4cc7 100644 --- a/src/core/thread/link_quality.hpp +++ b/src/core/thread/link_quality.hpp @@ -250,7 +250,7 @@ constexpr uint8_t kCostForLinkQuality3 = 1; ///< Link Cost for /** * This function converts link quality to route cost. * - * @param[in] aLinkQuality The link quality to covert. + * @param[in] aLinkQuality The link quality to convert. * * @returns The route cost corresponding to @p aLinkQuality. * diff --git a/src/core/utils/history_tracker.hpp b/src/core/utils/history_tracker.hpp index f1cabbf89..c3613935e 100644 --- a/src/core/utils/history_tracker.hpp +++ b/src/core/utils/history_tracker.hpp @@ -101,7 +101,7 @@ public: /** * This constants specified no next hop. * - * Used for `mNextHop` in `RouteInfo` struture. + * Used for `mNextHop` in `RouteInfo` structure. * */ static constexpr uint8_t kNoNextHop = OT_HISTORY_TRACKER_NO_NEXT_HOP; diff --git a/src/ncp/ncp_base_mtd.cpp b/src/ncp/ncp_base_mtd.cpp index 48a927055..78141dbfc 100644 --- a/src/ncp/ncp_base_mtd.cpp +++ b/src/ncp/ncp_base_mtd.cpp @@ -1047,7 +1047,7 @@ template <> otError NcpBase::HandlePropertyRemove(mSpiResetDelay) * kUsecPerMsec); diff --git a/tests/scripts/thread-cert/Cert_5_3_03_AddressQuery.py b/tests/scripts/thread-cert/Cert_5_3_03_AddressQuery.py index 233764d44..403a39784 100755 --- a/tests/scripts/thread-cert/Cert_5_3_03_AddressQuery.py +++ b/tests/scripts/thread-cert/Cert_5_3_03_AddressQuery.py @@ -118,7 +118,7 @@ class Cert_5_3_3_AddressQuery(thread_cert.TestCase): self.assertTrue(self.nodes[MED1].ping(router3_mleid)) # 3 - # Wait the finish of address resolution traffic triggerred by previous + # Wait the finish of address resolution traffic triggered by previous # ping. self.simulator.go(5) @@ -126,7 +126,7 @@ class Cert_5_3_3_AddressQuery(thread_cert.TestCase): self.assertTrue(self.nodes[ROUTER1].ping(med1_mleid)) # 4 - # Wait the finish of address resolution traffic triggerred by previous + # Wait the finish of address resolution traffic triggered by previous # ping. self.simulator.go(5) diff --git a/tests/scripts/thread-cert/Cert_5_3_09_AddressQuery.py b/tests/scripts/thread-cert/Cert_5_3_09_AddressQuery.py index 6e1ca9d21..74608b38b 100755 --- a/tests/scripts/thread-cert/Cert_5_3_09_AddressQuery.py +++ b/tests/scripts/thread-cert/Cert_5_3_09_AddressQuery.py @@ -155,7 +155,7 @@ class Cert_5_3_09_AddressQuery(thread_cert.TestCase): self.assertTrue(self.nodes[SED1].ping(router3_addr)) self.simulator.go(1) - # 6 DUT_ROUTER2: Power off ROUTER3 and wait 580s to alow LEADER to + # 6 DUT_ROUTER2: Power off ROUTER3 and wait 580s to allow LEADER to # expire its Router ID self.nodes[ROUTER3].stop() self.simulator.go(580) @@ -233,7 +233,7 @@ class Cert_5_3_09_AddressQuery(thread_cert.TestCase): must_next() # Step 3: Router_1 sends an ICMPv6 Echo Request to SED using GUA 2001:: - # addresss + # address # The DUT MUST respond to the Address Query Request with a properly # formatted Address Notification Message: # CoAP URI-Path diff --git a/tests/scripts/thread-cert/Cert_5_3_10_AddressQuery.py b/tests/scripts/thread-cert/Cert_5_3_10_AddressQuery.py index 775ee5f8c..8a6354804 100755 --- a/tests/scripts/thread-cert/Cert_5_3_10_AddressQuery.py +++ b/tests/scripts/thread-cert/Cert_5_3_10_AddressQuery.py @@ -239,7 +239,7 @@ class Cert_5_3_10_AddressQuery(thread_cert.TestCase): must_next() # Step 4: Border Router sends an ICMPv6 Echo Request to MED using GUA 2003:: - # addresss + # address # The DUT MUST respond to the Address Query Request with a properly # formatted Address Notification Message: # CoAP URI-Path diff --git a/tests/scripts/thread-cert/Cert_5_7_03_CoapDiagCommands.py b/tests/scripts/thread-cert/Cert_5_7_03_CoapDiagCommands.py index 36b5b98c9..bf2482673 100755 --- a/tests/scripts/thread-cert/Cert_5_7_03_CoapDiagCommands.py +++ b/tests/scripts/thread-cert/Cert_5_7_03_CoapDiagCommands.py @@ -175,7 +175,7 @@ class Cert_5_7_03_CoapDiagCommands_Base(thread_cert.TestCase): # TLV Type 8 – IPv6 address list # TLV Type 17 – Channel Pagesi # - # if DUT is Router, contianing the following as well: + # if DUT is Router, containing the following as well: # TLV Type 4 – Connectivity # TLV Type 5 – Route64 # TLV Type 16 – Child Table diff --git a/tests/scripts/thread-cert/Cert_5_8_04_SecurityPolicyTLV.py b/tests/scripts/thread-cert/Cert_5_8_04_SecurityPolicyTLV.py index 37f5506e3..8620314c5 100755 --- a/tests/scripts/thread-cert/Cert_5_8_04_SecurityPolicyTLV.py +++ b/tests/scripts/thread-cert/Cert_5_8_04_SecurityPolicyTLV.py @@ -49,7 +49,7 @@ THREAD_NODE = 4 # requires an External Commissioner which is currently not part of Thread # Certification. # -# Notes: Due to the packet parsing compatiable issue for supporting Thread 1.2 +# Notes: Due to the packet parsing compatible issue for supporting Thread 1.2 # and 1.1, the security policy values can be fetched only in the unknown # field. # diff --git a/tests/scripts/thread-cert/backbone/test_bmlr.py b/tests/scripts/thread-cert/backbone/test_bmlr.py index 990038c85..335d9056e 100755 --- a/tests/scripts/thread-cert/backbone/test_bmlr.py +++ b/tests/scripts/thread-cert/backbone/test_bmlr.py @@ -161,7 +161,7 @@ class BBR_5_11_01(thread_cert.TestCase): and ipv6.src.is_link_local """) - # Commissioner registers MA3 with deafult timeout + # Commissioner registers MA3 with default timeout pkts.filter_wpan_src64(COMMISSIONER).filter_coap_request('/n/mr').must_next().must_verify(f""" thread_meshcop.tlv.ipv6_addr == ['{MA3}'] and thread_bl.tlv.timeout is null diff --git a/tests/scripts/thread-cert/backbone/test_dua_routing.py b/tests/scripts/thread-cert/backbone/test_dua_routing.py index 3c3c2498e..fd469e1ba 100755 --- a/tests/scripts/thread-cert/backbone/test_dua_routing.py +++ b/tests/scripts/thread-cert/backbone/test_dua_routing.py @@ -211,7 +211,7 @@ class TestNdProxy(thread_cert.TestCase): PBBR_ETH = pv.vars['PBBR_ETH'] PBBR2_ETH = pv.vars['PBBR2_ETH'] - # Verify that SBBR should not foward any Ping Request to the Thread network. + # Verify that SBBR should not forward any Ping Request to the Thread network. # Use `ipv6.hlim == 63` to avoid false fails because SBBR might still forward Ping Request from PBBR to ROUTER1 pkts.filter_wpan_src64(SBBR).filter_ping_request().filter('ipv6.hlim == 63').must_not_next() diff --git a/tests/scripts/thread-cert/border_router/nat64/test_single_border_router.py b/tests/scripts/thread-cert/border_router/nat64/test_single_border_router.py index 4a69b2a93..7aeea62b7 100755 --- a/tests/scripts/thread-cert/border_router/nat64/test_single_border_router.py +++ b/tests/scripts/thread-cert/border_router/nat64/test_single_border_router.py @@ -99,7 +99,7 @@ class Nat64SingleBorderRouter(thread_cert.TestCase): if ready[0]: return sock.recv(1024) else: - raise AssertionError("No data recevied") + raise AssertionError("No data received") def listen_udp(self, addr, port): sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) diff --git a/tests/scripts/thread-cert/border_router/test_multi_thread_networks.py b/tests/scripts/thread-cert/border_router/test_multi_thread_networks.py index bc2bb38a8..4e0823b0a 100755 --- a/tests/scripts/thread-cert/border_router/test_multi_thread_networks.py +++ b/tests/scripts/thread-cert/border_router/test_multi_thread_networks.py @@ -33,7 +33,7 @@ import config import thread_cert # Test description: -# This test verifies bi-directional connectivity accross multiple Thread networks. +# This test verifies bi-directional connectivity across multiple Thread networks. # # Topology: # -------------(eth)---------------- diff --git a/tests/scripts/thread-cert/command.py b/tests/scripts/thread-cert/command.py index e1944932b..419840f02 100644 --- a/tests/scripts/thread-cert/command.py +++ b/tests/scripts/thread-cert/command.py @@ -682,7 +682,7 @@ def check_joiner_router_commissioning_messages(commissioning_messages): def check_payload_same(tp1, tp2): - """Verfiy two payloads are totally the same. + """Verify two payloads are totally the same. A payload is a tuple of tlvs. """ assert len(tp1) == len(tp2) diff --git a/tests/scripts/thread-cert/config.py b/tests/scripts/thread-cert/config.py index cf04cbe74..e378ec169 100644 --- a/tests/scripts/thread-cert/config.py +++ b/tests/scripts/thread-cert/config.py @@ -330,7 +330,7 @@ def create_deafult_network_tlvs_factories(): network_layer.TlvType.XTAL_ACCURACY: network_layer.XtalAccuracyFactory(), # Routing information are distributed in a Thread network by MLE Routing TLV - # which is in fact MLE Route64 TLV. Thread specificaton v1.1. - Chapter 5.20 + # which is in fact MLE Route64 TLV. Thread specification v1.1. - Chapter 5.20 network_layer.TlvType.MLE_ROUTING: create_default_mle_tlv_route64_factory(), network_layer.TlvType.IPv6_ADDRESSES: diff --git a/tests/scripts/thread-cert/ipv6.py b/tests/scripts/thread-cert/ipv6.py index ab00a26e9..f4915742a 100644 --- a/tests/scripts/thread-cert/ipv6.py +++ b/tests/scripts/thread-cert/ipv6.py @@ -622,7 +622,7 @@ class FragmentHeader(ExtensionHeader): | Next Header | Reserved | Fragment Offset | Res | M | Identification | +-------------+----------+-----------------+-----+---+----------------+ - Fragment extention header consists of: + Fragment extension header consists of: - next_header type (8 bit) - fragment offset which is multiple of 8 (13 bit) - more_flag to indicate further data (1 bit) @@ -1010,7 +1010,7 @@ class HopByHopFactory(PacketFactory): hdr_ext_len = ord(data.read(1)) # Note! Two bytes were read (next_header and hdr_ext_len) so they must - # be substracted from header length + # be subtracted from header length hop_by_hop_length = (self._calculate_extension_header_length(hdr_ext_len) - 2) hop_by_hop_data = data.read(hop_by_hop_length) diff --git a/tests/scripts/thread-cert/mcast6.py b/tests/scripts/thread-cert/mcast6.py index b090fd95f..8699d5c73 100755 --- a/tests/scripts/thread-cert/mcast6.py +++ b/tests/scripts/thread-cert/mcast6.py @@ -57,7 +57,7 @@ def if_indextoname(index): ifname = ctypes.create_string_buffer(32) ifname = libc.if_indextoname(index, ifname) if not ifname: - raise RuntimeError("Inavlid Index") + raise RuntimeError("Invalid Index") return ifname diff --git a/tests/scripts/thread-cert/mle.py b/tests/scripts/thread-cert/mle.py index 0c826ad98..2bf6c9313 100644 --- a/tests/scripts/thread-cert/mle.py +++ b/tests/scripts/thread-cert/mle.py @@ -332,7 +332,7 @@ class LinkQualityAndRouteData(object): return (self.output == other.output and self.input == other.input and self.route == other.route) def __repr__(self): - return "LinkQualityAndRouteData(ouput={}, input={}, route={})".format(self.output, self.input, self.route) + return "LinkQualityAndRouteData(output={}, input={}, route={})".format(self.output, self.input, self.route) class LinkQualityAndRouteDataFactory: diff --git a/tests/scripts/thread-cert/node.py b/tests/scripts/thread-cert/node.py index 57a41b2d8..ea6adb2b7 100755 --- a/tests/scripts/thread-cert/node.py +++ b/tests/scripts/thread-cert/node.py @@ -3173,7 +3173,7 @@ class NodeImpl: def _parse_linkmetrics_query_result(self, lines): """Parse link metrics query result""" - # Exmaple of command output: + # Example of command output: # ['Received Link Metrics Report from: fe80:0:0:0:146e:a00:0:1', # '- PDU Counter: 1 (Count/Summation)', # '- LQI: 0 (Exponential Moving Average)', diff --git a/tests/scripts/thread-cert/pktverify/utils.py b/tests/scripts/thread-cert/pktverify/utils.py index 7d57ce05e..9eeb3ed26 100644 --- a/tests/scripts/thread-cert/pktverify/utils.py +++ b/tests/scripts/thread-cert/pktverify/utils.py @@ -140,11 +140,11 @@ def which_mergecap() -> str: def colon_hex(hexstr, interval) -> str: - """ Convert hexstr to colon seperated string every interval + """ Convert hexstr to colon separated string every interval :param hexstr: The hex string to convert. :param interval: The interval number. - :return: The colon seperated string. + :return: The colon separated string. """ assert len(hexstr) % interval == 0 return ':'.join(hexstr[i:i + interval] for i in range(0, len(hexstr), interval)) diff --git a/tests/scripts/thread-cert/v1_2_test_domain_unicast_address.py b/tests/scripts/thread-cert/v1_2_test_domain_unicast_address.py index 13c195016..7a98680a2 100755 --- a/tests/scripts/thread-cert/v1_2_test_domain_unicast_address.py +++ b/tests/scripts/thread-cert/v1_2_test_domain_unicast_address.py @@ -137,7 +137,7 @@ class TestDomainUnicastAddress(thread_cert.TestCase): def __check_dua_registration(self, node, iid, dp_cid): ''' Check whether or not the specified Domain Unicast Address is registered in Address - Registraion TLV. + Registration TLV. Args: node (int) : The device id diff --git a/tests/scripts/thread-cert/v1_2_test_domain_unicast_address_registration.py b/tests/scripts/thread-cert/v1_2_test_domain_unicast_address_registration.py index dfbf3140f..4053feca0 100755 --- a/tests/scripts/thread-cert/v1_2_test_domain_unicast_address_registration.py +++ b/tests/scripts/thread-cert/v1_2_test_domain_unicast_address_registration.py @@ -165,13 +165,13 @@ class TestDomainUnicastAddressRegistration(thread_cert.TestCase): ''' return ''.join(ipaddress.ip_address(address).exploded.split(':')[4:]) - def __check_dua_registration_tmf(self, node, occurences=1, ml_eid=None): + def __check_dua_registration_tmf(self, node, occurrences=1, ml_eid=None): messages = self.simulator.get_messages_sent_by(node) - for i in range(occurences): + for i in range(occurrences): msg = messages.next_coap_message('0.02', '/n/dr', False) assert msg, 'Expected {}, but {}th not found\n node: {}(extaddr: {})'.format( - occurences, i + 1, node, self.nodes[node].get_addr64()) + occurrences, i + 1, node, self.nodes[node].get_addr64()) if ml_eid: ml_eid_tlv = msg.get_coap_message_tlv(network_layer.MlEid) self.assertEqual(ml_eid, ml_eid_tlv.ml_eid.hex()) diff --git a/tests/scripts/thread-cert/v1_2_test_multicast_listener_registration.py b/tests/scripts/thread-cert/v1_2_test_multicast_listener_registration.py index c6d369e45..18875362c 100755 --- a/tests/scripts/thread-cert/v1_2_test_multicast_listener_registration.py +++ b/tests/scripts/thread-cert/v1_2_test_multicast_listener_registration.py @@ -891,7 +891,7 @@ class TestMulticastListenerRegistration(thread_cert.TestCase): self.simulator.go(WAIT_REDUNDANCE) self.__check_send_mlr_req(parent_id, MA1, should_send=True, expect_mlr_rsp=True) - # Parent should not register MA1 of Child 1 because it's already registerd + # Parent should not register MA1 of Child 1 because it's already registered self.flush_all() self.nodes[meds[0]].add_ipmaddr(MA1) self.simulator.go(PARENT_AGGREGATE_DELAY + WAIT_REDUNDANCE) diff --git a/tests/scripts/thread-cert/v1_2_test_multicast_registration.py b/tests/scripts/thread-cert/v1_2_test_multicast_registration.py index 67537b7ee..8001261a4 100755 --- a/tests/scripts/thread-cert/v1_2_test_multicast_registration.py +++ b/tests/scripts/thread-cert/v1_2_test_multicast_registration.py @@ -144,7 +144,7 @@ class TestMulticastRegistration(thread_cert.TestCase): in_address_registration=True): ''' Check whether or not the addition of the multicast address on the specific node would trigger Child Update Request for multicast address registration via Address - Registraion TLV. + Registration TLV. Args: node (int) : The device id diff --git a/tests/toranj/cli/test-018-next-hop-and-path-cost.py b/tests/toranj/cli/test-018-next-hop-and-path-cost.py index b31b2f878..ebaca1fc2 100755 --- a/tests/toranj/cli/test-018-next-hop-and-path-cost.py +++ b/tests/toranj/cli/test-018-next-hop-and-path-cost.py @@ -120,7 +120,7 @@ fed3_rloc = int(fed3.get_rloc16(), 16) def parse_nexthop(line): - # Exmaple: "0x5000 cost:3" -> (0x5000, 3). + # Example: "0x5000 cost:3" -> (0x5000, 3). items = line.strip().split(' ', 2) return (int(items[0], 16), int(items[1].split(':')[1])) diff --git a/tests/toranj/cli/test-601-channel-manager-channel-change.py b/tests/toranj/cli/test-601-channel-manager-channel-change.py index cb67d64f6..82be9f70f 100755 --- a/tests/toranj/cli/test-601-channel-manager-channel-change.py +++ b/tests/toranj/cli/test-601-channel-manager-channel-change.py @@ -154,7 +154,7 @@ r1.cli('channel manager delay 20') r1.cli('channel manager change 17') time.sleep(5 / speedup) verify_within(check_channel_on_all_nodes, 10) -channael = 18 +channel = 18 r2.cli('channel manager change', channel) verify_within(check_channel_on_all_nodes, 10) diff --git a/tests/toranj/ncp/test-030-slaac-address-ncp.py b/tests/toranj/ncp/test-030-slaac-address-ncp.py index cbcc5e20c..6bca1190c 100644 --- a/tests/toranj/ncp/test-030-slaac-address-ncp.py +++ b/tests/toranj/ncp/test-030-slaac-address-ncp.py @@ -173,7 +173,7 @@ wpan.verify_within(check_prefix_and_slaac_address_are_added, WAIT_INTERVAL) slaac_addrs = [node.find_ip6_address_with_prefix(PREFIX) for node in all_nodes] # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# Check recovery after reseting r1 and c1 (same SLAAC address to be added) +# Check recovery after resetting r1 and c1 (same SLAAC address to be added) r1.reset() wpan.verify_within(check_prefix_and_slaac_address_are_added, WAIT_INTERVAL) diff --git a/tests/toranj/ncp/wpan.py b/tests/toranj/ncp/wpan.py index 1dc313a7f..ffe20a235 100644 --- a/tests/toranj/ncp/wpan.py +++ b/tests/toranj/ncp/wpan.py @@ -747,7 +747,7 @@ class Node(object): while asyncore.socket_map: elapsed_time = time.time() - start_time if elapsed_time > timeout: - print('Performing aysnc tx/tx took too long ({}>{} sec)'.format(elapsed_time, timeout)) + print('Performing async tx/tx took too long ({}>{} sec)'.format(elapsed_time, timeout)) raise Node._NodeError('perform_tx_rx timed out ({}>{} sec)'.format(elapsed_time, timeout)) # perform a single asyncore loop asyncore.loop(timeout=0.5, count=1) diff --git a/tests/unit/test_aes.cpp b/tests/unit/test_aes.cpp index e88b1e20e..4ed31edd1 100644 --- a/tests/unit/test_aes.cpp +++ b/tests/unit/test_aes.cpp @@ -234,7 +234,7 @@ void TestInPlaceAesCcmProcessing(void) VerifyOrQuit(message->GetLength() == msgLength + kTagLength); - // Decrpt in place + // Decrypt in place aesCcm.Init(kHeaderLength, msgLength - kHeaderLength, kTagLength, kNonce, sizeof(kNonce)); aesCcm.Header(header); aesCcm.Payload(*message, kHeaderLength, msgLength - kHeaderLength, ot::Crypto::AesCcm::kDecrypt); diff --git a/tests/unit/test_dns.cpp b/tests/unit/test_dns.cpp index 6df6b3bd1..089b4861b 100644 --- a/tests/unit/test_dns.cpp +++ b/tests/unit/test_dns.cpp @@ -1258,7 +1258,7 @@ void TestDnsTxtEntry(void) const uint8_t kInvalidEncodedTxt1[] = {4, 'a', '=', 'b'}; // Incorrect length // Special encoded txt data with zero strings and string starting - // with '=' (missing key) whcih should be skipped over silently. + // with '=' (missing key) which should be skipped over silently. const uint8_t kSpecialEncodedTxt[] = {0, 0, 3, 'A', '=', 'B', 2, '=', 'C', 3, 'D', '=', 'E', 3, '=', '1', '2'}; const Dns::TxtEntry kTxtEntries[] = { diff --git a/tests/unit/test_dns_client.cpp b/tests/unit/test_dns_client.cpp index 88f56299c..ad36def7f 100644 --- a/tests/unit/test_dns_client.cpp +++ b/tests/unit/test_dns_client.cpp @@ -588,7 +588,7 @@ void TestDnsClient(void) VerifyOrQuit(sBrowseInfo.mNumInstances == 1); sBrowseInfo.Reset(); - Log("Browse() for unknwon service"); + Log("Browse() for unknown service"); SuccessOrQuit(dnsClient->Browse("_unknown._udp.default.service.arpa.", BrowseCallback, sInstance)); AdvanceTime(100); VerifyOrQuit(sBrowseInfo.mCallbackCount == 1); diff --git a/tests/unit/test_link_quality.cpp b/tests/unit/test_link_quality.cpp index 0f2e9eb76..2562ec8ef 100644 --- a/tests/unit/test_link_quality.cpp +++ b/tests/unit/test_link_quality.cpp @@ -57,7 +57,7 @@ enum #define MAX_RSS(_rss1, _rss2) (((_rss1) < (_rss2)) ? (_rss2) : (_rss1)) #define ABS(value) (((value) >= 0) ? (value) : -(value)) -// This struct contains RSS values and test data for checking link quality info calss. +// This struct contains RSS values and test data for checking link quality info class. struct RssTestData { const int8_t *mRssList; // Array of RSS values. diff --git a/tests/unit/test_lowpan.cpp b/tests/unit/test_lowpan.cpp index c28f8fda8..f50f868e9 100644 --- a/tests/unit/test_lowpan.cpp +++ b/tests/unit/test_lowpan.cpp @@ -277,7 +277,7 @@ static const uint8_t sTestPayloadDefault[] = {0x80, 0x00, 0x01, 0x02, 0x03, 0x04 static void TestFullyCompressableLongAddresses(void) { - TestIphcVector testVector("Fully compressable IPv6 addresses using long MAC addresses"); + TestIphcVector testVector("Fully compressible IPv6 addresses using long MAC addresses"); // Setup MAC addresses. testVector.SetMacSource(sTestMacSourceDefaultLong); @@ -302,7 +302,7 @@ static void TestFullyCompressableLongAddresses(void) static void TestFullyCompressableShortAddresses(void) { - TestIphcVector testVector("Fully compressable IPv6 addresses using short MAC addresses"); + TestIphcVector testVector("Fully compressible IPv6 addresses using short MAC addresses"); // Setup MAC addresses. testVector.SetMacSource(sTestMacSourceDefaultShort); @@ -327,7 +327,7 @@ static void TestFullyCompressableShortAddresses(void) static void TestFullyCompressableShortLongAddresses(void) { - TestIphcVector testVector("Fully compressable IPv6 addresses using short and long MAC addresses"); + TestIphcVector testVector("Fully compressible IPv6 addresses using short and long MAC addresses"); // Setup MAC addresses. testVector.SetMacSource(sTestMacSourceDefaultShort); @@ -352,7 +352,7 @@ static void TestFullyCompressableShortLongAddresses(void) static void TestFullyCompressableLongShortAddresses(void) { - TestIphcVector testVector("Fully compressable IPv6 addresses using long and short MAC addresses"); + TestIphcVector testVector("Fully compressible IPv6 addresses using long and short MAC addresses"); // Setup MAC addresses. testVector.SetMacSource(sTestMacSourceDefaultLong); @@ -505,7 +505,7 @@ static void TestSource16bitDestination16bitAddresses(void) static void TestSourceCompressedDestination16bitAddresses(void) { - TestIphcVector testVector("Fully compressable IPv6 source and destination 16-bit using long MAC addresses"); + TestIphcVector testVector("Fully compressible IPv6 source and destination 16-bit using long MAC addresses"); // Setup MAC addresses. testVector.SetMacSource(sTestMacSourceDefaultLong); @@ -530,7 +530,7 @@ static void TestSourceCompressedDestination16bitAddresses(void) static void TestSourceCompressedDestination128bitAddresses(void) { - TestIphcVector testVector("Fully compressable IPv6 source and destination inline using long MAC addresses"); + TestIphcVector testVector("Fully compressible IPv6 source and destination inline using long MAC addresses"); // Setup MAC addresses. testVector.SetMacSource(sTestMacSourceDefaultLong); @@ -734,7 +734,7 @@ static void TestStatefulSource16bitDestination16bitContext0(void) static void TestStatefulCompressableLongAddressesContext0(void) { - TestIphcVector testVector("Stateful compression compressable long addresses, context 0"); + TestIphcVector testVector("Stateful compression compressible long addresses, context 0"); // Setup MAC addresses. testVector.SetMacSource(sTestMacSourceDefaultLong); @@ -759,7 +759,7 @@ static void TestStatefulCompressableLongAddressesContext0(void) static void TestStatefulCompressableShortAddressesContext0(void) { - TestIphcVector testVector("Stateful compression compressable short addresses, context 0"); + TestIphcVector testVector("Stateful compression compressible short addresses, context 0"); // Setup MAC addresses. testVector.SetMacSource(sTestMacSourceDefaultShort); @@ -784,7 +784,7 @@ static void TestStatefulCompressableShortAddressesContext0(void) static void TestStatefulCompressableLongShortAddressesContext0(void) { - TestIphcVector testVector("Stateful compression compressable long and short addresses, context 0"); + TestIphcVector testVector("Stateful compression compressible long and short addresses, context 0"); // Setup MAC addresses. testVector.SetMacSource(sTestMacSourceDefaultLong); diff --git a/tests/unit/test_spinel_encoder.cpp b/tests/unit/test_spinel_encoder.cpp index 7acb0d015..4b76d4c6b 100644 --- a/tests/unit/test_spinel_encoder.cpp +++ b/tests/unit/test_spinel_encoder.cpp @@ -310,7 +310,7 @@ void TestEncoder(void) printf(" -- PASS\n"); printf("\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -"); - printf("\nTest 5: Test saving position and reseting back to a saved position"); + printf("\nTest 5: Test saving position and resetting back to a saved position"); SuccessOrQuit(encoder.BeginFrame(Spinel::Buffer::kPriorityLow)); SuccessOrQuit(encoder.WriteUint8(kUint8)); diff --git a/tests/unit/test_timer.cpp b/tests/unit/test_timer.cpp index b6ecd6651..26b55d8ce 100644 --- a/tests/unit/test_timer.cpp +++ b/tests/unit/test_timer.cpp @@ -507,7 +507,7 @@ template static void TenTimers(uint32_t aTimeShift) } // given the order in which timers are started, the TimerScheduler should call otPlatAlarmMilliStartAt 2 times. - // one for timer[0] and one for timer[5] which will supercede timer[0]. + // one for timer[0] and one for timer[5] which will supersede timer[0]. VerifyOrQuit(sCallCount[kCallCountIndexAlarmStart] == 2, "TestTenTimer: Start CallCount Failed."); VerifyOrQuit(sCallCount[kCallCountIndexAlarmStop] == 0, "TestTenTimer: Stop CallCount Failed."); VerifyOrQuit(sCallCount[kCallCountIndexTimerHandler] == 0, "TestTenTimer: Handler CallCount Failed."); diff --git a/tools/harness-simulation/harness/Thread_Harness/THCI/OpenThread_Sim.py b/tools/harness-simulation/harness/Thread_Harness/THCI/OpenThread_Sim.py index 18c622ec0..c8e84aeea 100644 --- a/tools/harness-simulation/harness/Thread_Harness/THCI/OpenThread_Sim.py +++ b/tools/harness-simulation/harness/Thread_Harness/THCI/OpenThread_Sim.py @@ -89,7 +89,7 @@ class SSHHandle(object): self.__stdout.channel.setblocking(0) # Some commands such as `udp send -x ` send binary data - # The UDP packet recevier will output the data in binary to stdout + # The UDP packet receiver will output the data in binary to stdout self.__stdout._set_mode('rb') def __disconnect(self, dwCtrlType): diff --git a/tools/harness-sniffer/OT_Sniffer.py b/tools/harness-sniffer/OT_Sniffer.py index 78da15a38..2c97d6cc1 100644 --- a/tools/harness-sniffer/OT_Sniffer.py +++ b/tools/harness-sniffer/OT_Sniffer.py @@ -43,7 +43,7 @@ class OT_Sniffer(ISniffer): self.is_active = False except Exception as e: - ModuleHelper.WriteIntoDebugLogger('OT_Sniffer: [intialize] --> ' + str(e)) + ModuleHelper.WriteIntoDebugLogger('OT_Sniffer: [initialize] --> ' + str(e)) def discoverSniffer(self): sniffers = [] @@ -148,7 +148,7 @@ class OT_Sniffer(ISniffer): def getSnifferAddress(self): """ - Method to retrun the current sniffer's COM/IP address + Method to return the current sniffer's COM/IP address @return : string """ return self.port diff --git a/tools/harness-thci/OpenThread.py b/tools/harness-thci/OpenThread.py index 2410bc49d..1e4edbb37 100644 --- a/tools/harness-thci/OpenThread.py +++ b/tools/harness-thci/OpenThread.py @@ -72,7 +72,7 @@ OT11_VERSION = 'OPENTHREAD' OT12_VERSION = 'OPENTHREAD' OT13_VERSION = 'OPENTHREAD' -# Supported device capabilites in this THCI implementation +# Supported device capabilities in this THCI implementation OT11_CAPBS = DevCapb.V1_1 OT12_CAPBS = (DevCapb.L_AIO | DevCapb.C_FFD | DevCapb.C_RFD) OT12BR_CAPBS = (DevCapb.C_BBR | DevCapb.C_Host | DevCapb.C_Comm) @@ -225,7 +225,7 @@ class OpenThreadTHCI(object): **kwargs: Arbitrary keyword arguments Includes 'EUI' and 'SerialPort' """ - self.intialize(kwargs) + self.initialize(kwargs) @abstractmethod def _connect(self): @@ -255,7 +255,7 @@ class OpenThreadTHCI(object): line str: data send to device """ - # Override the following empty methods in the dervied classes when needed + # Override the following empty methods in the derived classes when needed def _onCommissionStart(self): """Called when commissioning starts""" @@ -399,7 +399,7 @@ class OpenThreadTHCI(object): time.sleep(duration) @API - def intialize(self, params): + def initialize(self, params): """initialize the serial port with baudrate, timeout parameters""" self.mac = params.get('EUI') self.backboneNetif = params.get('Param8') or 'eth0' @@ -442,7 +442,7 @@ class OpenThreadTHCI(object): self.UIStatusMsg) ModuleHelper.WriteIntoDebugLogger('Err: OpenThread device Firmware not matching..') - # Make this class compatible with Thread referenece 20200818 + # Make this class compatible with Thread reference 20200818 self.__detectReference20200818() def __repr__(self): @@ -880,7 +880,7 @@ class OpenThreadTHCI(object): @API def setMAC(self, xEUI): - """set the extended addresss of Thread device + """set the extended address of Thread device Args: xEUI: extended address in hex format @@ -2369,7 +2369,7 @@ class OpenThreadTHCI(object): Args: sAddr: IPv6 destination address for this message xCommissionerSessionId: commissioner session id - listChannelMask: a channel array to indicate which channels to be scaned + listChannelMask: a channel array to indicate which channels to be scanned xCount: number of IEEE 802.15.4 ED Scans (milliseconds) xPeriod: Period between successive IEEE802.15.4 ED Scans (milliseconds) xScanDuration: ScanDuration when performing an IEEE 802.15.4 ED Scan (milliseconds) diff --git a/tools/harness-thci/OpenThread_BR.py b/tools/harness-thci/OpenThread_BR.py index 83e16bf1b..c22557a86 100644 --- a/tools/harness-thci/OpenThread_BR.py +++ b/tools/harness-thci/OpenThread_BR.py @@ -708,7 +708,7 @@ class OpenThread_BR(OpenThreadTHCI, IThci): @API def stopListeningToAddr(self, sAddr): """ - Unsubscribe to a given IPv6 address which was subscribed earlier wiht `registerMulticast`. + Unsubscribe to a given IPv6 address which was subscribed earlier with `registerMulticast`. Args: sAddr : str : Multicast address to be unsubscribed. Use an empty string to unsubscribe diff --git a/tools/harness-thci/OpenThread_WpanCtl.py b/tools/harness-thci/OpenThread_WpanCtl.py index 42d8aa944..1d41fe2ab 100644 --- a/tools/harness-thci/OpenThread_WpanCtl.py +++ b/tools/harness-thci/OpenThread_WpanCtl.py @@ -90,7 +90,7 @@ class OpenThread_WpanCtl(IThci): self.password = kwargs.get('Param7').strip() if kwargs.get('Param7') else None else: self.port = kwargs.get('SerialPort') - self.intialize() + self.initialize() except Exception as e: ModuleHelper.WriteIntoDebugLogger('initialize() Error: ' + str(e)) @@ -794,7 +794,7 @@ class OpenThread_WpanCtl(IThci): except Exception as e: ModuleHelper.WriteIntoDebugLogger('closeConnection() Error: ' + str(e)) - def intialize(self): + def initialize(self): """initialize the serial port with baudrate, timeout parameters""" print('%s call intialize' % self.port) try: @@ -867,7 +867,7 @@ class OpenThread_WpanCtl(IThci): return self.__sendCommand(self.wpan_cmd_prefix + 'getprop -v NCP:Channel')[0] def setMAC(self, xEUI): - """set the extended addresss of Thread device + """set the extended address of Thread device Args: xEUI: extended address in hex format @@ -2180,7 +2180,7 @@ class OpenThread_WpanCtl(IThci): Args: sAddr: IPv6 destination address for this message xCommissionerSessionId: commissioner session id - listChannelMask: a channel array to indicate which channels to be scaned + listChannelMask: a channel array to indicate which channels to be scanned xCount: number of IEEE 802.15.4 ED Scans (milliseconds) xPeriod: Period between successive IEEE802.15.4 ED Scans (milliseconds) xScanDuration: IEEE 802.15.4 ScanDuration to use when performing an IEEE 802.15.4 ED Scan (milliseconds) diff --git a/tools/otci/otci/otci.py b/tools/otci/otci/otci.py index 9a8c2cb22..d9d5c1f25 100644 --- a/tools/otci/otci/otci.py +++ b/tools/otci/otci/otci.py @@ -1975,14 +1975,14 @@ class OTCI(object): def enable_backbone_router(self): """Enable Backbone Router Service for Thread 1.2 FTD. - SRV_DATA.ntf would be triggerred for attached device if there is no Backbone Router Service in Thread Network Data. + SRV_DATA.ntf would be triggered for attached device if there is no Backbone Router Service in Thread Network Data. """ self.execute_command('bbr enable') def disable_backbone_router(self): """Disable Backbone Router Service for Thread 1.2 FTD. - SRV_DATA.ntf would be triggerred if Backbone Router is Primary state. + SRV_DATA.ntf would be triggered if Backbone Router is Primary state. """ self.execute_command('bbr disable') @@ -2036,7 +2036,7 @@ class OTCI(object): def register_backbone_router_dataset(self): """Register Backbone Router Service for Thread 1.2 FTD. - SRV_DATA.ntf would be triggerred for attached device. + SRV_DATA.ntf would be triggered for attached device. """ self.execute_command('bbr register') diff --git a/tools/spi-hdlc-adapter/spi-hdlc-adapter.c b/tools/spi-hdlc-adapter/spi-hdlc-adapter.c index 0adff6b73..48c256c93 100644 --- a/tools/spi-hdlc-adapter/spi-hdlc-adapter.c +++ b/tools/spi-hdlc-adapter/spi-hdlc-adapter.c @@ -1416,7 +1416,7 @@ static void print_help(void) " --spi-mode[=mode] ............ Specify the SPI mode to use (0-3).\n" " --spi-speed[=hertz] .......... Specify the SPI speed in hertz.\n" " --spi-cs-delay[=usec] ........ Specify the delay after C̅S̅ assertion, in µsec\n" - " --spi-reset-delay[=ms] ....... Specify the delay after R̅E̅S̅E̅T̅ assertion, in miliseconds\n" + " --spi-reset-delay[=ms] ....... Specify the delay after R̅E̅S̅E̅T̅ assertion, in milliseconds\n" " --spi-align-allowance[=n] .... Specify the maximum number of 0xFF bytes to\n" " clip from start of MISO frame. Max value is 16.\n" " --spi-small-packet=[n] ....... Specify the smallest packet we can receive\n"