diff --git a/include/rc_devices.h b/include/rc_devices.h index 288b753..2d274f2 100644 --- a/include/rc_devices.h +++ b/include/rc_devices.h @@ -25,7 +25,7 @@ struct PollinSwitch : Switch { : Switch(nullptr, [group, channel]{ // copy id from string into a new pointer, to avoid memory leaks return (new string{Protocol_1::buildId(group, channel)})->c_str(); - }()), group(group), channel(channel) { + }()), group(group), channel(channel) { // cppcheck-suppress [selfInitialization] if (!name) name = (new string{string(man).append(" ").append(id)})->c_str(); mainDevice = &DeviceConfig::create(id).withName(name).withManufacturer(man).withArea(area).withParent(gatewayDevice); withStateTopic(); @@ -41,8 +41,8 @@ struct PollinSwitch : Switch { }; struct EasyHomeSwitch : Switch { - uint32_t on[8] = { 4326554, 4537114, 4767530, 4972714 }; - uint32_t off[8] = { 4483146, 4626810, 4661562, 4819642 }; + uint32_t on[8] = { 4326554, 4537114, 4767530, 4972714, 0, 0, 0, 0 }; + uint32_t off[8] = { 4483146, 4626810, 4661562, 4819642, 0, 0, 0, 0 }; EasyHomeSwitch(const char remotePosition, uint32_t on[4], uint32_t off[4], const char* name = nullptr, const char* area = nullptr) : Switch(nullptr, [remotePosition] { @@ -50,8 +50,8 @@ struct EasyHomeSwitch : Switch { (*uId) += tolower(remotePosition); return uId->c_str(); }()) { - memcpy(&this->on[4], on, 4 * sizeof(uint32_t)); - memcpy(&this->off[4], off, 4 * sizeof(uint32_t)); + memcpy(&this->on[4], on, 4 * sizeof(uint32_t)); // cppcheck-suppress [overlappingWriteFunction] + memcpy(&this->off[4], off, 4 * sizeof(uint32_t)); // cppcheck-suppress [overlappingWriteFunction] if (!name) { auto n = new string("Easy Home "); (*n) += remotePosition; diff --git a/platformio.ini b/platformio.ini index 8c108dc..a71fb66 100644 --- a/platformio.ini +++ b/platformio.ini @@ -21,7 +21,7 @@ lib_deps = https://git.hodos.ro/libraries/serial-reader.git@^1.0.0 build_flags = -D DEBUG_RAW=0 check_tool = cppcheck -check_flags = --enable=all cppcheck: --suppress=*:*/.pio/* +check_flags = --enable=all cppcheck: --suppress=*:*/.pio/* --inline-suppr check_skip_packages = yes [env:huzzah] diff --git a/src/gateway.cpp b/src/gateway.cpp index 77bc713..dccefdd 100644 --- a/src/gateway.cpp +++ b/src/gateway.cpp @@ -1,4 +1,3 @@ -#include #include #include #include "pins.h"