mirror of
https://github.com/espressif/openthread.git
synced 2026-08-17 07:59:51 +00:00
[cli] use static constexpr for constants instead of of enum (#9789)
This commit is contained in:
+4
-8
@@ -277,14 +277,10 @@ protected:
|
||||
static Interpreter *sInterpreter;
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
kIndentSize = 4,
|
||||
kMaxArgs = 32,
|
||||
kMaxAutoAddresses = 8,
|
||||
kMaxLineLength = OPENTHREAD_CONFIG_CLI_MAX_LINE_LENGTH,
|
||||
kMaxUserCommandEntries = OPENTHREAD_CONFIG_CLI_MAX_USER_CMD_ENTRIES,
|
||||
};
|
||||
static constexpr uint8_t kIndentSize = 4;
|
||||
static constexpr uint16_t kMaxArgs = 32;
|
||||
static constexpr uint16_t kMaxLineLength = OPENTHREAD_CONFIG_CLI_MAX_LINE_LENGTH;
|
||||
static constexpr uint16_t kMaxUserCommandEntries = OPENTHREAD_CONFIG_CLI_MAX_USER_CMD_ENTRIES;
|
||||
|
||||
static constexpr uint32_t kNetworkDiagnosticTimeoutMsecs = 5000;
|
||||
static constexpr uint32_t kLocateTimeoutMsecs = 2500;
|
||||
|
||||
@@ -78,11 +78,8 @@ public:
|
||||
otError Process(Arg aArgs[]);
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
kMaxUriLength = 32,
|
||||
kMaxBufferSize = 16
|
||||
};
|
||||
static constexpr uint16_t kMaxUriLength = 32;
|
||||
static constexpr uint16_t kMaxBufferSize = 16;
|
||||
|
||||
using Command = CommandEntry<Coap>;
|
||||
|
||||
|
||||
@@ -84,13 +84,10 @@ public:
|
||||
otError Process(Arg aArgs[]);
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
kMaxUriLength = 32,
|
||||
kMaxBufferSize = 16,
|
||||
kPskMaxLength = 32,
|
||||
kPskIdMaxLength = 32
|
||||
};
|
||||
static constexpr uint16_t kMaxUriLength = 32;
|
||||
static constexpr uint16_t kMaxBufferSize = 16;
|
||||
static constexpr uint8_t kPskMaxLength = 32;
|
||||
static constexpr uint8_t kPskIdMaxLength = 32;
|
||||
|
||||
using Command = CommandEntry<CoapSecure>;
|
||||
|
||||
|
||||
@@ -81,10 +81,7 @@ public:
|
||||
otError Process(Arg aArgs[]);
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
kDefaultJoinerTimeout = 120, ///< Default timeout for Joiners, in seconds.
|
||||
};
|
||||
static constexpr uint32_t kDefaultJoinerTimeout = 120; ///< Default timeout for Joiners, in seconds.
|
||||
|
||||
using Command = CommandEntry<Commissioner>;
|
||||
|
||||
|
||||
@@ -80,11 +80,8 @@ public:
|
||||
otError Process(Arg aArgs[]);
|
||||
|
||||
private:
|
||||
enum : uint8_t
|
||||
{
|
||||
kMaxHostAddresses = OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_MAX_HOST_ADDRESSES,
|
||||
kIndentSize = 4,
|
||||
};
|
||||
static constexpr uint8_t kIndentSize = 4;
|
||||
static constexpr uint8_t kMaxHostAddresses = OPENTHREAD_CONFIG_SRP_CLIENT_BUFFERS_MAX_HOST_ADDRESSES;
|
||||
|
||||
using Command = CommandEntry<SrpClient>;
|
||||
|
||||
|
||||
+1
-4
@@ -399,10 +399,7 @@ exit:
|
||||
|
||||
otError UdpExample::PrepareHexStringPayload(otMessage &aMessage, const char *aHexString)
|
||||
{
|
||||
enum : uint8_t
|
||||
{
|
||||
kBufferSize = 50,
|
||||
};
|
||||
static constexpr uint16_t kBufferSize = 50;
|
||||
|
||||
otError error;
|
||||
uint8_t buf[kBufferSize];
|
||||
|
||||
Reference in New Issue
Block a user