mirror of
https://github.com/espressif/openthread.git
synced 2026-08-24 03:09:52 +00:00
[style] fix spelling errors (#8939)
This commit is contained in:
@@ -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.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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).
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
+10
-10
@@ -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)
|
||||
|
||||
+3
-3
@@ -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.
|
||||
|
||||
|
||||
+1
-1
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -285,7 +285,7 @@ private:
|
||||
// Returns format string to output a `ValueType` (e.g., "%u" for `uint16_t`).
|
||||
template <typename ValueType> 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 <typename ValueType> otError ProcessGet(Arg aArgs[], GetHandler<ValueType> aGetHandler)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
|
||||
+2
-2
@@ -169,7 +169,7 @@ template <> otError UdpExample::Process<Cmd("send")>(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
|
||||
{
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ private:
|
||||
template <CommandId kCommandId> 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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
+12
-12
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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(); }
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -158,7 +158,7 @@ void TrickleTimer::HandleTimer(void)
|
||||
}
|
||||
|
||||
StartNewInterval();
|
||||
ExitNow(); // Exit so to not call `mHanlder`
|
||||
ExitNow(); // Exit so to not call `mHandler`
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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_
|
||||
|
||||
@@ -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
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
};
|
||||
|
||||
@@ -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<RadioSelector>().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));
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -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<Radio>().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))
|
||||
{
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -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<StateTlv>(*aMessage, state));
|
||||
|
||||
SetState(kStateEntrust);
|
||||
mTimer.Start(kReponseTimeout);
|
||||
mTimer.Start(kResponseTimeout);
|
||||
|
||||
LogInfo("Received %s %d", UriToString<kUriJoinerFinalize>(), state);
|
||||
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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<Tlv::kProvisioningUrl, Tlv::kMaxkProvisioningUrlLength> ProvisioningUrlTlv;
|
||||
typedef StringTlvInfo<Tlv::kProvisioningUrl, Tlv::kMaxProvisioningUrlLength> ProvisioningUrlTlv;
|
||||
|
||||
/**
|
||||
* This class defines Vendor Name TLV constants and types.
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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`.
|
||||
|
||||
@@ -763,7 +763,7 @@ private:
|
||||
enum TcpState : uint8_t
|
||||
{
|
||||
kTcpUninitialized = 0,
|
||||
kTcpConecting,
|
||||
kTcpConnecting,
|
||||
kTcpConnectedIdle,
|
||||
kTcpConnectedSending,
|
||||
};
|
||||
|
||||
@@ -183,7 +183,7 @@ Error Name::AppendMultipleLabels(const char *aLabels, uint8_t aLength, Message &
|
||||
{
|
||||
ch = index < aLength ? aLabels[index] : static_cast<char>(kNullChar);
|
||||
|
||||
if ((ch == kNullChar) || (ch == kLabelSeperatorChar))
|
||||
if ((ch == kNullChar) || (ch == kLabelSeparatorChar))
|
||||
{
|
||||
uint8_t labelLength = static_cast<uint8_t>(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
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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++;
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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<uint8_t>::kMax)
|
||||
if (mTimeoutFailureCount < NumericLimits<uint8_t>::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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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<AddressMode>(OPENTHREAD_CONFIG_SRP_SERVER_DEFAULT_ADDDRESS_MODE);
|
||||
static_cast<AddressMode>(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
|
||||
|
||||
@@ -256,12 +256,12 @@ private:
|
||||
Peer *GetNewPeerEntry(void);
|
||||
void RemovePeerEntry(Peer &aEntry);
|
||||
|
||||
using RegsiterServiceTask = TaskletIn<Interface, &Interface::RegisterService>;
|
||||
using RegisterServiceTask = TaskletIn<Interface, &Interface::RegisterService>;
|
||||
|
||||
bool mInitialized : 1;
|
||||
bool mEnabled : 1;
|
||||
bool mFiltered : 1;
|
||||
RegsiterServiceTask mRegisterServiceTask;
|
||||
RegisterServiceTask mRegisterServiceTask;
|
||||
uint16_t mUdpPort;
|
||||
Packet mRxPacket;
|
||||
PeerTable mPeerTable;
|
||||
|
||||
@@ -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())
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<ThreadNetif>().HasUnicastAddress(GetDomainUnicastAddress()));
|
||||
|
||||
OT_FALL_THROUGH;
|
||||
|
||||
@@ -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_
|
||||
|
||||
@@ -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`.
|
||||
*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -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<TimeTicker>().UnregisterReceiver(TimeTicker::kMeshForwarder);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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<Mle>().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;
|
||||
|
||||
@@ -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<Mle, &Mle::HandleParentSearchTimer>;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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<Mle::Mle>().IsRxOnWhenIdle())
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -527,7 +527,7 @@ private:
|
||||
GetSubTlvOffset());
|
||||
}
|
||||
|
||||
void AdvaceSubTlv(const NetworkDataTlv *aSubTlvs)
|
||||
void AdvanceSubTlv(const NetworkDataTlv *aSubTlvs)
|
||||
{
|
||||
SaveSubTlvOffset(GetSubTlv(aSubTlvs)->GetNext(), aSubTlvs);
|
||||
SetEntryIndex(0);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -423,7 +423,7 @@ public:
|
||||
/**
|
||||
* This method adds a Thread Service entry to the local Thread Network Data.
|
||||
*
|
||||
* This version of `Add<SeviceType>()` is intended for use with a `ServiceType` that has a constant service data
|
||||
* This version of `Add<ServiceType>()` 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<SeviceType>()` is intended for use with a `ServiceType` that has a non-const service data
|
||||
* This version of `Add<ServiceType>()` 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<SeviceType>()` is intended for use with a `ServiceType` that has a non-const service data
|
||||
* format (provided as input parameter).
|
||||
* This version of `Remove<ServiceType>()` 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).
|
||||
|
||||
@@ -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<int16_t>(old);
|
||||
int16_t preference = static_cast<int16_t>(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<uint8_t>(preferecne));
|
||||
aNeighbor.SetRadioPreference(aRadioType, static_cast<uint8_t>(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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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<NeighborTable>().FindNeighbor(aMacAddresss, Neighbor::kInStateAnyExceptInvalid);
|
||||
Neighbor *neighbor = Get<NeighborTable>().FindNeighbor(aMacAddress, Neighbor::kInStateAnyExceptInvalid);
|
||||
|
||||
if (neighbor != nullptr)
|
||||
{
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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<uint64_t>(-static_cast<int64_t>(NumericLimits<int32_t>::kMin))
|
||||
: static_cast<uint64_t>(NumericLimits<int32_t>::kMax)),
|
||||
VerifyOrExit(value <= (isNegative ? static_cast<uint64_t>(-static_cast<int64_t>(NumericLimits<int32_t>::kMin))
|
||||
: static_cast<uint64_t>(NumericLimits<int32_t>::kMax)),
|
||||
error = kErrorInvalidArgs);
|
||||
aInt32 = static_cast<int32_t>(isNegavtive ? -static_cast<int64_t>(value) : static_cast<int64_t>(value));
|
||||
aInt32 = static_cast<int32_t>(isNegative ? -static_cast<int64_t>(value) : static_cast<int64_t>(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)
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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_<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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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<SPINEL_PROP_PHY_CALIBRATED_POWER>
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user