From 839938ffd2cb338992901e07deb7fa6b9603a975 Mon Sep 17 00:00:00 2001 From: Norbert Schulz Date: Thu, 31 Oct 2024 16:49:38 +0100 Subject: [PATCH] Applied review feedback https://github.com/BlueAndi/DroidControlShip/pull/185 --- config/buildmode.ini | 32 +++++++ doc/ROS2/setup/Agent.md | 4 +- .../src/Transports/CustomRosTransportBase.h | 6 +- .../src/Transports/CustomRosTransportTcp.cpp | 80 ++++++++++------- .../src/Transports/CustomRosTransportTcp.h | 85 +++++++++--------- .../src/Transports/CustomRosTransportUdp.h | 8 +- lib/WiFiNative/src/WiFiClient.h | 14 ++- lib/WiFiNative/src/WifiClient.cpp | 86 +++++++++++++------ platformio.ini | 34 ++++++-- 9 files changed, 230 insertions(+), 119 deletions(-) create mode 100644 config/buildmode.ini diff --git a/config/buildmode.ini b/config/buildmode.ini new file mode 100644 index 00000000..cbef9ae3 --- /dev/null +++ b/config/buildmode.ini @@ -0,0 +1,32 @@ +; ******************************************************************************** +; Build mode log configurations +; * debug: Standard debugging purposes during development. +; * release: The release build contains only the relevant user informations. +; * trace: Hardcore debugging by following e.g. method call hierarchy. +; ******************************************************************************** +[mode:debug_log] +build_flags = + -D LOG_DEBUG_ENABLE=1 + -D LOG_TRACE_ENABLE=0 + -D CONFIG_LOG_SEVERITY=Logging::LOG_LEVEL_DEBUG + +[mode:release_log] +build_flags = + -D LOG_DEBUG_ENABLE=0 + -D LOG_TRACE_ENABLE=0 + -D CONFIG_LOG_SEVERITY=Logging::LOG_LEVEL_INFO + +[mode:trace_log] +build_flags = + -D LOG_DEBUG_ENABLE=1 + -D LOG_TRACE_ENABLE=1 + -D CONFIG_LOG_SEVERITY=Logging::LOG_LEVEL_TRACE + +[mode:debug_native] +build_flags = + -O0 + -ggdb + +[mode:release_native] +build_flags = + -O2 \ No newline at end of file diff --git a/doc/ROS2/setup/Agent.md b/doc/ROS2/setup/Agent.md index 1e2257ac..165bc7d7 100644 --- a/doc/ROS2/setup/Agent.md +++ b/doc/ROS2/setup/Agent.md @@ -58,7 +58,9 @@ Start the MicroXRCEAgent binary to listen to **TCP** connections: ## Using the agent with the UDP interface > [!WARNING] -> Note: UDP ports on WSL are not working properly if you need to access them outside of the WSL VM. Use TCP with WSL instead. +> Note: UDP ports on WSL are not working properly if you need to access them outside of the WSL VM (Status 2024-10-31). Use TCP with WSL instead. +> See [https://github.com/micro-ROS/micro-ROS-Agent/issues/194](https://github.com/micro-ROS/micro-ROS-Agent/issues/194) for further details. +> The mentioned ```netsh`` tool for port proxy forwarding only supports TCP. Start the MicroXRCEAgent binary to listen to UDP connections: diff --git a/lib/APPTurtle/src/Transports/CustomRosTransportBase.h b/lib/APPTurtle/src/Transports/CustomRosTransportBase.h index a4e13085..a84fc84f 100644 --- a/lib/APPTurtle/src/Transports/CustomRosTransportBase.h +++ b/lib/APPTurtle/src/Transports/CustomRosTransportBase.h @@ -72,7 +72,7 @@ class CustomRosTransportBase * Destroys custom Micro-ROS transport. * */ - ~CustomRosTransportBase() + virtual ~CustomRosTransportBase() { } @@ -166,8 +166,8 @@ class CustomRosTransportBase static size_t read(uxrCustomTransport* transport, uint8_t* buffer, size_t size, int timeout, uint8_t* errorCode); /** - * Get protocol name used by this trandport. - * @return protocol name + * Get protocol name used by this transport. + * @return Protocol name */ virtual const String& getProtocolName() const = 0; diff --git a/lib/APPTurtle/src/Transports/CustomRosTransportTcp.cpp b/lib/APPTurtle/src/Transports/CustomRosTransportTcp.cpp index 758bddab..03aafe91 100644 --- a/lib/APPTurtle/src/Transports/CustomRosTransportTcp.cpp +++ b/lib/APPTurtle/src/Transports/CustomRosTransportTcp.cpp @@ -60,9 +60,10 @@ const String CustomRosTransportTcp::m_protocolName("TCP"); -const CustomRosTransportTcp::ReadFunc CustomRosTransportTcp::m_readFunction[MAX] = +const CustomRosTransportTcp::ReadFunc +CustomRosTransportTcp::m_readFunction[InputState::INPUT_STATE_MAX] = { - &CustomRosTransportTcp::readSizePrefix, + &CustomRosTransportTcp::readSizePrefix, &CustomRosTransportTcp::readPendingSizePrefix, &CustomRosTransportTcp::readPayload, &CustomRosTransportTcp::readFinish @@ -84,7 +85,7 @@ bool CustomRosTransportTcp::open(void) { bool isOpen = false; - if (!m_tcpClient.connect(m_address, m_port)) + if (0U == m_tcpClient.connect(m_address, m_port)) { LOG_ERROR("TCP connect error"); } @@ -113,22 +114,22 @@ size_t CustomRosTransportTcp::write(const uint8_t* buffer, size_t size, uint8_t* else { uint8_t lengthPrefix[2]; - lengthPrefix[0] = static_cast(size & 0xFF); - lengthPrefix[1] = static_cast((size >> 8) & 0xFF); + lengthPrefix[0] = static_cast(size & 0xFFU); + lengthPrefix[1] = static_cast((size >> 8U) & 0xFFU); if (sizeof(lengthPrefix) != m_tcpClient.write(lengthPrefix, sizeof(lengthPrefix))) { LOG_ERROR("Write prefix error (size=%zu, sent=%zu)", size, sent); - *errorCode = 1; + *errorCode = 1U; } else if ((sent = m_tcpClient.write(buffer, size)) != size) { LOG_ERROR("Write data error (size=%zu, sent=%zu)", size, sent); - *errorCode = 1; + *errorCode = 1U; } else { - *errorCode = 0; + *errorCode = 0U; } } @@ -148,30 +149,45 @@ size_t CustomRosTransportTcp::read(uint8_t* buffer, size_t size, int timeout, ui bool loop = true; /** - * Run receive state machine. + * Run receive state machine. * The read function relationships are: - * + * * read() -> [state]->read() -> readInternal() -> WifiClient */ - while (loop) + while (true == loop) { - loop = (this->*m_readFunction[m_inputState])(timeout, errorCode); + + if (InputState::INPUT_STATE_MAX > m_inputState) + { + ReadFunc stateReadFunc = m_readFunction[m_inputState]; /**< Get state dependend input reader. */ + + /* Read state dependend message portion. */ + loop = (this->*stateReadFunc)(timeout, errorCode); + } + else + { + LOG_FATAL("Invalid state %d", static_cast(m_inputState)); + *errorCode = 4U; + loop = false; + } } - if (InputState::FINISH == m_inputState) + if (InputState::INPUT_STATE_FINISH == m_inputState) { if (readBytes > size) { - /* internal error, request buffer would be overrun */ + /* Internal error, request buffer would be overrun. */ close(); - * errorCode = 3U; + *errorCode = 5U; } - else + else { + /* Provide payload to destination buffer. */ readBytes = m_payloadLen; memcpy(buffer, m_inputBuf, readBytes); - m_inputState = InputState::INIT; + /* Reset state machine*/ + m_inputState = InputState::INPUT_STATE_INIT; m_received = 0U; m_payloadLen = 0U; } @@ -192,7 +208,7 @@ size_t CustomRosTransportTcp::readInternal(uint8_t* buffer, size_t size, int tim readTimer.start(timeout); - while ((0 < remaining) && (false == timeOver)) + while ((0U < remaining) && (false == timeOver)) { int count = m_tcpClient.read(buffer, remaining); if (-1 == count) @@ -232,29 +248,29 @@ bool CustomRosTransportTcp::readSizePrefix(int timeout, uint8_t* errorCode) switch (readInternal(prefix, sizeof(prefix), timeout, errorCode)) { - case 0: /* nothing received */ - if (0 != *errorCode) + case 0U: /* nothing received */ + if (0U != *errorCode) { close(); } loop = false; break; - case 1: /* only low byte out of the 2 length prefix bytes received. */ + case 1U: /* only low byte out of the 2 length prefix bytes received. */ m_payloadLen = static_cast(prefix[0]); - m_inputState = InputState::PREFIX_1; + m_inputState = InputState::INPUT_STATE_PREFIX_1; loop = true; break; - case 2: /* 2 byte prefix received */ + case 2U: /* 2 byte prefix received */ m_payloadLen = static_cast(prefix[0]) + (static_cast(prefix[1]) << 8); m_received = 0U; - m_inputState = InputState::PLAY_LOAD; + m_inputState = InputState::INPUT_STATE_PLAYLOAD; loop = true; break; default: /* should never be possible but ...*/ - *errorCode = 2; + *errorCode = 2U; loop = false; break; } @@ -264,12 +280,12 @@ bool CustomRosTransportTcp::readSizePrefix(int timeout, uint8_t* errorCode) bool CustomRosTransportTcp::readPendingSizePrefix(int timeout, uint8_t* errorCode) { - bool loop = true; + bool loop = true; uint8_t prefix[1]; switch (readInternal(prefix, sizeof(prefix), timeout, errorCode)) { - case 0: /* nothing received */ + case 0U: /* nothing received */ if (0U != *errorCode) { close(); @@ -277,15 +293,15 @@ bool CustomRosTransportTcp::readPendingSizePrefix(int timeout, uint8_t* errorCod loop = false; break; - case 1: /* High byte received. */ + case 1U: /* High byte received. */ m_payloadLen |= (static_cast(prefix[0]) << 8); m_received = 0U; - m_inputState = InputState::PLAY_LOAD; + m_inputState = InputState::INPUT_STATE_PLAYLOAD; loop = true; break; default: /* should never be possible but ...*/ - *errorCode = 2; + *errorCode = 2U; loop = false; break; } @@ -295,7 +311,7 @@ bool CustomRosTransportTcp::readPendingSizePrefix(int timeout, uint8_t* errorCod bool CustomRosTransportTcp::readPayload(int timeout, uint8_t* errorCode) { - bool loop = true; + bool loop = true; size_t readByteCnt = readInternal(m_inputBuf + m_received, m_payloadLen - m_received, timeout, errorCode); if (0U < readByteCnt) @@ -304,7 +320,7 @@ bool CustomRosTransportTcp::readPayload(int timeout, uint8_t* errorCode) if (m_received == m_payloadLen) { /* record completed */ - m_inputState = InputState::FINISH; + m_inputState = InputState::INPUT_STATE_FINISH; } } else diff --git a/lib/APPTurtle/src/Transports/CustomRosTransportTcp.h b/lib/APPTurtle/src/Transports/CustomRosTransportTcp.h index a07803bf..b9699cb8 100644 --- a/lib/APPTurtle/src/Transports/CustomRosTransportTcp.h +++ b/lib/APPTurtle/src/Transports/CustomRosTransportTcp.h @@ -54,7 +54,7 @@ * Types and Classes *****************************************************************************/ -/** +/** * Map this transport to the class name used in MicroRosClient. * The used transport is a compile time decision and this typedef * avoids the use of ifdef's. @@ -66,15 +66,15 @@ typedef class CustomRosTransportTcp CustomRosTransport; * * TCP protocol uses a record format with a 16 bit length field before the * payload. - * + * * +----------------+----------------+---------------------+ * | 1 Byte | 1 Bytes | "Lenght" Bytes | * +----------------+----------------+---------------------+ * | Length [0..7] | Length [8..15] | < payload > | * +----------------+----------------+---------------------+ - * - * A state machine is used for reading the record format. - * + * + * A state machine is used for reading the record format. + * */ class CustomRosTransportTcp : public CustomRosTransportBase { @@ -82,10 +82,10 @@ class CustomRosTransportTcp : public CustomRosTransportBase /** * Constructs a custom Micro-ROS transport. */ - CustomRosTransportTcp() : - CustomRosTransportBase(), + CustomRosTransportTcp() : + CustomRosTransportBase(), m_tcpClient(), - m_inputState(InputState::INIT), + m_inputState(InputState::INPUT_STATE_INIT), m_payloadLen(0U), m_received(0U), m_inputBuf() @@ -96,15 +96,15 @@ class CustomRosTransportTcp : public CustomRosTransportBase * Destroys custom Micro-ROS transport. * */ - virtual ~CustomRosTransportTcp() final + ~CustomRosTransportTcp() { } - /** - * Get protocol name used by this trandport. - * @return protocol name + /** + * Get protocol name used by this transport. + * @return Protocol name */ - virtual const String& getProtocolName() const final + const String& getProtocolName() const final { return m_protocolName; } @@ -162,7 +162,7 @@ class CustomRosTransportTcp : public CustomRosTransportBase /** * Try to read 2 byte size prefix (low, high) in InputState::INIT - * + * * @param[in] timeout The timeout in milliseconds. * @param[out] errorCode Set the error code to != 0 on error. * @@ -172,9 +172,9 @@ class CustomRosTransportTcp : public CustomRosTransportBase /** * Try to read 2nd byte of size prefix (low, high) in InputState::PREFIX_1 - * + * * Used in the rare event that low level read only provided one byte. - * + * * @param[in] timeout The timeout in milliseconds. * @param[out] errorCode Set the error code to != 0 on error. * @@ -184,66 +184,67 @@ class CustomRosTransportTcp : public CustomRosTransportBase /** * Try payload bytes in InputState::PLAY_LOAD - * + * * Used in the rare event that low level read only provided one byte. - * + * * @param[in] timeout The timeout in milliseconds. * @param[out] errorCode Set the error code to != 0 on error. - * + * * @return true if statemachine shall reloop. */ bool readPayload(int timeout, uint8_t* errorCode); /** * Handle message complete in InputState::FINISH - * + * * Used in the rare event that low level read only provided one byte. - * + * * @param[in] timeout The timeout in milliseconds. * @param[out] errorCode Set the error code to != 0 on error. - * + * * @return true if statemachine shall reloop. */ bool readFinish(int timeout, uint8_t* errorCode); private: - WiFiClient m_tcpClient; /**< The TCP client. */ - static const String m_protocolName; /**< This protocol name. */ - + WiFiClient m_tcpClient; /**< The TCP client. */ + static const String m_protocolName; /**< This protocol name. */ + /** * Read buffer handling from streaming sockets to implement framing. * * Custom transports with framing support need a customized agent. * That is why the framing is implemented here to work with the - * "standard" tcpv4 agent protocol. + * "standard" tcpv4 agent protocol. */ - enum InputState { - INIT, /**< Input buffer ready for new record. */ - PREFIX_1, /**< First byte of 2 -Byte size prefix received. */ - PLAY_LOAD, /**< Collecting payload bytes. */ - FINISH, /**< Payload record is complete. */ - MAX /**< Enum Range value, not a true state. */ + enum InputState + { + INPUT_STATE_INIT = 0, /**< Input buffer ready for new record. */ + INPUT_STATE_PREFIX_1, /**< First byte of 2 -Byte size prefix received. */ + INPUT_STATE_PLAYLOAD, /**< Collecting payload bytes. */ + INPUT_STATE_FINISH, /**< Payload record is complete. */ + INPUT_STATE_MAX /**< Enum Range value, not a true state. */ }; - /** State dependent read function pointers + /** State dependent read function pointers * * @param[in] timeout Read timout in milliseconds. * @param[out] errorCode Read error code if != 0 - * - * return true if state machine shall reloop. - */ + * + * return true if state machine shall reloop. + */ typedef bool (CustomRosTransportTcp::*ReadFunc)(int timeout, uint8_t* errorCode); /** Read functions ponter array indexed by InputState. */ - static const ReadFunc m_readFunction[MAX]; + static const ReadFunc m_readFunction[InputState::INPUT_STATE_MAX]; - InputState m_inputState; /**< Actual input buffer status */ + InputState m_inputState; /**< Actual input buffer status */ - size_t m_payloadLen; /**< Number of bytes to read as payload. */ - size_t m_received; /**< Number of bytes received already */ + size_t m_payloadLen; /**< Number of bytes to read as payload. */ + size_t m_received; /**< Number of bytes received already */ - static const size_t MTU = 1024U; /**< Maximum supported transmission size.*/ - uint8_t m_inputBuf[MTU]; /**< Buffer for input record reading. */ + static const size_t MTU = 1024U; /**< Maximum supported transmission size.*/ + uint8_t m_inputBuf[MTU]; /**< Buffer for input record reading. */ }; /****************************************************************************** diff --git a/lib/APPTurtle/src/Transports/CustomRosTransportUdp.h b/lib/APPTurtle/src/Transports/CustomRosTransportUdp.h index 6929aa26..19da3fa1 100644 --- a/lib/APPTurtle/src/Transports/CustomRosTransportUdp.h +++ b/lib/APPTurtle/src/Transports/CustomRosTransportUdp.h @@ -80,15 +80,15 @@ class CustomRosTransportUdp : public CustomRosTransportBase * Destroys custom Micro-ROS transport. * */ - virtual ~CustomRosTransportUdp() final + ~CustomRosTransportUdp() { } /** - * Get protocol name used by this trandport. - * @return protocol name + * Get protocol name used by this transport. + * @return Protocol name */ - virtual const String& getProtocolName() const final + const String& getProtocolName() const final { return m_protocolName; } diff --git a/lib/WiFiNative/src/WiFiClient.h b/lib/WiFiNative/src/WiFiClient.h index 63aeede2..b5cdec44 100644 --- a/lib/WiFiNative/src/WiFiClient.h +++ b/lib/WiFiNative/src/WiFiClient.h @@ -106,10 +106,16 @@ class WiFiClient /** * Write bytes to stream. + * + * The write uses non blocking socket mode, but retries on a + * EWOULDBLOCK result. The constants SOCK_WRITE_RETRY and + * SOCK_WRITE_TMO_US define how often to retry and the + * time delay in between. * * @param[in] buffer Byte Array to send. * @param[in] size Length of Buffer. - * @returns Number of bytes written + * + * @returns Number of bytes written or 0 on error. */ size_t write(const uint8_t* buffer, size_t size); @@ -132,9 +138,11 @@ class WiFiClient int read(uint8_t* buffer, size_t size); private: - struct pollfd m_poll; /**< The poll/socket structure. */ + struct pollfd m_poll; /**< The poll/socket structure. */ - static const int SOCK_INVAL = -1; /**< The invalid socket value */ + static const int SOCK_INVAL = -1; /**< The invalid socket value. */ + static const uint32_t SOCK_WRITE_RETRY = 4U; /**< How often to retry sending. */ + static const uint32_t SOCK_WRITE_TMO_US = 250U; /**< Delay between write attemps. */ }; /****************************************************************************** diff --git a/lib/WiFiNative/src/WifiClient.cpp b/lib/WiFiNative/src/WifiClient.cpp index a526d113..f24c94b3 100644 --- a/lib/WiFiNative/src/WifiClient.cpp +++ b/lib/WiFiNative/src/WifiClient.cpp @@ -33,6 +33,7 @@ * Includes *****************************************************************************/ #include "WiFiClient.h" +#include #include #include @@ -52,16 +53,15 @@ * Local Variables *****************************************************************************/ - /****************************************************************************** * Public Methods *****************************************************************************/ uint8_t WiFiClient::connect(const IPAddress& addr, uint16_t port) { - uint8_t retval = 0; + uint8_t retval = 0U; - if (connected()) + if (0U != connected()) { stop(); } @@ -71,36 +71,54 @@ uint8_t WiFiClient::connect(const IPAddress& addr, uint16_t port) struct sockaddr_in serverAddr; memset(&serverAddr, 0, sizeof(serverAddr)); - serverAddr.sin_family = AF_INET; + serverAddr.sin_family = AF_INET; serverAddr.sin_addr.s_addr = htonl(addr); - serverAddr.sin_port = htons(port); + serverAddr.sin_port = htons(port); - if (0 == ::connect( - m_poll.fd, - reinterpret_cast(&serverAddr), - sizeof(serverAddr) )) + if (0 == ::connect(m_poll.fd, reinterpret_cast(&serverAddr), sizeof(serverAddr))) { const int one = 1; - - ::setsockopt(m_poll.fd, SOL_TCP, TCP_NODELAY, &one, sizeof(one)); - ::fcntl(m_poll.fd, F_SETFL, O_NONBLOCK); - retval = 1; /* success*/ + if (-1 == ::setsockopt(m_poll.fd, SOL_TCP, TCP_NODELAY, &one, sizeof(one))) + { + LOG_ERROR("%s:%s", "setsockopt", strerror(errno)); + } + else if (-1 == ::fcntl(m_poll.fd, F_SETFL, ::fcntl(m_poll.fd, F_GETFL) | O_NONBLOCK)) + { + LOG_ERROR("%s:%s", "fcntl", strerror(errno)); + } + else + { + retval = 1U; /* success*/ + } } else { - stop(); + LOG_ERROR("%s:%s", "connect", strerror(errno)); + } + + if (0U == retval) + { + stop(); /* One of the system calls above failed. */ } } + else + { + LOG_ERROR("%s:%s", "socket", strerror(errno)); + } return retval; } void WiFiClient::stop() { - if (connected()) + if (0U != connected()) { - ::close(m_poll.fd); + if (0 != ::close(m_poll.fd)) + { + LOG_ERROR("%s:%s", "close", strerror(errno)); + } + m_poll.fd = SOCK_INVAL; } } @@ -108,19 +126,31 @@ void WiFiClient::stop() size_t WiFiClient::write(const uint8_t* buffer, size_t size) { size_t remaining = size; - - if ((0 < size) && connected()) + uint32_t retries = 0; + + if ((0U < size) && (0U != connected())) { - while (0 < remaining) { - ssize_t written = ::send(m_poll.fd, buffer, remaining, 0); - - if (0 > written) /* error */ + while ((0U < remaining) && (retries < SOCK_WRITE_RETRY)) + { + ssize_t written = ::send(m_poll.fd, buffer, remaining, MSG_DONTWAIT); + if (0 > written) { - break; + if ((EAGAIN == errno) || (EWOULDBLOCK == errno)) + { + written = 0; /* Not an error, just retry indication. */ + usleep(SOCK_WRITE_TMO_US); + } + else + { + LOG_ERROR("%s:%s", "send", strerror(errno)); + break; + } } remaining -= written; buffer += written; + + ++retries; } } @@ -131,20 +161,20 @@ int WiFiClient::read(uint8_t* buffer, size_t size) { int retval = -1; - if (connected()) + if (0U != connected()) { if (-1 != ::poll(&m_poll, 1, 10)) { if (0 != (POLLIN & m_poll.revents)) { - ssize_t result = ::recv(m_poll.fd, buffer, size, 0); + ssize_t result = ::recv(m_poll.fd, buffer, size, 0); if (-1 != result) { - retval = result; /* Success! */ + retval = result; /* Success! */ } else { - perror("recv"); + LOG_ERROR("%s:%s", "recv", strerror(errno)); } } else @@ -154,7 +184,7 @@ int WiFiClient::read(uint8_t* buffer, size_t size) } else { - perror("poll"); + LOG_ERROR("%s:%s", "poll", strerror(errno)); } } diff --git a/platformio.ini b/platformio.ini index 891f6f51..2c7133d3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -14,6 +14,30 @@ [platformio] default_envs = ConvoyLeaderTarget, ConvoyLeaderSim +extra_configs = + config/buildmode.ini + +; ******************************************************************************** +; Select native build mode here! +; ******************************************************************************** +[mode:selected_native] +#extends = mode:debug_native +#build_flags = +# ${mode:debug_native.build_flags} + +extends = mode:release_native +build_flags = + ${mode:release_native.build_flags} + + +; ******************************************************************************** +; Select esp32 build mode here! +; ******************************************************************************** +[mode:selected_esp32] +extends = mode:debug_log +build_flags = + ${mode:debug_log.build_flags} + ; ***************************************************************************** ; Static check configuration ; ***************************************************************************** @@ -33,14 +57,14 @@ check_skip_packages = yes ; Target environment for ZumoComSystem. ; ***************************************************************************** [target:esp32] +extends = mode:selected_esp32 platform = espressif32 @ ~6.9.0 board = esp32doit-devkit-v1 board_build.filesystem = littlefs framework = arduino build_flags = + ${mode:selected_esp32.build_flags} -Wl,-Map,firmware.map - -D LOG_DEBUG_ENABLE=1 - -D CONFIG_LOG_SEVERITY=Logging::LOG_LEVEL_DEBUG -D CONFIG_FILE_PATH="\"/config/config.json\"" lib_deps = HALInterfaces @@ -71,14 +95,12 @@ monitor_filters = esp32_exception_decoder ; ***************************************************************************** [target:Sim] platform = native @ ~1.2.1 +extends = mode:selected_native build_flags = + ${mode:selected_native.build_flags} -std=c++11 - -O0 - -ggdb -D TRANSPORT_USE_TCP=1 -D TARGET_NATIVE - -D LOG_DEBUG_ENABLE=1 - -D CONFIG_LOG_SEVERITY=Logging::LOG_LEVEL_DEBUG -lmosquitto -I./lib/Webots/include/c -I./lib/Webots/include/cpp