diff --git a/examples/platforms/cc2538/startup-gcc.c b/examples/platforms/cc2538/startup-gcc.c index 6c028da11..430520f5a 100644 --- a/examples/platforms/cc2538/startup-gcc.c +++ b/examples/platforms/cc2538/startup-gcc.c @@ -151,7 +151,7 @@ void IntDefaultHandler(void) ; } - // clang-format off +// clang-format off #define FLASH_CCA_BOOTLDR_CFG_DISABLE 0xEFFFFFFF ///< Disable backdoor function #define FLASH_CCA_BOOTLDR_CFG_ENABLE 0xF0FFFFFF ///< Enable backdoor function diff --git a/examples/platforms/kw41z/radio.c b/examples/platforms/kw41z/radio.c index 9e7e2bfb3..9e4115a65 100644 --- a/examples/platforms/kw41z/radio.c +++ b/examples/platforms/kw41z/radio.c @@ -70,7 +70,8 @@ ZLL_RX_FRAME_FILTER_BEACON_FT_MASK) // clang-format on -typedef enum xcvr_state_tag { +typedef enum xcvr_state_tag +{ XCVR_Idle_c, XCVR_RX_c, XCVR_TX_c, @@ -79,7 +80,8 @@ typedef enum xcvr_state_tag { XCVR_CCCA_c, } xcvr_state_t; -typedef enum xcvr_cca_type_tag { +typedef enum xcvr_cca_type_tag +{ XCVR_ED_c, /* energy detect - CCA bit not active, not to be used for T and CCCA sequences */ XCVR_CCA_MODE1_c, /* energy detect - CCA bit ACTIVE */ SCVR_CCA_MODE2_c, /* 802.15.4 compliant signal detect - CCA bit ACTIVE */ diff --git a/examples/platforms/nrf52840/alarm.c b/examples/platforms/nrf52840/alarm.c index ca0b96193..3076b9a8d 100644 --- a/examples/platforms/nrf52840/alarm.c +++ b/examples/platforms/nrf52840/alarm.c @@ -76,7 +76,14 @@ #define XTAL_ACCURACY 40 // The crystal used on nRF52840PDK has ±20ppm accuracy. // clang-format on -typedef enum { kMsTimer, kUsTimer, k802154Timer, k802154Sync, kNumTimers } AlarmIndex; +typedef enum +{ + kMsTimer, + kUsTimer, + k802154Timer, + k802154Sync, + kNumTimers +} AlarmIndex; typedef struct { diff --git a/examples/platforms/nrf52840/diag.c b/examples/platforms/nrf52840/diag.c index 8c08f5ba8..0e3c19f0d 100644 --- a/examples/platforms/nrf52840/diag.c +++ b/examples/platforms/nrf52840/diag.c @@ -49,7 +49,12 @@ #include #include -typedef enum { kDiagTransmitModeIdle, kDiagTransmitModePackets, kDiagTransmitModeCarrier } DiagTrasmitMode; +typedef enum +{ + kDiagTransmitModeIdle, + kDiagTransmitModePackets, + kDiagTransmitModeCarrier +} DiagTrasmitMode; struct PlatformDiagCommand { diff --git a/examples/platforms/nrf52840/radio.c b/examples/platforms/nrf52840/radio.c index 24a552231..a869e0f53 100644 --- a/examples/platforms/nrf52840/radio.c +++ b/examples/platforms/nrf52840/radio.c @@ -93,7 +93,8 @@ static uint32_t sEnergyDetectionTime; static uint8_t sEnergyDetectionChannel; static int8_t sEnergyDetected; -typedef enum { +typedef enum +{ kPendingEventSleep, // Requested to enter Sleep state. kPendingEventFrameTransmitted, // Transmitted frame and received ACK (if requested). kPendingEventChannelAccessFailure, // Failed to transmit frame (channel busy). diff --git a/examples/platforms/posix/misc.c b/examples/platforms/posix/misc.c index 8e79d682f..73303117d 100644 --- a/examples/platforms/posix/misc.c +++ b/examples/platforms/posix/misc.c @@ -48,7 +48,7 @@ static otPlatMcuPowerState gPlatMcuPowerState = OT_PLAT_MCU_POWER_STATE_ON; void otPlatReset(otInstance *aInstance) { #if _WIN32 -// This function does nothing on the Windows platform. + // This function does nothing on the Windows platform. #elif OPENTHREAD_PLATFORM_USE_PSEUDO_RESET // if _WIN32 gPlatformPseudoResetWasRequested = true; diff --git a/include/openthread/border_agent.h b/include/openthread/border_agent.h index eedacaab0..1d0f3cb04 100644 --- a/include/openthread/border_agent.h +++ b/include/openthread/border_agent.h @@ -55,7 +55,8 @@ extern "C" { * This enumeration defines the Border Agent state. * */ -typedef enum otBorderAgentState { +typedef enum otBorderAgentState +{ OT_BORDER_AGENT_STATE_STOPPED = 0, ///< Border agent role is disabled. OT_BORDER_AGENT_STATE_STARTED = 1, ///< Border agent is started. OT_BORDER_AGENT_STATE_ACTIVE = 2, ///< Border agent is connected with external commissioner. diff --git a/include/openthread/coap.h b/include/openthread/coap.h index b7ccfef52..5697b826a 100644 --- a/include/openthread/coap.h +++ b/include/openthread/coap.h @@ -65,7 +65,8 @@ extern "C" { * CoAP Type values. * */ -typedef enum otCoapType { +typedef enum otCoapType +{ OT_COAP_TYPE_CONFIRMABLE = 0x00, ///< Confirmable OT_COAP_TYPE_NON_CONFIRMABLE = 0x10, ///< Non-confirmable OT_COAP_TYPE_ACKNOWLEDGMENT = 0x20, ///< Acknowledgment @@ -82,7 +83,8 @@ typedef enum otCoapType { * CoAP Code values. * */ -typedef enum otCoapCode { +typedef enum otCoapCode +{ OT_COAP_CODE_EMPTY = OT_COAP_CODE(0, 0), ///< Empty message code OT_COAP_CODE_GET = OT_COAP_CODE(0, 1), ///< Get OT_COAP_CODE_POST = OT_COAP_CODE(0, 2), ///< Post @@ -118,7 +120,8 @@ typedef enum otCoapCode { /** * CoAP Option Numbers */ -typedef enum otCoapOptionType { +typedef enum otCoapOptionType +{ OT_COAP_OPTION_IF_MATCH = 1, ///< If-Match OT_COAP_OPTION_URI_HOST = 3, ///< Uri-Host OT_COAP_OPTION_E_TAG = 4, ///< ETag @@ -153,7 +156,8 @@ typedef struct otCoapOption * https://tools.ietf.org/html/rfc7252#page-92 * */ -typedef enum otCoapOptionContentFormat { +typedef enum otCoapOptionContentFormat +{ OT_COAP_OPTION_CONTENT_FORMAT_TEXT_PLAIN = 0, ///< text/plain OT_COAP_OPTION_CONTENT_FORMAT_LINK_FORMAT = 40, ///< application/link-format OT_COAP_OPTION_CONTENT_FORMAT_XML = 41, ///< application/xml diff --git a/include/openthread/commissioner.h b/include/openthread/commissioner.h index b8a2d4c95..87f3e83aa 100644 --- a/include/openthread/commissioner.h +++ b/include/openthread/commissioner.h @@ -58,7 +58,8 @@ extern "C" { * This enumeration defines the Commissioner State. * */ -typedef enum otCommissionerState { +typedef enum otCommissionerState +{ OT_COMMISSIONER_STATE_DISABLED = 0, ///< Commissioner role is disabled. OT_COMMISSIONER_STATE_PETITION = 1, ///< Currently petitioning to become a Commissioner. OT_COMMISSIONER_STATE_ACTIVE = 2, ///< Commissioner role is active. diff --git a/include/openthread/dataset.h b/include/openthread/dataset.h index a88f487b1..adf316d17 100644 --- a/include/openthread/dataset.h +++ b/include/openthread/dataset.h @@ -222,7 +222,8 @@ typedef struct otOperationalDataset * This enumeration represents meshcop TLV types. * */ -typedef enum otMeshcopTlvType { +typedef enum otMeshcopTlvType +{ OT_MESHCOP_TLV_CHANNEL = 0, ///< meshcop Channel TLV OT_MESHCOP_TLV_PANID = 1, ///< meshcop Pan Id TLV OT_MESHCOP_TLV_EXTPANID = 2, ///< meshcop Extended Pan Id TLV diff --git a/include/openthread/error.h b/include/openthread/error.h index d9691dafa..9ae1a50e1 100644 --- a/include/openthread/error.h +++ b/include/openthread/error.h @@ -173,7 +173,8 @@ extern "C" { * This enumeration represents error codes used throughout OpenThread. * */ -typedef enum otError { +typedef enum otError +{ /** * No error. */ diff --git a/include/openthread/icmp6.h b/include/openthread/icmp6.h index 0fa25599b..7363e3ab8 100644 --- a/include/openthread/icmp6.h +++ b/include/openthread/icmp6.h @@ -56,7 +56,8 @@ extern "C" { * ICMPv6 Message Types * */ -typedef enum otIcmp6Type { +typedef enum otIcmp6Type +{ OT_ICMP6_TYPE_DST_UNREACH = 1, ///< Destination Unreachable OT_ICMP6_TYPE_ECHO_REQUEST = 128, ///< Echo Request OT_ICMP6_TYPE_ECHO_REPLY = 129, ///< Echo Reply @@ -66,7 +67,8 @@ typedef enum otIcmp6Type { * ICMPv6 Message Codes * */ -typedef enum otIcmp6Code { +typedef enum otIcmp6Code +{ OT_ICMP6_CODE_DST_UNREACH_NO_ROUTE = 0, ///< Destination Unreachable No Route } otIcmp6Code; @@ -127,7 +129,8 @@ typedef struct otIcmp6Handler * ICMPv6 Echo Reply Modes * */ -typedef enum otIcmp6EchoMode { +typedef enum otIcmp6EchoMode +{ OT_ICMP6_ECHO_HANDLER_DISABLED = 0, ///< ICMPv6 Echo processing disabled OT_ICMP6_ECHO_HANDLER_UNICAST_ONLY = 1, ///< ICMPv6 Echo processing enabled only for unicast requests only OT_ICMP6_ECHO_HANDLER_MULTICAST_ONLY = 2, ///< ICMPv6 Echo processing enabled only for multicast requests only diff --git a/include/openthread/ip6.h b/include/openthread/ip6.h index abd7b2afb..4799ec8c6 100644 --- a/include/openthread/ip6.h +++ b/include/openthread/ip6.h @@ -126,7 +126,8 @@ typedef struct otNetifMulticastAddress * This enumeration represents the list of allowable values for an InterfaceId. * */ -typedef enum otNetifInterfaceId { +typedef enum otNetifInterfaceId +{ OT_NETIF_INTERFACE_ID_HOST = -1, ///< The interface ID telling packets received by host side interfaces. OT_NETIF_INTERFACE_ID_THREAD = 1, ///< The Thread Network interface ID. } otNetifInterfaceId; diff --git a/include/openthread/joiner.h b/include/openthread/joiner.h index 35c7f0ff0..ed144eaeb 100644 --- a/include/openthread/joiner.h +++ b/include/openthread/joiner.h @@ -56,7 +56,8 @@ extern "C" { * This enumeration defines the Joiner State. * */ -typedef enum otJoinerState { +typedef enum otJoinerState +{ OT_JOINER_STATE_IDLE = 0, OT_JOINER_STATE_DISCOVER = 1, OT_JOINER_STATE_CONNECT = 2, diff --git a/include/openthread/link.h b/include/openthread/link.h index 222268bc7..e99b662a1 100644 --- a/include/openthread/link.h +++ b/include/openthread/link.h @@ -84,7 +84,8 @@ typedef uint8_t otMacFilterIterator; ///< Used to iterate through mac filter ent * Defines address mode of the mac filter. * */ -typedef enum otMacFilterAddressMode { +typedef enum otMacFilterAddressMode +{ OT_MAC_FILTER_ADDRESS_MODE_DISABLED, ///< Address filter is disabled. OT_MAC_FILTER_ADDRESS_MODE_WHITELIST, ///< Whitelist address filter mode is enabled. OT_MAC_FILTER_ADDRESS_MODE_BLACKLIST, ///< Blacklist address filter mode is enabled. diff --git a/include/openthread/netdata.h b/include/openthread/netdata.h index caeab6a89..46744a369 100644 --- a/include/openthread/netdata.h +++ b/include/openthread/netdata.h @@ -150,7 +150,8 @@ typedef struct otExternalRouteConfig * Defines valid values for member mPreference in otExternalRouteConfig and otBorderRouterConfig. * */ -typedef enum otRoutePreference { +typedef enum otRoutePreference +{ OT_ROUTE_PREFERENCE_LOW = -1, ///< Low route preference. OT_ROUTE_PREFERENCE_MED = 0, ///< Medium route preference. OT_ROUTE_PREFERENCE_HIGH = 1, ///< High route preference. diff --git a/include/openthread/network_time.h b/include/openthread/network_time.h index 2990c2c98..477e5385d 100644 --- a/include/openthread/network_time.h +++ b/include/openthread/network_time.h @@ -56,7 +56,8 @@ extern "C" { * This enum represents OpenThread time synchronization status. * */ -typedef enum otNetworkTimeStatus { +typedef enum otNetworkTimeStatus +{ OT_NETWORK_TIME_UNSYNCHRONIZED = -1, ///< The device hasn't attached to a network. OT_NETWORK_TIME_RESYNC_NEEDED = 0, ///< The device hasn’t received time sync for more than two periods time. OT_NETWORK_TIME_SYNCHRONIZED = 1, ///< The device network time is synchronized. diff --git a/include/openthread/platform/ble.h b/include/openthread/platform/ble.h index bffb97ab2..50844f64d 100644 --- a/include/openthread/platform/ble.h +++ b/include/openthread/platform/ble.h @@ -203,7 +203,8 @@ enum * This enum represents BLE Device Address types. * */ -typedef enum otPlatBleAddressType { +typedef enum otPlatBleAddressType +{ OT_BLE_ADDRESS_TYPE_PUBLIC = 0, ///< Bluetooth public device address. OT_BLE_ADDRESS_TYPE_RANDOM_STATIC = 1, ///< Bluetooth random static address. OT_BLE_ADDRESS_TYPE_RANDOM_PRIVATE_RESOLVABLE = 2, ///< Bluetooth random private resolvable address. @@ -216,7 +217,8 @@ typedef enum otPlatBleAddressType { * * See v4.2 [Vol 3, Part G] 3.3.1.1 Characteristic Properties - Table 3.5 */ -typedef enum otPlatBleCccdFlags { +typedef enum otPlatBleCccdFlags +{ /** * If set, permits broadcasts of the Characteristic Value using Characteristic Configuration Descriptor. */ @@ -273,7 +275,8 @@ typedef struct otPlatBleDeviceAddr * This enumeration defines flags for BLE advertisement mode. * */ -typedef enum otPlatBleAdvMode { +typedef enum otPlatBleAdvMode +{ /** * If set, advertising device will allow connections to be initiated. */ @@ -321,7 +324,8 @@ typedef struct otPlatBleGapConnParams * This enumeration represents BLE UUID value. * */ -typedef enum otPlatBleUuidType { +typedef enum otPlatBleUuidType +{ OT_BLE_UUID_TYPE_16 = 0, ///< UUID represented by 16-bit value. OT_BLE_UUID_TYPE_32 = 1, ///< UUID represented by 32-bit value. OT_BLE_UUID_TYPE_128 = 2, ///< UUID represented by 128-bit value. diff --git a/include/openthread/platform/logging.h b/include/openthread/platform/logging.h index b2c5bc14f..9eaafd608 100644 --- a/include/openthread/platform/logging.h +++ b/include/openthread/platform/logging.h @@ -116,7 +116,8 @@ typedef uint8_t otLogLevel; * This enumeration represents log regions. * */ -typedef enum otLogRegion { +typedef enum otLogRegion +{ OT_LOG_REGION_API = 1, ///< OpenThread API OT_LOG_REGION_MLE = 2, ///< MLE OT_LOG_REGION_ARP = 3, ///< EID-to-RLOC mapping. diff --git a/include/openthread/platform/misc.h b/include/openthread/platform/misc.h index 7b87b8183..99c3ed3f5 100644 --- a/include/openthread/platform/misc.h +++ b/include/openthread/platform/misc.h @@ -67,7 +67,8 @@ void otPlatReset(otInstance *aInstance); * These are in the same order as the Spinel reset reason codes. * */ -typedef enum { +typedef enum +{ OT_PLAT_RESET_REASON_POWER_ON = 0, OT_PLAT_RESET_REASON_EXTERNAL = 1, OT_PLAT_RESET_REASON_SOFTWARE = 2, @@ -120,7 +121,8 @@ void otPlatWakeHost(void); * After a reset, the MCU power state MUST be `OT_PLAT_POWER_STATE_ON`. * */ -typedef enum { +typedef enum +{ /** * NCP's MCU stays on and active all the time. * diff --git a/include/openthread/platform/radio.h b/include/openthread/platform/radio.h index b4921710a..091ef8cf5 100644 --- a/include/openthread/platform/radio.h +++ b/include/openthread/platform/radio.h @@ -204,7 +204,8 @@ typedef struct otRadioFrame * This structure represents the state of a radio. * Initially, a radio is in the Disabled state. */ -typedef enum otRadioState { +typedef enum otRadioState +{ OT_RADIO_STATE_DISABLED = 0, OT_RADIO_STATE_SLEEP = 1, OT_RADIO_STATE_RECEIVE = 2, diff --git a/include/openthread/thread.h b/include/openthread/thread.h index b7b8e16b8..47fe24f02 100644 --- a/include/openthread/thread.h +++ b/include/openthread/thread.h @@ -59,7 +59,8 @@ extern "C" { * Represents a Thread device role. * */ -typedef enum { +typedef enum +{ OT_DEVICE_ROLE_DISABLED = 0, ///< The Thread stack is disabled. OT_DEVICE_ROLE_DETACHED = 1, ///< Not currently participating in a Thread network/partition. OT_DEVICE_ROLE_CHILD = 2, ///< The Thread Child role. diff --git a/include/openthread/thread_ftd.h b/include/openthread/thread_ftd.h index 387dcd66c..32824e910 100644 --- a/include/openthread/thread_ftd.h +++ b/include/openthread/thread_ftd.h @@ -546,7 +546,8 @@ OTAPI otError OTCALL otThreadSetParentPriority(otInstance *aInstance, int8_t aPa * removed. * */ -typedef enum otThreadChildTableEvent { +typedef enum otThreadChildTableEvent +{ OT_THREAD_CHILD_TABLE_EVENT_CHILD_ADDED, ///< A child is being added. OT_THREAD_CHILD_TABLE_EVENT_CHILD_REMOVED, ///< A child is being removed. } otThreadChildTableEvent; diff --git a/script/clang-format.sh b/script/clang-format.sh index fd3454745..d07796749 100755 --- a/script/clang-format.sh +++ b/script/clang-format.sh @@ -41,7 +41,7 @@ elif which clang-format > /dev/null; then "$CLANG_FORMAT_VERSION"*) ;; *) - die "clang-format 6.0 required" + die "$(clang-format --version); clang-format 6.0 required" ;; esac else diff --git a/src/cli/cli_uart.cpp b/src/cli/cli_uart.cpp index 5c704061e..f783a507f 100644 --- a/src/cli/cli_uart.cpp +++ b/src/cli/cli_uart.cpp @@ -176,29 +176,29 @@ otError Uart::ProcessCommand(void) } #if OPENTHREAD_CONFIG_LOG_OUTPUT != OPENTHREAD_CONFIG_LOG_OUTPUT_NONE - /* - * Note this is here for this reason: - * - * TEXT (command) input ... in a test automation script occurs - * rapidly and often without gaps between the command and the - * terminal CR - * - * In contrast as a human is typing there is a delay between the - * last character of a command and the terminal CR which executes - * a command. - * - * During that human induced delay a tasklet may be scheduled and - * the LOG becomes confusing and it is hard to determine when - * something happened. Which happened first? the command-CR or - * the tasklet. - * - * Yes, while rare it is a race condition that is hard to debug. - * - * Thus this is here to affirmatively LOG exactly when the CLI - * command is being executed. - */ + /* + * Note this is here for this reason: + * + * TEXT (command) input ... in a test automation script occurs + * rapidly and often without gaps between the command and the + * terminal CR + * + * In contrast as a human is typing there is a delay between the + * last character of a command and the terminal CR which executes + * a command. + * + * During that human induced delay a tasklet may be scheduled and + * the LOG becomes confusing and it is hard to determine when + * something happened. Which happened first? the command-CR or + * the tasklet. + * + * Yes, while rare it is a race condition that is hard to debug. + * + * Thus this is here to affirmatively LOG exactly when the CLI + * command is being executed. + */ #if OPENTHREAD_ENABLE_MULTIPLE_INSTANCES - /* TODO: how exactly do we get the instance here? */ + /* TODO: how exactly do we get the instance here? */ #else otLogInfoCli("execute command: %s", mRxBuffer); #endif diff --git a/src/core/api/instance_api.cpp b/src/core/api/instance_api.cpp index 95ccd0190..52883caeb 100644 --- a/src/core/api/instance_api.cpp +++ b/src/core/api/instance_api.cpp @@ -119,21 +119,21 @@ otError otInstanceErasePersistentInfo(otInstance *aInstance) const char *otGetVersionString(void) { -/** - * PLATFORM_VERSION_ATTR_PREFIX and PLATFORM_VERSION_ATTR_SUFFIX are - * intended to be used to specify compiler directives to indicate - * what linker section the platform version string should be stored. - * - * This is useful for specifying an exact location of where the version - * string will be located so that it can be easily retrieved from the - * raw firmware image. - * - * If PLATFORM_VERSION_ATTR_PREFIX is unspecified, the keyword `static` - * is used instead. - * - * If both are unspecified, the location of the string in the firmware - * image will be undefined and may change. - */ + /** + * PLATFORM_VERSION_ATTR_PREFIX and PLATFORM_VERSION_ATTR_SUFFIX are + * intended to be used to specify compiler directives to indicate + * what linker section the platform version string should be stored. + * + * This is useful for specifying an exact location of where the version + * string will be located so that it can be easily retrieved from the + * raw firmware image. + * + * If PLATFORM_VERSION_ATTR_PREFIX is unspecified, the keyword `static` + * is used instead. + * + * If both are unspecified, the location of the string in the firmware + * image will be undefined and may change. + */ #ifdef PLATFORM_VERSION_ATTR_PREFIX PLATFORM_VERSION_ATTR_PREFIX diff --git a/src/core/meshcop/meshcop_tlvs.hpp b/src/core/meshcop/meshcop_tlvs.hpp index 32432125c..27b81fa02 100644 --- a/src/core/meshcop/meshcop_tlvs.hpp +++ b/src/core/meshcop/meshcop_tlvs.hpp @@ -49,9 +49,9 @@ #include "meshcop/timestamp.hpp" #include "net/ip6_address.hpp" +using ot::Encoding::Reverse32; using ot::Encoding::BigEndian::HostSwap16; using ot::Encoding::BigEndian::HostSwap32; -using ot::Encoding::Reverse32; namespace ot { namespace MeshCoP { diff --git a/src/core/net/dhcp6.hpp b/src/core/net/dhcp6.hpp index 998f1ebc4..649354c25 100644 --- a/src/core/net/dhcp6.hpp +++ b/src/core/net/dhcp6.hpp @@ -72,7 +72,8 @@ enum * DHCPv6 Message Types * */ -typedef enum Type { +typedef enum Type +{ kTypeSolicit = 1, kTypeAdvertise = 2, kTypeRequest = 3, @@ -149,7 +150,8 @@ private: * DHCPv6 Option Codes * */ -typedef enum Code { +typedef enum Code +{ kOptionClientIdentifier = 1, kOptionServerIdentifier = 2, kOptionIaNa = 3, @@ -233,7 +235,8 @@ private: * Duid Type * */ -typedef enum DuidType { +typedef enum DuidType +{ kDuidLLT = 1, kDuidEN = 2, kDuidLL = 3, @@ -555,7 +558,8 @@ private: * Status Code * */ -typedef enum Status { +typedef enum Status +{ kStatusSuccess = 0, kStatusUnspecFail = 1, kStatusNoAddrsAvail = 2, diff --git a/src/core/net/dhcp6_client.hpp b/src/core/net/dhcp6_client.hpp index 57510b479..5aaa4fe0b 100644 --- a/src/core/net/dhcp6_client.hpp +++ b/src/core/net/dhcp6_client.hpp @@ -83,7 +83,8 @@ public: * Status of IdentityAssociation * */ - typedef enum Status { + typedef enum Status + { kStatusInvalid, kStatusSolicit, kStatusSoliciting, diff --git a/src/ncp/ncp_base.cpp b/src/ncp/ncp_base.cpp index c8a505d70..2844a5032 100644 --- a/src/ncp/ncp_base.cpp +++ b/src/ncp/ncp_base.cpp @@ -1322,9 +1322,9 @@ exit: #endif // OPENTHREAD_CONFIG_NCP_ENABLE_PEEK_POKE - // ---------------------------------------------------------------------------- - // MARK: Individual Property Getters and Setters - // ---------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- +// MARK: Individual Property Getters and Setters +// ---------------------------------------------------------------------------- #if OPENTHREAD_ENABLE_DIAG diff --git a/src/ncp/spinel.c b/src/ncp/spinel.c index e2c90bf43..86ce2541c 100644 --- a/src/ncp/spinel.c +++ b/src/ncp/spinel.c @@ -2494,9 +2494,9 @@ const char *spinel_capability_to_cstr(unsigned int capability) return ret; } - // **** LCOV_EXCL_STOP **** +// **** LCOV_EXCL_STOP **** - /* -------------------------------------------------------------------------- */ +/* -------------------------------------------------------------------------- */ #if SPINEL_SELF_TEST diff --git a/src/ncp/spinel.h b/src/ncp/spinel.h index 663b83baf..1e02f8d32 100644 --- a/src/ncp/spinel.h +++ b/src/ncp/spinel.h @@ -99,7 +99,8 @@ extern "C" { #endif -typedef enum { +typedef enum +{ SPINEL_STATUS_OK = 0, ///< Operation has completed successfully. SPINEL_STATUS_FAILURE = 1, ///< Operation has failed for some undefined reason. @@ -196,28 +197,32 @@ typedef enum { SPINEL_STATUS_EXPERIMENTAL__END = 2097152, } spinel_status_t; -typedef enum { +typedef enum +{ SPINEL_NET_ROLE_DETACHED = 0, SPINEL_NET_ROLE_CHILD = 1, SPINEL_NET_ROLE_ROUTER = 2, SPINEL_NET_ROLE_LEADER = 3, } spinel_net_role_t; -typedef enum { +typedef enum +{ SPINEL_IPV6_ICMP_PING_OFFLOAD_DISABLED = 0, SPINEL_IPV6_ICMP_PING_OFFLOAD_UNICAST_ONLY = 1, SPINEL_IPV6_ICMP_PING_OFFLOAD_MULTICAST_ONLY = 2, SPINEL_IPV6_ICMP_PING_OFFLOAD_ALL = 3, } spinel_ipv6_icmp_ping_offload_mode_t; -typedef enum { +typedef enum +{ SPINEL_SCAN_STATE_IDLE = 0, SPINEL_SCAN_STATE_BEACON = 1, SPINEL_SCAN_STATE_ENERGY = 2, SPINEL_SCAN_STATE_DISCOVER = 3, } spinel_scan_state_t; -typedef enum { +typedef enum +{ SPINEL_MCU_POWER_STATE_ON = 0, SPINEL_MCU_POWER_STATE_LOW_POWER = 1, SPINEL_MCU_POWER_STATE_OFF = 2, @@ -226,7 +231,8 @@ typedef enum { // The `spinel_power_state_t` enumeration and `POWER_STATE` // property are deprecated. Please use `MCU_POWER_STATE` // instead. -typedef enum { +typedef enum +{ SPINEL_POWER_STATE_OFFLINE = 0, SPINEL_POWER_STATE_DEEP_SLEEP = 1, SPINEL_POWER_STATE_STANDBY = 2, @@ -234,7 +240,8 @@ typedef enum { SPINEL_POWER_STATE_ONLINE = 4, } spinel_power_state_t; -typedef enum { +typedef enum +{ SPINEL_HOST_POWER_STATE_OFFLINE = 0, SPINEL_HOST_POWER_STATE_DEEP_SLEEP = 1, SPINEL_HOST_POWER_STATE_RESERVED = 2, @@ -518,7 +525,8 @@ enum * Experimental | 2,000,000 - 2,097,151 | Experimental use only * */ -typedef enum { +typedef enum +{ SPINEL_PROP_LAST_STATUS = 0, ///< status [i] SPINEL_PROP_PROTOCOL_VERSION = 1, ///< major, minor [i,i] SPINEL_PROP_NCP_VERSION = 2, ///< version string [U]