From 839987d1ee6ac0c8526361444e21db6c1e9c5761 Mon Sep 17 00:00:00 2001 From: gabryelreyes Date: Tue, 7 Nov 2023 17:04:50 +0100 Subject: [PATCH 01/11] Changed port number from int to string. Comes from command line as string. Needed in Winsock as string. Some formatting changes come from auto-format --- lib/ArduinoNative/Arduino.cpp | 28 +++++----------------------- lib/ArduinoNative/SocketServer.cpp | 6 +++--- lib/ArduinoNative/SocketServer.h | 5 ++--- 3 files changed, 10 insertions(+), 29 deletions(-) diff --git a/lib/ArduinoNative/Arduino.cpp b/lib/ArduinoNative/Arduino.cpp index f692fb07..4e682d2b 100644 --- a/lib/ArduinoNative/Arduino.cpp +++ b/lib/ArduinoNative/Arduino.cpp @@ -64,7 +64,7 @@ /** This type defines the possible program arguments. */ typedef struct { - uint16_t socketServerPort; /**< Socket server port */ + const char* socketServerPort; /**< Socket server port */ const char* name; /**< Robot name */ } PrgArguments; @@ -111,7 +111,7 @@ static SimTime* gSimTime = nullptr; /** * Default port used for socket communications. */ -static const uint16_t SOCKET_SERVER_DEFAULT_PORT = 65432U; +static const char* SOCKET_SERVER_DEFAULT_PORT = "65432"; /** * Maximum number of socket connections. @@ -186,7 +186,7 @@ extern int main(int argc, char** argv) } else { - printf("SocketServer ready on port %d.\n", prgArguments.socketServerPort); + printf("SocketServer ready on port %s.\n", prgArguments.socketServerPort); /* Get simulation time handler. It will be used by millis() and delay(). */ gSimTime = &Board::getInstance().getSimTime(); @@ -301,27 +301,9 @@ static int handleCommandLineArguments(PrgArguments& prgArguments, int argc, char switch (option) { case 'p': /* Port */ - { - /* Parse Port Number */ - char* p; /* End Pointer*/ - errno = 0; /* Reset Error Register */ - long parsedValue = strtol(optarg, &p, 10); /* Long value parsed from string. */ - - if (('\0' == *p) && /* Make sure the string is completely read. */ - (0 == errno) && /* No Errors were produced. */ - (UINT16_MAX >= parsedValue) && /* No overflow of uint16_t to allow direct casting. */ - (0U <= parsedValue)) /* No negative values. */ - { - prgArguments.socketServerPort = parsedValue; - } - else - { - printf("Error parsing port argument.\n"); - status = -1; - } - + printf("Using Socket Client in Port \"%s\".\n", optarg); + prgArguments.socketServerPort = optarg; break; - } case 'n': /* Name */ printf("Instance has been named \"%s\".\n", optarg); diff --git a/lib/ArduinoNative/SocketServer.cpp b/lib/ArduinoNative/SocketServer.cpp index 584b0d52..833b3ef1 100644 --- a/lib/ArduinoNative/SocketServer.cpp +++ b/lib/ArduinoNative/SocketServer.cpp @@ -52,7 +52,7 @@ #include #include #include /* definition of close */ -#include /* definition of memset for tests. */ +#include /* definition of memset for tests. */ #endif /****************************************************************************** @@ -126,7 +126,7 @@ SocketServer::~SocketServer() } } -bool SocketServer::init(uint16_t port, uint8_t maxConnections) +bool SocketServer::init(const char* port, uint8_t maxConnections) { int result; struct addrinfo hints; @@ -158,7 +158,7 @@ bool SocketServer::init(uint16_t port, uint8_t maxConnections) #endif /* Resolve the server address and port */ - result = getaddrinfo(nullptr, std::to_string(port).c_str(), &hints, &addrInfo); + result = getaddrinfo(nullptr, port, &hints, &addrInfo); if (0 != result) { printf("getaddrinfo failed with error: %d\n", result); diff --git a/lib/ArduinoNative/SocketServer.h b/lib/ArduinoNative/SocketServer.h index 109620d8..e507c6b1 100644 --- a/lib/ArduinoNative/SocketServer.h +++ b/lib/ArduinoNative/SocketServer.h @@ -68,7 +68,7 @@ class SocketServer : public Stream * @param[in] maxConnections Number of maxConnections allowed. * @returns true if server has been succesfully set-up. */ - bool init(uint16_t port, uint8_t maxConnections); + bool init(const char* port, uint8_t maxConnections); /** * Print argument to the Output Stream. @@ -189,12 +189,11 @@ class SocketServer : public Stream void process(); private: - /** Struct for Implementation of PIMPL Idiom. */ struct SocketServerImpl; /** SocketServer Members. PIMPL Idiom. */ - SocketServerImpl *m_members; + SocketServerImpl* m_members; /* Not allowed. */ SocketServer(const SocketServer& srv); From 7cea87ba2dd316cd6a31464db645e74fceba804a Mon Sep 17 00:00:00 2001 From: gabryelreyes Date: Wed, 8 Nov 2023 14:25:41 +0100 Subject: [PATCH 02/11] Program arguments refactoring. Added verbose option. Default values are defined and displayed on help text. Organized comments. --- lib/ArduinoNative/Arduino.cpp | 83 +++++++++++++++++++++++++++-------- 1 file changed, 65 insertions(+), 18 deletions(-) diff --git a/lib/ArduinoNative/Arduino.cpp b/lib/ArduinoNative/Arduino.cpp index 4e682d2b..3d37824d 100644 --- a/lib/ArduinoNative/Arduino.cpp +++ b/lib/ArduinoNative/Arduino.cpp @@ -61,21 +61,31 @@ * Types and classes *****************************************************************************/ +#ifndef UNIT_TEST + /** This type defines the possible program arguments. */ typedef struct { const char* socketServerPort; /**< Socket server port */ - const char* name; /**< Robot name */ - + const char* robotName; /**< Robot name */ + bool verbose; /**< Show verbose information */ } PrgArguments; +#endif + /****************************************************************************** * Prototypes *****************************************************************************/ extern void setup(); extern void loop(); + +#ifndef UNIT_TEST + static int handleCommandLineArguments(PrgArguments& prgArguments, int argc, char** argv); +static void showPrgArguments(const PrgArguments& prgArgs); + +#endif /****************************************************************************** * Local Variables @@ -108,10 +118,14 @@ static const int MAX_TIME_STEP = 10; */ static SimTime* gSimTime = nullptr; -/** - * Default port used for socket communications. - */ -static const char* SOCKET_SERVER_DEFAULT_PORT = "65432"; +/** Program argument default value of the robot name. */ +static const char* PRG_ARG_ROBOT_NAME_DEFAULT = ""; + +/** Default port used for socket communications. */ +static const char* PRG_ARG_SOCKET_SERVER_PORT_DEFAULT = "65432"; + +/** Program argument default value of the verbose flag. */ +static bool PRG_ARG_VERBOSE_DEFAULT = false; /** * Maximum number of socket connections. @@ -171,6 +185,8 @@ extern int main(int argc, char** argv) Keyboard& keyboard = Board::getInstance().getKeyboard(); PrgArguments prgArguments; + printf("\n*** Radon Ulzer ***\n"); + /* Remove any buffering from stout and stderr to get the printed information immediately. */ (void)setvbuf(stdout, NULL, _IONBF, 0); (void)setvbuf(stderr, NULL, _IONBF, 0); @@ -179,6 +195,13 @@ extern int main(int argc, char** argv) if (0 == status) { + /* Show used arguments only in verbose mode. */ + if (true == prgArguments.verbose) + { + showPrgArguments(prgArguments); + } + + /* Initialize the socket server. */ if (false == gSocketStream.init(prgArguments.socketServerPort, SOCKET_SERVER_MAX_CONNECTIONS)) { printf("Error initializing SocketServer.\n"); @@ -186,7 +209,10 @@ extern int main(int argc, char** argv) } else { - printf("SocketServer ready on port %s.\n", prgArguments.socketServerPort); + if (true == prgArguments.verbose) + { + printf("SocketServer ready on port %s.\n", prgArguments.socketServerPort); + } /* Get simulation time handler. It will be used by millis() and delay(). */ gSimTime = &Board::getInstance().getSimTime(); @@ -293,21 +319,24 @@ static int handleCommandLineArguments(PrgArguments& prgArguments, int argc, char int option = getopt(argc, argv, availableOptions); /* Set default values */ - prgArguments.socketServerPort = SOCKET_SERVER_DEFAULT_PORT; - prgArguments.name = nullptr; + prgArguments.socketServerPort = PRG_ARG_SOCKET_SERVER_PORT_DEFAULT; + prgArguments.robotName = PRG_ARG_ROBOT_NAME_DEFAULT; + prgArguments.verbose = PRG_ARG_VERBOSE_DEFAULT; while ((-1 != option) && (0 == status)) { switch (option) { - case 'p': /* Port */ - printf("Using Socket Client in Port \"%s\".\n", optarg); + case 'n': /* Name */ + prgArguments.robotName = optarg; + break; + + case 'p': /* SocketServer Port */ prgArguments.socketServerPort = optarg; break; - case 'n': /* Name */ - printf("Instance has been named \"%s\".\n", optarg); - prgArguments.name = optarg; + case 'v': /* Verbose */ + prgArguments.verbose = true; break; case '?': /* Unknown */ @@ -317,10 +346,6 @@ static int handleCommandLineArguments(PrgArguments& prgArguments, int argc, char /* fallthrough */ default: /* Default */ - printf("Usage: %s \nOptions:\n", programName); - printf("\t-h\t\t\tShow this help message.\n"); /* Help */ - printf("\t-p \tSet SocketServer port.\n"); /* Port */ - printf("\t-n \t\tSet instace name."); /* Name */ status = -1; break; } @@ -328,7 +353,29 @@ static int handleCommandLineArguments(PrgArguments& prgArguments, int argc, char option = getopt(argc, argv, availableOptions); } + /* Does the user need help? */ + if (0 > status) + { + printf("Usage: %s \nOptions:\n", programName); + printf("\t-h\t\t\tShow this help message.\n"); /* Help */ + printf("\t-n \t\tSet robot name."); /* Robot Name */ + printf("\t-p \tSet SocketServer port."); /* SocketServer Port */ + printf(" Default: %s\n", PRG_ARG_SOCKET_SERVER_PORT_DEFAULT); /* SocketServer port default value*/ + } + return status; } +/** + * Show program arguments on the console. + * + * @param[in] prgArgs Program arguments + */ +static void showPrgArguments(const PrgArguments& prgArgs) +{ + printf("Robot name : %s\n", prgArgs.robotName); + printf("SocketServer Port : %s\n", prgArgs.socketServerPort); + /* Skip verbose flag. */ +} + #endif \ No newline at end of file From 0a3f465a1c12dc7a838c03203051191851fb6a0e Mon Sep 17 00:00:00 2001 From: gabryelreyes Date: Wed, 8 Nov 2023 14:34:34 +0100 Subject: [PATCH 03/11] Fixed tests. handleCommandLineArguments not define in Test environment --- lib/ArduinoNative/Arduino.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/lib/ArduinoNative/Arduino.cpp b/lib/ArduinoNative/Arduino.cpp index 3d37824d..5f7d9dfd 100644 --- a/lib/ArduinoNative/Arduino.cpp +++ b/lib/ArduinoNative/Arduino.cpp @@ -273,34 +273,10 @@ extern void delay(unsigned long ms) } } -#endif - /****************************************************************************** * Local Functions *****************************************************************************/ -#ifdef UNIT_TEST - -/** - * Handle the Arguments passed to the programm. - * - * @param[in] argc Program argument count - * @param[in] argv Program argument vector - * - * @returns 0 if handling was succesful. Otherwise, -1 - */ -static int handleCommandLineArguments(PrgArguments& prgArguments, int argc, char** argv) -{ - /* Not implemented. */ - (void)prgArguments; - (void)argc; - (void)argv; - - return 0; -} - -#else - /** * Handle the arguments passed to the programm. * If a argument is not given via command line interface, its default value will be used. From 917c24312eae207ba124ca880f890ff85cb91d01 Mon Sep 17 00:00:00 2001 From: gabryelreyes Date: Wed, 8 Nov 2023 21:21:54 +0100 Subject: [PATCH 04/11] Fixed text printed to console --- lib/ArduinoNative/Arduino.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ArduinoNative/Arduino.cpp b/lib/ArduinoNative/Arduino.cpp index 5f7d9dfd..236a4b95 100644 --- a/lib/ArduinoNative/Arduino.cpp +++ b/lib/ArduinoNative/Arduino.cpp @@ -334,8 +334,8 @@ static int handleCommandLineArguments(PrgArguments& prgArguments, int argc, char { printf("Usage: %s \nOptions:\n", programName); printf("\t-h\t\t\tShow this help message.\n"); /* Help */ - printf("\t-n \t\tSet robot name."); /* Robot Name */ - printf("\t-p \tSet SocketServer port."); /* SocketServer Port */ + printf("\t-n \t\tSet robot name.\n"); /* Robot Name */ + printf("\t-p \tSet SocketServer port.\n"); /* SocketServer Port */ printf(" Default: %s\n", PRG_ARG_SOCKET_SERVER_PORT_DEFAULT); /* SocketServer port default value*/ } @@ -349,8 +349,8 @@ static int handleCommandLineArguments(PrgArguments& prgArguments, int argc, char */ static void showPrgArguments(const PrgArguments& prgArgs) { - printf("Robot name : %s\n", prgArgs.robotName); - printf("SocketServer Port : %s\n", prgArgs.socketServerPort); + printf("Robot name : %s\n", prgArgs.robotName); + printf("SocketServer Port: %s\n", prgArgs.socketServerPort); /* Skip verbose flag. */ } From c1d051f299ebf48f8c386883e08df2751cfb3a88 Mon Sep 17 00:00:00 2001 From: gabryelreyes Date: Wed, 8 Nov 2023 21:41:01 +0100 Subject: [PATCH 05/11] Removed extra carriage return --- lib/ArduinoNative/Arduino.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ArduinoNative/Arduino.cpp b/lib/ArduinoNative/Arduino.cpp index 236a4b95..d7a6f09d 100644 --- a/lib/ArduinoNative/Arduino.cpp +++ b/lib/ArduinoNative/Arduino.cpp @@ -335,7 +335,7 @@ static int handleCommandLineArguments(PrgArguments& prgArguments, int argc, char printf("Usage: %s \nOptions:\n", programName); printf("\t-h\t\t\tShow this help message.\n"); /* Help */ printf("\t-n \t\tSet robot name.\n"); /* Robot Name */ - printf("\t-p \tSet SocketServer port.\n"); /* SocketServer Port */ + printf("\t-p \tSet SocketServer port."); /* SocketServer Port */ printf(" Default: %s\n", PRG_ARG_SOCKET_SERVER_PORT_DEFAULT); /* SocketServer port default value*/ } From 9abdcd6dc4f1caa14b00f9c1c5e97d7c08cddf49 Mon Sep 17 00:00:00 2001 From: gabryelreyes Date: Thu, 9 Nov 2023 10:27:35 +0100 Subject: [PATCH 06/11] Removed doxygen "extract all" option. It silences warning on undocumented members --- doc/doxygen/ConvoyLeaderSimDoxyfile | 8 ++--- doc/doxygen/ConvoyLeaderTargetDoxyfile | 8 ++--- doc/doxygen/LineFollowerSimDoxyfile | 8 ++--- doc/doxygen/LineFollowerTargetDoxyfile | 8 ++--- doc/doxygen/RemoteControlSimDoxyfile | 8 ++--- doc/doxygen/RemoteControlTargetDoxyfile | 8 ++--- doc/doxygen/doxygen_warnings.txt | 45 +++++++++++++++++++++++++ 7 files changed, 69 insertions(+), 24 deletions(-) diff --git a/doc/doxygen/ConvoyLeaderSimDoxyfile b/doc/doxygen/ConvoyLeaderSimDoxyfile index 3b6c9c96..1da4d551 100644 --- a/doc/doxygen/ConvoyLeaderSimDoxyfile +++ b/doc/doxygen/ConvoyLeaderSimDoxyfile @@ -499,19 +499,19 @@ NUM_PROC_THREADS = 1 # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = YES +EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. -EXTRACT_PRIVATE = NO +EXTRACT_PRIVATE = YES # If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual # methods of a class will be included in the documentation. # The default value is: NO. -EXTRACT_PRIV_VIRTUAL = NO +EXTRACT_PRIV_VIRTUAL = YES # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. @@ -523,7 +523,7 @@ EXTRACT_PACKAGE = NO # included in the documentation. # The default value is: NO. -EXTRACT_STATIC = NO +EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, diff --git a/doc/doxygen/ConvoyLeaderTargetDoxyfile b/doc/doxygen/ConvoyLeaderTargetDoxyfile index 93d4e10d..8de91895 100644 --- a/doc/doxygen/ConvoyLeaderTargetDoxyfile +++ b/doc/doxygen/ConvoyLeaderTargetDoxyfile @@ -499,19 +499,19 @@ NUM_PROC_THREADS = 1 # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = YES +EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. -EXTRACT_PRIVATE = NO +EXTRACT_PRIVATE = YES # If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual # methods of a class will be included in the documentation. # The default value is: NO. -EXTRACT_PRIV_VIRTUAL = NO +EXTRACT_PRIV_VIRTUAL = YES # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. @@ -523,7 +523,7 @@ EXTRACT_PACKAGE = NO # included in the documentation. # The default value is: NO. -EXTRACT_STATIC = NO +EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, diff --git a/doc/doxygen/LineFollowerSimDoxyfile b/doc/doxygen/LineFollowerSimDoxyfile index 877cbf7e..a2f348f7 100644 --- a/doc/doxygen/LineFollowerSimDoxyfile +++ b/doc/doxygen/LineFollowerSimDoxyfile @@ -499,19 +499,19 @@ NUM_PROC_THREADS = 1 # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = YES +EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. -EXTRACT_PRIVATE = NO +EXTRACT_PRIVATE = YES # If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual # methods of a class will be included in the documentation. # The default value is: NO. -EXTRACT_PRIV_VIRTUAL = NO +EXTRACT_PRIV_VIRTUAL = YES # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. @@ -523,7 +523,7 @@ EXTRACT_PACKAGE = NO # included in the documentation. # The default value is: NO. -EXTRACT_STATIC = NO +EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, diff --git a/doc/doxygen/LineFollowerTargetDoxyfile b/doc/doxygen/LineFollowerTargetDoxyfile index 69b65998..c902f1bd 100644 --- a/doc/doxygen/LineFollowerTargetDoxyfile +++ b/doc/doxygen/LineFollowerTargetDoxyfile @@ -499,19 +499,19 @@ NUM_PROC_THREADS = 1 # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = YES +EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. -EXTRACT_PRIVATE = NO +EXTRACT_PRIVATE = YES # If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual # methods of a class will be included in the documentation. # The default value is: NO. -EXTRACT_PRIV_VIRTUAL = NO +EXTRACT_PRIV_VIRTUAL = YES # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. @@ -523,7 +523,7 @@ EXTRACT_PACKAGE = NO # included in the documentation. # The default value is: NO. -EXTRACT_STATIC = NO +EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, diff --git a/doc/doxygen/RemoteControlSimDoxyfile b/doc/doxygen/RemoteControlSimDoxyfile index e4bab806..d4cae55c 100644 --- a/doc/doxygen/RemoteControlSimDoxyfile +++ b/doc/doxygen/RemoteControlSimDoxyfile @@ -499,19 +499,19 @@ NUM_PROC_THREADS = 1 # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = YES +EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. -EXTRACT_PRIVATE = NO +EXTRACT_PRIVATE = YES # If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual # methods of a class will be included in the documentation. # The default value is: NO. -EXTRACT_PRIV_VIRTUAL = NO +EXTRACT_PRIV_VIRTUAL = YES # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. @@ -523,7 +523,7 @@ EXTRACT_PACKAGE = NO # included in the documentation. # The default value is: NO. -EXTRACT_STATIC = NO +EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, diff --git a/doc/doxygen/RemoteControlTargetDoxyfile b/doc/doxygen/RemoteControlTargetDoxyfile index 759357ed..79d776f7 100644 --- a/doc/doxygen/RemoteControlTargetDoxyfile +++ b/doc/doxygen/RemoteControlTargetDoxyfile @@ -499,19 +499,19 @@ NUM_PROC_THREADS = 1 # normally produced when WARNINGS is set to YES. # The default value is: NO. -EXTRACT_ALL = YES +EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. -EXTRACT_PRIVATE = NO +EXTRACT_PRIVATE = YES # If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual # methods of a class will be included in the documentation. # The default value is: NO. -EXTRACT_PRIV_VIRTUAL = NO +EXTRACT_PRIV_VIRTUAL = YES # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. @@ -523,7 +523,7 @@ EXTRACT_PACKAGE = NO # included in the documentation. # The default value is: NO. -EXTRACT_STATIC = NO +EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, diff --git a/doc/doxygen/doxygen_warnings.txt b/doc/doxygen/doxygen_warnings.txt index e69de29b..76f2dba8 100644 --- a/doc/doxygen/doxygen_warnings.txt +++ b/doc/doxygen/doxygen_warnings.txt @@ -0,0 +1,45 @@ +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:44: error: Member LOG_FATAL_ENABLE (macro definition) of group Service is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:48: error: Member LOG_ERROR_ENABLE (macro definition) of group Service is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:52: error: Member LOG_WARNING_ENABLE (macro definition) of group Service is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:56: error: Member LOG_INFO_ENABLE (macro definition) of group Service is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:60: error: Member LOG_DEBUG_ENABLE (macro definition) of group Service is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:186: error: Member LOG_DEBUG(_filename, _msg) (macro definition) of group Service is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:187: error: Member LOG_DEBUG_VAL(_filename, _msg, _val) (macro definition) of group Service is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:188: error: Member LOG_DEBUG_HEAD(_filename) (macro definition) of group Service is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:189: error: Member LOG_DEBUG_MSG(_msg) (macro definition) of group Service is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:190: error: Member LOG_DEBUG_TAIL() (macro definition) of group Service is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/SerialMuxChannels.h:79: error: Member commandId (variable) of struct _Command is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/SerialMuxChannels.h:85: error: Member response (variable) of struct _CommandResponse is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/SerialMuxChannels.h:98: error: Member lineSensorData[5U] (variable) of struct _LineSensorData is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/SerialMuxChannels.h:91: error: Member left (variable) of struct _SpeedData is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/SerialMuxChannels.h:92: error: Member right (variable) of struct _SpeedData is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/App.h:127: error: Member App(const App &app) (function) of class App is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/App.h:128: error: Member operator=(const App &app) (function) of class App is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/HALRemoteControlSim/Board.h:386: error: Member main(int argc, char **argv) (friend) of class Board is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/DifferentialDrive.h:281: error: Member DifferentialDrive(const DifferentialDrive &diffDrive) (function) of class DifferentialDrive is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/DifferentialDrive.h:282: error: Member operator=(const DifferentialDrive &diffDrive) (function) of class DifferentialDrive is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/ErrorState.h:125: error: Member ErrorState(const ErrorState &state) (function) of class ErrorState is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/ErrorState.h:126: error: Member operator=(const ErrorState &state) (function) of class ErrorState is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/LineSensorsCalibrationState.h:134: error: Member LineSensorsCalibrationState(const LineSensorsCalibrationState &state) (function) of class LineSensorsCalibrationState is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/LineSensorsCalibrationState.h:135: error: Member operator=(const LineSensorsCalibrationState &state) (function) of class LineSensorsCalibrationState is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/MotorSpeedCalibrationState.h:140: error: Member MotorSpeedCalibrationState(const MotorSpeedCalibrationState &state) (function) of class MotorSpeedCalibrationState is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/MotorSpeedCalibrationState.h:141: error: Member operator=(const MotorSpeedCalibrationState &state) (function) of class MotorSpeedCalibrationState is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/MovAvg.hpp:154: error: Member MovAvg(const MovAvg &avg) (function) of class MovAvg is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/MovAvg.hpp:155: error: Member operator=(const MovAvg &avg) (function) of class MovAvg is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Odometry.h:233: error: Member Odometry(const Odometry &value) (function) of class Odometry is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Odometry.h:234: error: Member operator=(const Odometry &value) (function) of class Odometry is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Odometry.h:237: error: argument 'relStepsLeft' of command @param is not found in the argument list of Odometry::detectStandStill(uint16_t absStepsLeft, uint16_t absStepsRight) +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Odometry.h:237: error: argument 'relStepsRight' of command @param is not found in the argument list of Odometry::detectStandStill(uint16_t absStepsLeft, uint16_t absStepsRight) +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Odometry.h:237: error: The following parameters of Odometry::detectStandStill(uint16_t absStepsLeft, uint16_t absStepsRight) are not documented: + parameter 'absStepsLeft' + parameter 'absStepsRight' +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/RelativeEncoders.h:133: error: Member RelativeEncoders(const RelativeEncoders &relEncoder) (function) of class RelativeEncoders is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/RelativeEncoders.h:134: error: Member operator=(const RelativeEncoders &relEncoder) (function) of class RelativeEncoders is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/RemoteCtrlState.h:159: error: Member RemoteCtrlState(const RemoteCtrlState &state) (function) of class RemoteCtrlState is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/RemoteCtrlState.h:160: error: Member operator=(const RemoteCtrlState &state) (function) of class RemoteCtrlState is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Speedometer.h:162: error: Member Speedometer(const Speedometer &value) (function) of class Speedometer is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Speedometer.h:163: error: Member operator=(const Speedometer &value) (function) of class Speedometer is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/StartupState.h:113: error: Member StartupState(const StartupState &state) (function) of class StartupState is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/StartupState.h:114: error: Member operator=(const StartupState &state) (function) of class StartupState is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/StateMachine.h:104: error: Member StateMachine(const StateMachine &sm) (function) of class StateMachine is not documented. +C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/StateMachine.h:105: error: Member operator=(const StateMachine &sm) (function) of class StateMachine is not documented. From a01f41b8df98084847949401a818323a09c8e75a Mon Sep 17 00:00:00 2001 From: gabryelreyes Date: Thu, 9 Nov 2023 11:06:16 +0100 Subject: [PATCH 07/11] doxygen warnings file must be empty --- doc/doxygen/doxygen_warnings.txt | 45 -------------------------------- 1 file changed, 45 deletions(-) diff --git a/doc/doxygen/doxygen_warnings.txt b/doc/doxygen/doxygen_warnings.txt index 76f2dba8..e69de29b 100644 --- a/doc/doxygen/doxygen_warnings.txt +++ b/doc/doxygen/doxygen_warnings.txt @@ -1,45 +0,0 @@ -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:44: error: Member LOG_FATAL_ENABLE (macro definition) of group Service is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:48: error: Member LOG_ERROR_ENABLE (macro definition) of group Service is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:52: error: Member LOG_WARNING_ENABLE (macro definition) of group Service is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:56: error: Member LOG_INFO_ENABLE (macro definition) of group Service is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:60: error: Member LOG_DEBUG_ENABLE (macro definition) of group Service is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:186: error: Member LOG_DEBUG(_filename, _msg) (macro definition) of group Service is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:187: error: Member LOG_DEBUG_VAL(_filename, _msg, _val) (macro definition) of group Service is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:188: error: Member LOG_DEBUG_HEAD(_filename) (macro definition) of group Service is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:189: error: Member LOG_DEBUG_MSG(_msg) (macro definition) of group Service is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Logging.h:190: error: Member LOG_DEBUG_TAIL() (macro definition) of group Service is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/SerialMuxChannels.h:79: error: Member commandId (variable) of struct _Command is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/SerialMuxChannels.h:85: error: Member response (variable) of struct _CommandResponse is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/SerialMuxChannels.h:98: error: Member lineSensorData[5U] (variable) of struct _LineSensorData is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/SerialMuxChannels.h:91: error: Member left (variable) of struct _SpeedData is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/SerialMuxChannels.h:92: error: Member right (variable) of struct _SpeedData is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/App.h:127: error: Member App(const App &app) (function) of class App is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/App.h:128: error: Member operator=(const App &app) (function) of class App is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/HALRemoteControlSim/Board.h:386: error: Member main(int argc, char **argv) (friend) of class Board is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/DifferentialDrive.h:281: error: Member DifferentialDrive(const DifferentialDrive &diffDrive) (function) of class DifferentialDrive is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/DifferentialDrive.h:282: error: Member operator=(const DifferentialDrive &diffDrive) (function) of class DifferentialDrive is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/ErrorState.h:125: error: Member ErrorState(const ErrorState &state) (function) of class ErrorState is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/ErrorState.h:126: error: Member operator=(const ErrorState &state) (function) of class ErrorState is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/LineSensorsCalibrationState.h:134: error: Member LineSensorsCalibrationState(const LineSensorsCalibrationState &state) (function) of class LineSensorsCalibrationState is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/LineSensorsCalibrationState.h:135: error: Member operator=(const LineSensorsCalibrationState &state) (function) of class LineSensorsCalibrationState is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/MotorSpeedCalibrationState.h:140: error: Member MotorSpeedCalibrationState(const MotorSpeedCalibrationState &state) (function) of class MotorSpeedCalibrationState is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/MotorSpeedCalibrationState.h:141: error: Member operator=(const MotorSpeedCalibrationState &state) (function) of class MotorSpeedCalibrationState is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/MovAvg.hpp:154: error: Member MovAvg(const MovAvg &avg) (function) of class MovAvg is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/MovAvg.hpp:155: error: Member operator=(const MovAvg &avg) (function) of class MovAvg is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Odometry.h:233: error: Member Odometry(const Odometry &value) (function) of class Odometry is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Odometry.h:234: error: Member operator=(const Odometry &value) (function) of class Odometry is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Odometry.h:237: error: argument 'relStepsLeft' of command @param is not found in the argument list of Odometry::detectStandStill(uint16_t absStepsLeft, uint16_t absStepsRight) -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Odometry.h:237: error: argument 'relStepsRight' of command @param is not found in the argument list of Odometry::detectStandStill(uint16_t absStepsLeft, uint16_t absStepsRight) -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Odometry.h:237: error: The following parameters of Odometry::detectStandStill(uint16_t absStepsLeft, uint16_t absStepsRight) are not documented: - parameter 'absStepsLeft' - parameter 'absStepsRight' -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/RelativeEncoders.h:133: error: Member RelativeEncoders(const RelativeEncoders &relEncoder) (function) of class RelativeEncoders is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/RelativeEncoders.h:134: error: Member operator=(const RelativeEncoders &relEncoder) (function) of class RelativeEncoders is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/RemoteCtrlState.h:159: error: Member RemoteCtrlState(const RemoteCtrlState &state) (function) of class RemoteCtrlState is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/RemoteCtrlState.h:160: error: Member operator=(const RemoteCtrlState &state) (function) of class RemoteCtrlState is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Speedometer.h:162: error: Member Speedometer(const Speedometer &value) (function) of class Speedometer is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/Speedometer.h:163: error: Member operator=(const Speedometer &value) (function) of class Speedometer is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/StartupState.h:113: error: Member StartupState(const StartupState &state) (function) of class StartupState is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/APPRemoteControl/StartupState.h:114: error: Member operator=(const StartupState &state) (function) of class StartupState is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/StateMachine.h:104: error: Member StateMachine(const StateMachine &sm) (function) of class StateMachine is not documented. -C:/Users/reyes/Documents/repos/RadonUlzer/lib/Service/StateMachine.h:105: error: Member operator=(const StateMachine &sm) (function) of class StateMachine is not documented. From ef69ab943db54eeed43cd285381b58360e8489d9 Mon Sep 17 00:00:00 2001 From: gabryelreyes Date: Thu, 9 Nov 2023 11:33:56 +0100 Subject: [PATCH 08/11] Fixed Doxygen findings --- lib/APPConvoyLeader/App.h | 14 ++--- lib/APPConvoyLeader/DrivingState.h | 23 ++++---- lib/APPConvoyLeader/ErrorState.h | 14 ++--- .../LineSensorsCalibrationState.h | 5 +- .../MotorSpeedCalibrationState.h | 5 +- lib/APPConvoyLeader/ParameterSets.h | 7 +-- lib/APPConvoyLeader/ReadyState.h | 7 +-- lib/APPConvoyLeader/ReleaseTrackState.h | 7 +-- lib/APPConvoyLeader/StartupState.h | 7 +-- lib/APPLineFollower/App.h | 5 +- lib/APPLineFollower/DrivingState.h | 23 ++++---- lib/APPLineFollower/ErrorState.h | 14 ++--- .../LineSensorsCalibrationState.h | 5 +- .../MotorSpeedCalibrationState.h | 5 +- lib/APPLineFollower/ParameterSets.h | 7 +-- lib/APPLineFollower/ReadyState.h | 7 +-- lib/APPLineFollower/ReleaseTrackState.h | 7 +-- lib/APPLineFollower/StartupState.h | 7 +-- lib/APPRemoteControl/App.h | 5 +- lib/APPRemoteControl/ErrorState.h | 14 ++--- .../LineSensorsCalibrationState.h | 5 +- .../MotorSpeedCalibrationState.h | 5 +- lib/APPRemoteControl/RemoteCtrlState.h | 22 ++++---- lib/APPRemoteControl/SerialMuxChannels.h | 10 ++-- lib/APPRemoteControl/StartupState.h | 7 +-- lib/HALConvoyLeaderSim/Board.h | 10 +++- lib/HALLineFollowerSim/Board.h | 10 +++- lib/HALRemoteControlSim/Board.h | 10 +++- lib/Service/DifferentialDrive.h | 6 +-- lib/Service/Logging.h | 52 +++++++++++++++---- lib/Service/MovAvg.hpp | 7 +-- lib/Service/Odometry.h | 21 ++++---- lib/Service/RelativeEncoders.h | 6 +-- lib/Service/Speedometer.h | 9 ++-- lib/Service/StateMachine.h | 7 +-- 35 files changed, 219 insertions(+), 156 deletions(-) diff --git a/lib/APPConvoyLeader/App.h b/lib/APPConvoyLeader/App.h index 8f8cd5af..b5184114 100644 --- a/lib/APPConvoyLeader/App.h +++ b/lib/APPConvoyLeader/App.h @@ -27,7 +27,7 @@ /** * @brief ConvoyLeader application * @author Andreas Merkle - * + * * @addtogroup Application * * @{ @@ -60,14 +60,10 @@ class App { public: - /** * Construct the convoy leader application. */ - App() : - m_systemStateMachine(), - m_controlInterval(), - m_smpServer(Serial) + App() : m_systemStateMachine(), m_controlInterval(), m_smpServer(Serial) { } @@ -89,7 +85,6 @@ class App void loop(); private: - /** Differential drive control period in ms. */ static const uint32_t DIFFERENTIAL_DRIVE_CONTROL_PERIOD = 5U; @@ -129,8 +124,9 @@ class App */ static void positionCallback(const uint8_t* payload, const uint8_t payloadSize); - App(const App& app); - App& operator=(const App& app); + /* Not allowed. */ + App(const App& app); /**< Copy construction of an instance. */ + App& operator=(const App& app); /**< Assignment of an instance. */ }; /****************************************************************************** diff --git a/lib/APPConvoyLeader/DrivingState.h b/lib/APPConvoyLeader/DrivingState.h index 8067719b..45433d88 100644 --- a/lib/APPConvoyLeader/DrivingState.h +++ b/lib/APPConvoyLeader/DrivingState.h @@ -127,11 +127,11 @@ class DrivingState : public IState SimpleTimer m_lapTime; /**< Timer used to calculate the lap time. */ SimpleTimer m_pidProcessTime; /**< Timer used for periodically PID processing. */ PIDController m_pidCtrl; /**< PID controller, used for driving. */ - int16_t m_topSpeed; /**< Top speed in [steps/s]. It might be lower or equal to the max. speed! */ - LineStatus m_lineStatus; /**< Status of start-/end line detection */ - TrackStatus m_trackStatus; /**< Status of track which means on track or track lost, etc. */ - uint8_t m_startEndLineDebounce; /**< Counter used for easys debouncing of the start-/end line detection. */ - MovAvg m_posMovAvg; /**< The moving average of the position over 2 calling cycles. */ + int16_t m_topSpeed; /**< Top speed in [steps/s]. It might be lower or equal to the max. speed! */ + LineStatus m_lineStatus; /**< Status of start-/end line detection */ + TrackStatus m_trackStatus; /**< Status of track which means on track or track lost, etc. */ + uint8_t m_startEndLineDebounce; /**< Counter used for easys debouncing of the start-/end line detection. */ + MovAvg m_posMovAvg; /**< The moving average of the position over 2 calling cycles. */ /** * Default constructor. @@ -156,14 +156,15 @@ class DrivingState : public IState { } - DrivingState(const DrivingState& state); - DrivingState& operator=(const DrivingState& state); + /* Not allowed. */ + DrivingState(const DrivingState& state); /**< Copy construction of an instance. */ + DrivingState& operator=(const DrivingState& state); /**< Assignment of an instance. */ /** * Control driving in case the robot is on track. * - * @param[in] position Current position on track - * @param[in] lineSensorValue Value of each line sensor + * @param[in] position Current position on track + * @param[in] lineSensorValues Value of each line sensor */ void processOnTrack(int16_t position, const uint16_t* lineSensorValues); @@ -171,8 +172,8 @@ class DrivingState : public IState * Control driving in case the robot lost the track. * It handles the track search algorithm. * - * @param[in] position Current position on track - * @param[in] lineSensorValue Value of each line sensor + * @param[in] position Current position on track + * @param[in] lineSensorValues Value of each line sensor */ void processTrackLost(int16_t position, const uint16_t* lineSensorValues); diff --git a/lib/APPConvoyLeader/ErrorState.h b/lib/APPConvoyLeader/ErrorState.h index 83313626..3ded9542 100644 --- a/lib/APPConvoyLeader/ErrorState.h +++ b/lib/APPConvoyLeader/ErrorState.h @@ -27,7 +27,7 @@ /** * @brief Error state * @author Andreas Merkle - * + * * @addtogroup Application * * @{ @@ -91,21 +91,20 @@ class ErrorState : public IState /** * Set error message, which to show on the display. - * + * * @param[in] msg Error message */ void setErrorMsg(const char* msg); protected: private: - /** * The error message string size in bytes, which * includes the terminating character. */ - static const size_t ERROR_MSG_SIZE = 20; + static const size_t ERROR_MSG_SIZE = 20; - char m_errorMsg[ERROR_MSG_SIZE]; /**< Error message, which to show. */ + char m_errorMsg[ERROR_MSG_SIZE]; /**< Error message, which to show. */ /** * Default constructor. @@ -122,8 +121,9 @@ class ErrorState : public IState { } - ErrorState(const ErrorState& state); - ErrorState& operator=(const ErrorState& state); + /* Not allowed. */ + ErrorState(const ErrorState& state); /**< Copy construction of an instance. */ + ErrorState& operator=(const ErrorState& state); /**< Assignment of an instance. */ }; /****************************************************************************** diff --git a/lib/APPConvoyLeader/LineSensorsCalibrationState.h b/lib/APPConvoyLeader/LineSensorsCalibrationState.h index da2da11c..3f695436 100644 --- a/lib/APPConvoyLeader/LineSensorsCalibrationState.h +++ b/lib/APPConvoyLeader/LineSensorsCalibrationState.h @@ -131,8 +131,9 @@ class LineSensorsCalibrationState : public IState { } - LineSensorsCalibrationState(const LineSensorsCalibrationState& state); - LineSensorsCalibrationState& operator=(const LineSensorsCalibrationState& state); + /* Not allowed. */ + LineSensorsCalibrationState(const LineSensorsCalibrationState& state); /**< Copy construction of an instance. */ + LineSensorsCalibrationState& operator=(const LineSensorsCalibrationState& state); /**< Assignment of an instance. */ /** * Turn and calibrate the line sensors. diff --git a/lib/APPConvoyLeader/MotorSpeedCalibrationState.h b/lib/APPConvoyLeader/MotorSpeedCalibrationState.h index 772abc8f..356d0204 100644 --- a/lib/APPConvoyLeader/MotorSpeedCalibrationState.h +++ b/lib/APPConvoyLeader/MotorSpeedCalibrationState.h @@ -137,8 +137,9 @@ class MotorSpeedCalibrationState : public IState { } - MotorSpeedCalibrationState(const MotorSpeedCalibrationState& state); - MotorSpeedCalibrationState& operator=(const MotorSpeedCalibrationState& state); + /* Not allowed. */ + MotorSpeedCalibrationState(const MotorSpeedCalibrationState& state); /**< Copy construction of an instance. */ + MotorSpeedCalibrationState& operator=(const MotorSpeedCalibrationState& state); /**< Assignment of an instance. */ /** * Determine the max. motor speed, considering both driving directions. diff --git a/lib/APPConvoyLeader/ParameterSets.h b/lib/APPConvoyLeader/ParameterSets.h index a92040f5..28b3bd3c 100644 --- a/lib/APPConvoyLeader/ParameterSets.h +++ b/lib/APPConvoyLeader/ParameterSets.h @@ -27,7 +27,7 @@ /** * @brief Parameter state * @author Andreas Merkle - * + * * @addtogroup Application * * @{ @@ -132,8 +132,9 @@ class ParameterSets */ ~ParameterSets(); - ParameterSets(const ParameterSets& set); - ParameterSets& operator=(const ParameterSets& set); + /* Not allowed. */ + ParameterSets(const ParameterSets& set); /**< Copy construction of an instance. */ + ParameterSets& operator=(const ParameterSets& set); /**< Assignment of an instance. */ }; /****************************************************************************** diff --git a/lib/APPConvoyLeader/ReadyState.h b/lib/APPConvoyLeader/ReadyState.h index 772b638a..25efd942 100644 --- a/lib/APPConvoyLeader/ReadyState.h +++ b/lib/APPConvoyLeader/ReadyState.h @@ -27,7 +27,7 @@ /** * @brief Ready state * @author Andreas Merkle - * + * * @addtogroup Application * * @{ @@ -116,8 +116,9 @@ class ReadyState : public IState { } - ReadyState(const ReadyState& state); - ReadyState& operator=(const ReadyState& state); + /* Not allowed. */ + ReadyState(const ReadyState& state); /**< Copy construction of an instance. */ + ReadyState& operator=(const ReadyState& state); /**< Assignment of an instance. */ }; /****************************************************************************** diff --git a/lib/APPConvoyLeader/ReleaseTrackState.h b/lib/APPConvoyLeader/ReleaseTrackState.h index af39725e..3c408768 100644 --- a/lib/APPConvoyLeader/ReleaseTrackState.h +++ b/lib/APPConvoyLeader/ReleaseTrackState.h @@ -27,7 +27,7 @@ /** * @brief Release track state * @author Andreas Merkle - * + * * @addtogroup Application * * @{ @@ -111,8 +111,9 @@ class ReleaseTrackState : public IState { } - ReleaseTrackState(const ReleaseTrackState& state); - ReleaseTrackState& operator=(const ReleaseTrackState& state); + /* Not allowed. */ + ReleaseTrackState(const ReleaseTrackState& state); /**< Copy construction of an instance. */ + ReleaseTrackState& operator=(const ReleaseTrackState& state); /**< Assignment of an instance. */ /** * Show choosen parameter set on LCD. diff --git a/lib/APPConvoyLeader/StartupState.h b/lib/APPConvoyLeader/StartupState.h index 4cd0c506..8f3d8b5a 100644 --- a/lib/APPConvoyLeader/StartupState.h +++ b/lib/APPConvoyLeader/StartupState.h @@ -27,7 +27,7 @@ /** * @brief Startup state * @author Andreas Merkle - * + * * @addtogroup Application * * @{ @@ -110,8 +110,9 @@ class StartupState : public IState { } - StartupState(const StartupState& state); - StartupState& operator=(const StartupState& state); + /* Not allowed. */ + StartupState(const StartupState& state); /**< Copy construction of an instance. */ + StartupState& operator=(const StartupState& state); /**< Assignment of an instance. */ }; /****************************************************************************** diff --git a/lib/APPLineFollower/App.h b/lib/APPLineFollower/App.h index 7ff60046..47408043 100644 --- a/lib/APPLineFollower/App.h +++ b/lib/APPLineFollower/App.h @@ -96,8 +96,9 @@ class App /** Timer used for differential drive control processing. */ SimpleTimer m_controlInterval; - App(const App& app); - App& operator=(const App& app); + /* Not allowed. */ + App(const App& app); /**< Copy construction of an instance. */ + App& operator=(const App& app); /**< Assignment of an instance. */ }; /****************************************************************************** diff --git a/lib/APPLineFollower/DrivingState.h b/lib/APPLineFollower/DrivingState.h index 8067719b..45433d88 100644 --- a/lib/APPLineFollower/DrivingState.h +++ b/lib/APPLineFollower/DrivingState.h @@ -127,11 +127,11 @@ class DrivingState : public IState SimpleTimer m_lapTime; /**< Timer used to calculate the lap time. */ SimpleTimer m_pidProcessTime; /**< Timer used for periodically PID processing. */ PIDController m_pidCtrl; /**< PID controller, used for driving. */ - int16_t m_topSpeed; /**< Top speed in [steps/s]. It might be lower or equal to the max. speed! */ - LineStatus m_lineStatus; /**< Status of start-/end line detection */ - TrackStatus m_trackStatus; /**< Status of track which means on track or track lost, etc. */ - uint8_t m_startEndLineDebounce; /**< Counter used for easys debouncing of the start-/end line detection. */ - MovAvg m_posMovAvg; /**< The moving average of the position over 2 calling cycles. */ + int16_t m_topSpeed; /**< Top speed in [steps/s]. It might be lower or equal to the max. speed! */ + LineStatus m_lineStatus; /**< Status of start-/end line detection */ + TrackStatus m_trackStatus; /**< Status of track which means on track or track lost, etc. */ + uint8_t m_startEndLineDebounce; /**< Counter used for easys debouncing of the start-/end line detection. */ + MovAvg m_posMovAvg; /**< The moving average of the position over 2 calling cycles. */ /** * Default constructor. @@ -156,14 +156,15 @@ class DrivingState : public IState { } - DrivingState(const DrivingState& state); - DrivingState& operator=(const DrivingState& state); + /* Not allowed. */ + DrivingState(const DrivingState& state); /**< Copy construction of an instance. */ + DrivingState& operator=(const DrivingState& state); /**< Assignment of an instance. */ /** * Control driving in case the robot is on track. * - * @param[in] position Current position on track - * @param[in] lineSensorValue Value of each line sensor + * @param[in] position Current position on track + * @param[in] lineSensorValues Value of each line sensor */ void processOnTrack(int16_t position, const uint16_t* lineSensorValues); @@ -171,8 +172,8 @@ class DrivingState : public IState * Control driving in case the robot lost the track. * It handles the track search algorithm. * - * @param[in] position Current position on track - * @param[in] lineSensorValue Value of each line sensor + * @param[in] position Current position on track + * @param[in] lineSensorValues Value of each line sensor */ void processTrackLost(int16_t position, const uint16_t* lineSensorValues); diff --git a/lib/APPLineFollower/ErrorState.h b/lib/APPLineFollower/ErrorState.h index 83313626..3ded9542 100644 --- a/lib/APPLineFollower/ErrorState.h +++ b/lib/APPLineFollower/ErrorState.h @@ -27,7 +27,7 @@ /** * @brief Error state * @author Andreas Merkle - * + * * @addtogroup Application * * @{ @@ -91,21 +91,20 @@ class ErrorState : public IState /** * Set error message, which to show on the display. - * + * * @param[in] msg Error message */ void setErrorMsg(const char* msg); protected: private: - /** * The error message string size in bytes, which * includes the terminating character. */ - static const size_t ERROR_MSG_SIZE = 20; + static const size_t ERROR_MSG_SIZE = 20; - char m_errorMsg[ERROR_MSG_SIZE]; /**< Error message, which to show. */ + char m_errorMsg[ERROR_MSG_SIZE]; /**< Error message, which to show. */ /** * Default constructor. @@ -122,8 +121,9 @@ class ErrorState : public IState { } - ErrorState(const ErrorState& state); - ErrorState& operator=(const ErrorState& state); + /* Not allowed. */ + ErrorState(const ErrorState& state); /**< Copy construction of an instance. */ + ErrorState& operator=(const ErrorState& state); /**< Assignment of an instance. */ }; /****************************************************************************** diff --git a/lib/APPLineFollower/LineSensorsCalibrationState.h b/lib/APPLineFollower/LineSensorsCalibrationState.h index da2da11c..3f695436 100644 --- a/lib/APPLineFollower/LineSensorsCalibrationState.h +++ b/lib/APPLineFollower/LineSensorsCalibrationState.h @@ -131,8 +131,9 @@ class LineSensorsCalibrationState : public IState { } - LineSensorsCalibrationState(const LineSensorsCalibrationState& state); - LineSensorsCalibrationState& operator=(const LineSensorsCalibrationState& state); + /* Not allowed. */ + LineSensorsCalibrationState(const LineSensorsCalibrationState& state); /**< Copy construction of an instance. */ + LineSensorsCalibrationState& operator=(const LineSensorsCalibrationState& state); /**< Assignment of an instance. */ /** * Turn and calibrate the line sensors. diff --git a/lib/APPLineFollower/MotorSpeedCalibrationState.h b/lib/APPLineFollower/MotorSpeedCalibrationState.h index 772abc8f..356d0204 100644 --- a/lib/APPLineFollower/MotorSpeedCalibrationState.h +++ b/lib/APPLineFollower/MotorSpeedCalibrationState.h @@ -137,8 +137,9 @@ class MotorSpeedCalibrationState : public IState { } - MotorSpeedCalibrationState(const MotorSpeedCalibrationState& state); - MotorSpeedCalibrationState& operator=(const MotorSpeedCalibrationState& state); + /* Not allowed. */ + MotorSpeedCalibrationState(const MotorSpeedCalibrationState& state); /**< Copy construction of an instance. */ + MotorSpeedCalibrationState& operator=(const MotorSpeedCalibrationState& state); /**< Assignment of an instance. */ /** * Determine the max. motor speed, considering both driving directions. diff --git a/lib/APPLineFollower/ParameterSets.h b/lib/APPLineFollower/ParameterSets.h index a92040f5..28b3bd3c 100644 --- a/lib/APPLineFollower/ParameterSets.h +++ b/lib/APPLineFollower/ParameterSets.h @@ -27,7 +27,7 @@ /** * @brief Parameter state * @author Andreas Merkle - * + * * @addtogroup Application * * @{ @@ -132,8 +132,9 @@ class ParameterSets */ ~ParameterSets(); - ParameterSets(const ParameterSets& set); - ParameterSets& operator=(const ParameterSets& set); + /* Not allowed. */ + ParameterSets(const ParameterSets& set); /**< Copy construction of an instance. */ + ParameterSets& operator=(const ParameterSets& set); /**< Assignment of an instance. */ }; /****************************************************************************** diff --git a/lib/APPLineFollower/ReadyState.h b/lib/APPLineFollower/ReadyState.h index 772b638a..25efd942 100644 --- a/lib/APPLineFollower/ReadyState.h +++ b/lib/APPLineFollower/ReadyState.h @@ -27,7 +27,7 @@ /** * @brief Ready state * @author Andreas Merkle - * + * * @addtogroup Application * * @{ @@ -116,8 +116,9 @@ class ReadyState : public IState { } - ReadyState(const ReadyState& state); - ReadyState& operator=(const ReadyState& state); + /* Not allowed. */ + ReadyState(const ReadyState& state); /**< Copy construction of an instance. */ + ReadyState& operator=(const ReadyState& state); /**< Assignment of an instance. */ }; /****************************************************************************** diff --git a/lib/APPLineFollower/ReleaseTrackState.h b/lib/APPLineFollower/ReleaseTrackState.h index af39725e..3c408768 100644 --- a/lib/APPLineFollower/ReleaseTrackState.h +++ b/lib/APPLineFollower/ReleaseTrackState.h @@ -27,7 +27,7 @@ /** * @brief Release track state * @author Andreas Merkle - * + * * @addtogroup Application * * @{ @@ -111,8 +111,9 @@ class ReleaseTrackState : public IState { } - ReleaseTrackState(const ReleaseTrackState& state); - ReleaseTrackState& operator=(const ReleaseTrackState& state); + /* Not allowed. */ + ReleaseTrackState(const ReleaseTrackState& state); /**< Copy construction of an instance. */ + ReleaseTrackState& operator=(const ReleaseTrackState& state); /**< Assignment of an instance. */ /** * Show choosen parameter set on LCD. diff --git a/lib/APPLineFollower/StartupState.h b/lib/APPLineFollower/StartupState.h index 4cd0c506..8f3d8b5a 100644 --- a/lib/APPLineFollower/StartupState.h +++ b/lib/APPLineFollower/StartupState.h @@ -27,7 +27,7 @@ /** * @brief Startup state * @author Andreas Merkle - * + * * @addtogroup Application * * @{ @@ -110,8 +110,9 @@ class StartupState : public IState { } - StartupState(const StartupState& state); - StartupState& operator=(const StartupState& state); + /* Not allowed. */ + StartupState(const StartupState& state); /**< Copy construction of an instance. */ + StartupState& operator=(const StartupState& state); /**< Assignment of an instance. */ }; /****************************************************************************** diff --git a/lib/APPRemoteControl/App.h b/lib/APPRemoteControl/App.h index cf8acd9b..10912d2e 100644 --- a/lib/APPRemoteControl/App.h +++ b/lib/APPRemoteControl/App.h @@ -124,8 +124,9 @@ class App /** Last remote control response id */ RemoteCtrlState::RspId m_lastRemoteControlRspId; - App(const App& app); - App& operator=(const App& app); + /* Not allowed. */ + App(const App& app); /**< Copy construction of an instance. */ + App& operator=(const App& app); /**< Assignment of an instance. */ /** * Send remote control command responses on change. diff --git a/lib/APPRemoteControl/ErrorState.h b/lib/APPRemoteControl/ErrorState.h index 83313626..3ded9542 100644 --- a/lib/APPRemoteControl/ErrorState.h +++ b/lib/APPRemoteControl/ErrorState.h @@ -27,7 +27,7 @@ /** * @brief Error state * @author Andreas Merkle - * + * * @addtogroup Application * * @{ @@ -91,21 +91,20 @@ class ErrorState : public IState /** * Set error message, which to show on the display. - * + * * @param[in] msg Error message */ void setErrorMsg(const char* msg); protected: private: - /** * The error message string size in bytes, which * includes the terminating character. */ - static const size_t ERROR_MSG_SIZE = 20; + static const size_t ERROR_MSG_SIZE = 20; - char m_errorMsg[ERROR_MSG_SIZE]; /**< Error message, which to show. */ + char m_errorMsg[ERROR_MSG_SIZE]; /**< Error message, which to show. */ /** * Default constructor. @@ -122,8 +121,9 @@ class ErrorState : public IState { } - ErrorState(const ErrorState& state); - ErrorState& operator=(const ErrorState& state); + /* Not allowed. */ + ErrorState(const ErrorState& state); /**< Copy construction of an instance. */ + ErrorState& operator=(const ErrorState& state); /**< Assignment of an instance. */ }; /****************************************************************************** diff --git a/lib/APPRemoteControl/LineSensorsCalibrationState.h b/lib/APPRemoteControl/LineSensorsCalibrationState.h index da2da11c..3f695436 100644 --- a/lib/APPRemoteControl/LineSensorsCalibrationState.h +++ b/lib/APPRemoteControl/LineSensorsCalibrationState.h @@ -131,8 +131,9 @@ class LineSensorsCalibrationState : public IState { } - LineSensorsCalibrationState(const LineSensorsCalibrationState& state); - LineSensorsCalibrationState& operator=(const LineSensorsCalibrationState& state); + /* Not allowed. */ + LineSensorsCalibrationState(const LineSensorsCalibrationState& state); /**< Copy construction of an instance. */ + LineSensorsCalibrationState& operator=(const LineSensorsCalibrationState& state); /**< Assignment of an instance. */ /** * Turn and calibrate the line sensors. diff --git a/lib/APPRemoteControl/MotorSpeedCalibrationState.h b/lib/APPRemoteControl/MotorSpeedCalibrationState.h index 772abc8f..356d0204 100644 --- a/lib/APPRemoteControl/MotorSpeedCalibrationState.h +++ b/lib/APPRemoteControl/MotorSpeedCalibrationState.h @@ -137,8 +137,9 @@ class MotorSpeedCalibrationState : public IState { } - MotorSpeedCalibrationState(const MotorSpeedCalibrationState& state); - MotorSpeedCalibrationState& operator=(const MotorSpeedCalibrationState& state); + /* Not allowed. */ + MotorSpeedCalibrationState(const MotorSpeedCalibrationState& state); /**< Copy construction of an instance. */ + MotorSpeedCalibrationState& operator=(const MotorSpeedCalibrationState& state); /**< Assignment of an instance. */ /** * Determine the max. motor speed, considering both driving directions. diff --git a/lib/APPRemoteControl/RemoteCtrlState.h b/lib/APPRemoteControl/RemoteCtrlState.h index af60b934..dedaeb7a 100644 --- a/lib/APPRemoteControl/RemoteCtrlState.h +++ b/lib/APPRemoteControl/RemoteCtrlState.h @@ -27,7 +27,7 @@ /** * @brief Remote control state * @author Andreas Merkle - * + * * @addtogroup Application * * @{ @@ -58,7 +58,6 @@ class RemoteCtrlState : public IState { public: - /** Remote control commands. */ typedef enum : uint8_t { @@ -112,7 +111,7 @@ class RemoteCtrlState : public IState /** * Execute command. * If a command is pending, it won't be executed. - * + * * @param[in] cmdId The id of the command which to execute. */ void execute(CmdId cmdId) @@ -126,7 +125,7 @@ class RemoteCtrlState : public IState /** * Get command response of current command. - * + * * @return Command response */ RspId getCmdRsp() const @@ -136,16 +135,13 @@ class RemoteCtrlState : public IState protected: private: - - CmdId m_cmdId; /**< Current pending command. */ - RspId m_rspId; /**< Current command response. */ + CmdId m_cmdId; /**< Current pending command. */ + RspId m_rspId; /**< Current command response. */ /** * Default constructor. */ - RemoteCtrlState() : - m_cmdId(CMD_ID_IDLE), - m_rspId(RSP_ID_OK) + RemoteCtrlState() : m_cmdId(CMD_ID_IDLE), m_rspId(RSP_ID_OK) { } @@ -156,12 +152,12 @@ class RemoteCtrlState : public IState { } - RemoteCtrlState(const RemoteCtrlState& state); - RemoteCtrlState& operator=(const RemoteCtrlState& state); + RemoteCtrlState(const RemoteCtrlState& state); /**< Copy construction of an instance. */ + RemoteCtrlState& operator=(const RemoteCtrlState& state); /**< Assignment of an instance. */ /** * Set command response and finish the command execution. - * + * * @param[in] rsp Command response */ void finishCommand(RspId rsp) diff --git a/lib/APPRemoteControl/SerialMuxChannels.h b/lib/APPRemoteControl/SerialMuxChannels.h index d37cccf2..b4b6b643 100644 --- a/lib/APPRemoteControl/SerialMuxChannels.h +++ b/lib/APPRemoteControl/SerialMuxChannels.h @@ -76,26 +76,26 @@ /** Struct of the "Command" channel payload. */ typedef struct _Command { - uint8_t commandId; + uint8_t commandId; /**< Command ID */ } __attribute__((packed)) Command; /** Struct of the "Command Response" channel payload. */ typedef struct _CommandResponse { - uint8_t response; + uint8_t response; /**< Response to the command */ } __attribute__((packed)) CommandResponse; /** Struct of the "Speed" channel payload. */ typedef struct _SpeedData { - int16_t left; - int16_t right; + int16_t left; /**< Left motor speed */ + int16_t right; /**< Right motor speed */ } __attribute__((packed)) SpeedData; /** Struct of the "Line Sensor" channel payload. */ typedef struct _LineSensorData { - uint16_t lineSensorData[5U]; + uint16_t lineSensorData[5U]; /**< Line sensor data */ } __attribute__((packed)) LineSensorData; /****************************************************************************** diff --git a/lib/APPRemoteControl/StartupState.h b/lib/APPRemoteControl/StartupState.h index a4609b1b..c58233fb 100644 --- a/lib/APPRemoteControl/StartupState.h +++ b/lib/APPRemoteControl/StartupState.h @@ -27,7 +27,7 @@ /** * @brief Startup state * @author Andreas Merkle - * + * * @addtogroup Application * * @{ @@ -110,8 +110,9 @@ class StartupState : public IState { } - StartupState(const StartupState& state); - StartupState& operator=(const StartupState& state); + /* Not allowed. */ + StartupState(const StartupState& state); /**< Copy construction of an instance. */ + StartupState& operator=(const StartupState& state); /**< Assignment of an instance. */ }; /****************************************************************************** diff --git a/lib/HALConvoyLeaderSim/Board.h b/lib/HALConvoyLeaderSim/Board.h index ccb9ef43..ed84723f 100644 --- a/lib/HALConvoyLeaderSim/Board.h +++ b/lib/HALConvoyLeaderSim/Board.h @@ -205,7 +205,7 @@ class Board : public IBoard /** * Get proximity sensors driver. - * + * * @return Proximity sensors driver */ IProximitySensors& getProximitySensors() final @@ -379,9 +379,15 @@ class Board : public IBoard return m_keyboard; } - /* The main entry needs access to the simulation robot instance. + /** + * The main entry needs access to the simulation robot instance. * But all other application parts shall have no access, which is * solved by this friend. + * + * @param[in] argc Number of arguments + * @param[in] argv Arguments + * + * @return Exit code */ friend int main(int argc, char** argv); }; diff --git a/lib/HALLineFollowerSim/Board.h b/lib/HALLineFollowerSim/Board.h index ccb9ef43..ed84723f 100644 --- a/lib/HALLineFollowerSim/Board.h +++ b/lib/HALLineFollowerSim/Board.h @@ -205,7 +205,7 @@ class Board : public IBoard /** * Get proximity sensors driver. - * + * * @return Proximity sensors driver */ IProximitySensors& getProximitySensors() final @@ -379,9 +379,15 @@ class Board : public IBoard return m_keyboard; } - /* The main entry needs access to the simulation robot instance. + /** + * The main entry needs access to the simulation robot instance. * But all other application parts shall have no access, which is * solved by this friend. + * + * @param[in] argc Number of arguments + * @param[in] argv Arguments + * + * @return Exit code */ friend int main(int argc, char** argv); }; diff --git a/lib/HALRemoteControlSim/Board.h b/lib/HALRemoteControlSim/Board.h index ccb9ef43..ed84723f 100644 --- a/lib/HALRemoteControlSim/Board.h +++ b/lib/HALRemoteControlSim/Board.h @@ -205,7 +205,7 @@ class Board : public IBoard /** * Get proximity sensors driver. - * + * * @return Proximity sensors driver */ IProximitySensors& getProximitySensors() final @@ -379,9 +379,15 @@ class Board : public IBoard return m_keyboard; } - /* The main entry needs access to the simulation robot instance. + /** + * The main entry needs access to the simulation robot instance. * But all other application parts shall have no access, which is * solved by this friend. + * + * @param[in] argc Number of arguments + * @param[in] argv Arguments + * + * @return Exit code */ friend int main(int argc, char** argv); }; diff --git a/lib/Service/DifferentialDrive.h b/lib/Service/DifferentialDrive.h index e09b408e..773d6e6c 100644 --- a/lib/Service/DifferentialDrive.h +++ b/lib/Service/DifferentialDrive.h @@ -107,7 +107,7 @@ class DifferentialDrive * Disable the differential drive control. * It will stop the motors to avoid any unexpected driving behaviour. * After that the motors are not controlled anymore. - * + * * Important: Processing the differential drive control shall not be stopped. */ void disable() @@ -278,8 +278,8 @@ class DifferentialDrive } /* Not allowed. */ - DifferentialDrive(const DifferentialDrive& diffDrive); - DifferentialDrive& operator=(const DifferentialDrive& diffDrive); + DifferentialDrive(const DifferentialDrive& diffDrive); /**< Copy construction of an instance. */ + DifferentialDrive& operator=(const DifferentialDrive& diffDrive); /**< Assignment of an instance. */ /** * Calculate the linear speed left and right from the linear speed center and diff --git a/lib/Service/Logging.h b/lib/Service/Logging.h index 88ab8243..d2387873 100644 --- a/lib/Service/Logging.h +++ b/lib/Service/Logging.h @@ -41,24 +41,29 @@ *****************************************************************************/ #ifndef LOG_FATAL_ENABLE +/** Enable/disable fatal log messages. */ #define LOG_FATAL_ENABLE (1) -#endif /* LOG_FATAL_ENABLE */ +#endif #ifndef LOG_ERROR_ENABLE +/** Enable/disable error log messages. */ #define LOG_ERROR_ENABLE (1) -#endif /* LOG_ERROR_ENABLE */ +#endif #ifndef LOG_WARNING_ENABLE +/** Enable/disable warning log messages. */ #define LOG_WARNING_ENABLE (1) -#endif /* LOG_WARNING_ENABLE */ +#endif #ifndef LOG_INFO_ENABLE +/** Enable/disable info log messages. */ #define LOG_INFO_ENABLE (1) -#endif /* LOG_INFO_ENABLE */ +#endif #ifndef LOG_DEBUG_ENABLE +/** Enable/disable debug log messages. */ #define LOG_DEBUG_ENABLE (0) -#endif /* LOG_DEBUG_ENABLE */ +#endif /****************************************************************************** * Includes @@ -71,10 +76,15 @@ #if (0 == LOG_FATAL_ENABLE) +/** Log fatal error message. */ #define LOG_FATAL(_filename, _msg) +/** Log fatal error message with additional value. */ #define LOG_FATAL_VAL(_filename, _msg, _val) +/** Log fatal error header. */ #define LOG_FATAL_HEAD(_filename) +/** Log fatal error message, without line feed. */ #define LOG_FATAL_MSG(_msg) +/** Log fatal error tail. */ #define LOG_FATAL_TAIL() #else /* (0 == LOG_FATAL_ENABLE) */ @@ -99,10 +109,15 @@ #if (0 == LOG_ERROR_ENABLE) +/** Log error message. */ #define LOG_ERROR(_filename, _msg) +/** Log error message with additional value. */ #define LOG_ERROR_VAL(_filename, _msg, _val) +/** Log error header. */ #define LOG_ERROR_HEAD(_filename) +/** Log error error message, without line feed. */ #define LOG_ERROR_MSG(_msg) +/** Log error tail. */ #define LOG_ERROR_TAIL() #else /* (0 == LOG_ERROR_ENABLE) */ @@ -127,10 +142,15 @@ #if (0 == LOG_WARNING_ENABLE) +/** Log warning message. */ #define LOG_WARNING(_filename, _msg) +/** Log warning message with additional value. */ #define LOG_WARNING_VAL(_filename, _msg, _val) +/** Log warning header. */ #define LOG_WARNING_HEAD(_filename) +/** Log warning message, without line feed. */ #define LOG_WARNING_MSG(_msg) +/** Log warning tail. */ #define LOG_WARNING_TAIL() #else /* (0 == LOG_WARNING_ENABLE) */ @@ -155,10 +175,15 @@ #if (0 == LOG_INFO_ENABLE) +/** Log info message. */ #define LOG_INFO(_filename, _msg) +/** Log info message with additional value. */ #define LOG_INFO_VAL(_filename, _msg, _val) +/** Log info header. */ #define LOG_INFO_HEAD(_filename) +/** Log info message, without line feed. */ #define LOG_INFO_MSG(_msg) +/** Log info tail. */ #define LOG_INFO_TAIL() #else /* (0 == LOG_INFO_ENABLE) */ @@ -183,10 +208,15 @@ #if (0 == LOG_DEBUG_ENABLE) -#define LOG_DEBUG(_filename, _msg) (void)(_filename) -#define LOG_DEBUG_VAL(_filename, _msg, _val) (void)(_filename) -#define LOG_DEBUG_HEAD(_filename) (void)(_filename) +/** Log debug message. */ +#define LOG_DEBUG(_filename, _msg) +/** Log debug message with additional value. */ +#define LOG_DEBUG_VAL(_filename, _msg, _val) +/** Log debug header. */ +#define LOG_DEBUG_HEAD(_filename) +/** Log debug message, without line feed. */ #define LOG_DEBUG_MSG(_msg) +/** Log debug tail. */ #define LOG_DEBUG_TAIL() #else /* (0 == LOG_DEBUG_ENABLE) */ @@ -283,9 +313,9 @@ namespace Logging }; // namespace Logging - /****************************************************************************** - * Functions - *****************************************************************************/ +/****************************************************************************** + * Functions + *****************************************************************************/ #endif /* __LOGGING_H__ */ /** @} */ diff --git a/lib/Service/MovAvg.hpp b/lib/Service/MovAvg.hpp index 410ac9f4..51536d23 100644 --- a/lib/Service/MovAvg.hpp +++ b/lib/Service/MovAvg.hpp @@ -27,7 +27,7 @@ /** * @brief Moving average * @author Andreas Merkle - * + * * @addtogroup Service * * @{ @@ -151,8 +151,9 @@ class MovAvg uint8_t m_written; /**< The number of written values to the list of values, till length is reached. */ T m_sum; /**< Sum of all values */ - MovAvg(const MovAvg& avg); - MovAvg& operator=(const MovAvg& avg); + /* Not allowed. */ + MovAvg(const MovAvg& avg); /**< Copy construction of an instance. */ + MovAvg& operator=(const MovAvg& avg); /**< Assignment of an instance. */ }; /****************************************************************************** diff --git a/lib/Service/Odometry.h b/lib/Service/Odometry.h index 71589ef4..ad31b346 100644 --- a/lib/Service/Odometry.h +++ b/lib/Service/Odometry.h @@ -63,15 +63,15 @@ * - Orientation * - Position * - Mileage - * + * * Its following the REP-103: https://ros.org/reps/rep-0103.html - * + * * That means the cartesian representation of geographic locations use the * east-north-up (ENU) convention: * - X east * - Y north * - Z up - * + * * Rotation only about the Z axis (yaw) is supported. * The yaw relates to the X axis. That means if the robot is heading to the * north, the yaw will be 90°. @@ -129,7 +129,7 @@ class Odometry /** * Set the orientation. * Use this to align the Y axis to north. - * + * * @param[in] orientation The orientation in mrad. */ void setOrientation(int32_t orientation) @@ -230,24 +230,25 @@ class Odometry { } - Odometry(const Odometry& value); - Odometry& operator=(const Odometry& value); + /* Not allowed. */ + Odometry(const Odometry& value); /**< Copy construction of an instance. */ + Odometry& operator=(const Odometry& value); /**< Assignment of an instance. */ /** * Is the robot standstill? * - * @param[in] relStepsLeft Relative absolute steps left - * @param[in] relStepsRight Relative absolute steps right + * @param[in] absStepsLeft Absolute steps left + * @param[in] absStepsRight Absolute steps right */ bool detectStandStill(uint16_t absStepsLeft, uint16_t absStepsRight); /** * Calculate the mileage in mm. - * + * * @param[in] mileage Mileage in mm * @param[in] stepsCenter Number of steps center - * + * * @return Mileage in mm */ int32_t calculateMileage(uint32_t mileage, int16_t stepsCenter); diff --git a/lib/Service/RelativeEncoders.h b/lib/Service/RelativeEncoders.h index a8807e65..953f81f5 100644 --- a/lib/Service/RelativeEncoders.h +++ b/lib/Service/RelativeEncoders.h @@ -129,9 +129,9 @@ class RelativeEncoders int16_t m_referencePointRight; /* Not allowed. */ - RelativeEncoders(); - RelativeEncoders(const RelativeEncoders& relEncoder); - RelativeEncoders& operator=(const RelativeEncoders& relEncoder); + RelativeEncoders(); /**< Default constructor. */ + RelativeEncoders(const RelativeEncoders& relEncoder); /**< Copy construction of an instance. */ + RelativeEncoders& operator=(const RelativeEncoders& relEncoder); /**< Assignment of an instance. */ }; /****************************************************************************** diff --git a/lib/Service/Speedometer.h b/lib/Service/Speedometer.h index ea7448c8..477be9cf 100644 --- a/lib/Service/Speedometer.h +++ b/lib/Service/Speedometer.h @@ -159,8 +159,9 @@ class Speedometer { } - Speedometer(const Speedometer& value); - Speedometer& operator=(const Speedometer& value); + /* Not allowed. */ + Speedometer(const Speedometer& value); /**< Copy construction of an instance. */ + Speedometer& operator=(const Speedometer& value); /**< Assignment of an instance. */ /** * Get the direction of movement left. @@ -178,9 +179,9 @@ class Speedometer /** * Determine the direction of the movement by motor speed. - * + * * @param[in] motorSpeed Motor speed in digits - * + * * @return Direction of movement. */ Direction getDirectionByMotorSpeed(int16_t motorSpeed); diff --git a/lib/Service/StateMachine.h b/lib/Service/StateMachine.h index 774476b0..a27cce0c 100644 --- a/lib/Service/StateMachine.h +++ b/lib/Service/StateMachine.h @@ -27,7 +27,7 @@ /** * @brief Statemachine * @author Andreas Merkle - * + * * @addtogroup Application * * @{ @@ -101,8 +101,9 @@ class StateMachine IState* m_currentState; /**< Current active state */ IState* m_nextState; /**< Next state */ - StateMachine(const StateMachine& sm); - StateMachine& operator=(const StateMachine& sm); + /* Not allowed. */ + StateMachine(const StateMachine& sm); /**< Copy construction of an instance. */ + StateMachine& operator=(const StateMachine& sm); /**< Assignment of an instance. */ }; /****************************************************************************** From 1ba4cfa33f657e0d9f82012b4966726fdafd23cb Mon Sep 17 00:00:00 2001 From: gabryelreyes Date: Thu, 9 Nov 2023 11:43:25 +0100 Subject: [PATCH 09/11] Ignore TAG when debug is not enabled --- lib/Service/Logging.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Service/Logging.h b/lib/Service/Logging.h index d2387873..cd34d666 100644 --- a/lib/Service/Logging.h +++ b/lib/Service/Logging.h @@ -209,11 +209,11 @@ #if (0 == LOG_DEBUG_ENABLE) /** Log debug message. */ -#define LOG_DEBUG(_filename, _msg) +#define LOG_DEBUG(_filename, _msg) (void)(_filename) /** Log debug message with additional value. */ -#define LOG_DEBUG_VAL(_filename, _msg, _val) +#define LOG_DEBUG_VAL(_filename, _msg, _val) (void)(_filename) /** Log debug header. */ -#define LOG_DEBUG_HEAD(_filename) +#define LOG_DEBUG_HEAD(_filename) (void)(_filename) /** Log debug message, without line feed. */ #define LOG_DEBUG_MSG(_msg) /** Log debug tail. */ From 7daa944580aa7f9e535a5d6d8a05b3fe5804d9e7 Mon Sep 17 00:00:00 2001 From: gabryelreyes Date: Thu, 9 Nov 2023 13:16:56 +0100 Subject: [PATCH 10/11] Fixed documentation findings --- lib/APPRemoteControl/SerialMuxChannels.h | 6 +++--- lib/Service/Logging.h | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/APPRemoteControl/SerialMuxChannels.h b/lib/APPRemoteControl/SerialMuxChannels.h index b4b6b643..caeaddc1 100644 --- a/lib/APPRemoteControl/SerialMuxChannels.h +++ b/lib/APPRemoteControl/SerialMuxChannels.h @@ -88,14 +88,14 @@ typedef struct _CommandResponse /** Struct of the "Speed" channel payload. */ typedef struct _SpeedData { - int16_t left; /**< Left motor speed */ - int16_t right; /**< Right motor speed */ + int16_t left; /**< Left motor speed [steps/s] */ + int16_t right; /**< Right motor speed [steps/s] */ } __attribute__((packed)) SpeedData; /** Struct of the "Line Sensor" channel payload. */ typedef struct _LineSensorData { - uint16_t lineSensorData[5U]; /**< Line sensor data */ + uint16_t lineSensorData[5U]; /**< Line sensor data [digits] normalized to max 1000 digits. */ } __attribute__((packed)) LineSensorData; /****************************************************************************** diff --git a/lib/Service/Logging.h b/lib/Service/Logging.h index cd34d666..40eb09b8 100644 --- a/lib/Service/Logging.h +++ b/lib/Service/Logging.h @@ -43,27 +43,27 @@ #ifndef LOG_FATAL_ENABLE /** Enable/disable fatal log messages. */ #define LOG_FATAL_ENABLE (1) -#endif +#endif /* LOG_FATAL_ENABLE */ #ifndef LOG_ERROR_ENABLE /** Enable/disable error log messages. */ #define LOG_ERROR_ENABLE (1) -#endif +#endif /* LOG_ERROR_ENABLE */ #ifndef LOG_WARNING_ENABLE /** Enable/disable warning log messages. */ #define LOG_WARNING_ENABLE (1) -#endif +#endif /* LOG_WARNING_ENABLE */ #ifndef LOG_INFO_ENABLE /** Enable/disable info log messages. */ #define LOG_INFO_ENABLE (1) -#endif +#endif /* LOG_INFO_ENABLE */ #ifndef LOG_DEBUG_ENABLE /** Enable/disable debug log messages. */ #define LOG_DEBUG_ENABLE (0) -#endif +#endif /* LOG_DEBUG_ENABLE */ /****************************************************************************** * Includes From f5e669b5f413ff6dfa6428a17e0edb72390605dd Mon Sep 17 00:00:00 2001 From: gabryelreyes Date: Thu, 9 Nov 2023 17:08:53 +0100 Subject: [PATCH 11/11] Debug enabled in all applications. Before only in Sim --- lib/Service/Logging.h | 6 +++--- platformio.ini | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/Service/Logging.h b/lib/Service/Logging.h index 40eb09b8..7a58a50c 100644 --- a/lib/Service/Logging.h +++ b/lib/Service/Logging.h @@ -209,11 +209,11 @@ #if (0 == LOG_DEBUG_ENABLE) /** Log debug message. */ -#define LOG_DEBUG(_filename, _msg) (void)(_filename) +#define LOG_DEBUG(_filename, _msg) /** Log debug message with additional value. */ -#define LOG_DEBUG_VAL(_filename, _msg, _val) (void)(_filename) +#define LOG_DEBUG_VAL(_filename, _msg, _val) /** Log debug header. */ -#define LOG_DEBUG_HEAD(_filename) (void)(_filename) +#define LOG_DEBUG_HEAD(_filename) /** Log debug message, without line feed. */ #define LOG_DEBUG_MSG(_msg) /** Log debug tail. */ diff --git a/platformio.ini b/platformio.ini index c5029929..4e0b59e6 100644 --- a/platformio.ini +++ b/platformio.ini @@ -90,7 +90,6 @@ platform = native @ ~1.2.1 build_flags = -std=c++11 -DTARGET_NATIVE - -DLOG_DEBUG_ENABLE -I./lib/Webots/include/c -I./lib/Webots/include/cpp -L./lib/Webots/lib/controller @@ -135,6 +134,7 @@ extra_scripts = [app:ConvoyLeader] build_flags = ${common.build_flags} + -DLOG_DEBUG_ENABLE lib_deps = APPConvoyLeader Service @@ -178,6 +178,7 @@ extra_scripts = [app:LineFollower] build_flags = ${common.build_flags} + -DLOG_DEBUG_ENABLE lib_deps = APPLineFollower Service @@ -221,6 +222,7 @@ extra_scripts = [app:RemoteControl] build_flags = ${common.build_flags} + -DLOG_DEBUG_ENABLE lib_deps = APPRemoteControl Service