Skip to content

Improve serial command handling#319

Open
hhvrc wants to merge 16 commits intodevelopfrom
bugfix/serial-subcommands
Open

Improve serial command handling#319
hhvrc wants to merge 16 commits intodevelopfrom
bugfix/serial-subcommands

Conversation

@hhvrc
Copy link
Copy Markdown
Contributor

@hhvrc hhvrc commented Nov 15, 2024

Split apart command handlers and fix command handler selection logic

@hhvrc hhvrc self-assigned this Nov 15, 2024
@LucHeart LucHeart requested a review from Copilot April 7, 2025 19:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Sep 2, 2025

⚠️ No Changeset found

Latest commit: 868f356

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

hhvrc and others added 2 commits September 2, 2025 11:08
Resolve 18 merge conflicts in serial subsystem. Keep branch's design:
- Separate handler functions per subcommand (handleGet/handleSet/handleClear)
- Named subcommand registration via CommandGroup
- getCommandEntry() for intelligent subcommand matching
- CommandGroup in separate files (not duplicated in CommandEntry.h)

Adopt from develop:
- OS_SERIAL_PRINT/PRINTF/PRINTLN macros (Arduino→ESP-IDF migration)
- USB serial support (#if ARDUINO_USB_MODE)
- TinyVec usage for rawconfig
- LedTestHandler

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v21.1.8) reports: 5 file(s) not formatted
  • include/serial/SerialBuffer.h
  • src/serial/SerialInputHandler.cpp
  • src/serial/command_handlers/networks.cpp
  • src/serial/command_handlers/rftxpin.cpp
  • src/serial/command_handlers/validgpios.cpp
