diff --git a/examples/platforms/simulation/openthread-core-simulation-config.h b/examples/platforms/simulation/openthread-core-simulation-config.h index 78bd55f16..f71383008 100644 --- a/examples/platforms/simulation/openthread-core-simulation-config.h +++ b/examples/platforms/simulation/openthread-core-simulation-config.h @@ -257,7 +257,7 @@ /** * @def OPENTHREAD_CONFIG_DETERMINISTIC_ECDSA_ENABLE * - * Define to 1 to generate ECDSA signatures determinsitically + * Define to 1 to generate ECDSA signatures deterministically * according to RFC 6979 instead of randomly. * */ diff --git a/include/openthread/dataset.h b/include/openthread/dataset.h index ac034364b..efd18bc4b 100644 --- a/include/openthread/dataset.h +++ b/include/openthread/dataset.h @@ -229,7 +229,7 @@ typedef struct otTimestamp /** * This structure represents an Active or Pending Operational Dataset. * - * Components in Dataset are optional. `mComponets` structure specifies which components are present in the Dataset. + * Components in Dataset are optional. `mComponents` structure specifies which components are present in the Dataset. * */ typedef struct otOperationalDataset diff --git a/include/openthread/history_tracker.h b/include/openthread/history_tracker.h index 02d72f2e5..79a255a77 100644 --- a/include/openthread/history_tracker.h +++ b/include/openthread/history_tracker.h @@ -43,7 +43,7 @@ extern "C" { * Records the history of different events, for example RX and TX messages or network info changes. All tracked * entries are timestamped. * - * The functions in this module are available when `OPENTHREAD_CONFIG_HISTOR_TRACKER_ENABLE` is enabled. + * The functions in this module are available when `OPENTHREAD_CONFIG_HISTORY_TRACKER_ENABLE` is enabled. * * @{ * @@ -152,7 +152,7 @@ typedef struct otHistoryTrackerMessageInfo uint16_t mChecksum; ///< Message checksum (valid only for UDP/TCP/ICMP6). uint8_t mIpProto; ///< IP Protocol number (`OT_IP6_PROTO_*` enumeration). uint8_t mIcmp6Type; ///< ICMP6 type if msg is ICMP6, zero otherwise (`OT_ICMP6_TYPE_*` enumeration). - int8_t mAveRxRss; ///< RSS of received message or OT_RADIO_INVALI_RSSI if not known. + int8_t mAveRxRss; ///< RSS of received message or OT_RADIO_INVALID_RSSI if not known. bool mLinkSecurity : 1; ///< Indicates whether msg used link security. bool mTxSuccess : 1; ///< Indicates TX success (e.g., ack received). Applicable for TX msg only. uint8_t mPriority : 2; ///< Message priority (`OT_HISTORY_TRACKER_MSG_PRIORITY_*` enumeration). diff --git a/include/openthread/instance.h b/include/openthread/instance.h index 8f523cbe1..1ccca2691 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 (308) +#define OPENTHREAD_API_VERSION (309) /** * @addtogroup api-instance diff --git a/include/openthread/link_raw.h b/include/openthread/link_raw.h index 461b81d7a..1f43a0578 100644 --- a/include/openthread/link_raw.h +++ b/include/openthread/link_raw.h @@ -236,7 +236,7 @@ typedef void (*otLinkRawEnergyScanDone)(otInstance *aInstance, int8_t aEnergySca * @param[in] aCallback A pointer to a function called on completion of a scanned channel. * * @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. * @retval OT_ERROR_INVALID_STATE If the raw link-layer isn't enabled. * diff --git a/include/openthread/ncp.h b/include/openthread/ncp.h index fb766ef9d..4576c7fd3 100644 --- a/include/openthread/ncp.h +++ b/include/openthread/ncp.h @@ -158,7 +158,7 @@ typedef bool (*otNcpDelegateAllowPeekPoke)(uint32_t aAddress, uint16_t aCount); * @param[in] aAllowPokeDelegate Delegate function pointer for poke operation. * */ -void otNcpRegisterPeekPokeDelagates(otNcpDelegateAllowPeekPoke aAllowPeekDelegate, +void otNcpRegisterPeekPokeDelegates(otNcpDelegateAllowPeekPoke aAllowPeekDelegate, otNcpDelegateAllowPeekPoke aAllowPokeDelegate); /** diff --git a/include/openthread/platform/udp.h b/include/openthread/platform/udp.h index 5b4a21c6c..b1dae45c7 100644 --- a/include/openthread/platform/udp.h +++ b/include/openthread/platform/udp.h @@ -68,7 +68,7 @@ otError otPlatUdpClose(otUdpSocket *aUdpSocket); * * @param[in] aUdpSocket A pointer to the UDP socket. * - * @retval OT_ERROR_NONE Successfully binded UDP socket by platform. + * @retval OT_ERROR_NONE Successfully bound UDP socket by platform. * @retval OT_ERROR_FAILED Failed to bind UDP socket. * */ @@ -107,7 +107,7 @@ otError otPlatUdpConnect(otUdpSocket *aUdpSocket); * @param[in] aMessageInfo A pointer to the message info associated with @p aMessage. * * @retval OT_ERROR_NONE Successfully sent by platform, and @p aMessage is freed. - * @retval OT_ERROR_FAILED Failed to binded UDP socket. + * @retval OT_ERROR_FAILED Failed to bind UDP socket. * */ otError otPlatUdpSend(otUdpSocket *aUdpSocket, otMessage *aMessage, const otMessageInfo *aMessageInfo); diff --git a/include/openthread/srp_server.h b/include/openthread/srp_server.h index 4dceee203..c3dd36b2f 100644 --- a/include/openthread/srp_server.h +++ b/include/openthread/srp_server.h @@ -327,7 +327,7 @@ void otSrpServerSetEnabled(otInstance *aInstance, bool aEnabled); * it stays enabled). * * @param[in] aInstance A pointer to an OpenThread instance. - * @param[in] aEnbaled A boolean to enable/disable the auto-enable mode. + * @param[in] aEnabled A boolean to enable/disable the auto-enable mode. * */ void otSrpServerSetAutoEnableMode(otInstance *aInstance, bool aEnabled); diff --git a/include/openthread/thread.h b/include/openthread/thread.h index df663f7f5..ed45a8c50 100644 --- a/include/openthread/thread.h +++ b/include/openthread/thread.h @@ -416,7 +416,7 @@ otError otThreadSetLinkMode(otInstance *aInstance, otLinkModeConfig aConfig); * Get the Thread Network Key. * * @param[in] aInstance A pointer to an OpenThread instance. - * @param[out] aNetworkKey A pointer to an `otNetworkkey` to return the Thread Network Key. + * @param[out] aNetworkKey A pointer to an `otNetworkKey` to return the Thread Network Key. * * @sa otThreadSetNetworkKey * diff --git a/src/cli/Makefile.am b/src/cli/Makefile.am index 43d1b4750..6df2c08e1 100644 --- a/src/cli/Makefile.am +++ b/src/cli/Makefile.am @@ -65,23 +65,23 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am # # Thus, the existing(previous) way *THIS* library was compiled is # exactly the FTD path. Meaning the "cli" library always sees -# the FTD varients of various headers/classes. +# the FTD variants of various headers/classes. # # The same is true of the "ncp" library. # -# HOWEVER there are two varients of the CLI application, CLI-MTD -# and CLI-FTD (and likewise, two varients of the ncp application) +# HOWEVER there are two variants of the CLI application, CLI-MTD +# and CLI-FTD (and likewise, two variants of the ncp application) # These applications link against two different OpenThread libraries. # # Which flavor, you get depends upon which library: "mtd" or "ftd" is linked. # # Which on the surface appear to link fine against the MTD/FTD library. # -# In this description/example we focus on the "nework_data_leader" -# header file. The FTD varient has many private variables, functions +# In this description/example we focus on the "network_data_leader" +# header file. The FTD variant has many private variables, functions # and other things of "FTD" (ie: full) implementation items. # -# In contrast the MTD is generaly stubbed out with stub-functions +# In contrast the MTD is generally stubbed out with stub-functions # inlined in the header that return "error not implemented" or similar. # # Thus it works... here ... With this file and this example. @@ -92,20 +92,20 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am # Is this true always? Is this robust? # Or is there a hidden "got-ya" that will snag the next person? # -# This also fails static analisys, checks. +# This also fails static analysis, checks. # Application - with MTD vrs FTD class. # Library #1 (cli-lib) with FTD selected. # Library #2 (openthread) with two different class flavors. # -# The static analisys tools will say: "NOPE" different classes! +# The static analysis tools will say: "NOPE" different classes! # Perhaps this will change if/when nothing is implemented in the 'mtd-header' # # Additionally, tools that perform "whole program optimization" will -# throw errors becuase the data structures differ greatly. +# throw errors because the data structures differ greatly. # # Hence, CLI library (and NCP) must exist in two flavors. # -# Unless and until these libraries do not "accidently" suck in +# Unless and until these libraries do not "accidentally" suck in # a "flavored" header file somewhere. lib_LIBRARIES = $(NULL) diff --git a/src/cli/README.md b/src/cli/README.md index 22da85b09..f6006955f 100644 --- a/src/cli/README.md +++ b/src/cli/README.md @@ -254,7 +254,7 @@ Done ### bbr enable -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. +Enable Backbone Router Service for Thread 1.2 FTD. `SRV_DATA.ntf` would be triggered for attached device if there is no Backbone Router Service in Thread Network Data. `OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE` is required. @@ -265,7 +265,7 @@ Done ### bbr disable -Disable Backbone Router Service for Thread 1.2 FTD. `SRV_DATA.ntf` would be triggerred if Backbone Router is Primary state. o `OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE` is required. +Disable Backbone Router Service for Thread 1.2 FTD. `SRV_DATA.ntf` would be triggered if Backbone Router is Primary state. o `OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE` is required. ```bash > bbr disable @@ -274,7 +274,7 @@ Done ### bbr register -Register Backbone Router Service for Thread 1.2 FTD. `SRV_DATA.ntf` would be triggerred for attached device. +Register Backbone Router Service for Thread 1.2 FTD. `SRV_DATA.ntf` would be triggered for attached device. `OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE` is required. diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index b45c2c3c7..3c66637d2 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -3501,7 +3501,7 @@ void Interpreter::HandleDnsServiceResponse(otError aError, const otDnsServiceRes if (otDnsServiceResponseGetServiceInfo(aResponse, &serviceInfo) == OT_ERROR_NONE) { - OutputDnsServiceInfo(/* aIndetSize */ 0, serviceInfo); + OutputDnsServiceInfo(/* aIndentSize */ 0, serviceInfo); OutputNewLine(); } } diff --git a/src/cli/cli.hpp b/src/cli/cli.hpp index d9a59ce53..faa3d41c4 100644 --- a/src/cli/cli.hpp +++ b/src/cli/cli.hpp @@ -285,7 +285,7 @@ private: // Returns format string to output a `ValueType` (e.g., "%u" for `uint16_t`). template static constexpr const char *FormatStringFor(void); - // General temaplate implementaion. + // General template implementation. // Specializations for `uint32_t` and `int32_t` are added at the end. template otError ProcessGet(Arg aArgs[], GetHandler aGetHandler) { diff --git a/src/cli/cli_history.cpp b/src/cli/cli_history.cpp index e5285658c..0ea5ebf69 100644 --- a/src/cli/cli_history.cpp +++ b/src/cli/cli_history.cpp @@ -43,7 +43,7 @@ namespace ot { namespace Cli { static const char *const kSimpleEventStrings[] = { - "Added", // (0) OT_HISTORY_TRACKER_{NET_DATA_ENTRY/ADDRESSS_EVENT}_ADDED + "Added", // (0) OT_HISTORY_TRACKER_{NET_DATA_ENTRY/ADDRESS_EVENT}_ADDED "Removed" // (1) OT_HISTORY_TRACKER_{NET_DATA_ENTRY/ADDRESS_EVENT}_REMOVED }; diff --git a/src/cli/cli_udp.cpp b/src/cli/cli_udp.cpp index 6edc257e5..d5f379288 100644 --- a/src/cli/cli_udp.cpp +++ b/src/cli/cli_udp.cpp @@ -169,7 +169,7 @@ template <> otError UdpExample::Process(Arg aArgs[]) // Binary hex data payload VerifyOrExit(!aArgs[1].IsEmpty(), error = OT_ERROR_INVALID_ARGS); - SuccessOrExit(error = PrepareHexStringPaylod(*message, aArgs[1].GetCString())); + SuccessOrExit(error = PrepareHexStringPayload(*message, aArgs[1].GetCString())); } else { @@ -243,7 +243,7 @@ exit: return error; } -otError UdpExample::PrepareHexStringPaylod(otMessage &aMessage, const char *aHexString) +otError UdpExample::PrepareHexStringPayload(otMessage &aMessage, const char *aHexString) { enum : uint8_t { diff --git a/src/cli/cli_udp.hpp b/src/cli/cli_udp.hpp index 4bfb9ea2a..55996c7ec 100644 --- a/src/cli/cli_udp.hpp +++ b/src/cli/cli_udp.hpp @@ -75,7 +75,7 @@ private: template otError Process(Arg aArgs[]); static otError PrepareAutoGeneratedPayload(otMessage &aMessage, uint16_t aPayloadLength); - static otError PrepareHexStringPaylod(otMessage &aMessage, const char *aHexString); + static otError PrepareHexStringPayload(otMessage &aMessage, const char *aHexString); static void HandleUdpReceive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleUdpReceive(otMessage *aMessage, const otMessageInfo *aMessageInfo); diff --git a/src/core/api/nat64_api.cpp b/src/core/api/nat64_api.cpp index e296a47d8..05c589a18 100644 --- a/src/core/api/nat64_api.cpp +++ b/src/core/api/nat64_api.cpp @@ -46,7 +46,7 @@ using namespace ot; -// Note: We support the following scenrios: +// Note: We support the following scenarios: // - Using OpenThread's routing manager, while using external NAT64 translator (like tayga). // - Using OpenThread's NAT64 translator, while using external routing manager. // So OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE translator and OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE are two diff --git a/src/core/border_router/routing_manager.cpp b/src/core/border_router/routing_manager.cpp index 8cae2141a..8563c1fb4 100644 --- a/src/core/border_router/routing_manager.cpp +++ b/src/core/border_router/routing_manager.cpp @@ -1354,7 +1354,7 @@ void RoutingManager::DiscoveredPrefixTable::ProcessPrefixInfoOption(const Ip6::N Entry newEntry; newEntry.SetFrom(aPio); - entry->AdoptValidAndPreferredLiftimesFrom(newEntry); + entry->AdoptValidAndPreferredLifetimesFrom(newEntry); } mEntryTimer.FireAtIfEarlier(entry->GetExpireTime()); @@ -1764,7 +1764,7 @@ exit: void RoutingManager::DiscoveredPrefixTable::UpdateRouterOnRx(Router &aRouter) { aRouter.mNsProbeCount = 0; - aRouter.mTimeout = TimerMilli::GetNow() + Random::NonCrypto::AddJitter(Router::kActiveTimout, Router::kJitter); + aRouter.mTimeout = TimerMilli::GetNow() + Random::NonCrypto::AddJitter(Router::kActiveTimeout, Router::kJitter); mRouterTimer.FireAtIfEarlier(aRouter.mTimeout); } @@ -1805,7 +1805,7 @@ void RoutingManager::DiscoveredPrefixTable::HandleRouterTimer(void) } router.mTimeout = now + ((router.mNsProbeCount < Router::kMaxNsProbes) ? Router::kNsProbeRetryInterval - : Router::kNsProbeTimout); + : Router::kNsProbeTimeout); SendNeighborSolicitToRouter(router); } @@ -1927,9 +1927,9 @@ bool RoutingManager::DiscoveredPrefixTable::Entry::Matches(const Matcher &aMatch return (mType == aMatcher.mType) && (mPrefix == aMatcher.mPrefix); } -bool RoutingManager::DiscoveredPrefixTable::Entry::Matches(const ExpirationChecker &aCheker) const +bool RoutingManager::DiscoveredPrefixTable::Entry::Matches(const ExpirationChecker &aChecker) const { - return GetExpireTime() <= aCheker.mNow; + return GetExpireTime() <= aChecker.mNow; } TimeMilli RoutingManager::DiscoveredPrefixTable::Entry::GetExpireTime(void) const @@ -1959,7 +1959,7 @@ RoutingManager::RoutePreference RoutingManager::DiscoveredPrefixTable::Entry::Ge return IsOnLinkPrefix() ? NetworkData::kRoutePreferenceMedium : GetRoutePreference(); } -void RoutingManager::DiscoveredPrefixTable::Entry::AdoptValidAndPreferredLiftimesFrom(const Entry &aEntry) +void RoutingManager::DiscoveredPrefixTable::Entry::AdoptValidAndPreferredLifetimesFrom(const Entry &aEntry) { constexpr uint32_t kTwoHoursInSeconds = 2 * 3600; diff --git a/src/core/border_router/routing_manager.hpp b/src/core/border_router/routing_manager.hpp index 5ed94e2c8..1e365f2c5 100644 --- a/src/core/border_router/routing_manager.hpp +++ b/src/core/border_router/routing_manager.hpp @@ -292,7 +292,7 @@ public: Nat64::State GetNat64PrefixManagerState(void) const { return mNat64PrefixManager.GetState(); } /** - * Enable or disable NAT64 orefix publishing. + * Enable or disable NAT64 prefix publishing. * * @param[in] aEnabled A boolean to enable/disable NAT64 prefix publishing. * @@ -358,7 +358,7 @@ public: * @param[in] aOnMeshPrefixConfig The on-mesh prefix configuration to check. * * @retval TRUE The prefix is a valid OMR prefix. - * @retval FALE The prefix is not a valid OMR prefix. + * @retval FALSE The prefix is not a valid OMR prefix. * */ static bool IsValidOmrPrefix(const NetworkData::OnMeshPrefixConfig &aOnMeshPrefixConfig); @@ -369,7 +369,7 @@ public: * @param[in] aPrefix The prefix to check. * * @retval TRUE The prefix is a valid OMR prefix. - * @retval FALE The prefix is not a valid OMR prefix. + * @retval FALSE The prefix is not a valid OMR prefix. * */ static bool IsValidOmrPrefix(const Ip6::Prefix &aPrefix); @@ -575,13 +575,13 @@ private: RoutePreference GetPreference(void) const; bool operator==(const Entry &aOther) const; bool Matches(const Matcher &aMatcher) const; - bool Matches(const ExpirationChecker &aCheker) const; + bool Matches(const ExpirationChecker &aChecker) const; // Methods to use when `IsOnLinkPrefix()` uint32_t GetPreferredLifetime(void) const { return mShared.mPreferredLifetime; } void ClearPreferredLifetime(void) { mShared.mPreferredLifetime = 0; } bool IsDeprecated(void) const; - void AdoptValidAndPreferredLiftimesFrom(const Entry &aEntry); + void AdoptValidAndPreferredLifetimesFrom(const Entry &aEntry); // Method to use when `!IsOnlinkPrefix()` RoutePreference GetRoutePreference(void) const { return mShared.mRoutePreference; } @@ -605,11 +605,11 @@ private: { // The timeout (in msec) for router staying in active state // before starting the Neighbor Solicitation (NS) probes. - static constexpr uint32_t kActiveTimout = OPENTHREAD_CONFIG_BORDER_ROUTING_ROUTER_ACTIVE_CHECK_TIMEOUT; + static constexpr uint32_t kActiveTimeout = OPENTHREAD_CONFIG_BORDER_ROUTING_ROUTER_ACTIVE_CHECK_TIMEOUT; static constexpr uint8_t kMaxNsProbes = 5; // Max number of NS probe attempts. static constexpr uint32_t kNsProbeRetryInterval = 1000; // In msec. Time between NS probe attempts. - static constexpr uint32_t kNsProbeTimout = 2000; // In msec. Max Wait time after last NS probe. + static constexpr uint32_t kNsProbeTimeout = 2000; // In msec. Max Wait time after last NS probe. static constexpr uint32_t kJitter = 2000; // In msec. Jitter to randomize probe starts. static_assert(kMaxNsProbes < 255, "kMaxNsProbes MUST not be 255"); @@ -788,7 +788,7 @@ private: // lifetime, and selection of the NAT64 prefix to publish in // Network Data. // - // Calling methods except GeneratrLocalPrefix and SetEnabled + // Calling methods except GenerateLocalPrefix and SetEnabled // when disabled becomes no-op. explicit Nat64PrefixManager(Instance &aInstance); diff --git a/src/core/coap/coap.cpp b/src/core/coap/coap.cpp index a1c5c2109..38e561858 100644 --- a/src/core/coap/coap.cpp +++ b/src/core/coap/coap.cpp @@ -1081,8 +1081,8 @@ void CoapBase::ProcessReceivedResponse(Message &aMessage, const Ip6::MessageInfo bool responseObserve = false; #endif #if OPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE - uint8_t blockOptionType = 0; - uint32_t totalTransfereSize = 0; + uint8_t blockOptionType = 0; + uint32_t totalTransferSize = 0; #endif request = FindRelatedRequest(aMessage, aMessageInfo, metadata); @@ -1181,7 +1181,7 @@ void CoapBase::ProcessReceivedResponse(Message &aMessage, const Ip6::MessageInfo case kOptionSize2: // ToDo: wait for method to read uint option values - totalTransfereSize = 0; + totalTransferSize = 0; break; default: @@ -1212,8 +1212,8 @@ void CoapBase::ProcessReceivedResponse(Message &aMessage, const Ip6::MessageInfo case 2: // Block2 option if (aMessage.GetCode() < kCodeBadRequest && metadata.mBlockwiseReceiveHook != nullptr) { - error = SendNextBlock2Request(*request, aMessage, aMessageInfo, metadata, totalTransfereSize, - false); + error = + SendNextBlock2Request(*request, aMessage, aMessageInfo, metadata, totalTransferSize, false); } if (aMessage.GetCode() >= kCodeBadRequest || metadata.mBlockwiseReceiveHook == nullptr || @@ -1226,7 +1226,7 @@ void CoapBase::ProcessReceivedResponse(Message &aMessage, const Ip6::MessageInfo if (aMessage.GetCode() < kCodeBadRequest && metadata.mBlockwiseReceiveHook != nullptr) { error = - SendNextBlock2Request(*request, aMessage, aMessageInfo, metadata, totalTransfereSize, true); + SendNextBlock2Request(*request, aMessage, aMessageInfo, metadata, totalTransferSize, true); } FinalizeCoapTransaction(*request, metadata, &aMessage, &aMessageInfo, error); @@ -1295,9 +1295,9 @@ void CoapBase::ProcessReceivedRequest(Message &aMessage, const Ip6::MessageInfo Error error = kErrorNone; #if OPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE Option::Iterator iterator; - char *curUriPath = uriPath; - uint8_t blockOptionType = 0; - uint32_t totalTransfereSize = 0; + char *curUriPath = uriPath; + uint8_t blockOptionType = 0; + uint32_t totalTransferSize = 0; #endif if (mInterceptor.IsSet()) @@ -1350,7 +1350,7 @@ void CoapBase::ProcessReceivedRequest(Message &aMessage, const Ip6::MessageInfo case kOptionSize1: // ToDo: wait for method to read uint option values - totalTransfereSize = 0; + totalTransferSize = 0; break; default: @@ -1376,7 +1376,7 @@ void CoapBase::ProcessReceivedRequest(Message &aMessage, const Ip6::MessageInfo case 1: if (resource.mReceiveHook != nullptr) { - switch (ProcessBlock1Request(aMessage, aMessageInfo, resource, totalTransfereSize)) + switch (ProcessBlock1Request(aMessage, aMessageInfo, resource, totalTransferSize)) { case kErrorNone: resource.HandleRequest(aMessage, aMessageInfo); @@ -1643,7 +1643,7 @@ bool TxParameters::IsValid(void) const if ((mAckRandomFactorDenominator > 0) && (mAckRandomFactorNumerator >= mAckRandomFactorDenominator) && (mAckTimeout >= OT_COAP_MIN_ACK_TIMEOUT) && (mMaxRetransmit <= OT_COAP_MAX_RETRANSMIT)) { - // Calulate exchange lifetime step by step and verify no overflow. + // Calculate exchange lifetime step by step and verify no overflow. uint32_t tmp = Multiply(mAckTimeout, (1U << (mMaxRetransmit + 1)) - 1); tmp = Multiply(tmp, mAckRandomFactorNumerator); diff --git a/src/core/coap/coap_message.hpp b/src/core/coap/coap_message.hpp index b5bf83153..40c9c9785 100644 --- a/src/core/coap/coap_message.hpp +++ b/src/core/coap/coap_message.hpp @@ -634,7 +634,7 @@ public: void SetBlockWiseBlockNumber(uint32_t aBlockNumber) { GetHelpData().mBlockWiseData.mBlockNumber = aBlockNumber; } /** - * This method sets the More Blocks falg in the message HelpData. + * This method sets the More Blocks flag in the message HelpData. * * @param[in] aMoreBlocks TRUE or FALSE. * diff --git a/src/core/common/heap_data.hpp b/src/core/common/heap_data.hpp index 97c12a306..20545dae0 100644 --- a/src/core/common/heap_data.hpp +++ b/src/core/common/heap_data.hpp @@ -94,7 +94,7 @@ public: /** * This method returns the `Heap::Data` length. * - * @returns The data length (number of bytes) or zero if the `HeadpData` is null. + * @returns The data length (number of bytes) or zero if the `HeapData` is null. * */ uint16_t GetLength(void) const { return mData.GetLength(); } diff --git a/src/core/common/pool.hpp b/src/core/common/pool.hpp index 279655f14..4a0f0e542 100644 --- a/src/core/common/pool.hpp +++ b/src/core/common/pool.hpp @@ -82,7 +82,7 @@ public: * This constructor initializes the pool. * * This constructor version requires the `Type` class to provide method `void Init(Instance &)` to initialize - * each `Type` entry object. This can be realized by the `Type` class inheriting from `InstaceLocatorInit()`. + * each `Type` entry object. This can be realized by the `Type` class inheriting from `InstanceLocatorInit()`. * * @param[in] aInstance A reference to the OpenThread instance. * diff --git a/src/core/common/preference.hpp b/src/core/common/preference.hpp index a4e2651a6..cf0657dd7 100644 --- a/src/core/common/preference.hpp +++ b/src/core/common/preference.hpp @@ -87,7 +87,7 @@ public: /** * This static method indicates whether a given `int8_t` preference value is valid, i.e., whether it has of the - * three values `kHigh`, `kMediumm`, or `kLow`. + * three values `kHigh`, `kMedium`, or `kLow`. * * @param[in] aPrf The signed preference value to check. * diff --git a/src/core/common/trickle_timer.cpp b/src/core/common/trickle_timer.cpp index fe84d8aea..7258cd27e 100644 --- a/src/core/common/trickle_timer.cpp +++ b/src/core/common/trickle_timer.cpp @@ -158,7 +158,7 @@ void TrickleTimer::HandleTimer(void) } StartNewInterval(); - ExitNow(); // Exit so to not call `mHanlder` + ExitNow(); // Exit so to not call `mHandler` } break; diff --git a/src/core/config/misc.h b/src/core/config/misc.h index 918531cc2..bed58df81 100644 --- a/src/core/config/misc.h +++ b/src/core/config/misc.h @@ -103,7 +103,7 @@ /** * @def OPENTHREAD_CONFIG_DETERMINISTIC_ECDSA_ENABLE * - * Define to 1 to generate ECDSA signatures determinsitically + * Define to 1 to generate ECDSA signatures deterministically * according to RFC 6979 instead of randomly. * */ @@ -194,7 +194,7 @@ * to that on 32bit system. As a result, the first message always have some * bytes left for small packets. * - * Some configuration options can increase the buffer size requirments, including + * Some configuration options can increase the buffer size requirements, including * OPENTHREAD_CONFIG_MLE_MAX_CHILDREN and OPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE. * */ @@ -271,9 +271,9 @@ /** * @def OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS * - * Define as 1 to enable bultin-mbedtls. + * Define as 1 to enable builtin-mbedtls. * - * Note that the OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS determines whether to use bultin-mbedtls as well as + * Note that the OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS determines whether to use builtin-mbedtls as well as * whether to manage mbedTLS internally, such as memory allocation and debug. * */ @@ -284,7 +284,7 @@ /** * @def OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT * - * Define as 1 to enable bultin mbedtls management. + * Define as 1 to enable builtin mbedtls management. * * OPENTHREAD_CONFIG_ENABLE_BUILTIN_MBEDTLS_MANAGEMENT determines whether to manage mbedTLS memory * allocation and debug config internally. If not configured, the default is to enable builtin diff --git a/src/core/config/openthread-core-config-check.h b/src/core/config/openthread-core-config-check.h index 685fb9123..8d03a000b 100644 --- a/src/core/config/openthread-core-config-check.h +++ b/src/core/config/openthread-core-config-check.h @@ -505,7 +505,7 @@ #ifdef OPENTHREAD_CONFIG_SRP_SERVER_SERVICE_NUMBER #error "OPENTHREAD_CONFIG_SRP_SERVER_SERVICE_NUMBER was removed. "\ - "Service numbers are defined in `network_data_servcie.hpp` per spec" + "Service numbers are defined in `network_data_service.hpp` per spec" #endif #ifdef OPENTHREAD_CONFIG_SRP_SERVER_UDP_PORT @@ -654,4 +654,14 @@ "Netdiag server functionality is always supported." #endif +#ifdef OPENTHREAD_CONFIG_PING_SENDER_DEFAULT_INTEVRAL +#error "OPENTHREAD_CONFIG_PING_SENDER_DEFAULT_INTEVRAL was replaced by "\ + "OPENTHREAD_CONFIG_PING_SENDER_DEFAULT_INTERVAL." +#endif + +#ifdef OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDDRESS_MODE +#error "OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDDRESS_MODE was replaced by "\ + "OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDRESS_MODE." +#endif + #endif // OPENTHREAD_CORE_CONFIG_CHECK_H_ diff --git a/src/core/config/ping_sender.h b/src/core/config/ping_sender.h index 2143389c8..d655b1dc8 100644 --- a/src/core/config/ping_sender.h +++ b/src/core/config/ping_sender.h @@ -48,13 +48,13 @@ #endif /** - * @def OPENTHREAD_CONFIG_PING_SENDER_DEFAULT_INTEVRAL + * @def OPENTHREAD_CONFIG_PING_SENDER_DEFAULT_INTERVAL * * Specifies the default ping interval (time between sending echo requests) in milliseconds. * */ -#ifndef OPENTHREAD_CONFIG_PING_SENDER_DEFAULT_INTEVRAL -#define OPENTHREAD_CONFIG_PING_SENDER_DEFAULT_INTEVRAL 1000 +#ifndef OPENTHREAD_CONFIG_PING_SENDER_DEFAULT_INTERVAL +#define OPENTHREAD_CONFIG_PING_SENDER_DEFAULT_INTERVAL 1000 #endif /** diff --git a/src/core/config/srp_server.h b/src/core/config/srp_server.h index aeffbdf31..5b76ec3ee 100644 --- a/src/core/config/srp_server.h +++ b/src/core/config/srp_server.h @@ -46,7 +46,7 @@ #endif /** - * @def OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDDRESS_MODE + * @def OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDRESS_MODE * * Specifies the default address mode used by the SRP server. * @@ -56,8 +56,8 @@ * The value of this configuration should be from `otSrpServerAddressMode` enumeration. * */ -#ifndef OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDDRESS_MODE -#define OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDDRESS_MODE OT_SRP_SERVER_ADDRESS_MODE_UNICAST +#ifndef OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDRESS_MODE +#define OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDRESS_MODE OT_SRP_SERVER_ADDRESS_MODE_UNICAST #endif /** diff --git a/src/core/config/tmf.h b/src/core/config/tmf.h index 5632b8f64..653ed75e4 100644 --- a/src/core/config/tmf.h +++ b/src/core/config/tmf.h @@ -228,7 +228,7 @@ /** * @def OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE * - * This setting configures the Multicast Listener Registration parent proxing in Thread 1.2. + * This setting configures the Multicast Listener Registration parent proxying in Thread 1.2. * */ #ifndef OPENTHREAD_CONFIG_TMF_PROXY_MLR_ENABLE diff --git a/src/core/crypto/storage.hpp b/src/core/crypto/storage.hpp index d435e3432..e7189e09f 100644 --- a/src/core/crypto/storage.hpp +++ b/src/core/crypto/storage.hpp @@ -204,7 +204,7 @@ public: * This method sets the `Key` as a literal key from a given byte array and length. * * @param[in] aKeyBytes A pointer to buffer containing the key. - * @param[in] aKeyLength The key length (number of bytes in @p akeyBytes). + * @param[in] aKeyLength The key length (number of bytes in @p aKeyBytes). * */ void Set(const uint8_t *aKeyBytes, uint16_t aKeyLength) diff --git a/src/core/mac/data_poll_sender.hpp b/src/core/mac/data_poll_sender.hpp index 13e11beea..2327bd9ad 100644 --- a/src/core/mac/data_poll_sender.hpp +++ b/src/core/mac/data_poll_sender.hpp @@ -295,7 +295,7 @@ private: bool mEnabled : 1; // Indicates whether data polling is enabled/started. bool mAttachMode : 1; // Indicates whether in attach mode (to use attach poll period). bool mRetxMode : 1; // Indicates whether last poll tx failed at mac/radio layer (poll retx mode). - uint8_t mPollTimeoutCounter : 4; // Poll timeouts counter (0 to `kQuickPollsAfterTimout`). + uint8_t mPollTimeoutCounter : 4; // Poll timeouts counter (0 to `kQuickPollsAfterTimeout`). uint8_t mPollTxFailureCounter : 4; // Poll tx failure counter (0 to `kMaxPollRetxAttempts`). uint8_t mRemainingFastPolls : 4; // Number of remaining fast polls when in transient fast polling mode. }; diff --git a/src/core/mac/mac.cpp b/src/core/mac/mac.cpp index 7a129135b..6997fd01b 100644 --- a/src/core/mac/mac.cpp +++ b/src/core/mac/mac.cpp @@ -1305,11 +1305,11 @@ void Mac::HandleTransmitDone(TxFrame &aFrame, RxFrame *aAckFrame, Error aError) if (!aFrame.IsEmpty()) { RadioType radio = aFrame.GetRadioType(); - RadioTypes requriedRadios = mLinks.GetTxFrames().GetRequiredRadioTypes(); + RadioTypes requiredRadios = mLinks.GetTxFrames().GetRequiredRadioTypes(); Get().UpdateOnSendDone(aFrame, aError); - if (requriedRadios.IsEmpty()) + if (requiredRadios.IsEmpty()) { // If the "required radio type set" is empty, successful // tx over any radio link is sufficient for overall tx to @@ -1330,7 +1330,7 @@ void Mac::HandleTransmitDone(TxFrame &aFrame, RxFrame *aAckFrame, Error aError) // `mTxError` starts as `kErrorNone` and we update it // if tx over any link in the set fails. - if (requriedRadios.Contains(radio) && (aError != kErrorNone)) + if (requiredRadios.Contains(radio) && (aError != kErrorNone)) { LogDebg("Frame tx failed on required radio link %s with error %s", RadioTypeToString(radio), ErrorToString(aError)); diff --git a/src/core/mac/mac_filter.cpp b/src/core/mac/mac_filter.cpp index a5df54ae8..97604a33c 100644 --- a/src/core/mac/mac_filter.cpp +++ b/src/core/mac/mac_filter.cpp @@ -266,7 +266,7 @@ Error Filter::ApplyToRxFrame(RxFrame &aRxFrame, const ExtAddress &aExtAddress, N { // Clear the previous RSS average to ensure the fixed RSS // value takes effect quickly. - aNeighbor->GetLinkInfo().CleaAverageRss(); + aNeighbor->GetLinkInfo().ClearAverageRss(); } exit: diff --git a/src/core/mac/mac_frame.hpp b/src/core/mac/mac_frame.hpp index 13b603311..78924bfc2 100644 --- a/src/core/mac/mac_frame.hpp +++ b/src/core/mac/mac_frame.hpp @@ -381,7 +381,7 @@ public: * @param[in] aVerion Frame version. * @param[in] aAddrs Frame source and destination addresses (each can be none, short, or extended). * @param[in] aPanIds Source and destination PAN IDs. - * @param[in] aSeucirtyLevel Frame security level. + * @param[in] aSecurityLevel Frame security level. * @param[in] aKeyIdMode Frame security key ID mode. * */ diff --git a/src/core/mac/sub_mac.cpp b/src/core/mac/sub_mac.cpp index 15d85554a..8e2fc8f32 100644 --- a/src/core/mac/sub_mac.cpp +++ b/src/core/mac/sub_mac.cpp @@ -1116,7 +1116,7 @@ void SubMac::HandleCslTimer(void) * sample sleep sample sleep * * When the radio doesn't support receive-timing: - * The handler will be called twice per CSL period: at the begining of sample and sleep. When the handler is + * The handler will be called twice per CSL period: at the beginning of sample and sleep. When the handler is * called, it will explicitly change the radio state due to the current state by calling `Radio::Receive` or * `Radio::Sleep`. * @@ -1160,7 +1160,7 @@ void SubMac::HandleCslTimer(void) Get().UpdateCslSampleTime(mCslSampleTime.GetValue()); - // Scedule reception window for any state except RX - so that CSL RX Window has lower priority + // Schedule reception window for any state except RX - so that CSL RX Window has lower priority // than scanning or RX after the data poll. if (RadioSupportsReceiveTiming() && (mState != kStateDisabled) && (mState != kStateReceive)) { diff --git a/src/core/meshcop/dataset_manager.cpp b/src/core/meshcop/dataset_manager.cpp index 49d72c5ff..7dcef3da2 100644 --- a/src/core/meshcop/dataset_manager.cpp +++ b/src/core/meshcop/dataset_manager.cpp @@ -116,7 +116,7 @@ Error DatasetManager::Save(const Dataset &aDataset) { Error error = kErrorNone; int compare; - bool isNetworkkeyUpdated = false; + bool isNetworkKeyUpdated = false; if (aDataset.GetTimestamp(GetType(), mTimestamp) == kErrorNone) { @@ -124,13 +124,13 @@ Error DatasetManager::Save(const Dataset &aDataset) if (IsActiveDataset()) { - SuccessOrExit(error = aDataset.ApplyConfiguration(GetInstance(), &isNetworkkeyUpdated)); + SuccessOrExit(error = aDataset.ApplyConfiguration(GetInstance(), &isNetworkKeyUpdated)); } } compare = Timestamp::Compare(mTimestampValid ? &mTimestamp : nullptr, mLocal.GetTimestamp()); - if (isNetworkkeyUpdated || compare > 0) + if (isNetworkKeyUpdated || compare > 0) { SuccessOrExit(error = mLocal.Save(aDataset)); diff --git a/src/core/meshcop/joiner.cpp b/src/core/meshcop/joiner.cpp index fc6ac92c6..84b7d5565 100644 --- a/src/core/meshcop/joiner.cpp +++ b/src/core/meshcop/joiner.cpp @@ -395,7 +395,7 @@ void Joiner::HandleSecureCoapClientConnect(bool aConnected) { SetState(kStateConnected); SendJoinerFinalize(); - mTimer.Start(kReponseTimeout); + mTimer.Start(kResponseTimeout); } else { @@ -503,7 +503,7 @@ void Joiner::HandleJoinerFinalizeResponse(Coap::Message *aMessage, const Ip6::Me SuccessOrExit(Tlv::Find(*aMessage, state)); SetState(kStateEntrust); - mTimer.Start(kReponseTimeout); + mTimer.Start(kResponseTimeout); LogInfo("Received %s %d", UriToString(), state); diff --git a/src/core/meshcop/joiner.hpp b/src/core/meshcop/joiner.hpp index f47dddb76..81e4b2bbb 100644 --- a/src/core/meshcop/joiner.hpp +++ b/src/core/meshcop/joiner.hpp @@ -185,7 +185,7 @@ private: static constexpr uint16_t kJoinerUdpPort = OPENTHREAD_CONFIG_JOINER_UDP_PORT; static constexpr uint32_t kConfigExtAddressDelay = 100; // in msec. - static constexpr uint32_t kReponseTimeout = 4000; ///< Max wait time to receive response (in msec). + static constexpr uint32_t kResponseTimeout = 4000; ///< Max wait time to receive response (in msec). struct JoinerRouter { diff --git a/src/core/meshcop/meshcop_tlvs.hpp b/src/core/meshcop/meshcop_tlvs.hpp index fac5836a1..1cd275505 100644 --- a/src/core/meshcop/meshcop_tlvs.hpp +++ b/src/core/meshcop/meshcop_tlvs.hpp @@ -124,7 +124,7 @@ public: * Max length of Provisioning URL TLV. * */ - static constexpr uint8_t kMaxkProvisioningUrlLength = OT_PROVISIONING_URL_MAX_SIZE; + static constexpr uint8_t kMaxProvisioningUrlLength = OT_PROVISIONING_URL_MAX_SIZE; static constexpr uint8_t kMaxVendorNameLength = 32; ///< Max length of Vendor Name TLV. static constexpr uint8_t kMaxVendorModelLength = 32; ///< Max length of Vendor Model TLV. @@ -1559,7 +1559,7 @@ private: * This class defines Provisioning TLV constants and types. * */ -typedef StringTlvInfo ProvisioningUrlTlv; +typedef StringTlvInfo ProvisioningUrlTlv; /** * This class defines Vendor Name TLV constants and types. diff --git a/src/core/net/checksum.cpp b/src/core/net/checksum.cpp index 6c9d3aff1..df761d429 100644 --- a/src/core/net/checksum.cpp +++ b/src/core/net/checksum.cpp @@ -125,7 +125,7 @@ void Checksum::Calculate(const Ip4::Address &aSource, uint16_t length = aMessage.GetLength() - aMessage.GetOffset(); // Pseudo-header for checksum calculation (RFC-768/792/793). - // Note: ICMP checksum won't count the presudo header like TCP and UDP. + // Note: ICMP checksum won't count the pseudo header like TCP and UDP. if (aIpProto != Ip4::kProtoIcmp) { AddData(aSource.GetBytes(), sizeof(Ip4::Address)); diff --git a/src/core/net/dhcp6.hpp b/src/core/net/dhcp6.hpp index 6a1f3dac5..5d65f2163 100644 --- a/src/core/net/dhcp6.hpp +++ b/src/core/net/dhcp6.hpp @@ -480,7 +480,7 @@ class IaAddress : public Option { public: static constexpr uint32_t kDefaultPreferredLifetime = 0xffffffffU; ///< Default preferred lifetime. - static constexpr uint32_t kDefaultValidLiftetime = 0xffffffffU; ///< Default valid lifetime. + static constexpr uint32_t kDefaultValidLifetime = 0xffffffffU; ///< Default valid lifetime. /** * This method initializes the DHCPv6 Option. diff --git a/src/core/net/dhcp6_server.cpp b/src/core/net/dhcp6_server.cpp index 5b66f1518..431833bcf 100644 --- a/src/core/net/dhcp6_server.cpp +++ b/src/core/net/dhcp6_server.cpp @@ -470,7 +470,7 @@ Error Server::AddIaAddress(Message &aMessage, const Ip6::Address &aPrefix, Clien option.GetAddress().SetPrefix(aPrefix.mFields.m8, OT_IP6_PREFIX_BITSIZE); option.GetAddress().GetIid().SetFromExtAddress(aClientId.GetDuidLinkLayerAddress()); option.SetPreferredLifetime(IaAddress::kDefaultPreferredLifetime); - option.SetValidLifetime(IaAddress::kDefaultValidLiftetime); + option.SetValidLifetime(IaAddress::kDefaultValidLifetime); SuccessOrExit(error = aMessage.Append(option)); exit: diff --git a/src/core/net/dns_client.cpp b/src/core/net/dns_client.cpp index 531a6b208..043114742 100644 --- a/src/core/net/dns_client.cpp +++ b/src/core/net/dns_client.cpp @@ -950,7 +950,7 @@ Error Client::StartQuery(QueryInfo &aInfo, const char *aLabel, const char *aName // with the first one. SuccessOrExit(AllocateQuery(aInfo, aLabel, aName, secondQuery)); - IgnoreError(SendQuery(*secondQuery, aInfo, /* aUpdateTiemr */ true)); + IgnoreError(SendQuery(*secondQuery, aInfo, /* aUpdateTimer */ true)); // Update first query to link to second one by updating // its `mNextQuery`. @@ -1090,7 +1090,7 @@ Error Client::SendQuery(Query &aQuery, QueryInfo &aInfo, bool aUpdateTimer) SuccessOrExit(error = InitTcpSocket()); SuccessOrExit( error = mEndpoint.Connect(AsCoreType(&aInfo.mConfig.mServerSockAddr), OT_TCP_CONNECT_NO_FAST_OPEN)); - mTcpState = kTcpConecting; + mTcpState = kTcpConnecting; PrepareTcpMessage(*message); break; case kTcpConnectedIdle: @@ -1098,7 +1098,7 @@ Error Client::SendQuery(Query &aQuery, QueryInfo &aInfo, bool aUpdateTimer) SuccessOrExit(error = mEndpoint.SendByReference(mSendLink, /* aFlags */ 0)); mTcpState = kTcpConnectedSending; break; - case kTcpConecting: + case kTcpConnecting: PrepareTcpMessage(*message); break; case kTcpConnectedSending: @@ -1343,7 +1343,7 @@ bool Client::CanFinalizeQuery(Query &aQuery) // Determines whether we can finalize a main query by checking if // we have received and saved responses for all other related // queries associated with `aQuery`. Note that this method is - // called when we receive a response for `aQeury`, so no need to + // called when we receive a response for `aQuery`, so no need to // check for a saved response for `aQuery` itself. bool canFinalize = true; @@ -1601,7 +1601,7 @@ Error Client::ReadFromLinkBuffer(const otLinkedBuffer *&aLinkedBuffer, // and copy the content into `aMessage`. As we read we can move // to the next `aLinkedBuffer` and update `aOffset`. // Returns: - // - `kErrorNone` if `aLengh` bytes are successfully read and + // - `kErrorNone` if `aLength` bytes are successfully read and // `aOffset` and `aLinkedBuffer` are updated. // - `kErrorNotFound` is not enough bytes available to read // from `aLinkedBuffer`. diff --git a/src/core/net/dns_client.hpp b/src/core/net/dns_client.hpp index 74a74036d..12c63b9a9 100644 --- a/src/core/net/dns_client.hpp +++ b/src/core/net/dns_client.hpp @@ -763,7 +763,7 @@ private: enum TcpState : uint8_t { kTcpUninitialized = 0, - kTcpConecting, + kTcpConnecting, kTcpConnectedIdle, kTcpConnectedSending, }; diff --git a/src/core/net/dns_types.cpp b/src/core/net/dns_types.cpp index a5a964a7f..7c3241e95 100644 --- a/src/core/net/dns_types.cpp +++ b/src/core/net/dns_types.cpp @@ -183,7 +183,7 @@ Error Name::AppendMultipleLabels(const char *aLabels, uint8_t aLength, Message & { ch = index < aLength ? aLabels[index] : static_cast(kNullChar); - if ((ch == kNullChar) || (ch == kLabelSeperatorChar)) + if ((ch == kNullChar) || (ch == kLabelSeparatorChar)) { uint8_t labelLength = static_cast(index - labelStartIndex); @@ -328,7 +328,7 @@ Error Name::ReadName(const Message &aMessage, uint16_t &aOffset, char *aNameBuff if (!firstLabel) { - *aNameBuffer++ = kLabelSeperatorChar; + *aNameBuffer++ = kLabelSeparatorChar; aNameBufferSize--; // No need to check if we have reached end of the name buffer @@ -345,7 +345,7 @@ Error Name::ReadName(const Message &aMessage, uint16_t &aOffset, char *aNameBuff case kErrorNotFound: // We reach the end of name successfully. Always add a terminating dot // at the end. - *aNameBuffer++ = kLabelSeperatorChar; + *aNameBuffer++ = kLabelSeparatorChar; aNameBufferSize--; VerifyOrExit(aNameBufferSize >= sizeof(uint8_t), error = kErrorNoBufs); *aNameBuffer = kNullChar; @@ -382,7 +382,7 @@ Error Name::CompareName(const Message &aMessage, uint16_t &aOffset, const char * LabelIterator iterator(aMessage, aOffset); bool matches = true; - if (*aName == kLabelSeperatorChar) + if (*aName == kLabelSeparatorChar) { aName++; VerifyOrExit(*aName == kNullChar, error = kErrorInvalidArgs); @@ -561,7 +561,7 @@ Error Name::LabelIterator::ReadLabel(char *aLabelBuffer, uint8_t &aLabelLength, if (!aAllowDotCharInLabel) { - VerifyOrExit(StringFind(aLabelBuffer, kLabelSeperatorChar) == nullptr, error = kErrorParse); + VerifyOrExit(StringFind(aLabelBuffer, kLabelSeparatorChar) == nullptr, error = kErrorParse); } exit: @@ -598,7 +598,7 @@ bool Name::LabelIterator::CompareLabel(const char *&aName, bool aIsSingleLabel) matches = (*aName == kNullChar); - if (!aIsSingleLabel && (*aName == kLabelSeperatorChar)) + if (!aIsSingleLabel && (*aName == kLabelSeparatorChar)) { matches = true; aName++; @@ -641,13 +641,13 @@ bool Name::IsSubDomainOf(const char *aName, const char *aDomain) uint16_t nameLength = StringLength(aName, kMaxNameLength); uint16_t domainLength = StringLength(aDomain, kMaxNameLength); - if (nameLength > 0 && aName[nameLength - 1] == kLabelSeperatorChar) + if (nameLength > 0 && aName[nameLength - 1] == kLabelSeparatorChar) { nameEndsWithDot = true; --nameLength; } - if (domainLength > 0 && aDomain[domainLength - 1] == kLabelSeperatorChar) + if (domainLength > 0 && aDomain[domainLength - 1] == kLabelSeparatorChar) { domainEndsWithDot = true; --domainLength; @@ -659,7 +659,7 @@ bool Name::IsSubDomainOf(const char *aName, const char *aDomain) if (nameLength > domainLength) { - VerifyOrExit(aName[-1] == kLabelSeperatorChar); + VerifyOrExit(aName[-1] == kLabelSeparatorChar); } // This method allows either `aName` or `aDomain` to include or diff --git a/src/core/net/dns_types.hpp b/src/core/net/dns_types.hpp index 7ee4005fa..19b9061ea 100644 --- a/src/core/net/dns_types.hpp +++ b/src/core/net/dns_types.hpp @@ -514,7 +514,7 @@ public: */ static constexpr uint8_t kMaxLabelLength = kMaxLabelSize - 1; - static constexpr char kLabelSeperatorChar = '.'; + static constexpr char kLabelSeparatorChar = '.'; /** * This enumeration represents the name type. @@ -1020,7 +1020,7 @@ private: static constexpr uint16_t kPointerLabelTypeUint16 = 0xc000; // Pointer label type mask (first 2 bits). static constexpr uint16_t kPointerLabelOffsetMask = 0x3fff; // Mask for offset in a pointer label (lower 14 bits). - static constexpr bool kIsSingleLabel = true; // Used in `LabelIterator::CompareLable()`. + static constexpr bool kIsSingleLabel = true; // Used in `LabelIterator::CompareLabel()`. struct LabelIterator { @@ -2361,7 +2361,7 @@ public: * @param[in] aExtendedResponse The upper 8-bit of the extended 12-bit Response Code. * */ - void SetExtnededResponseCode(uint8_t aExtendedResponse) { GetTtlByteAt(kExtRCodeByteIndex) = aExtendedResponse; } + void SetExtendedResponseCode(uint8_t aExtendedResponse) { GetTtlByteAt(kExtRCodeByteIndex) = aExtendedResponse; } /** * This method gets the Version field. diff --git a/src/core/net/dnssd_server.cpp b/src/core/net/dnssd_server.cpp index 31efd3159..ad5b933b4 100644 --- a/src/core/net/dnssd_server.cpp +++ b/src/core/net/dnssd_server.cpp @@ -686,10 +686,10 @@ Error Server::FindPreviousLabel(const char *aName, uint8_t &aStart, uint8_t &aSt uint8_t end; VerifyOrExit(start > 0, error = kErrorNotFound); - VerifyOrExit(aName[--start] == Name::kLabelSeperatorChar, error = kErrorInvalidArgs); + VerifyOrExit(aName[--start] == Name::kLabelSeparatorChar, error = kErrorInvalidArgs); end = start; - while (start > 0 && aName[start - 1] != Name::kLabelSeperatorChar) + while (start > 0 && aName[start - 1] != Name::kLabelSeparatorChar) { start--; } @@ -1126,9 +1126,9 @@ void Server::SetQueryCallbacks(otDnssdQuerySubscribeCallback aSubscribe, void Server::HandleDiscoveredServiceInstance(const char *aServiceFullName, const otDnssdServiceInstanceInfo &aInstanceInfo) { - OT_ASSERT(StringEndsWith(aServiceFullName, Name::kLabelSeperatorChar)); - OT_ASSERT(StringEndsWith(aInstanceInfo.mFullName, Name::kLabelSeperatorChar)); - OT_ASSERT(StringEndsWith(aInstanceInfo.mHostName, Name::kLabelSeperatorChar)); + OT_ASSERT(StringEndsWith(aServiceFullName, Name::kLabelSeparatorChar)); + OT_ASSERT(StringEndsWith(aInstanceInfo.mFullName, Name::kLabelSeparatorChar)); + OT_ASSERT(StringEndsWith(aInstanceInfo.mHostName, Name::kLabelSeparatorChar)); for (QueryTransaction &query : mQueryTransactions) { @@ -1141,7 +1141,7 @@ void Server::HandleDiscoveredServiceInstance(const char *a void Server::HandleDiscoveredHost(const char *aHostFullName, const otDnssdHostInfo &aHostInfo) { - OT_ASSERT(StringEndsWith(aHostFullName, Name::kLabelSeperatorChar)); + OT_ASSERT(StringEndsWith(aHostFullName, Name::kLabelSeparatorChar)); for (QueryTransaction &query : mQueryTransactions) { diff --git a/src/core/net/ip4_types.cpp b/src/core/net/ip4_types.cpp index 449d1083e..73dce4e50 100644 --- a/src/core/net/ip4_types.cpp +++ b/src/core/net/ip4_types.cpp @@ -39,7 +39,7 @@ namespace Ip4 { Error Address::FromString(const char *aString) { - constexpr char kSeperatorChar = '.'; + constexpr char kSeparatorChar = '.'; constexpr char kNullChar = '\0'; Error error = kErrorParse; @@ -70,7 +70,7 @@ Error Address::FromString(const char *aString) break; } - VerifyOrExit(*aString == kSeperatorChar); + VerifyOrExit(*aString == kSeparatorChar); aString++; } diff --git a/src/core/net/ip4_types.hpp b/src/core/net/ip4_types.hpp index fa4bb4165..0efff96b2 100644 --- a/src/core/net/ip4_types.hpp +++ b/src/core/net/ip4_types.hpp @@ -284,7 +284,7 @@ public: static constexpr uint8_t kVersionIhlOffset = 0; static constexpr uint8_t kTrafficClassOffset = 1; static constexpr uint8_t kTotalLengthOffset = 2; - static constexpr uint8_t kIdenficationOffset = 4; + static constexpr uint8_t kIdentificationOffset = 4; static constexpr uint8_t kFlagsFragmentOffset = 6; static constexpr uint8_t kTtlOffset = 8; static constexpr uint8_t kProtocolOffset = 9; @@ -513,7 +513,7 @@ public: * @returns Whether don't fragment flag is set. * */ - bool GetDf(void) const { return HostSwap16(mFlagsFargmentOffset) & kFlagsDf; } + bool GetDf(void) const { return HostSwap16(mFlagsFragmentOffset) & kFlagsDf; } /** * This method returns the Mf flag in the IPv4 header. @@ -521,7 +521,7 @@ public: * @returns Whether more fragments flag is set. * */ - bool GetMf(void) const { return HostSwap16(mFlagsFargmentOffset) & kFlagsMf; } + bool GetMf(void) const { return HostSwap16(mFlagsFragmentOffset) & kFlagsMf; } /** * This method returns the fragment offset in the IPv4 header. @@ -529,7 +529,7 @@ public: * @returns The fragment offset of the IPv4 packet. * */ - uint16_t GetFragmentOffset(void) const { return HostSwap16(mFlagsFargmentOffset) & kFragmentOffsetMask; } + uint16_t GetFragmentOffset(void) const { return HostSwap16(mFlagsFragmentOffset) & kFragmentOffsetMask; } private: // IPv4 header @@ -561,7 +561,7 @@ private: uint8_t mDscpEcn; uint16_t mTotalLength; uint16_t mIdentification; - uint16_t mFlagsFargmentOffset; + uint16_t mFlagsFragmentOffset; uint8_t mTtl; uint8_t mProtocol; uint16_t mHeaderChecksum; @@ -571,7 +571,7 @@ private: /** * This class implements ICMP(v4). - * Note: ICMP(v4) messages will only be generated / handled by NAT64. So only header defination is required. + * Note: ICMP(v4) messages will only be generated / handled by NAT64. So only header definition is required. * */ class Icmp @@ -670,9 +670,9 @@ public: * @param[in] aRestOfHeader The rest of header field in the ICMP message. The buffer should have 4 octets. * */ - void SetRestOfHeader(const uint8_t *aRestOfheader) + void SetRestOfHeader(const uint8_t *aRestOfHeader) { - memcpy(mRestOfHeader, aRestOfheader, sizeof(mRestOfHeader)); + memcpy(mRestOfHeader, aRestOfHeader, sizeof(mRestOfHeader)); } private: diff --git a/src/core/net/nat64_translator.cpp b/src/core/net/nat64_translator.cpp index d642aa353..ee9cd2d70 100644 --- a/src/core/net/nat64_translator.cpp +++ b/src/core/net/nat64_translator.cpp @@ -414,7 +414,7 @@ Error Translator::TranslateIcmp4(Message &aMessage) { case Ip4::Icmp::Header::Type::kTypeEchoReply: { - // The only difference between ICMPv6 echo and ICMP4 echo is the message type field, so we can reinteprete it as + // The only difference between ICMPv6 echo and ICMP4 echo is the message type field, so we can reinterpret it as // ICMP6 header and set the message type. SuccessOrExit(err = aMessage.Read(0, icmp6Header)); icmp6Header.SetType(Ip6::Icmp::Header::Type::kTypeEchoReply); @@ -444,7 +444,7 @@ Error Translator::TranslateIcmp6(Message &aMessage) { case Ip6::Icmp::Header::Type::kTypeEchoRequest: { - // The only difference between ICMPv6 echo and ICMP4 echo is the message type field, so we can reinteprete it as + // The only difference between ICMPv6 echo and ICMP4 echo is the message type field, so we can reinterpret it as // ICMP6 header and set the message type. SuccessOrExit(err = aMessage.Read(0, icmp4Header)); icmp4Header.SetType(Ip4::Icmp::Header::Type::kTypeEchoRequest); diff --git a/src/core/net/nat64_translator.hpp b/src/core/net/nat64_translator.hpp index b670aa1c2..1ec16a4a6 100644 --- a/src/core/net/nat64_translator.hpp +++ b/src/core/net/nat64_translator.hpp @@ -215,7 +215,7 @@ public: * @param[in,out] aMessage the message to be processed. * * @retval kNotTranslated The message is already an IPv6 datagram. @p aMessage is not updated. - * @retval kForward The caller should contiue forwarding the datagram. + * @retval kForward The caller should continue forwarding the datagram. * @retval kDrop The caller should drop the datagram silently. * */ @@ -229,7 +229,7 @@ public: * @param[in,out] aMessage the message to be processed. * * @retval kNotTranslated The datagram is not sending to the configured NAT64 prefix. - * @retval kForward The caller should contiue forwarding the datagram. + * @retval kForward The caller should continue forwarding the datagram. * @retval kDrop The caller should drop the datagram silently. * */ diff --git a/src/core/net/srp_client.cpp b/src/core/net/srp_client.cpp index a1c8c1ca6..6335bdc4a 100644 --- a/src/core/net/srp_client.cpp +++ b/src/core/net/srp_client.cpp @@ -355,7 +355,7 @@ void Client::Stop(Requester aRequester, StopMode aMode) #if OPENTHREAD_CONFIG_SRP_CLIENT_AUTO_START_API_ENABLE #if OPENTHREAD_CONFIG_SRP_CLIENT_SWITCH_SERVER_ON_FAILURE - mAutoStart.ResetTimoutFailureCount(); + mAutoStart.ResetTimeoutFailureCount(); #endif if (aRequester == kRequesterAuto) { @@ -1494,7 +1494,7 @@ void Client::ProcessResponse(Message &aMessage) LogInfo("Received response"); #if OPENTHREAD_CONFIG_SRP_CLIENT_AUTO_START_API_ENABLE && OPENTHREAD_CONFIG_SRP_CLIENT_SWITCH_SERVER_ON_FAILURE - mAutoStart.ResetTimoutFailureCount(); + mAutoStart.ResetTimeoutFailureCount(); #endif error = Dns::Header::ResponseCodeToError(header.GetResponseCode()); @@ -1888,9 +1888,9 @@ void Client::HandleTimer(void) // callback. It works correctly due to the guard check at the // top of `SelectNextServer()`. - mAutoStart.IncrementTimoutFailureCount(); + mAutoStart.IncrementTimeoutFailureCount(); - if (mAutoStart.GetTimoutFailureCount() >= kMaxTimeoutFailuresToSwitchServer) + if (mAutoStart.GetTimeoutFailureCount() >= kMaxTimeoutFailuresToSwitchServer) { SelectNextServer(kDisallowSwitchOnRegisteredHost); } diff --git a/src/core/net/srp_client.hpp b/src/core/net/srp_client.hpp index 5c5f1d738..0b846cb56 100644 --- a/src/core/net/srp_client.hpp +++ b/src/core/net/srp_client.hpp @@ -952,13 +952,13 @@ private: void InvokeCallback(const Ip6::SockAddr *aServerSockAddr) const; #if OPENTHREAD_CONFIG_SRP_CLIENT_SWITCH_SERVER_ON_FAILURE - uint8_t GetTimoutFailureCount(void) const { return mTimoutFailureCount; } - void ResetTimoutFailureCount(void) { mTimoutFailureCount = 0; } - void IncrementTimoutFailureCount(void) + uint8_t GetTimeoutFailureCount(void) const { return mTimeoutFailureCount; } + void ResetTimeoutFailureCount(void) { mTimeoutFailureCount = 0; } + void IncrementTimeoutFailureCount(void) { - if (mTimoutFailureCount < NumericLimits::kMax) + if (mTimeoutFailureCount < NumericLimits::kMax) { - mTimoutFailureCount++; + mTimeoutFailureCount++; } } #endif @@ -972,7 +972,7 @@ private: State mState; uint8_t mAnycastSeqNum; #if OPENTHREAD_CONFIG_SRP_CLIENT_SWITCH_SERVER_ON_FAILURE - uint8_t mTimoutFailureCount; // Number of no-response timeout failures with the currently selected server. + uint8_t mTimeoutFailureCount; // Number of no-response timeout failures with the currently selected server. #endif }; #endif // OPENTHREAD_CONFIG_SRP_CLIENT_AUTO_START_API_ENABLE diff --git a/src/core/net/srp_server.cpp b/src/core/net/srp_server.cpp index f243d16a5..224d77628 100644 --- a/src/core/net/srp_server.cpp +++ b/src/core/net/srp_server.cpp @@ -2149,7 +2149,7 @@ Error Server::Host::MergeServicesAndResourcesFrom(Host &aHost) if (service.mIsDeleted) { - // `RemoveService()` does nothing if `exitsingService` is `nullptr`. + // `RemoveService()` does nothing if `existingService` is `nullptr`. RemoveService(existingService, kRetainName, kDoNotNotifyServiceHandler); continue; } diff --git a/src/core/net/srp_server.hpp b/src/core/net/srp_server.hpp index 9473b06cb..b88b13656 100644 --- a/src/core/net/srp_server.hpp +++ b/src/core/net/srp_server.hpp @@ -832,7 +832,7 @@ public: * disabled by a call to `SetEnabled()` method. Disabling auto-enable mode using `SetAutoEnableMode(false` call * will not change the current state of SRP sever (e.g., if it is enabled it stays enabled). * - * @param[in] aEnbaled A boolean to enable/disable the auto-enable mode. + * @param[in] aEnabled A boolean to enable/disable the auto-enable mode. * */ void SetAutoEnableMode(bool aEnabled); @@ -929,11 +929,11 @@ private: static constexpr uint32_t kDefaultEventsHandlerTimeout = OPENTHREAD_CONFIG_SRP_SERVER_SERVICE_UPDATE_TIMEOUT; static constexpr AddressMode kDefaultAddressMode = - static_cast(OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDDRESS_MODE); + static_cast(OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDRESS_MODE); static constexpr uint16_t kAnycastAddressModePort = 53; - // Metdata for a received SRP Update message. + // Metadata for a received SRP Update message. struct MessageMetadata { // Indicates whether the `Message` is received directly from a diff --git a/src/core/radio/trel_interface.hpp b/src/core/radio/trel_interface.hpp index 2181915ec..1822d4739 100644 --- a/src/core/radio/trel_interface.hpp +++ b/src/core/radio/trel_interface.hpp @@ -256,12 +256,12 @@ private: Peer *GetNewPeerEntry(void); void RemovePeerEntry(Peer &aEntry); - using RegsiterServiceTask = TaskletIn; + using RegisterServiceTask = TaskletIn; bool mInitialized : 1; bool mEnabled : 1; bool mFiltered : 1; - RegsiterServiceTask mRegisterServiceTask; + RegisterServiceTask mRegisterServiceTask; uint16_t mUdpPort; Packet mRxPacket; PeerTable mPeerTable; diff --git a/src/core/radio/trel_link.cpp b/src/core/radio/trel_link.cpp index f5635012d..8eb2b9e88 100644 --- a/src/core/radio/trel_link.cpp +++ b/src/core/radio/trel_link.cpp @@ -121,9 +121,9 @@ void Link::BeginTransmit(void) Mac::PanId destPanId; Header::Type type; Packet txPacket; - Neighbor *neighbor = nullptr; - Mac::RxFrame *ackFrame = nullptr; - bool isDisovery = false; + Neighbor *neighbor = nullptr; + Mac::RxFrame *ackFrame = nullptr; + bool isDiscovery = false; VerifyOrExit(mState == kStateTransmit); @@ -170,14 +170,14 @@ void Link::BeginTransmit(void) if (!mTxFrame.GetSecurityEnabled()) { - isDisovery = true; + isDiscovery = true; } else { uint8_t keyIdMode; IgnoreError(mTxFrame.GetKeyIdMode(keyIdMode)); - isDisovery = (keyIdMode == Mac::Frame::kKeyIdMode2); + isDiscovery = (keyIdMode == Mac::Frame::kKeyIdMode2); } } @@ -212,7 +212,7 @@ void Link::BeginTransmit(void) LogDebg("BeginTransmit() [%s] plen:%d", txPacket.GetHeader().ToString().AsCString(), txPacket.GetPayloadLength()); - VerifyOrExit(mInterface.Send(txPacket, isDisovery) == kErrorNone, InvokeSendDone(kErrorAbort)); + VerifyOrExit(mInterface.Send(txPacket, isDiscovery) == kErrorNone, InvokeSendDone(kErrorAbort)); if (mTxFrame.GetAckRequest()) { diff --git a/src/core/thread/csl_tx_scheduler.hpp b/src/core/thread/csl_tx_scheduler.hpp index b07357db8..e0378b228 100644 --- a/src/core/thread/csl_tx_scheduler.hpp +++ b/src/core/thread/csl_tx_scheduler.hpp @@ -97,8 +97,8 @@ public: TimeMilli GetCslLastHeard(void) const { return mCslLastHeard; } void SetCslLastHeard(TimeMilli aCslLastHeard) { mCslLastHeard = aCslLastHeard; } - uint64_t GetLastRxTimestamp(void) const { return mLastRxTimstamp; } - void SetLastRxTimestamp(uint64_t aLastRxTimestamp) { mLastRxTimstamp = aLastRxTimestamp; } + uint64_t GetLastRxTimestamp(void) const { return mLastRxTimestamp; } + void SetLastRxTimestamp(uint64_t aLastRxTimestamp) { mLastRxTimestamp = aLastRxTimestamp; } private: uint8_t mCslTxAttempts : 7; ///< Number of CSL triggered tx attempts. @@ -108,7 +108,7 @@ public: uint16_t mCslPeriod; ///< CSL sampled listening period in units of 10 symbols (160 microseconds). uint16_t mCslPhase; ///< The time when the next CSL sample will start. TimeMilli mCslLastHeard; ///< Time when last frame containing CSL IE was heard. - uint64_t mLastRxTimstamp; ///< Time when last frame containing CSL IE was received, in microseconds. + uint64_t mLastRxTimestamp; ///< Time when last frame containing CSL IE was received, in microseconds. static_assert(kMaxCslTriggeredTxAttempts < (1 << 7), "mCslTxAttempts cannot fit max!"); }; @@ -187,7 +187,7 @@ public: void Clear(void); private: - // Guard time in usec to add when checking delay while preparaing the CSL frame for tx. + // Guard time in usec to add when checking delay while preparing the CSL frame for tx. static constexpr uint32_t kFramePreparationGuardInterval = 1500; void InitFrameRequestAhead(void); diff --git a/src/core/thread/dua_manager.cpp b/src/core/thread/dua_manager.cpp index 4a0d25f1f..53faa17f8 100644 --- a/src/core/thread/dua_manager.cpp +++ b/src/core/thread/dua_manager.cpp @@ -105,7 +105,7 @@ void DuaManager::HandleDomainPrefixUpdate(BackboneRouter::Leader::DomainPrefixSt switch (aState) { case BackboneRouter::Leader::kDomainPrefixUnchanged: - // In case removed for some reason e.g. the kDuaInvalid response from PBBR forcely + // In case removed for some reason e.g. the kDuaInvalid response from PBBR forcefully VerifyOrExit(!Get().HasUnicastAddress(GetDomainUnicastAddress())); OT_FALL_THROUGH; diff --git a/src/core/thread/indirect_sender_frame_context.hpp b/src/core/thread/indirect_sender_frame_context.hpp index 13d0c0d43..9e14348b3 100644 --- a/src/core/thread/indirect_sender_frame_context.hpp +++ b/src/core/thread/indirect_sender_frame_context.hpp @@ -31,8 +31,8 @@ * This file includes definitions of frame context used for indirect transmission. */ -#ifndef INDIRECT_SENDER_FRAME_CONTETX_HPP_ -#define INDIRECT_SENDER_FRAME_CONTETX_HPP_ +#ifndef INDIRECT_SENDER_FRAME_CONTEXT_HPP_ +#define INDIRECT_SENDER_FRAME_CONTEXT_HPP_ #include "openthread-core-config.h" @@ -87,4 +87,4 @@ public: } // namespace ot -#endif // INDIRECT_SENDER_FRAME_CONTETX_HPP_ +#endif // INDIRECT_SENDER_FRAME_CONTEXT_HPP_ diff --git a/src/core/thread/key_manager.hpp b/src/core/thread/key_manager.hpp index cba93e1c5..4182aa918 100644 --- a/src/core/thread/key_manager.hpp +++ b/src/core/thread/key_manager.hpp @@ -447,7 +447,7 @@ public: void IncrementMleFrameCounter(void); /** - * This method returns the KEK as `KekKeyMaterail` + * This method returns the KEK as `KekKeyMaterial` * * @returns The KEK as `KekKeyMaterial`. * diff --git a/src/core/thread/link_metrics_types.cpp b/src/core/thread/link_metrics_types.cpp index cd5872176..8a5fece54 100644 --- a/src/core/thread/link_metrics_types.cpp +++ b/src/core/thread/link_metrics_types.cpp @@ -73,7 +73,7 @@ uint8_t Metrics::ConvertToTypeIds(uint8_t aTypeIds[]) const { for (uint8_t i = 0; i < count; i++) { - TypeId::MarkAsReserverd(aTypeIds[i]); + TypeId::MarkAsReserved(aTypeIds[i]); } } #endif diff --git a/src/core/thread/link_metrics_types.hpp b/src/core/thread/link_metrics_types.hpp index f0d564a3f..eb10b2c0b 100644 --- a/src/core/thread/link_metrics_types.hpp +++ b/src/core/thread/link_metrics_types.hpp @@ -173,7 +173,7 @@ public: * @param[in, out] aTypeId A reference to a Type ID variable to update. * */ - static void MarkAsReserverd(uint8_t &aTypeId) { aTypeId = (aTypeId & ~kTypeMask) | kTypeReserved; } + static void MarkAsReserved(uint8_t &aTypeId) { aTypeId = (aTypeId & ~kTypeMask) | kTypeReserved; } TypeId(void) = delete; }; diff --git a/src/core/thread/link_quality.hpp b/src/core/thread/link_quality.hpp index 41932d842..086d74774 100644 --- a/src/core/thread/link_quality.hpp +++ b/src/core/thread/link_quality.hpp @@ -326,7 +326,7 @@ public: * This method clears the average RSS value. * */ - void CleaAverageRss(void) { mRssAverager.Clear(); } + void ClearAverageRss(void) { mRssAverager.Clear(); } /** * This method adds a new received signal strength (RSS) value to the average. diff --git a/src/core/thread/lowpan.hpp b/src/core/thread/lowpan.hpp index e9853c21d..77139a631 100644 --- a/src/core/thread/lowpan.hpp +++ b/src/core/thread/lowpan.hpp @@ -165,7 +165,7 @@ public: * @param[in] aMacAddrs The MAC source and destination addresses * @param[in,out] aFrameData A frame data containing the LOWPAN_IPHC header. * - * @retval kErrorNone The header was decompressed successfully. @p aIp6Headre and @p aFrameData are updated. + * @retval kErrorNone The header was decompressed successfully. @p aIp6Header and @p aFrameData are updated. * @retval kErrorParse Failed to parse the lowpan header. * */ @@ -418,9 +418,9 @@ public: /** * This method appends the Mesh Header into a given frame. * - * @param[out] aFrameBuilder The `FrameBuidler` to append to. + * @param[out] aFrameBuilder The `FrameBuilder` to append to. * - * @retval kErrorNone Successfully appended the MeshHeader to @p aFrameBuildr. + * @retval kErrorNone Successfully appended the MeshHeader to @p aFrameBuilder. * @retval kErrorNoBufs Insufficient available buffers. * */ diff --git a/src/core/thread/mesh_forwarder.cpp b/src/core/thread/mesh_forwarder.cpp index 4be804c07..a88830c4b 100644 --- a/src/core/thread/mesh_forwarder.cpp +++ b/src/core/thread/mesh_forwarder.cpp @@ -1496,15 +1496,15 @@ void MeshForwarder::ClearReassemblyList(void) void MeshForwarder::HandleTimeTick(void) { - bool contineRxingTicks = false; + bool continueRxingTicks = false; #if OPENTHREAD_FTD - contineRxingTicks = mFragmentPriorityList.UpdateOnTimeTick(); + continueRxingTicks = mFragmentPriorityList.UpdateOnTimeTick(); #endif - contineRxingTicks = UpdateReassemblyList() || contineRxingTicks; + continueRxingTicks = UpdateReassemblyList() || continueRxingTicks; - if (!contineRxingTicks) + if (!continueRxingTicks) { Get().UnregisterReceiver(TimeTicker::kMeshForwarder); } diff --git a/src/core/thread/mesh_forwarder_ftd.cpp b/src/core/thread/mesh_forwarder_ftd.cpp index 2df2775ed..ffec4c716 100644 --- a/src/core/thread/mesh_forwarder_ftd.cpp +++ b/src/core/thread/mesh_forwarder_ftd.cpp @@ -769,7 +769,7 @@ exit: bool MeshForwarder::FragmentPriorityList::UpdateOnTimeTick(void) { - bool contineRxingTicks = false; + bool continueRxingTicks = false; for (Entry &entry : mEntries) { @@ -779,12 +779,12 @@ bool MeshForwarder::FragmentPriorityList::UpdateOnTimeTick(void) if (!entry.IsExpired()) { - contineRxingTicks = true; + continueRxingTicks = true; } } } - return contineRxingTicks; + return continueRxingTicks; } void MeshForwarder::UpdateFragmentPriority(Lowpan::FragmentHeader &aFragmentHeader, diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp index 5354c6cda..e692dff5e 100644 --- a/src/core/thread/mle.cpp +++ b/src/core/thread/mle.cpp @@ -1387,7 +1387,7 @@ bool Mle::HasAcceptableParentCandidate(void) const switch (mAttachState) { case kAttachStateAnnounce: - VerifyOrExit(!HasMoreChannelsToAnnouce()); + VerifyOrExit(!HasMoreChannelsToAnnounce()); break; case kAttachStateParentRequest: @@ -1495,7 +1495,7 @@ void Mle::HandleAttachTimer(void) OT_FALL_THROUGH; case kAttachStateAnnounce: - if (shouldAnnounce && (GetNextAnnouceChannel(mAnnounceChannel) == kErrorNone)) + if (shouldAnnounce && (GetNextAnnounceChannel(mAnnounceChannel) == kErrorNone)) { SendAnnounce(mAnnounceChannel, kOrphanAnnounce); delay = mAnnounceDelay; @@ -2238,7 +2238,7 @@ exit: FreeMessageOnError(message, error); } -Error Mle::GetNextAnnouceChannel(uint8_t &aChannel) const +Error Mle::GetNextAnnounceChannel(uint8_t &aChannel) const { // This method gets the next channel to send announce on after // `aChannel`. Returns `kErrorNotFound` if no more channel in the @@ -2254,11 +2254,11 @@ Error Mle::GetNextAnnouceChannel(uint8_t &aChannel) const return channelMask.GetNextChannel(aChannel); } -bool Mle::HasMoreChannelsToAnnouce(void) const +bool Mle::HasMoreChannelsToAnnounce(void) const { uint8_t channel = mAnnounceChannel; - return GetNextAnnouceChannel(channel) == kErrorNone; + return GetNextAnnounceChannel(channel) == kErrorNone; } #if OPENTHREAD_CONFIG_MLE_LINK_METRICS_SUBJECT_ENABLE @@ -3925,9 +3925,9 @@ void Mle::ParentSearch::HandleTimer(void) LogInfo("PeriodicParentSearch: Parent RSS %d", parentRss); VerifyOrExit(parentRss != Radio::kInvalidRssi); - if (parentRss < kRssThreadhold) + if (parentRss < kRssThreshold) { - LogInfo("PeriodicParentSearch: Parent RSS less than %d, searching for new parents", kRssThreadhold); + LogInfo("PeriodicParentSearch: Parent RSS less than %d, searching for new parents", kRssThreshold); mIsInBackoff = true; Get().Attach(kBetterParent); } @@ -4852,7 +4852,7 @@ Error Mle::TxMessage::AppendConnectivityTlv(void) return tlv.AppendTo(*this); } -Error Mle::TxMessage::AppendAddresseRegisterationTlv(Child &aChild) +Error Mle::TxMessage::AppendAddressRegistrationTlv(Child &aChild) { Error error; Tlv tlv; diff --git a/src/core/thread/mle.hpp b/src/core/thread/mle.hpp index c73c4e8db..e9620f14b 100644 --- a/src/core/thread/mle.hpp +++ b/src/core/thread/mle.hpp @@ -1256,7 +1256,7 @@ protected: * @retval kErrorNoBufs Insufficient buffers available to append the Connectivity TLV. * */ - Error AppendAddresseRegisterationTlv(Child &aChild); + Error AppendAddressRegistrationTlv(Child &aChild); #endif // OPENTHREAD_FTD /** @@ -1956,7 +1956,7 @@ private: static constexpr uint32_t kCheckInterval = (OPENTHREAD_CONFIG_PARENT_SEARCH_CHECK_INTERVAL * 1000u); static constexpr uint32_t kBackoffInterval = (OPENTHREAD_CONFIG_PARENT_SEARCH_BACKOFF_INTERVAL * 1000u); static constexpr uint32_t kJitterInterval = (15 * 1000u); - static constexpr int8_t kRssThreadhold = OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_THRESHOLD; + static constexpr int8_t kRssThreshold = OPENTHREAD_CONFIG_PARENT_SEARCH_RSS_THRESHOLD; using SearchTimer = TimerMilliIn; @@ -2021,8 +2021,8 @@ private: uint32_t GetAttachStartDelay(void) const; void SendParentRequest(ParentRequestType aType); Error SendChildIdRequest(void); - Error GetNextAnnouceChannel(uint8_t &aChannel) const; - bool HasMoreChannelsToAnnouce(void) const; + Error GetNextAnnounceChannel(uint8_t &aChannel) const; + bool HasMoreChannelsToAnnounce(void) const; bool PrepareAnnounceState(void); void SendAnnounce(uint8_t aChannel, AnnounceMode aMode); void SendAnnounce(uint8_t aChannel, const Ip6::Address &aDestination, AnnounceMode aMode = kNormalAnnounce); diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 935451d03..4cb8fce0d 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -1134,7 +1134,7 @@ Error MleRouter::HandleAdvertisement(RxInfo &aRxInfo, uint16_t aSourceAddress, c // only when device is attached (in child, router, or leader roles) // and `IsFullThreadDevice()`. // - // - `aSourceAdress` is the read value from `SourceAddressTlv`. + // - `aSourceAddress` is the read value from `SourceAddressTlv`. // - `aLeaderData` is the read value from `LeaderDataTlv`. Error error = kErrorNone; @@ -2914,7 +2914,7 @@ Error MleRouter::SendChildIdResponse(Child &aChild) if (!aChild.IsFullThreadDevice()) { - SuccessOrExit(error = message->AppendAddresseRegisterationTlv(aChild)); + SuccessOrExit(error = message->AppendAddressRegistrationTlv(aChild)); } SetChildStateToValid(aChild); @@ -3053,7 +3053,7 @@ void MleRouter::SendChildUpdateResponse(Child *aChild, switch (tlvType) { case Tlv::kAddressRegistration: - SuccessOrExit(error = message->AppendAddresseRegisterationTlv(*aChild)); + SuccessOrExit(error = message->AppendAddressRegistrationTlv(*aChild)); break; case Tlv::kMode: diff --git a/src/core/thread/mlr_manager.cpp b/src/core/thread/mlr_manager.cpp index befb601ab..d8e8a0378 100644 --- a/src/core/thread/mlr_manager.cpp +++ b/src/core/thread/mlr_manager.cpp @@ -289,7 +289,7 @@ void MlrManager::SendMulticastListenerRegistration(void) mMlrPending = true; - // Generally Thread 1.2 Router would send MLR.req on bebelf for MA (scope >=4) subscribed by its MTD child. + // Generally Thread 1.2 Router would send MLR.req on behalf for MA (scope >=4) subscribed by its MTD child. // When Thread 1.2 MTD attaches to Thread 1.1 parent, 1.2 MTD should send MLR.req to PBBR itself. // In this case, Thread 1.2 sleepy end device relies on fast data poll to fetch the response timely. if (!Get().IsRxOnWhenIdle()) diff --git a/src/core/thread/network_data.cpp b/src/core/thread/network_data.cpp index 2ef2c33e7..009e67515 100644 --- a/src/core/thread/network_data.cpp +++ b/src/core/thread/network_data.cpp @@ -190,7 +190,7 @@ Error NetworkData::Iterate(Iterator &aIterator, uint16_t aRloc16, Config &aConfi for (const NetworkDataTlv *subCur; subCur = iterator.GetSubTlv(subTlvs), (subCur + 1 <= cur->GetNext()) && (subCur->GetNext() <= cur->GetNext()); - iterator.AdvaceSubTlv(subTlvs)) + iterator.AdvanceSubTlv(subTlvs)) { if (cur->GetType() == NetworkDataTlv::kTypePrefix) { diff --git a/src/core/thread/network_data.hpp b/src/core/thread/network_data.hpp index 72e44a56a..3c1db30e4 100644 --- a/src/core/thread/network_data.hpp +++ b/src/core/thread/network_data.hpp @@ -527,7 +527,7 @@ private: GetSubTlvOffset()); } - void AdvaceSubTlv(const NetworkDataTlv *aSubTlvs) + void AdvanceSubTlv(const NetworkDataTlv *aSubTlvs) { SaveSubTlvOffset(GetSubTlv(aSubTlvs)->GetNext(), aSubTlvs); SetEntryIndex(0); diff --git a/src/core/thread/network_data_publisher.cpp b/src/core/thread/network_data_publisher.cpp index 566bce702..22c31d9e5 100644 --- a/src/core/thread/network_data_publisher.cpp +++ b/src/core/thread/network_data_publisher.cpp @@ -64,8 +64,8 @@ Publisher::Publisher(Instance &aInstance) #if OPENTHREAD_CONFIG_BORDER_ROUTER_ENABLE // Since the `PrefixEntry` type is used in an array, // we cannot use a constructor with an argument (e.g., - // we cannot use `InstacneLocator`) so we use - // `IntanceLocatorInit` and `Init()` the entries one + // we cannot use `InstanceLocator`) so we use + // `InstanceLocatorInit` and `Init()` the entries one // by one. for (PrefixEntry &entry : mPrefixEntries) @@ -330,7 +330,7 @@ void Publisher::Entry::UpdateState(uint8_t aNumEntries, uint8_t aNumPreferredEnt if (aNumPreferredEntries < aDesiredNumEntries) { - mUpdateTime += kExtraDelayToRemovePeferred; + mUpdateTime += kExtraDelayToRemovePreferred; } SetState(kRemoving); diff --git a/src/core/thread/network_data_publisher.hpp b/src/core/thread/network_data_publisher.hpp index bd1dfbef0..d042311e7 100644 --- a/src/core/thread/network_data_publisher.hpp +++ b/src/core/thread/network_data_publisher.hpp @@ -306,7 +306,7 @@ private: // All intervals are in milliseconds. static constexpr uint32_t kMaxDelayToAdd = OPENTHREAD_CONFIG_NETDATA_PUBLISHER_MAX_DELAY_TO_ADD; static constexpr uint32_t kMaxDelayToRemove = OPENTHREAD_CONFIG_NETDATA_PUBLISHER_MAX_DELAY_TO_REMOVE; - static constexpr uint32_t kExtraDelayToRemovePeferred = + static constexpr uint32_t kExtraDelayToRemovePreferred = OPENTHREAD_CONFIG_NETDATA_PUBLISHER_EXTRA_DELAY_TIME_TO_REMOVE_PREFERRED; static constexpr uint16_t kInfoStringSize = 60; diff --git a/src/core/thread/network_data_service.hpp b/src/core/thread/network_data_service.hpp index 6695e9fb6..5dec83a69 100644 --- a/src/core/thread/network_data_service.hpp +++ b/src/core/thread/network_data_service.hpp @@ -423,7 +423,7 @@ public: /** * This method adds a Thread Service entry to the local Thread Network Data. * - * This version of `Add()` is intended for use with a `ServiceType` that has a constant service data + * This version of `Add()` is intended for use with a `ServiceType` that has a constant service data * format with a non-empty and potentially non-const server data format (provided as input parameter). * * The template type `ServiceType` has the following requirements: @@ -450,7 +450,7 @@ public: /** * This method adds a Thread Service entry to the local Thread Network Data. * - * This version of `Add()` is intended for use with a `ServiceType` that has a non-const service data + * This version of `Add()` is intended for use with a `ServiceType` that has a non-const service data * format (provided as input parameter) with an empty server data. * * The template type `ServiceType` has the following requirements: @@ -495,8 +495,8 @@ public: /** * This method removes a Thread Service entry from the local Thread Network Data. * - * This version of `Remove()` is intended for use with a `ServiceType` that has a non-const service data - * format (provided as input parameter). + * This version of `Remove()` is intended for use with a `ServiceType` that has a non-const service + * data format (provided as input parameter). * * The template type `ServiceType` has the following requirements: * - It MUST define nested type `ServiceType::ServiceData` representing the service data (and its format). diff --git a/src/core/thread/radio_selector.cpp b/src/core/thread/radio_selector.cpp index 7153f84ab..965734a0c 100644 --- a/src/core/thread/radio_selector.cpp +++ b/src/core/thread/radio_selector.cpp @@ -85,28 +85,28 @@ void RadioSelector::NeighborInfo::PopulateMultiRadioInfo(MultiRadioInfo &aInfo) LogLevel RadioSelector::UpdatePreference(Neighbor &aNeighbor, Mac::RadioType aRadioType, int16_t aDifference) { uint8_t old = aNeighbor.GetRadioPreference(aRadioType); - int16_t preferecne = static_cast(old); + int16_t preference = static_cast(old); - preferecne += aDifference; + preference += aDifference; - if (preferecne > kMaxPreference) + if (preference > kMaxPreference) { - preferecne = kMaxPreference; + preference = kMaxPreference; } - if (preferecne < kMinPreference) + if (preference < kMinPreference) { - preferecne = kMinPreference; + preference = kMinPreference; } - aNeighbor.SetRadioPreference(aRadioType, static_cast(preferecne)); + aNeighbor.SetRadioPreference(aRadioType, static_cast(preference)); // We check whether the update to the preference value caused it // to cross the threshold `kHighPreference`. Based on this we // return a suggested log level. If there is cross, suggest info // log level, otherwise debug log level. - return ((old >= kHighPreference) != (preferecne >= kHighPreference)) ? kLogLevelInfo : kLogLevelDebg; + return ((old >= kHighPreference) != (preference >= kHighPreference)) ? kLogLevelInfo : kLogLevelDebg; } void RadioSelector::UpdateOnReceive(Neighbor &aNeighbor, Mac::RadioType aRadioType, bool aIsDuplicate) diff --git a/src/core/thread/topology.hpp b/src/core/thread/topology.hpp index dcebedd71..b08f4d0bc 100644 --- a/src/core/thread/topology.hpp +++ b/src/core/thread/topology.hpp @@ -542,7 +542,7 @@ public: * This method MUST be used only when the tag is set (and not cleared). Otherwise its behavior is undefined. * * The tag value compassion follows the Serial Number Arithmetic logic from RFC-1982. It is semantically equivalent - * to `LastRxFragementTag > aTag`. + * to `LastRxFragmentTag > aTag`. * * @param[in] aTag A tag value to compare against. * @@ -1252,7 +1252,7 @@ public: /** * This method returns MLR state of an IPv6 multicast address. * - * @note The @p aAdddress reference MUST be from `IterateIp6Addresses()` or `AddressIterator`. + * @note The @p aAddress reference MUST be from `IterateIp6Addresses()` or `AddressIterator`. * * @param[in] aAddress The IPv6 multicast address. * @@ -1264,7 +1264,7 @@ public: /** * This method sets MLR state of an IPv6 multicast address. * - * @note The @p aAdddress reference MUST be from `IterateIp6Addresses()` or `AddressIterator`. + * @note The @p aAddress reference MUST be from `IterateIp6Addresses()` or `AddressIterator`. * * @param[in] aAddress The IPv6 multicast address. * @param[in] aState The target MLR state. diff --git a/src/core/utils/history_tracker.cpp b/src/core/utils/history_tracker.cpp index adb900599..2bcda12fd 100644 --- a/src/core/utils/history_tracker.cpp +++ b/src/core/utils/history_tracker.cpp @@ -82,7 +82,7 @@ exit: return; } -void HistoryTracker::RecordMessage(const Message &aMessage, const Mac::Address &aMacAddresss, MessageType aType) +void HistoryTracker::RecordMessage(const Message &aMessage, const Mac::Address &aMacAddress, MessageType aType) { MessageInfo *entry = nullptr; Ip6::Headers headers; @@ -125,7 +125,7 @@ void HistoryTracker::RecordMessage(const Message &aMessage, const Mac::Address & VerifyOrExit(entry != nullptr); entry->mPayloadLength = headers.GetIp6Header().GetPayloadLength(); - entry->mNeighborRloc16 = aMacAddresss.IsShort() ? aMacAddresss.GetShort() : kInvalidRloc16; + entry->mNeighborRloc16 = aMacAddress.IsShort() ? aMacAddress.GetShort() : kInvalidRloc16; entry->mSource.mAddress = headers.GetSourceAddress(); entry->mSource.mPort = headers.GetSourcePort(); entry->mDestination.mAddress = headers.GetDestinationAddress(); @@ -138,9 +138,9 @@ void HistoryTracker::RecordMessage(const Message &aMessage, const Mac::Address & entry->mTxSuccess = (aType == kTxMessage) ? aMessage.GetTxSuccess() : true; entry->mPriority = aMessage.GetPriority(); - if (aMacAddresss.IsExtended()) + if (aMacAddress.IsExtended()) { - Neighbor *neighbor = Get().FindNeighbor(aMacAddresss, Neighbor::kInStateAnyExceptInvalid); + Neighbor *neighbor = Get().FindNeighbor(aMacAddress, Neighbor::kInStateAnyExceptInvalid); if (neighbor != nullptr) { diff --git a/src/core/utils/history_tracker.hpp b/src/core/utils/history_tracker.hpp index a7bcee2eb..f1cabbf89 100644 --- a/src/core/utils/history_tracker.hpp +++ b/src/core/utils/history_tracker.hpp @@ -99,7 +99,7 @@ public: static constexpr uint16_t kEntryAgeStringSize = OT_HISTORY_TRACKER_ENTRY_AGE_STRING_SIZE; /** - * This constants specifid no next hop. + * This constants specified no next hop. * * Used for `mNextHop` in `RouteInfo` struture. * diff --git a/src/core/utils/parse_cmdline.cpp b/src/core/utils/parse_cmdline.cpp index ac81464ee..5261ce0b5 100644 --- a/src/core/utils/parse_cmdline.cpp +++ b/src/core/utils/parse_cmdline.cpp @@ -146,8 +146,8 @@ Error ParseAsUint64(const char *aString, uint64_t &aUint64) enum : uint64_t { - kMaxHexBeforeOveflow = (0xffffffffffffffffULL / 16), - kMaxDecBeforeOverlow = (0xffffffffffffffffULL / 10), + kMaxHexBeforeOverflow = (0xffffffffffffffffULL / 16), + kMaxDecBeforeOverflow = (0xffffffffffffffffULL / 10), }; VerifyOrExit(aString != nullptr, error = kErrorInvalidArgs); @@ -164,7 +164,7 @@ Error ParseAsUint64(const char *aString, uint64_t &aUint64) uint64_t newValue; SuccessOrExit(error = isHex ? ParseHexDigit(*cur, digit) : ParseDigit(*cur, digit)); - VerifyOrExit(value <= (isHex ? kMaxHexBeforeOveflow : kMaxDecBeforeOverlow), error = kErrorInvalidArgs); + VerifyOrExit(value <= (isHex ? kMaxHexBeforeOverflow : kMaxDecBeforeOverflow), error = kErrorInvalidArgs); value = isHex ? (value << 4) : (value * 10); newValue = value + digit; VerifyOrExit(newValue >= value, error = kErrorInvalidArgs); @@ -201,14 +201,14 @@ Error ParseAsInt32(const char *aString, int32_t &aInt32) { Error error; uint64_t value; - bool isNegavtive = false; + bool isNegative = false; VerifyOrExit(aString != nullptr, error = kErrorInvalidArgs); if (*aString == '-') { aString++; - isNegavtive = true; + isNegative = true; } else if (*aString == '+') { @@ -216,10 +216,10 @@ Error ParseAsInt32(const char *aString, int32_t &aInt32) } SuccessOrExit(error = ParseAsUint64(aString, value)); - VerifyOrExit(value <= (isNegavtive ? static_cast(-static_cast(NumericLimits::kMin)) - : static_cast(NumericLimits::kMax)), + VerifyOrExit(value <= (isNegative ? static_cast(-static_cast(NumericLimits::kMin)) + : static_cast(NumericLimits::kMax)), error = kErrorInvalidArgs); - aInt32 = static_cast(isNegavtive ? -static_cast(value) : static_cast(value)); + aInt32 = static_cast(isNegative ? -static_cast(value) : static_cast(value)); exit: return error; @@ -279,7 +279,7 @@ exit: enum HexStringParseMode { - kModeExtactSize, // Parse hex string expecting an exact size (number of bytes when parsed). + kModeExactSize, // Parse hex string expecting an exact size (number of bytes when parsed). kModeUpToSize, // Parse hex string expecting less than or equal a given size. kModeAllowPartial, // Allow parsing of partial segments. }; @@ -299,7 +299,7 @@ static Error ParseHexString(const char *&aString, uint16_t &aSize, uint8_t *aBuf switch (aMode) { - case kModeExtactSize: + case kModeExactSize: VerifyOrExit(expectedSize == aSize, error = kErrorInvalidArgs); break; case kModeUpToSize: @@ -353,7 +353,7 @@ exit: Error ParseAsHexString(const char *aString, uint8_t *aBuffer, uint16_t aSize) { - return ParseHexString(aString, aSize, aBuffer, kModeExtactSize); + return ParseHexString(aString, aSize, aBuffer, kModeExactSize); } Error ParseAsHexString(const char *aString, uint16_t &aSize, uint8_t *aBuffer) diff --git a/src/core/utils/parse_cmdline.hpp b/src/core/utils/parse_cmdline.hpp index 76bb213b4..e36506556 100644 --- a/src/core/utils/parse_cmdline.hpp +++ b/src/core/utils/parse_cmdline.hpp @@ -291,7 +291,7 @@ otError ParseAsHexString(const char *aString, uint16_t &aSize, uint8_t *aBuffer) * @param[out] aBuffer A pointer to a buffer to output the parsed byte sequence. * * @retval kErrorNone The string was parsed successfully to the end of string. - * @retval kErrorPedning The string segment was parsed successfully, but there are additional bytes remaining + * @retval kErrorPending The string segment was parsed successfully, but there are additional bytes remaining * to be parsed. * @retval kErrorInvalidArgs The string does not contain valid format hex digits. * diff --git a/src/core/utils/ping_sender.hpp b/src/core/utils/ping_sender.hpp index 81d52880a..9eb0a9129 100644 --- a/src/core/utils/ping_sender.hpp +++ b/src/core/utils/ping_sender.hpp @@ -130,7 +130,7 @@ public: private: static constexpr uint16_t kDefaultSize = OPENTHREAD_CONFIG_PING_SENDER_DEFAULT_SIZE; static constexpr uint16_t kDefaultCount = OPENTHREAD_CONFIG_PING_SENDER_DEFAULT_COUNT; - static constexpr uint32_t kDefaultInterval = OPENTHREAD_CONFIG_PING_SENDER_DEFAULT_INTEVRAL; + static constexpr uint32_t kDefaultInterval = OPENTHREAD_CONFIG_PING_SENDER_DEFAULT_INTERVAL; static constexpr uint32_t kDefaultTimeout = OPENTHREAD_CONFIG_PING_SENDER_DEFAULT_TIMEOUT; void SetUnspecifiedToDefault(void); diff --git a/src/core/utils/power_calibration.hpp b/src/core/utils/power_calibration.hpp index 838a55295..e16775b3a 100644 --- a/src/core/utils/power_calibration.hpp +++ b/src/core/utils/power_calibration.hpp @@ -62,7 +62,7 @@ public: explicit PowerCalibration(Instance &aInstance); /** - * Add a calibrated power of the specificed channel to the power calibration table. + * Add a calibrated power of the specified channel to the power calibration table. * * @param[in] aChannel The radio channel. * @param[in] aActualPower The actual power in 0.01dBm. diff --git a/src/core/utils/slaac_address.hpp b/src/core/utils/slaac_address.hpp index d9aecced1..1784d33ac 100644 --- a/src/core/utils/slaac_address.hpp +++ b/src/core/utils/slaac_address.hpp @@ -132,7 +132,7 @@ public: * @param[in] aNetworkId A pointer to a byte array of Network_ID to generate IID. * @param[in] aNetworkIdLength The size of array @p aNetworkId. * @param[in,out] aDadCounter A pointer to the DAD_Counter that is employed to resolve Duplicate - * Address Detection connflicts. + * Address Detection conflicts. * * @retval kErrorNone If successfully generated the IID. * @retval kErrorFailed If no valid IID was generated. diff --git a/src/lib/spinel/radio_spinel.hpp b/src/lib/spinel/radio_spinel.hpp index a7701811b..732690701 100644 --- a/src/lib/spinel/radio_spinel.hpp +++ b/src/lib/spinel/radio_spinel.hpp @@ -892,7 +892,7 @@ public: #if OPENTHREAD_CONFIG_PLATFORM_POWER_CALIBRATION_ENABLE /** - * Add a calibrated power of the specificed channel to the power calibration table. + * Add a calibrated power of the specified channel to the power calibration table. * * @param[in] aChannel The radio channel. * @param[in] aActualPower The actual power in 0.01dBm. diff --git a/src/lib/spinel/radio_spinel_metrics.h b/src/lib/spinel/radio_spinel_metrics.h index 438e14c8a..91d4d76da 100644 --- a/src/lib/spinel/radio_spinel_metrics.h +++ b/src/lib/spinel/radio_spinel_metrics.h @@ -46,7 +46,7 @@ extern "C" { typedef struct otRadioSpinelMetrics { uint32_t mRcpTimeoutCount; ///< The number of RCP timeouts. - uint32_t mRcpUnexpectedResetCount; ///< The number of RCP unexcepted resets. + uint32_t mRcpUnexpectedResetCount; ///< The number of RCP unexpected resets. uint32_t mRcpRestorationCount; ///< The number of RCP restorations. uint32_t mSpinelParseErrorCount; ///< The number of spinel frame parse errors. } otRadioSpinelMetrics; diff --git a/src/lib/spinel/spinel.h b/src/lib/spinel/spinel.h index 0324729ec..1f4476a9f 100644 --- a/src/lib/spinel/spinel.h +++ b/src/lib/spinel/spinel.h @@ -1625,14 +1625,14 @@ enum * * For GPIOs configured as inputs: * - * * `CMD_PROP_VAUE_GET`: The value of the associated bit describes the + * * `CMD_PROP_VALUE_GET`: The value of the associated bit describes the * logic level read from the pin. * * `CMD_PROP_VALUE_SET`: The value of the associated bit is ignored * for these pins. * * For GPIOs configured as outputs: * - * * `CMD_PROP_VAUE_GET`: The value of the associated bit is + * * `CMD_PROP_VALUE_GET`: The value of the associated bit is * implementation specific. * * `CMD_PROP_VALUE_SET`: The value of the associated bit determines * the new logic level of the output. If this pin is configured as an @@ -1641,7 +1641,7 @@ enum * * For GPIOs which are not specified in `PROP_GPIO_CONFIG`: * - * * `CMD_PROP_VAUE_GET`: The value of the associated bit is + * * `CMD_PROP_VALUE_GET`: The value of the associated bit is * implementation specific. * * `CMD_PROP_VALUE_SET`: The value of the associated bit MUST be * ignored by the NCP. @@ -1991,7 +1991,7 @@ enum * Channel energy result will be reported by emissions * of `PROP_MAC_ENERGY_SCAN_RESULT` (per channel). * - * Set to `SCAN_STATE_DISOVER` to start a Thread MLE discovery + * Set to `SCAN_STATE_DISCOVER` to start a Thread MLE discovery * scan operation. Discovery scan result will be emitted from * `PROP_MAC_SCAN_BEACON`. * @@ -2472,7 +2472,7 @@ enum * `6`: Route Prefix * `C`: Prefix length in bits * `b`: Stable flag - * `C`: Route flags (SPINEL_ROUTE_FLAG_* and SPINEL_ROUTE_PREFERNCE_* definitions) + * `C`: Route flags (SPINEL_ROUTE_FLAG_* and SPINEL_ROUTE_PREFERENCE_* definitions) * `b`: "Is defined locally" flag. Set if this route info was locally * defined as part of local network data. Assumed to be true for set, * insert and replace. Clear if the route is part of partition's network @@ -2984,7 +2984,7 @@ enum /** Format: `A(t(iD))` - Write only * * The formatting of this property follows the same rules as in SPINEL_PROP_THREAD_MGMT_SET_ACTIVE_DATASET. This - * property further allows the sender to not include a value associated with properties in formating of `t(iD)`, + * property further allows the sender to not include a value associated with properties in formatting of `t(iD)`, * i.e., it should accept either a `t(iD)` or a `t(i)` encoding (in both cases indicating that the associated * Dataset property should be requested as part of MGMT_GET command). * @@ -3266,7 +3266,7 @@ enum * Write to this property initiates update of Multicast Listeners Table on the primary BBR. * If the write succeeded, the result of network operation will be notified later by the * SPINEL_PROP_THREAD_MLR_RESPONSE property. If the write fails, no MLR.req is issued and - * notifiaction through the SPINEL_PROP_THREAD_MLR_RESPONSE property will not occur. + * notification through the SPINEL_PROP_THREAD_MLR_RESPONSE property will not occur. * */ SPINEL_PROP_THREAD_MLR_REQUEST = SPINEL_PROP_THREAD_EXT__BEGIN + 52, @@ -3319,7 +3319,7 @@ enum * * The valid values are specified by SPINEL_THREAD_BACKBONE_ROUTER_STATE_ enumeration. * Backbone functionality will be disabled if SPINEL_THREAD_BACKBONE_ROUTER_STATE_DISABLED - * is writted to this property, enabled otherwise. + * is written to this property, enabled otherwise. * */ SPINEL_PROP_THREAD_BACKBONE_ROUTER_LOCAL_STATE = SPINEL_PROP_THREAD_EXT__BEGIN + 56, diff --git a/src/lib/spinel/spinel_encoder.hpp b/src/lib/spinel/spinel_encoder.hpp index 537b4e143..214e8136d 100644 --- a/src/lib/spinel/spinel_encoder.hpp +++ b/src/lib/spinel/spinel_encoder.hpp @@ -123,7 +123,7 @@ public: /** * This method overwrites the property key with `LAST_STATUS` in a property update command frame. * - * This method should be only used after a successful `BeginFrame(aHeader, aCommand, aPropertKey)`, otherwise, its + * This method should be only used after a successful `BeginFrame(aHeader, aCommand, aPropertyKey)`, otherwise, its * behavior is undefined. * * This method moves the write position back to saved position by `BeginFrame()` and replaces the property key diff --git a/src/ncp/ncp_base.cpp b/src/ncp/ncp_base.cpp index 83b15a27a..f805e0537 100644 --- a/src/ncp/ncp_base.cpp +++ b/src/ncp/ncp_base.cpp @@ -671,7 +671,7 @@ exit: #if OPENTHREAD_CONFIG_NCP_ENABLE_PEEK_POKE -void NcpBase::RegisterPeekPokeDelagates(otNcpDelegateAllowPeekPoke aAllowPeekDelegate, +void NcpBase::RegisterPeekPokeDelegates(otNcpDelegateAllowPeekPoke aAllowPeekDelegate, otNcpDelegateAllowPeekPoke aAllowPokeDelegate) { mAllowPeekDelegate = aAllowPeekDelegate; @@ -2600,14 +2600,13 @@ template <> otError NcpBase::HandlePropertySet // ---------------------------------------------------------------------------- #if OPENTHREAD_CONFIG_NCP_ENABLE_PEEK_POKE -void otNcpRegisterPeekPokeDelagates(otNcpDelegateAllowPeekPoke aAllowPeekDelegate, - otNcpDelegateAllowPeekPoke aAllowPokeDelegate) +void otNcpRegisterPeekPoke(otNcpDelegateAllowPeekPoke aAllowPeekDelegate, otNcpDelegateAllowPeekPoke aAllowPokeDelegate) { ot::Ncp::NcpBase *ncp = ot::Ncp::NcpBase::GetNcpInstance(); if (ncp != nullptr) { - ncp->RegisterPeekPokeDelagates(aAllowPeekDelegate, aAllowPokeDelegate); + ncp->RegisterPeekPoke(aAllowPeekDelegate, aAllowPokeDelegate); } } #endif // OPENTHREAD_CONFIG_NCP_ENABLE_PEEK_POKE diff --git a/src/ncp/ncp_base.hpp b/src/ncp/ncp_base.hpp index d16693f50..ebbe99c29 100644 --- a/src/ncp/ncp_base.hpp +++ b/src/ncp/ncp_base.hpp @@ -126,7 +126,7 @@ public: * @param[in] aAllowPokeDelegate Delegate function pointer for poke operation. * */ - void RegisterPeekPokeDelagates(otNcpDelegateAllowPeekPoke aAllowPeekDelegate, + void RegisterPeekPokeDelegates(otNcpDelegateAllowPeekPoke aAllowPeekDelegate, otNcpDelegateAllowPeekPoke aAllowPokeDelegate); #endif diff --git a/src/ncp/ncp_base_mtd.cpp b/src/ncp/ncp_base_mtd.cpp index 1220e15e5..48a927055 100644 --- a/src/ncp/ncp_base_mtd.cpp +++ b/src/ncp/ncp_base_mtd.cpp @@ -3659,7 +3659,7 @@ exit: return error; } -static spinel_srp_client_item_state_t SrpClientItemStatetoSpinel(otSrpClientItemState aItemState) +static spinel_srp_client_item_state_t SrpClientItemStateToSpinel(otSrpClientItemState aItemState) { spinel_srp_client_item_state_t state = SPINEL_SRP_CLIENT_ITEM_STATE_REMOVED; @@ -3699,7 +3699,7 @@ otError NcpBase::EncodeSrpClientHostInfo(const otSrpClientHostInfo &aHostInfo) otError error; SuccessOrExit(error = mEncoder.WriteUtf8(aHostInfo.mName != nullptr ? aHostInfo.mName : "")); - SuccessOrExit(error = mEncoder.WriteUint8(SrpClientItemStatetoSpinel(aHostInfo.mState))); + SuccessOrExit(error = mEncoder.WriteUint8(SrpClientItemStateToSpinel(aHostInfo.mState))); SuccessOrExit(error = mEncoder.OpenStruct()); diff --git a/src/posix/README.md b/src/posix/README.md index d45a4a388..ccffb3612 100644 --- a/src/posix/README.md +++ b/src/posix/README.md @@ -28,7 +28,7 @@ If built successfully, the binary should be found at: `build/posix/src/posix/ot- ### Simulation -OpenThread provides an implemenation on the simulation platform which enables running a simulated transceiver on the host. +OpenThread provides an implementation on the simulation platform which enables running a simulated transceiver on the host. #### Build diff --git a/src/posix/platform/mainloop.hpp b/src/posix/platform/mainloop.hpp index 4f0fa7cc9..fd2989b66 100644 --- a/src/posix/platform/mainloop.hpp +++ b/src/posix/platform/mainloop.hpp @@ -66,7 +66,7 @@ public: virtual void Process(const otSysMainloopContext &aContext) = 0; /** - * This method marks desturctor virtual method. + * This method marks destructor virtual method. * */ virtual ~Source() = default; @@ -117,7 +117,7 @@ public: /** * This function returns the Mainloop singleton. * - * @returns A refernce to the Mainloop singleton. + * @returns A reference to the Mainloop singleton. * */ static Manager &Get(void); diff --git a/src/posix/platform/misc.cpp b/src/posix/platform/misc.cpp index 77ef07a90..7e2a82e4d 100644 --- a/src/posix/platform/misc.cpp +++ b/src/posix/platform/misc.cpp @@ -84,7 +84,7 @@ void otPlatAssertFail(const char *aFilename, int aLineNumber) #else otLogCritPlat("assert failed at %s:%d", aFilename, aLineNumber); #endif - // For debug build, use assert to genreate a core dump + // For debug build, use assert to generate a core dump assert(false); exit(1); } diff --git a/src/posix/platform/multicast_routing.hpp b/src/posix/platform/multicast_routing.hpp index c55844c27..dc8b72a03 100644 --- a/src/posix/platform/multicast_routing.hpp +++ b/src/posix/platform/multicast_routing.hpp @@ -69,7 +69,7 @@ private: { kMulticastForwardingCacheExpireTimeout = 300, //< Expire timeout of Multicast Forwarding Cache (in seconds) kMulticastForwardingCacheExpiringInterval = 60, //< Expire interval of Multicast Forwarding Cache (in seconds) - kMulitcastForwardingCacheTableSize = + kMulticastForwardingCacheTableSize = OPENTHREAD_POSIX_CONFIG_MAX_MULTICAST_FORWARDING_CACHE_TABLE, //< The max size of MFC table. }; @@ -132,7 +132,7 @@ private: void HandleBackboneMulticastListenerEvent(otBackboneRouterMulticastListenerEvent aEvent, const Ip6::Address &aAddress); - MulticastForwardingCache mMulticastForwardingCacheTable[kMulitcastForwardingCacheTableSize]; + MulticastForwardingCache mMulticastForwardingCacheTable[kMulticastForwardingCacheTableSize]; uint64_t mLastExpireTime; int mMulticastRouterSock; }; diff --git a/src/posix/platform/power_updater.hpp b/src/posix/platform/power_updater.hpp index 5a8e20aa9..fb12c2385 100644 --- a/src/posix/platform/power_updater.hpp +++ b/src/posix/platform/power_updater.hpp @@ -48,7 +48,7 @@ namespace ot { namespace Posix { /** - * This class updates the target power table and calibrated powe table to the RCP. + * This class updates the target power table and calibrated power table to the RCP. * */ class PowerUpdater