diff --git a/receivers/native/arduino/src/main/c++/arduino/uart-module/UartModule.hpp b/receivers/native/arduino/src/main/c++/arduino/uart-module/UartModule.hpp index 375014822..97c7f6154 100644 --- a/receivers/native/arduino/src/main/c++/arduino/uart-module/UartModule.hpp +++ b/receivers/native/arduino/src/main/c++/arduino/uart-module/UartModule.hpp @@ -61,15 +61,15 @@ class UartModule : public ZscriptModule { static void execute(ZscriptCommandContext ctx, uint8_t bottomBits) { switch (bottomBits) { - case uart_module::ZscriptUartCapabilitiesCommand::CODE: - uart_module::ZscriptUartCapabilitiesCommand::execute(ctx); + case uart_module::UartCapabilitiesCommand::CODE: + uart_module::UartCapabilitiesCommand::execute(ctx); break; #ifdef ZSCRIPT_HAVE_UART_CHANNEL - case uart_module::ZscriptUartChannelInfoCommand::CODE: - uart_module::ZscriptUartChannelInfoCommand::execute(ctx); + case uart_module::UartChannelInfoCommand::CODE: + uart_module::UartChannelInfoCommand::execute(ctx); break; - case uart_module::ZscriptUartChannelSetupCommand::CODE: - uart_module::ZscriptUartChannelSetupCommand::execute(ctx); + case uart_module::UartChannelSetupCommand::CODE: + uart_module::UartChannelSetupCommand::execute(ctx); break; #endif default: diff --git a/receivers/native/arduino/src/main/c++/arduino/uart-module/channels/UartChannel.hpp b/receivers/native/arduino/src/main/c++/arduino/uart-module/channels/UartChannel.hpp index 6b32d0631..d621702e1 100644 --- a/receivers/native/arduino/src/main/c++/arduino/uart-module/channels/UartChannel.hpp +++ b/receivers/native/arduino/src/main/c++/arduino/uart-module/channels/UartChannel.hpp @@ -126,7 +126,7 @@ class UartChannel : public ZscriptChannel { } UartChannel() : - buffer(), ZscriptChannel(&out, &tBuffer, uart_module::MODULE_FULL_ID, true), + ZscriptChannel(&out, &tBuffer, uart_module::MODULE_FULL_ID, true), tBuffer(buffer, ZP::uartChannelBufferSize), tokenizer(tBuffer.getWriter(), 2), usingTmp(false) { } diff --git a/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartCapabilitiesCommand.hpp b/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartCapabilitiesCommand.hpp index 290a67b65..fc38308ad 100644 --- a/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartCapabilitiesCommand.hpp +++ b/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartCapabilitiesCommand.hpp @@ -20,7 +20,7 @@ namespace Zscript { namespace uart_module { template -class ZscriptUartCapabilitiesCommand: public Capabilities_CommandDefs { +class UartCapabilitiesCommand: public Capabilities_CommandDefs { public: static void execute(ZscriptCommandContext ctx) { CommandOutStream out = ctx.getOutStream(); diff --git a/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartChannelInfo.hpp b/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartChannelInfo.hpp index 9bc6d31fe..27c119def 100644 --- a/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartChannelInfo.hpp +++ b/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartChannelInfo.hpp @@ -28,14 +28,14 @@ class ZscriptUartOutStream; namespace uart_module { template -class ZscriptUartChannelInfoCommand : public ChannelInfo_CommandDefs { +class UartChannelInfoCommand : public ChannelInfo_CommandDefs { public: static void execute(ZscriptCommandContext ctx) { uint16_t channelIndex; if (!ctx.getReqdFieldCheckLimit(ReqChannel__C, Zscript::zscript.getChannelCount(), &channelIndex)) { return; } - UartChannel *selectedChannel = Zscript::zscript.getChannels()[channelIndex]; + UartChannel *selectedChannel = (UartChannel *) Zscript::zscript.getChannels()[channelIndex]; if (selectedChannel->getAssociatedModule() != MODULE_FULL_ID) { ctx.status(ResponseStatus::VALUE_UNSUPPORTED); return; @@ -60,10 +60,8 @@ class ZscriptUartChannelInfoCommand : public ChannelInfo_CommandDefs { out.writeField(RespBitsetCapabilities__B, (parity & 0x2 ? RespBitsetCapabilities_Values::parityOn_field : 0) | (parity & 0x1 ? RespBitsetCapabilities_Values::parityOdd_field : 0) - | (stopBits? RespBitsetCapabilities_Values::doubleStop_field : 0) + | (stopBits ? RespBitsetCapabilities_Values::doubleStop_field : 0) ); - - out.writeField(RespBitsetCapabilities__B, RespBitsetCapabilities_Values::parityOn_field | RespBitsetCapabilities_Values::doubleStop_field); } }; diff --git a/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartChannelSetup.hpp b/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartChannelSetup.hpp index dad0a9dba..d763a866e 100644 --- a/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartChannelSetup.hpp +++ b/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartChannelSetup.hpp @@ -27,7 +27,7 @@ class ZscriptUartOutStream; namespace uart_module { template -class ZscriptUartChannelSetupCommand : public ChannelSetup_CommandDefs { +class UartChannelSetupCommand : public ChannelSetup_CommandDefs { public: static void execute(ZscriptCommandContext ctx) { uint16_t channelIndex; @@ -35,7 +35,7 @@ class ZscriptUartChannelSetupCommand : public ChannelSetup_CommandDefs { return; } - UartChannel *selectedChannel = Zscript::zscript.getChannels()[channelIndex]; + auto selectedChannel = (UartChannel *) Zscript::zscript.getChannels()[channelIndex]; if (selectedChannel->getAssociatedModule() != MODULE_FULL_ID) { ctx.status(ResponseStatus::VALUE_UNSUPPORTED); return; diff --git a/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartUtil.hpp b/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartUtil.hpp index dd18755b5..5b60444be 100644 --- a/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartUtil.hpp +++ b/receivers/native/arduino/src/main/c++/arduino/uart-module/commands/UartUtil.hpp @@ -16,7 +16,10 @@ class UartUtil { public: static void writeFrequencySelection(CommandOutStream out, uint8_t freqIndex) { const uint32_t maxBaud = ZP::uartSupportedFreqs[freqIndex]; - uint8_t maxBaudBytes[4]{(maxBaud >> 24) & 0xff, (maxBaud >> 16) & 0xff, (maxBaud >> 8) & 0xff, (maxBaud) & 0xff}; + uint8_t maxBaudBytes[4]{(uint8_t) ((maxBaud >> 24) & 0xff), + (uint8_t) ((maxBaud >> 16) & 0xff), + (uint8_t) ((maxBaud >> 8) & 0xff), + (uint8_t) ((maxBaud) & 0xff)}; out.writeBigHex(maxBaudBytes, 4); } };