clang-tidy (v21.1.8) reports: 249 concern(s)
  • include/serial/SerialBuffer.h:1:1: warning: [portability-avoid-pragma-once]

    avoid 'pragma once' directive; use include guards instead

        1 | #pragma once
          | ^
  • include/serial/SerialBuffer.h:3:10: error: [clang-diagnostic-error]

    'cstdint' file not found

        3 | #include <cstdint>
          |          ^~~~~~~~~
  • include/serial/SerialBuffer.h:11:5: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       11 |     DISABLE_COPY(SerialBuffer);
          |     ^
    include/Common.h:9:13: note: expanded from macro 'DISABLE_COPY'
        9 |   TypeName& operator=(const TypeName&) = delete
          |             ^
  • include/serial/SerialBuffer.h:12:5: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       12 |     DISABLE_MOVE(SerialBuffer);
          |     ^
    include/Common.h:12:13: note: expanded from macro 'DISABLE_MOVE'
       12 |   TypeName& operator=(TypeName&&) = delete
          |             ^
  • include/serial/SerialBuffer.h:15:5: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: m_size, m_capacity

       15 |     constexpr SerialBuffer()
          |     ^
  • include/serial/SerialBuffer.h:15:15: warning: [modernize-use-equals-default]

    use '= default' to define a trivial default constructor

       15 |     constexpr SerialBuffer()
          |               ^
       16 |       : m_data(nullptr)
       17 |       , m_size(0)
       18 |       , m_capacity(0)
       19 |     {
          |     ~
          |     = default;
       20 |     }
          |     ~
  • include/serial/SerialBuffer.h:21:5: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: m_size, m_capacity

       21 |     SerialBuffer(size_t capacity)
          |     ^
  • include/serial/SerialBuffer.h:27:5: warning: [modernize-use-equals-default]

    use '= default' to define a trivial destructor

       27 |     ~SerialBuffer() { delete[] m_data; }
          |     ^
  • include/serial/SerialBuffer.h:29:21: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       29 |     constexpr char* data() { return m_data; }
          |               ~~~~~ ^
          |               auto         -> char*
  • include/serial/SerialBuffer.h:30:5: warning: [modernize-use-nodiscard]

    function 'size' should be marked [[nodiscard]]

       30 |     constexpr size_t size() const { return m_size; }
          |     ^
          |     [[nodiscard]] 
  • include/serial/SerialBuffer.h:30:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       30 |     constexpr size_t size() const { return m_size; }
          |                      ^
  • include/serial/SerialBuffer.h:31:5: warning: [modernize-use-nodiscard]

    function 'capacity' should be marked [[nodiscard]]

       31 |     constexpr size_t capacity() const { return m_capacity; }
          |     ^
          |     [[nodiscard]] 
  • include/serial/SerialBuffer.h:31:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       31 |     constexpr size_t capacity() const { return m_capacity; }
          |                      ^
  • include/serial/SerialBuffer.h:32:5: warning: [modernize-use-nodiscard]

    function 'empty' should be marked [[nodiscard]]

       32 |     constexpr bool empty() const { return m_size == 0; }
          |     ^
          |     [[nodiscard]] 
  • include/serial/SerialBuffer.h:32:20: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       32 |     constexpr bool empty() const { return m_size == 0; }
          |               ~~~~ ^
          |               auto               -> bool
  • include/serial/SerialBuffer.h:43:10: warning: [readability-convert-member-functions-to-static]

    method 'reserve' can be made static

       43 |     void reserve(size_t size)
          |          ^
          |     static 
  • include/serial/SerialBuffer.h:45:22: warning: [cppcoreguidelines-avoid-magic-numbers]

    31 is a magic number; consider replacing it with a named constant

       45 |       size = (size + 31) & ~31;  // Align to 32 bytes
          |                      ^
  • include/serial/SerialBuffer.h:45:29: warning: [cppcoreguidelines-avoid-magic-numbers]

    31 is a magic number; consider replacing it with a named constant

       45 |       size = (size + 31) & ~31;  // Align to 32 bytes
          |                             ^
  • include/serial/SerialBuffer.h:51:7: warning: [cppcoreguidelines-owning-memory]

    initializing non-owner 'char *' with a newly created 'gsl::owner<>'

       51 |       char* newData = new char[size];
          |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • include/serial/SerialBuffer.h:61:10: warning: [readability-convert-member-functions-to-static]

    method 'push_back' can be made static

       61 |     void push_back(char c)
          |          ^
          |     static 
  • include/serial/SerialBuffer.h:61:25: warning: [readability-identifier-length]

    parameter name 'c' is too short, expected at least 3 characters

       61 |     void push_back(char c)
          |                         ^
  • include/serial/SerialBuffer.h:70:20: warning: [readability-convert-member-functions-to-static]

    method 'pop_back' can be made static

       70 |     constexpr void pop_back()
          |                    ^
          |     static 
  • include/serial/SerialInputHandler.h:1:1: warning: [portability-avoid-pragma-once]

    avoid 'pragma once' directive; use include guards instead

        1 | #pragma once
          | ^
  • include/serial/SerialInputHandler.h:3:10: error: [clang-diagnostic-error]

    'cstdint' file not found

        3 | #include <cstdint>
          |          ^~~~~~~~~
  • include/serial/SerialInputHandler.h:18:9: warning: [cppcoreguidelines-macro-usage]

    variadic macro 'OS_SERIAL_PRINT' used; consider using a 'constexpr' variadic template function

       18 | #define OS_SERIAL_PRINT(...)          \
          |         ^
  • include/serial/SerialInputHandler.h:23:9: warning: [cppcoreguidelines-macro-usage]

    variadic macro 'OS_SERIAL_PRINTF' used; consider using a 'constexpr' variadic template function

       23 | #define OS_SERIAL_PRINTF(...)          \
          |         ^
  • include/serial/SerialInputHandler.h:28:9: warning: [cppcoreguidelines-macro-usage]

    variadic macro 'OS_SERIAL_PRINTLN' used; consider using a 'constexpr' variadic template function

       28 | #define OS_SERIAL_PRINTLN(...)          \
          |         ^
  • include/serial/SerialInputHandler.h:40:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       40 |   [[nodiscard]] bool Init();
          |                 ~~~~ ^     
          |                 auto        -> bool
  • include/serial/SerialInputHandler.h:42:8: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       42 |   bool SerialEchoEnabled();
          |   ~~~~ ^                  
          |   auto                     -> bool
  • include/serial/SerialReadResult.h:1:1: warning: [portability-avoid-pragma-once]

    avoid 'pragma once' directive; use include guards instead

        1 | #pragma once
          | ^
  • include/serial/SerialReadResult.h:4:14: warning: [performance-enum-size]

    enum 'SerialReadResult' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size

        4 |   enum class SerialReadResult {
          |              ^
  • include/serial/command_handlers/CommandArgument.h:1:1: warning: [portability-avoid-pragma-once]

    avoid 'pragma once' directive; use include guards instead

        1 | #pragma once
          | ^
  • include/serial/command_handlers/CommandArgument.h:3:10: error: [clang-diagnostic-error]

    'string_view' file not found

        3 | #include <string_view>
          |          ^~~~~~~~~~~~~
  • include/serial/command_handlers/CommandArgument.h:7:9: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: name, constraint, exampleValue, constraintExtensions

        7 |   class CommandArgument {
          |         ^
        8 |   public:
        9 |     std::string_view name;
          |                          
          |                          {}
       10 |     std::string_view constraint;
          |                                
          |                                {}
       11 |     std::string_view exampleValue;
          |                                  
          |                                  {}
       12 |     std::vector<std::string_view> constraintExtensions;
          |                                                       
          |                                                       {}
  • include/serial/command_handlers/CommandEntry.h:1:1: warning: [portability-avoid-pragma-once]

    avoid 'pragma once' directive; use include guards instead

        1 | #pragma once
          | ^
  • include/serial/command_handlers/CommandEntry.h:15:5: warning: [modernize-use-nodiscard]

    function 'name' should be marked [[nodiscard]]

       15 |     inline std::string_view name() const { return m_name; }
          |     ^
          |     [[nodiscard]] 
  • include/serial/command_handlers/CommandEntry.h:15:5: warning: [readability-redundant-inline-specifier]

    function 'name' has inline specifier but is implicitly inlined

       15 |     inline std::string_view name() const { return m_name; }
          |     ^~~~~~
  • include/serial/command_handlers/CommandEntry.h:15:29: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       15 |     inline std::string_view name() const { return m_name; }
          |                             ^
  • include/serial/command_handlers/CommandEntry.h:16:5: warning: [modernize-use-nodiscard]

    function 'description' should be marked [[nodiscard]]

       16 |     inline std::string_view description() const { return m_description; }
          |     ^
          |     [[nodiscard]] 
  • include/serial/command_handlers/CommandEntry.h:16:5: warning: [readability-redundant-inline-specifier]

    function 'description' has inline specifier but is implicitly inlined

       16 |     inline std::string_view description() const { return m_description; }
          |     ^~~~~~
  • include/serial/command_handlers/CommandEntry.h:16:29: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       16 |     inline std::string_view description() const { return m_description; }
          |                             ^
  • include/serial/command_handlers/CommandEntry.h:17:5: warning: [modernize-use-nodiscard]

    function 'arguments' should be marked [[nodiscard]]

       17 |     inline const std::vector<CommandArgument>& arguments() const { return m_arguments; }
          |     ^
          |     [[nodiscard]] 
  • include/serial/command_handlers/CommandEntry.h:17:5: warning: [readability-redundant-inline-specifier]

    function 'arguments' has inline specifier but is implicitly inlined

       17 |     inline const std::vector<CommandArgument>& arguments() const { return m_arguments; }
          |     ^~~~~~
  • include/serial/command_handlers/CommandEntry.h:17:48: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       17 |     inline const std::vector<CommandArgument>& arguments() const { return m_arguments; }
          |                                              ~ ^
          |                                              auto                -> &
  • include/serial/command_handlers/CommandEntry.h:18:5: warning: [modernize-use-nodiscard]

    function 'commandHandler' should be marked [[nodiscard]]

       18 |     inline CommandHandler commandHandler() const { return m_commandHandler; }
          |     ^
          |     [[nodiscard]] 
  • include/serial/command_handlers/CommandEntry.h:18:5: warning: [readability-redundant-inline-specifier]

    function 'commandHandler' has inline specifier but is implicitly inlined

       18 |     inline CommandHandler commandHandler() const { return m_commandHandler; }
          |     ^~~~~~
  • include/serial/command_handlers/CommandEntry.h:18:27: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       18 |     inline CommandHandler commandHandler() const { return m_commandHandler; }
          |                           ^
  • include/serial/command_handlers/CommandEntry.h:20:22: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       20 |     CommandArgument& addArgument(std::string_view name, std::string_view constraint, std::string_view exampleValue, std::vector<std::string_view> constraintExtensions = {});
          |     ~~~~~~~~~~~~~~~~ ^                                                                                                                                                      
          |     auto                                                                                                                                                                     -> CommandArgument&
  • include/serial/command_handlers/CommandGroup.h:1:1: warning: [portability-avoid-pragma-once]

    avoid 'pragma once' directive; use include guards instead

        1 | #pragma once
          | ^
  • include/serial/command_handlers/CommandGroup.h:10:9: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: m_name, m_commands

       10 |   class CommandGroup {
          |         ^
  • include/serial/command_handlers/CommandGroup.h:10:9: warning: [cppcoreguidelines-special-member-functions]

    class 'CommandGroup' defines a copy constructor, a copy assignment operator, a move constructor and a move assignment operator but does not define a destructor

  • include/serial/command_handlers/CommandGroup.h:16:19: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       16 |     CommandGroup& operator=(CommandGroup&& other)      = default;
          |     ~~~~~~~~~~~~~ ^
          |     auto                                          -> CommandGroup&
  • include/serial/command_handlers/CommandGroup.h:17:19: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       17 |     CommandGroup& operator=(const CommandGroup& other) = default;
          |     ~~~~~~~~~~~~~ ^
          |     auto                                               -> CommandGroup&
  • include/serial/command_handlers/CommandGroup.h:19:5: warning: [modernize-use-nodiscard]

    function 'name' should be marked [[nodiscard]]

       19 |     constexpr std::string_view name() const { return m_name; }
          |     ^
          |     [[nodiscard]] 
  • include/serial/command_handlers/CommandGroup.h:19:32: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       19 |     constexpr std::string_view name() const { return m_name; }
          |                                ^
  • include/serial/command_handlers/CommandGroup.h:20:5: warning: [modernize-use-nodiscard]

    function 'commands' should be marked [[nodiscard]]

       20 |     const std::vector<CommandEntry>& commands() const { return m_commands; }
          |     ^
          |     [[nodiscard]] 
  • include/serial/command_handlers/CommandGroup.h:20:38: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       20 |     const std::vector<CommandEntry>& commands() const { return m_commands; }
          |                                    ~ ^
          |                                    auto               -> &
  • include/serial/command_handlers/CommandGroup.h:22:19: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       22 |     CommandEntry& addCommand(std::string_view description, CommandHandler commandHandler);
          |     ~~~~~~~~~~~~~ ^                                                                      
          |     auto                                                                                  -> CommandEntry&
  • include/serial/command_handlers/CommandGroup.h:23:19: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       23 |     CommandEntry& addCommand(std::string_view name, std::string_view description, CommandHandler commandHandler);
          |     ~~~~~~~~~~~~~ ^                                                                                             
          |     auto                                                                                                         -> CommandEntry&
  • include/serial/command_handlers/CommandHandler.h:1:1: warning: [portability-avoid-pragma-once]

    avoid 'pragma once' directive; use include guards instead

        1 | #pragma once
          | ^
  • include/serial/command_handlers/CommandHandler.h:3:10: error: [clang-diagnostic-error]

    'string_view' file not found

        3 | #include <string_view>
          |          ^~~~~~~~~~~~~
  • include/serial/command_handlers/CommandHandler.h:6:3: warning: [modernize-use-using]

    use 'using' instead of 'typedef'

        6 |   typedef void (*CommandHandler)(std::string_view arg, bool isAutomated);
          |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          |   using CommandHandler = void (*)(std::string_view arg, bool isAutomated)
  • include/serial/command_handlers/index.h:1:1: warning: [portability-avoid-pragma-once]

    avoid 'pragma once' directive; use include guards instead

        1 | #pragma once
          | ^
  • include/serial/command_handlers/index.h:8:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

        8 |   OpenShock::Serial::CommandGroup VersionHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^               
          |   auto                                             -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:9:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

        9 |   OpenShock::Serial::CommandGroup RestartHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^               
          |   auto                                             -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:10:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       10 |   OpenShock::Serial::CommandGroup SysInfoHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^               
          |   auto                                             -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:11:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       11 |   OpenShock::Serial::CommandGroup EchoHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^            
          |   auto                                          -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:12:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       12 |   OpenShock::Serial::CommandGroup ValidGpiosHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^                  
          |   auto                                                -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:13:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       13 |   OpenShock::Serial::CommandGroup RfTxPinHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^               
          |   auto                                             -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:14:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       14 |   OpenShock::Serial::CommandGroup EStopHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^             
          |   auto                                           -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:15:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       15 |   OpenShock::Serial::CommandGroup DomainHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^              
          |   auto                                            -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:16:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       16 |   OpenShock::Serial::CommandGroup AuthTokenHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^                 
          |   auto                                               -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:17:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       17 |   OpenShock::Serial::CommandGroup HostnameHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^                
          |   auto                                              -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:18:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       18 |   OpenShock::Serial::CommandGroup NetworksHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^                
          |   auto                                              -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:19:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       19 |   OpenShock::Serial::CommandGroup KeepAliveHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^                 
          |   auto                                               -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:20:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       20 |   OpenShock::Serial::CommandGroup JsonConfigHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^                  
          |   auto                                                -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:21:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       21 |   OpenShock::Serial::CommandGroup RawConfigHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^                 
          |   auto                                               -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:22:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       22 |   OpenShock::Serial::CommandGroup RfTransmitHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^                  
          |   auto                                                -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:23:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       23 |   OpenShock::Serial::CommandGroup FactoryResetHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^                    
          |   auto                                                  -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:24:35: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       24 |   OpenShock::Serial::CommandGroup LedTestHandler();
          |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^               
          |   auto                                             -> OpenShock::Serial::CommandGroup
  • include/serial/command_handlers/index.h:26:55: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       26 |   inline std::vector<OpenShock::Serial::CommandGroup> AllCommandHandlers()
          |                                                       ^
  • src/serial/SerialInputHandler.cpp:38:17: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       38 |     std::size_t operator()(std::string_view str) const noexcept
          |                 ^
  • src/serial/SerialInputHandler.cpp:40:26: warning: [cppcoreguidelines-avoid-magic-numbers]

    7 is a magic number; consider replacing it with a named constant

       40 |       std::size_t hash = 7;
          |                          ^
  • src/serial/SerialInputHandler.cpp:43:23: warning: [cppcoreguidelines-avoid-magic-numbers]

    31 is a magic number; consider replacing it with a named constant

       43 |         hash = hash * 31 + tolower(str[i]);
          |                       ^
  • src/serial/SerialInputHandler.cpp:52:10: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       52 |     bool operator()(std::string_view a, std::string_view b) const { return a < b; }
          |     ~~~~ ^
          |     auto                                                          -> bool
  • src/serial/SerialInputHandler.cpp:52:38: warning: [readability-identifier-length]

    parameter name 'a' is too short, expected at least 3 characters

       52 |     bool operator()(std::string_view a, std::string_view b) const { return a < b; }
          |                                      ^
  • src/serial/SerialInputHandler.cpp:52:58: warning: [readability-identifier-length]

    parameter name 'b' is too short, expected at least 3 characters

       52 |     bool operator()(std::string_view a, std::string_view b) const { return a < b; }
          |                                                          ^
  • src/serial/SerialInputHandler.cpp:56:10: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       56 |     bool operator()(std::string_view a, std::string_view b) const { return OpenShock::StringIEquals(a, b); }
          |     ~~~~ ^
          |     auto                                                          -> bool
  • src/serial/SerialInputHandler.cpp:56:38: warning: [readability-identifier-length]

    parameter name 'a' is too short, expected at least 3 characters

       56 |     bool operator()(std::string_view a, std::string_view b) const { return OpenShock::StringIEquals(a, b); }
          |                                      ^
  • src/serial/SerialInputHandler.cpp:56:58: warning: [readability-identifier-length]

    parameter name 'b' is too short, expected at least 3 characters

       56 |     bool operator()(std::string_view a, std::string_view b) const { return OpenShock::StringIEquals(a, b); }
          |                                                          ^
  • src/serial/SerialInputHandler.cpp:60:9: warning: [cppcoreguidelines-macro-usage]

    macro 'OPENSHOCK_WELCOME_HEADER_STR' used to declare a constant; consider using a 'constexpr' constant

       60 | #define OPENSHOCK_WELCOME_HEADER_STR \
          |         ^
  • src/serial/SerialInputHandler.cpp:76:9: warning: [cppcoreguidelines-macro-usage]

    macro 'CLEAR_LINE' used to declare a constant; consider using a 'constexpr' constant

       76 | #define CLEAR_LINE "\r\x1B[K"
          |         ^
  • src/serial/SerialInputHandler.cpp:81:13: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'serialEchoEnabled' is non-const and globally accessible, consider making it const

       81 | static bool serialEchoEnabled = true;
          |             ^
  • src/serial/SerialInputHandler.cpp:82:53: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'serialCommandGroups' is non-const and globally accessible, consider making it const

       82 | static std::vector<OpenShock::Serial::CommandGroup> serialCommandGroups;
          |                                                     ^
  • src/serial/SerialInputHandler.cpp:83:108: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'serialCommandHandlers' is non-const and globally accessible, consider making it const

       83 | static std::unordered_map<std::string_view, OpenShock::Serial::CommandGroup, std::hash_ci, std::equals_ci> serialCommandHandlers;
          |                                                                                                            ^
  • src/serial/SerialInputHandler.cpp:290:8: warning: [readability-identifier-length]

    variable name 'it' is too short, expected at least 3 characters

      290 |   auto it = serialCommandHandlers.find(arg);
          |        ^
  • src/serial/SerialInputHandler.cpp:296:3: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

      296 |   SERPR_ERROR("Command \"%.*s\" not found", arg.length(), arg.data());
          |   ^
    include/serial/command_handlers/common.h:22:37: note: expanded from macro 'SERPR_ERROR'
       22 | #define SERPR_ERROR(format, ...)    SERPR_SYS("Error|" format, ##__VA_ARGS__)
          |                                     ^
    include/serial/command_handlers/common.h:13:5: note: expanded from macro 'SERPR_SYS'
       13 |     OS_SERIAL.printf("$SYS$|" format "\r\n", ##__VA_ARGS__);     \
          |     ^
    include/serial/SerialInputHandler.h:10:23: note: expanded from macro 'OS_SERIAL'
       10 | #define OS_SERIAL     ::Serial
          |                       ^
  • src/serial/SerialInputHandler.cpp:304:44: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      304 | static OpenShock::Serial::SerialReadResult serialTryReadLine(OpenShock::Serial::SerialBuffer& buffer)
          |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^                                                         
          |        auto                                                                                           -> OpenShock::Serial::SerialReadResult
  • src/serial/SerialInputHandler.cpp:317:10: warning: [readability-identifier-length]

    variable name 'c' is too short, expected at least 3 characters

      317 |     char c = OS_SERIAL.read();
          |          ^
  • src/serial/SerialInputHandler.cpp:343:13: warning: [cppcoreguidelines-avoid-magic-numbers]

    31 is a magic number; consider replacing it with a named constant

      343 |     if (c > 31 && c < 127) {
          |             ^
  • src/serial/SerialInputHandler.cpp:343:23: warning: [cppcoreguidelines-avoid-magic-numbers]

    127 is a magic number; consider replacing it with a named constant

      343 |     if (c > 31 && c < 127) {
          |                       ^
  • src/serial/SerialInputHandler.cpp:356:10: warning: [readability-identifier-length]

    variable name 'c' is too short, expected at least 3 characters

      356 |     char c = OS_SERIAL.read();
          |          ^
  • src/serial/SerialInputHandler.cpp:367:3: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

      367 |   OS_SERIAL_PRINTF(CLEAR_LINE "> %.*s", buffer.size(), buffer.data());
          |   ^
    include/serial/SerialInputHandler.h:25:5: note: expanded from macro 'OS_SERIAL_PRINTF'
       25 |     OS_SERIAL.printf(__VA_ARGS__);     \
          |     ^
    include/serial/SerialInputHandler.h:10:23: note: expanded from macro 'OS_SERIAL'
       10 | #define OS_SERIAL     ::Serial
          |                       ^
  • src/serial/SerialInputHandler.cpp:399:47: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      399 | static const OpenShock::Serial::CommandEntry* getCommandEntry(const std::vector<std::string_view>& arguments, const std::vector<OpenShock::Serial::CommandEntry>& commandsEntries)
          |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^                                                                                                                                   
          |        auto                                                                                                                                                                        -> const OpenShock::Serial::CommandEntry*
  • src/serial/SerialInputHandler.cpp:399:63: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'getCommandEntry' of similar type ('const int &') are easily swapped by mistake

      399 | static const OpenShock::Serial::CommandEntry* getCommandEntry(const std::vector<std::string_view>& arguments, const std::vector<OpenShock::Serial::CommandEntry>& commandsEntries)
          |                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/serial/SerialInputHandler.cpp:399:100: note: the first parameter in the range is 'arguments'
      399 | static const OpenShock::Serial::CommandEntry* getCommandEntry(const std::vector<std::string_view>& arguments, const std::vector<OpenShock::Serial::CommandEntry>& commandsEntries)
          |                                                                                                    ^~~~~~~~~
    src/serial/SerialInputHandler.cpp:399:163: note: the last parameter in the range is 'commandsEntries'
      399 | static const OpenShock::Serial::CommandEntry* getCommandEntry(const std::vector<std::string_view>& arguments, const std::vector<OpenShock::Serial::CommandEntry>& commandsEntries)
          |                                                                                                                                                                   ^~~~~~~~~~~~~~~
  • src/serial/SerialInputHandler.cpp:463:8: warning: [readability-identifier-length]

    variable name 'it' is too short, expected at least 3 characters

      463 |   auto it = serialCommandHandlers.find(command);
          |        ^
  • src/serial/SerialInputHandler.cpp:465:5: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

      465 |     SERPR_ERROR("Command \"%.*s\" not found", command.size(), command.data());
          |     ^
    include/serial/command_handlers/common.h:22:37: note: expanded from macro 'SERPR_ERROR'
       22 | #define SERPR_ERROR(format, ...)    SERPR_SYS("Error|" format, ##__VA_ARGS__)
          |                                     ^
    include/serial/command_handlers/common.h:13:5: note: expanded from macro 'SERPR_SYS'
       13 |     OS_SERIAL.printf("$SYS$|" format "\r\n", ##__VA_ARGS__);     \
          |     ^
    include/serial/SerialInputHandler.h:10:23: note: expanded from macro 'OS_SERIAL'
       10 | #define OS_SERIAL     ::Serial
          |                       ^
  • src/serial/SerialInputHandler.cpp:484:44: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      484 | static OpenShock::Serial::SerialReadResult serialTryReadUSBLine(OpenShock::Serial::SerialBuffer& buffer)
          |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^                                                            
          |        auto                                                                                              -> OpenShock::Serial::SerialReadResult
  • src/serial/SerialInputHandler.cpp:497:10: warning: [readability-identifier-length]

    variable name 'c' is too short, expected at least 3 characters

      497 |     char c = OS_SERIAL_USB.read();
          |          ^
  • src/serial/SerialInputHandler.cpp:523:13: warning: [cppcoreguidelines-avoid-magic-numbers]

    31 is a magic number; consider replacing it with a named constant

      523 |     if (c > 31 && c < 127) {
          |             ^
  • src/serial/SerialInputHandler.cpp:523:23: warning: [cppcoreguidelines-avoid-magic-numbers]

    127 is a magic number; consider replacing it with a named constant

      523 |     if (c > 31 && c < 127) {
          |                       ^
  • src/serial/SerialInputHandler.cpp:536:10: warning: [readability-identifier-length]

    variable name 'c' is too short, expected at least 3 characters

      536 |     char c = OS_SERIAL_USB.read();
          |          ^
  • src/serial/SerialInputHandler.cpp:546:31: warning: [readability-named-parameter]

    all parameters should be named in a function

      546 | static void serialTaskRX(void*)
          |                               ^
          |                                /*unused*/
  • src/serial/SerialInputHandler.cpp:548:42: warning: [cppcoreguidelines-avoid-magic-numbers]

    32 is a magic number; consider replacing it with a named constant

      548 |   OpenShock::Serial::SerialBuffer buffer(32);
          |                                          ^
  • src/serial/SerialInputHandler.cpp:566:9: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

      566 |         OS_SERIAL_PRINTF(CLEAR_LINE "> %.*s [AutoComplete is not implemented]", buffer.size(), buffer.data());
          |         ^
    include/serial/SerialInputHandler.h:25:5: note: expanded from macro 'OS_SERIAL_PRINTF'
       25 |     OS_SERIAL.printf(__VA_ARGS__);     \
          |     ^
    include/serial/SerialInputHandler.h:10:23: note: expanded from macro 'OS_SERIAL'
       10 | #define OS_SERIAL     ::Serial
          |                       ^
  • src/serial/SerialInputHandler.cpp:592:9: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

      592 |         OS_SERIAL_PRINTF(CLEAR_LINE "> %.*s [AutoComplete is not implemented]", buffer.size(), buffer.data());
          |         ^
    include/serial/SerialInputHandler.h:25:5: note: expanded from macro 'OS_SERIAL_PRINTF'
       25 |     OS_SERIAL.printf(__VA_ARGS__);     \
          |     ^
    include/serial/SerialInputHandler.h:10:23: note: expanded from macro 'OS_SERIAL'
       10 | #define OS_SERIAL     ::Serial
          |                       ^
  • src/serial/SerialInputHandler.cpp:607:26: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      607 | bool SerialInputHandler::Init()
          | ~~~~                     ^     
          | auto                            -> bool
  • src/serial/SerialInputHandler.cpp:630:64: warning: [cppcoreguidelines-avoid-magic-numbers]

    10'000 is a magic number; consider replacing it with a named constant

      630 |   if (TaskUtils::TaskCreateExpensive(serialTaskRX, "SerialRX", 10'000, nullptr, 1, nullptr) != pdPASS) {  // TODO: Profile stack size
          |                                                                ^
  • src/serial/SerialInputHandler.cpp:637:26: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

      637 | bool SerialInputHandler::SerialEchoEnabled()
          | ~~~~                     ^                  
          | auto                                         -> bool
  • src/serial/command_handlers/CommandEntry.cpp:5:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: m_name, m_description, m_arguments

        5 | CommandEntry::CommandEntry(std::string_view description, CommandHandler commandHandler) noexcept
          | ^
  • src/serial/command_handlers/CommandEntry.cpp:11:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: m_name, m_description, m_arguments

       11 | CommandEntry::CommandEntry(std::string_view name, std::string_view description, CommandHandler commandHandler) noexcept
          | ^
  • src/serial/command_handlers/CommandEntry.cpp:11:28: warning: [bugprone-easily-swappable-parameters]

    2 adjacent parameters of 'CommandEntry' of similar type ('int') are easily swapped by mistake

       11 | CommandEntry::CommandEntry(std::string_view name, std::string_view description, CommandHandler commandHandler) noexcept
          |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    src/serial/command_handlers/CommandEntry.cpp:11:45: note: the first parameter in the range is 'name'
       11 | CommandEntry::CommandEntry(std::string_view name, std::string_view description, CommandHandler commandHandler) noexcept
          |                                             ^~~~
    src/serial/command_handlers/CommandEntry.cpp:11:68: note: the last parameter in the range is 'description'
       11 | CommandEntry::CommandEntry(std::string_view name, std::string_view description, CommandHandler commandHandler) noexcept
          |                                                                    ^~~~~~~~~~~
  • src/serial/command_handlers/CommandGroup.cpp:5:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: m_name, m_commands

        5 | CommandGroup::CommandGroup(std::string_view name)
          | ^
  • src/serial/command_handlers/CommandGroup.cpp:10:29: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       10 | CommandEntry& CommandGroup::addCommand(std::string_view description, CommandHandler commandHandler)
          | ~~~~~~~~~~~~~               ^                                                                      
          | auto                                                                                                -> CommandEntry&
  • src/serial/command_handlers/authtoken.cpp:12:5: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

       12 |     SERPR_ERROR("Get command does not support parameters");
          |     ^
    include/serial/command_handlers/common.h:22:37: note: expanded from macro 'SERPR_ERROR'
       22 | #define SERPR_ERROR(format, ...)    SERPR_SYS("Error|" format, ##__VA_ARGS__)
          |                                     ^
    include/serial/command_handlers/common.h:14:19: note: expanded from macro 'SERPR_SYS'
       14 |     OS_SERIAL_USB.printf("$SYS$|" format "\r\n", ##__VA_ARGS__); \
          |                   ^
  • src/serial/command_handlers/authtoken.cpp:18:5: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

       18 |     SERPR_ERROR("Failed to get auth token from config");
          |     ^
    include/serial/command_handlers/common.h:22:37: note: expanded from macro 'SERPR_ERROR'
       22 | #define SERPR_ERROR(format, ...)    SERPR_SYS("Error|" format, ##__VA_ARGS__)
          |                                     ^
    include/serial/command_handlers/common.h:14:19: note: expanded from macro 'SERPR_SYS'
       14 |     OS_SERIAL_USB.printf("$SYS$|" format "\r\n", ##__VA_ARGS__); \
          |                   ^
  • src/serial/command_handlers/authtoken.cpp:23:3: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

       23 |   SERPR_RESPONSE("AuthToken|%s", authToken.c_str());
          |   ^
    include/serial/command_handlers/common.h:20:37: note: expanded from macro 'SERPR_RESPONSE'
       20 | #define SERPR_RESPONSE(format, ...) SERPR_SYS("Response|" format, ##__VA_ARGS__)
          |                                     ^
    include/serial/command_handlers/common.h:13:5: note: expanded from macro 'SERPR_SYS'
       13 |     OS_SERIAL.printf("$SYS$|" format "\r\n", ##__VA_ARGS__);     \
          |     ^
    include/serial/SerialInputHandler.h:10:23: note: expanded from macro 'OS_SERIAL'
       10 | #define OS_SERIAL     ::Serial
          |                       ^
  • src/serial/command_handlers/authtoken.cpp:29:5: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

       29 |     SERPR_ERROR("Auth token cannot be empty");
          |     ^
    include/serial/command_handlers/common.h:22:37: note: expanded from macro 'SERPR_ERROR'
       22 | #define SERPR_ERROR(format, ...)    SERPR_SYS("Error|" format, ##__VA_ARGS__)
          |                                     ^
    include/serial/command_handlers/common.h:14:19: note: expanded from macro 'SERPR_SYS'
       14 |     OS_SERIAL_USB.printf("$SYS$|" format "\r\n", ##__VA_ARGS__); \
          |                   ^
  • src/serial/command_handlers/authtoken.cpp:34:27: warning: [cppcoreguidelines-avoid-magic-numbers]

    401 is a magic number; consider replacing it with a named constant

       34 |   if (apiResponse.code == 401) {
          |                           ^
  • src/serial/command_handlers/authtoken.cpp:35:5: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

       35 |     SERPR_ERROR("Invalid auth token, refusing to save it!");
          |     ^
    include/serial/command_handlers/common.h:22:37: note: expanded from macro 'SERPR_ERROR'
       22 | #define SERPR_ERROR(format, ...)    SERPR_SYS("Error|" format, ##__VA_ARGS__)
          |                                     ^
    include/serial/command_handlers/common.h:14:19: note: expanded from macro 'SERPR_SYS'
       14 |     OS_SERIAL_USB.printf("$SYS$|" format "\r\n", ##__VA_ARGS__); \
          |                   ^
  • src/serial/command_handlers/authtoken.cpp:44:5: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

       44 |     SERPR_SUCCESS("Saved config");
          |     ^
    include/serial/command_handlers/common.h:21:37: note: expanded from macro 'SERPR_SUCCESS'
       21 | #define SERPR_SUCCESS(format, ...)  SERPR_SYS("Success|" format, ##__VA_ARGS__)
          |                                     ^
    include/serial/command_handlers/common.h:14:19: note: expanded from macro 'SERPR_SYS'
       14 |     OS_SERIAL_USB.printf("$SYS$|" format "\r\n", ##__VA_ARGS__); \
          |                   ^
  • src/serial/command_handlers/authtoken.cpp:46:5: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

       46 |     SERPR_ERROR("Failed to save config");
          |     ^
    include/serial/command_handlers/common.h:22:37: note: expanded from macro 'SERPR_ERROR'
       22 | #define SERPR_ERROR(format, ...)    SERPR_SYS("Error|" format, ##__VA_ARGS__)
          |                                     ^
    include/serial/command_handlers/common.h:14:19: note: expanded from macro 'SERPR_SYS'
       14 |     OS_SERIAL_USB.printf("$SYS$|" format "\r\n", ##__VA_ARGS__); \
          |                   ^
  • src/serial/command_handlers/authtoken.cpp:53:5: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

       53 |     SERPR_ERROR("Clear command does not support parameters");
          |     ^
    include/serial/command_handlers/common.h:22:37: note: expanded from macro 'SERPR_ERROR'
       22 | #define SERPR_ERROR(format, ...)    SERPR_SYS("Error|" format, ##__VA_ARGS__)
          |                                     ^
    include/serial/command_handlers/common.h:14:19: note: expanded from macro 'SERPR_SYS'
       14 |     OS_SERIAL_USB.printf("$SYS$|" format "\r\n", ##__VA_ARGS__); \
          |                   ^
  • src/serial/command_handlers/authtoken.cpp:60:5: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

       60 |     SERPR_SUCCESS("Saved config");
          |     ^
    include/serial/command_handlers/common.h:21:37: note: expanded from macro 'SERPR_SUCCESS'
       21 | #define SERPR_SUCCESS(format, ...)  SERPR_SYS("Success|" format, ##__VA_ARGS__)
          |                                     ^
    include/serial/command_handlers/common.h:14:19: note: expanded from macro 'SERPR_SYS'
       14 |     OS_SERIAL_USB.printf("$SYS$|" format "\r\n", ##__VA_ARGS__); \
          |                   ^
  • src/serial/command_handlers/authtoken.cpp:62:5: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

       62 |     SERPR_ERROR("Failed to save config");
          |     ^
    include/serial/command_handlers/common.h:22:37: note: expanded from macro 'SERPR_ERROR'
       22 | #define SERPR_ERROR(format, ...)    SERPR_SYS("Error|" format, ##__VA_ARGS__)
          |                                     ^
    include/serial/command_handlers/common.h:14:19: note: expanded from macro 'SERPR_SYS'
       14 |     OS_SERIAL_USB.printf("$SYS$|" format "\r\n", ##__VA_ARGS__); \
          |                   ^
  • src/serial/command_handlers/authtoken.cpp:66:69: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

       66 | OpenShock::Serial::CommandGroup OpenShock::Serial::CommandHandlers::AuthTokenHandler()
          | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                     ^                 
          | auto                                                                                   -> OpenShock::Serial::CommandGroup
  • src/serial/command_handlers/domain.cpp:17:5: warning: [cppcoreguidelines-pro-type-vararg]

    do not call c-style vararg functions

       17 |     SERPR_ERROR("Get command does not support parameters");
          |     ^
    include/serial/command_handlers/common.h:22:37: note: expanded from macro 'SERPR_ERROR'
       22 | #define SERPR_ERROR(format, ...)    SERPR_SYS("Error|" format, ##__VA_ARGS__)
          |                                     ^
    include/serial/command_handlers/common.h:14:19: note: expanded from macro 'SERPR_SYS'
       14 |     OS_SERIAL_USB.printf("$SYS$|" format "\r\n", ##__VA_ARGS__); \
          |                   ^
  • src/serial/command_handlers/domain.cpp:40:22: warning: [cppcoreguidelines-avoid-magic-numbers]

    40 is a magic number; consider replacing it with a named constant

       40 |   if (arg.length() + 40 >= OPENSHOCK_URI_BUFFER_SIZE) {
          |                      ^

Have any feedback or feature suggestions? Share it here.

- Add const qualifier to CommandEntry::commandHandler()
- Explicit std::string conversion in hostname handleSet
- Use push_back instead of append for single char in validgpios

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants