diff --git a/gd32_emac_artnet_pixel_dmx_multi/firmware/main.cpp b/gd32_emac_artnet_pixel_dmx_multi/firmware/main.cpp index 3ef8cba..db17c02 100644 --- a/gd32_emac_artnet_pixel_dmx_multi/firmware/main.cpp +++ b/gd32_emac_artnet_pixel_dmx_multi/firmware/main.cpp @@ -245,15 +245,14 @@ void main() { display.Set(4, displayudf::Labels::UNIVERSE_PORT_A); display.Set(5, displayudf::Labels::DMX_DIRECTION); - StoreDisplayUdf storeDisplayUdf; - DisplayUdfParams displayUdfParams(&storeDisplayUdf); + DisplayUdfParams displayUdfParams; - if (displayUdfParams.Load()) { - displayUdfParams.Dump(); - displayUdfParams.Set(&display); - } + displayUdfParams.Load(); + displayUdfParams.Dump(); + displayUdfParams.Set(&display); display.Show(&node, DMXPORT_OFFSET); + display.Printf(7, "%s:%d G%d %s", PixelType::GetType(pixelDmxConfiguration.GetType()), pixelDmxConfiguration.GetCount(), @@ -270,10 +269,9 @@ void main() { StoreRemoteConfig storeRemoteConfig; RemoteConfigParams remoteConfigParams(&storeRemoteConfig); - if(remoteConfigParams.Load()) { - remoteConfigParams.Dump(); - remoteConfigParams.Set(&remoteConfig); - } + remoteConfigParams.Load(); + remoteConfigParams.Dump(); + remoteConfigParams.Set(&remoteConfig); while (configStore.Flash()) ; diff --git a/gd32_emac_artnet_pixel_multi/firmware/main.cpp b/gd32_emac_artnet_pixel_multi/firmware/main.cpp index 5011617..feaea41 100644 --- a/gd32_emac_artnet_pixel_multi/firmware/main.cpp +++ b/gd32_emac_artnet_pixel_multi/firmware/main.cpp @@ -197,15 +197,14 @@ void main() { display.Set(4, displayudf::Labels::UNIVERSE_PORT_A); display.Set(5, displayudf::Labels::BOARDNAME); - StoreDisplayUdf storeDisplayUdf; - DisplayUdfParams displayUdfParams(&storeDisplayUdf); + DisplayUdfParams displayUdfParams; - if (displayUdfParams.Load()) { - displayUdfParams.Dump(); - displayUdfParams.Set(&display); - } + displayUdfParams.Load(); + displayUdfParams.Dump(); + displayUdfParams.Set(&display); display.Show(&node, DMXPORT_OFFSET); + display.Printf(7, "%s:%d G%d %s", PixelType::GetType(pixelDmxConfiguration.GetType()), pixelDmxConfiguration.GetCount(), @@ -222,10 +221,9 @@ void main() { StoreRemoteConfig storeRemoteConfig; RemoteConfigParams remoteConfigParams(&storeRemoteConfig); - if(remoteConfigParams.Load()) { - remoteConfigParams.Dump(); - remoteConfigParams.Set(&remoteConfig); - } + remoteConfigParams.Load(); + remoteConfigParams.Dump(); + remoteConfigParams.Set(&remoteConfig); while (configStore.Flash()) ; diff --git a/gd32_emac_ddp_pixel_dmx_multi/firmware/main.cpp b/gd32_emac_ddp_pixel_dmx_multi/firmware/main.cpp index 874cc34..8bfe1a1 100644 --- a/gd32_emac_ddp_pixel_dmx_multi/firmware/main.cpp +++ b/gd32_emac_ddp_pixel_dmx_multi/firmware/main.cpp @@ -189,15 +189,14 @@ void main() { display.Set(5, displayudf::Labels::DEFAULT_GATEWAY); display.Set(6, displayudf::Labels::DMX_DIRECTION); - StoreDisplayUdf storeDisplayUdf; - DisplayUdfParams displayUdfParams(&storeDisplayUdf); + DisplayUdfParams displayUdfParams; - if (displayUdfParams.Load()) { - displayUdfParams.Dump(); - displayUdfParams.Set(&display); - } + displayUdfParams.Load(); + displayUdfParams.Dump(); + displayUdfParams.Set(&display); display.Show(); + display.Printf(7, "%s:%d G%d %s", PixelType::GetType(pixelDmxConfiguration.GetType()), pixelDmxConfiguration.GetCount(), @@ -214,10 +213,9 @@ void main() { StoreRemoteConfig storeRemoteConfig; RemoteConfigParams remoteConfigParams(&storeRemoteConfig); - if(remoteConfigParams.Load()) { - remoteConfigParams.Dump(); - remoteConfigParams.Set(&remoteConfig); - } + remoteConfigParams.Load(); + remoteConfigParams.Dump(); + remoteConfigParams.Set(&remoteConfig); while (configStore.Flash()) ; diff --git a/gd32_emac_ddp_pixel_multi/firmware/main.cpp b/gd32_emac_ddp_pixel_multi/firmware/main.cpp index 8e5b73e..327f810 100644 --- a/gd32_emac_ddp_pixel_multi/firmware/main.cpp +++ b/gd32_emac_ddp_pixel_multi/firmware/main.cpp @@ -161,15 +161,14 @@ void main() { display.Set(5, displayudf::Labels::DEFAULT_GATEWAY); display.Set(6, displayudf::Labels::BOARDNAME); - StoreDisplayUdf storeDisplayUdf; - DisplayUdfParams displayUdfParams(&storeDisplayUdf); + DisplayUdfParams displayUdfParams; - if (displayUdfParams.Load()) { - displayUdfParams.Dump(); - displayUdfParams.Set(&display); - } + displayUdfParams.Load(); + displayUdfParams.Dump(); + displayUdfParams.Set(&display); display.Show(); + display.Printf(7, "%s:%d G%d %s", PixelType::GetType(pixelDmxConfiguration.GetType()), pixelDmxConfiguration.GetCount(), @@ -186,10 +185,9 @@ void main() { StoreRemoteConfig storeRemoteConfig; RemoteConfigParams remoteConfigParams(&storeRemoteConfig); - if(remoteConfigParams.Load()) { - remoteConfigParams.Dump(); - remoteConfigParams.Set(&remoteConfig); - } + remoteConfigParams.Load(); + remoteConfigParams.Dump(); + remoteConfigParams.Set(&remoteConfig); while (configStore.Flash()) ; diff --git a/gd32_emac_e131_pixel_dmx_multi/firmware/main.cpp b/gd32_emac_e131_pixel_dmx_multi/firmware/main.cpp index 40c8c88..999054a 100644 --- a/gd32_emac_e131_pixel_dmx_multi/firmware/main.cpp +++ b/gd32_emac_e131_pixel_dmx_multi/firmware/main.cpp @@ -241,15 +241,14 @@ void main() { display.Set(5, displayudf::Labels::DEFAULT_GATEWAY); display.Set(6, displayudf::Labels::DMX_DIRECTION); - StoreDisplayUdf storeDisplayUdf; - DisplayUdfParams displayUdfParams(&storeDisplayUdf); + DisplayUdfParams displayUdfParams; - if (displayUdfParams.Load()) { - displayUdfParams.Dump(); - displayUdfParams.Set(&display); - } + displayUdfParams.Load(); + displayUdfParams.Dump(); + displayUdfParams.Set(&display); display.Show(&bridge, DMXPORT_OFFSET); + display.Printf(7, "%s:%d G%d %s", PixelType::GetType(pixelDmxConfiguration.GetType()), pixelDmxConfiguration.GetCount(), @@ -266,10 +265,9 @@ void main() { StoreRemoteConfig storeRemoteConfig; RemoteConfigParams remoteConfigParams(&storeRemoteConfig); - if(remoteConfigParams.Load()) { - remoteConfigParams.Dump(); - remoteConfigParams.Set(&remoteConfig); - } + remoteConfigParams.Load(); + remoteConfigParams.Dump(); + remoteConfigParams.Set(&remoteConfig); while (configStore.Flash()) ; diff --git a/gd32_emac_e131_pixel_multi/firmware/main.cpp b/gd32_emac_e131_pixel_multi/firmware/main.cpp index d63ff29..a12f7b7 100644 --- a/gd32_emac_e131_pixel_multi/firmware/main.cpp +++ b/gd32_emac_e131_pixel_multi/firmware/main.cpp @@ -189,15 +189,14 @@ void main() { display.Set(5, displayudf::Labels::UNIVERSE_PORT_A); display.Set(6, displayudf::Labels::BOARDNAME); - StoreDisplayUdf storeDisplayUdf; - DisplayUdfParams displayUdfParams(&storeDisplayUdf); + DisplayUdfParams displayUdfParams; - if (displayUdfParams.Load()) { - displayUdfParams.Dump(); - displayUdfParams.Set(&display); - } + displayUdfParams.Load(); + displayUdfParams.Dump(); + displayUdfParams.Set(&display); display.Show(&bridge); + display.Printf(7, "%s:%d G%d %s", PixelType::GetType(pixelDmxConfiguration.GetType()), pixelDmxConfiguration.GetCount(), @@ -214,10 +213,9 @@ void main() { StoreRemoteConfig storeRemoteConfig; RemoteConfigParams remoteConfigParams(&storeRemoteConfig); - if (remoteConfigParams.Load()) { - remoteConfigParams.Dump(); - remoteConfigParams.Set(&remoteConfig); - } + remoteConfigParams.Load(); + remoteConfigParams.Dump(); + remoteConfigParams.Set(&remoteConfig); while (configStore.Flash()) ; diff --git a/lib-configstore/Rules.mk b/lib-configstore/Rules.mk old mode 100644 new mode 100755 index e9e9790..d2e044c --- a/lib-configstore/Rules.mk +++ b/lib-configstore/Rules.mk @@ -38,11 +38,6 @@ ifneq ($(MAKE_FLAGS),) EXTRA_INCLUDES+=../lib-remoteconfig/include endif - ifeq ($(findstring DISPLAY_UDF,$(MAKE_FLAGS)), DISPLAY_UDF) - EXTRA_SRCDIR+=src/displayudf - EXTRA_INCLUDES+=../lib-displayudf/include - endif - ifeq ($(findstring NODE_ARTNET,$(MAKE_FLAGS)), NODE_ARTNET) EXTRA_SRCDIR+=src/artnet EXTRA_INCLUDES+=../lib-artnet/include @@ -57,14 +52,6 @@ ifneq ($(MAKE_FLAGS),) EXTRA_INCLUDES+=../lib-e131/include endif - ifeq ($(findstring NODE_LTC_SMPTE,$(MAKE_FLAGS)), NODE_LTC_SMPTE) - EXTRA_SRCDIR+=src/ltc - EXTRA_INCLUDES+=../lib-ltc/include ../lib-tcnet/include - EXTRA_INCLUDES+=../lib-gps/include - EXTRA_INCLUDES+=../lib-rgbpanel/include - EXTRA_INCLUDES+=../lib-ws28xx/include - endif - ifeq ($(findstring NODE_NODE,$(MAKE_FLAGS)), NODE_NODE) EXTRA_SRCDIR+=src/node EXTRA_INCLUDES+=../lib-node/include ../lib-artnet/include ../lib-e131/include @@ -122,10 +109,6 @@ else EXTRA_INCLUDES+=../lib-e131/include EXTRA_SRCDIR+=src/node EXTRA_INCLUDES+=../lib-node/include ../lib-rdmdiscovery/include - EXTRA_SRCDIR+=src/ltc - EXTRA_INCLUDES+=../lib-ltc/include ../lib-tcnet/include - EXTRA_INCLUDES+=../lib-gps/include - EXTRA_INCLUDES+=../lib-rgbpanel/include endif EXTRA_INCLUDES+=../lib-ws28xx/include @@ -139,6 +122,5 @@ else endif EXTRA_INCLUDES+=../lib-displayudf/include ../lib-display/include -EXTRA_INCLUDES+=../lib-dmxsend/include EXTRA_INCLUDES+=../lib-dmxreceiver/include ../lib-dmx/include EXTRA_INCLUDES+=../lib-device/include \ No newline at end of file diff --git a/lib-configstore/device/i2c/storedevice.cpp b/lib-configstore/device/i2c/storedevice.cpp old mode 100644 new mode 100755 diff --git a/lib-configstore/device/rom/storedevice.cpp b/lib-configstore/device/rom/storedevice.cpp old mode 100644 new mode 100755 diff --git a/lib-configstore/device/spi/storedevice.cpp b/lib-configstore/device/spi/storedevice.cpp old mode 100644 new mode 100755 diff --git a/lib-configstore/include/configstore.h b/lib-configstore/include/configstore.h old mode 100644 new mode 100755 diff --git a/lib-configstore/include/storeartnet.h b/lib-configstore/include/storeartnet.h old mode 100644 new mode 100755 diff --git a/lib-configstore/include/storedevice.h b/lib-configstore/include/storedevice.h old mode 100644 new mode 100755 diff --git a/lib-configstore/include/storee131.h b/lib-configstore/include/storee131.h old mode 100644 new mode 100755 diff --git a/lib-configstore/include/storenetwork.h b/lib-configstore/include/storenetwork.h old mode 100644 new mode 100755 diff --git a/lib-configstore/include/storepixeldmx.h b/lib-configstore/include/storepixeldmx.h old mode 100644 new mode 100755 diff --git a/lib-configstore/include/storeremoteconfig.h b/lib-configstore/include/storeremoteconfig.h old mode 100644 new mode 100755 diff --git a/lib-configstore/src/artnet/storeartnet.cpp b/lib-configstore/src/artnet/storeartnet.cpp old mode 100644 new mode 100755 diff --git a/lib-configstore/src/configstore.cpp b/lib-configstore/src/configstore.cpp old mode 100644 new mode 100755 diff --git a/lib-configstore/src/e131/storee131.cpp b/lib-configstore/src/e131/storee131.cpp old mode 100644 new mode 100755 diff --git a/lib-configstore/src/pixel/storepixeldmx.cpp b/lib-configstore/src/pixel/storepixeldmx.cpp old mode 100644 new mode 100755 diff --git a/lib-configstore/src/platform_configstore.h b/lib-configstore/src/platform_configstore.h old mode 100644 new mode 100755 diff --git a/lib-configstore/src/storedisplayudf.cpp b/lib-configstore/src/storedisplayudf.cpp deleted file mode 100644 index ac5e8f2..0000000 --- a/lib-configstore/src/storedisplayudf.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @file storedisplayudf.cpp - * - */ -/* Copyright (C) 2019-2020 by Arjan van Vught mailto:info@orangepi-dmx.nl - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "storedisplayudf.h" - -#include "debug.h" - -StoreDisplayUdf *StoreDisplayUdf::s_pThis = nullptr; - -StoreDisplayUdf::StoreDisplayUdf() { - DEBUG_ENTRY - - assert(s_pThis == nullptr); - s_pThis = this; - - DEBUG_PRINTF("%p", reinterpret_cast(s_pThis)); - DEBUG_EXIT -} diff --git a/lib-displayudf/include/displayudfparams.h b/lib-displayudf/include/displayudfparams.h index 63ae980..5582679 100644 --- a/lib-displayudf/include/displayudfparams.h +++ b/lib-displayudf/include/displayudfparams.h @@ -48,19 +48,11 @@ struct Mask { }; } // namespace displayudfparams -class DisplayUdfParamsStore { -public: - virtual ~DisplayUdfParamsStore() = default; - - virtual void Update(const struct displayudfparams::Params *ptDisplayUdfParams)=0; - virtual void Copy(struct displayudfparams::Params *ptDisplayUdfParams)=0; -}; - class DisplayUdfParams { public: - DisplayUdfParams(DisplayUdfParamsStore *pDisplayUdfParamsStore); + DisplayUdfParams(); - bool Load(); + void Load(); void Load(const char *pBuffer, uint32_t nLength); void Builder(const struct displayudfparams::Params *ptDisplayUdfParams, char *pBuffer, uint32_t nLength, uint32_t& nSize); @@ -81,7 +73,6 @@ class DisplayUdfParams { } private: - DisplayUdfParamsStore *m_pDisplayUdfParamsStore; displayudfparams::Params m_tDisplayUdfParams; }; diff --git a/lib-configstore/include/storedisplayudf.h b/lib-displayudf/include/storedisplayudf.h old mode 100644 new mode 100755 similarity index 73% rename from lib-configstore/include/storedisplayudf.h rename to lib-displayudf/include/storedisplayudf.h index 5124125..ea01bae --- a/lib-configstore/include/storedisplayudf.h +++ b/lib-displayudf/include/storedisplayudf.h @@ -2,7 +2,7 @@ * @file storedisplayudf.h * */ -/* Copyright (C) 2019-2022 by Arjan van Vught mailto:info@orangepi-dmx.nl +/* Copyright (C) 2019-2023 by Arjan van Vught mailto:info@orangepi-dmx.nl * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -27,27 +27,31 @@ #define STOREDISPLAYUDF_H_ #include "displayudfparams.h" - #include "configstore.h" -class StoreDisplayUdf final: public DisplayUdfParamsStore { +class StoreDisplayUdf { public: - StoreDisplayUdf(); - - void Update(const struct displayudfparams::Params *pDisplayUdfParams) override { - ConfigStore::Get()->Update(configstore::Store::DISPLAYUDF, pDisplayUdfParams, sizeof(struct displayudfparams::Params)); + static StoreDisplayUdf& Get() { + static StoreDisplayUdf instance; + return instance; } - void Copy(struct displayudfparams::Params *pDisplayUdfParams) override { - ConfigStore::Get()->Copy(configstore::Store::DISPLAYUDF, pDisplayUdfParams, sizeof(struct displayudfparams::Params)); + static void Update(const struct displayudfparams::Params *pDisplayUdfParams) { + Get().IUpdate(pDisplayUdfParams); } - static StoreDisplayUdf *Get() { - return s_pThis; + static void Copy(struct displayudfparams::Params *pDisplayUdfParams) { + Get().ICopy(pDisplayUdfParams); } private: - static StoreDisplayUdf *s_pThis; + void IUpdate(const struct displayudfparams::Params *pDisplayUdfParams) { + ConfigStore::Get()->Update(configstore::Store::DISPLAYUDF, pDisplayUdfParams, sizeof(struct displayudfparams::Params)); + } + + void ICopy(struct displayudfparams::Params *pDisplayUdfParams) { + ConfigStore::Get()->Copy(configstore::Store::DISPLAYUDF, pDisplayUdfParams, sizeof(struct displayudfparams::Params)); + } }; #endif /* STOREDISPLAYUDF_H_ */ diff --git a/lib-displayudf/src/displayudfparams.cpp b/lib-displayudf/src/displayudfparams.cpp index 00e122a..d97e004 100644 --- a/lib-displayudf/src/displayudfparams.cpp +++ b/lib-displayudf/src/displayudfparams.cpp @@ -46,12 +46,13 @@ #include "displayudfparams.h" #include "displayudfparamsconst.h" +#include "storedisplayudf.h" + #include "networkparamsconst.h" #include "lightsetparamsconst.h" #include "readconfigfile.h" #include "sscan.h" - #include "propertiesbuilder.h" #include "display.h" @@ -140,31 +141,31 @@ static constexpr const char *pArray[static_cast(Labels::UNKNOWN)] = { # undef MAX_ARRAY #endif -DisplayUdfParams::DisplayUdfParams(DisplayUdfParamsStore *pDisplayUdfParamsStore): m_pDisplayUdfParamsStore(pDisplayUdfParamsStore) { +DisplayUdfParams::DisplayUdfParams() { + DEBUG_ENTRY + memset(&m_tDisplayUdfParams, 0, sizeof(struct displayudfparams::Params)); m_tDisplayUdfParams.nSleepTimeout = display::Defaults::SEEP_TIMEOUT; m_tDisplayUdfParams.nIntensity = defaults::INTENSITY; + + DEBUG_EXIT } -bool DisplayUdfParams::Load() { +void DisplayUdfParams::Load() { + DEBUG_ENTRY + m_tDisplayUdfParams.nSetList = 0; #if !defined(DISABLE_FS) ReadConfigFile configfile(DisplayUdfParams::staticCallbackFunction, this); if (configfile.Read(DisplayUdfParamsConst::FILE_NAME)) { - if (m_pDisplayUdfParamsStore != nullptr) { - m_pDisplayUdfParamsStore->Update(&m_tDisplayUdfParams); - } + StoreDisplayUdf::Update(&m_tDisplayUdfParams); } else #endif - if (m_pDisplayUdfParamsStore != nullptr) { - m_pDisplayUdfParamsStore->Copy(&m_tDisplayUdfParams); - } else { - return false; - } + StoreDisplayUdf::Copy(&m_tDisplayUdfParams); - return true; + DEBUG_EXIT } void DisplayUdfParams::Load(const char *pBuffer, uint32_t nLength) { @@ -179,8 +180,7 @@ void DisplayUdfParams::Load(const char *pBuffer, uint32_t nLength) { config.Read(pBuffer, nLength); - assert(m_pDisplayUdfParamsStore != nullptr); - m_pDisplayUdfParamsStore->Update(&m_tDisplayUdfParams); + StoreDisplayUdf::Update(&m_tDisplayUdfParams); DEBUG_EXIT } @@ -241,7 +241,7 @@ void DisplayUdfParams::Builder(const struct displayudfparams::Params *ptDisplayU memcpy(&m_tDisplayUdfParams, ptDisplayUdfParams, sizeof(struct displayudfparams::Params)); } else { assert(m_pDisplayUdfParamsStore != nullptr); - m_pDisplayUdfParamsStore->Copy(&m_tDisplayUdfParams); + StoreDisplayUdf::Copy(&m_tDisplayUdfParams); } PropertiesBuilder builder(DisplayUdfParamsConst::FILE_NAME, pBuffer, nLength); diff --git a/lib-remoteconfig/include/remoteconfigparams.h b/lib-remoteconfig/include/remoteconfigparams.h index 81daedb..95e4286 100644 --- a/lib-remoteconfig/include/remoteconfigparams.h +++ b/lib-remoteconfig/include/remoteconfigparams.h @@ -62,7 +62,7 @@ class RemoteConfigParams { public: RemoteConfigParams(RemoteConfigParamsStore *pRemoteConfigParamsStore); - bool Load(); + void Load(); void Load(const char *pBuffer, uint32_t nLength); void Builder(const struct TRemoteConfigParams *pRemoteConfigParams, char *pBuffer, uint32_t nLength, uint32_t& nSize); diff --git a/lib-remoteconfig/src/remoteconfig.cpp b/lib-remoteconfig/src/remoteconfig.cpp index eba7cc7..f6d0884 100644 --- a/lib-remoteconfig/src/remoteconfig.cpp +++ b/lib-remoteconfig/src/remoteconfig.cpp @@ -746,7 +746,7 @@ void RemoteConfig::HandleGetDevicesTxt(uint32_t& nSize) { void RemoteConfig::HandleGetLtcTxt(uint32_t& nSize) { DEBUG_ENTRY - LtcParams ltcParams(StoreLtc::Get()); + LtcParams ltcParams; ltcParams.Save(s_pUdpBuffer, remoteconfig::udp::BUFFER_SIZE, nSize); DEBUG_EXIT @@ -755,7 +755,7 @@ void RemoteConfig::HandleGetLtcTxt(uint32_t& nSize) { void RemoteConfig::HandleGetLdisplayTxt(uint32_t& nSize) { DEBUG_ENTRY - LtcDisplayParams ltcDisplayParams(StoreLtcDisplay::Get()); + LtcDisplayParams ltcDisplayParams; ltcDisplayParams.Save(s_pUdpBuffer, remoteconfig::udp::BUFFER_SIZE, nSize); DEBUG_EXIT @@ -782,7 +782,7 @@ void RemoteConfig::HandleGetGpsTxt(uint32_t& nSize) { void RemoteConfig::HandleGetLtcEtcTxt(uint32_t& nSize) { DEBUG_ENTRY - LtcEtcParams ltcEtcParams(StoreLtcEtc::Get()); + LtcEtcParams ltcEtcParams; ltcEtcParams.Save(s_pUdpBuffer, remoteconfig::udp::BUFFER_SIZE, nSize); DEBUG_EXIT @@ -804,7 +804,7 @@ void RemoteConfig::HandleGetMonTxt(uint32_t& nSize) { void RemoteConfig::HandleGetDisplayTxt(uint32_t& nSize) { DEBUG_ENTRY - DisplayUdfParams displayParams(StoreDisplayUdf::Get()); + DisplayUdfParams displayParams; displayParams.Save(s_pUdpBuffer, remoteconfig::udp::BUFFER_SIZE, nSize); DEBUG_EXIT @@ -1092,9 +1092,7 @@ void RemoteConfig::HandleSetDevicesTxt() { void RemoteConfig::HandleSetLtcTxt() { DEBUG_ENTRY - assert(StoreLtc::Get() != nullptr); - LtcParams ltcParams(StoreLtc::Get()); - + LtcParams ltcParams; ltcParams.Load(s_pUdpBuffer, m_nBytesReceived); #ifndef NDEBUG ltcParams.Dump(); @@ -1106,9 +1104,7 @@ void RemoteConfig::HandleSetLtcTxt() { void RemoteConfig::HandleSetLdisplayTxt() { DEBUG_ENTRY - assert(StoreLtcDisplay::Get() != nullptr); - LtcDisplayParams ltcDisplayParams(StoreLtcDisplay::Get()); - + LtcDisplayParams ltcDisplayParams; ltcDisplayParams.Load(s_pUdpBuffer, m_nBytesReceived); #ifndef NDEBUG ltcDisplayParams.Dump(); @@ -1144,9 +1140,7 @@ void RemoteConfig::HandleSetGpsTxt() { void RemoteConfig::HandleSetLtcEtcTxt() { DEBUG_ENTRY - assert(StoreLtcEtc::Get() != nullptr); - LtcEtcParams ltcEtcParams(StoreLtcEtc::Get()); - + LtcEtcParams ltcEtcParams; ltcEtcParams.Load(s_pUdpBuffer, m_nBytesReceived); #ifndef NDEBUG ltcEtcParams.Dump(); @@ -1174,9 +1168,7 @@ void RemoteConfig::HandleSetMonTxt() { void RemoteConfig::HandleSetDisplayTxt() { DEBUG_ENTRY - assert(StoreDisplayUdf::Get() != nullptr); - DisplayUdfParams displayParams(StoreDisplayUdf::Get()); - + DisplayUdfParams displayParams; displayParams.Load(s_pUdpBuffer, m_nBytesReceived); #ifndef NDEBUG displayParams.Dump(); diff --git a/lib-remoteconfig/src/remoteconfigparams.cpp b/lib-remoteconfig/src/remoteconfigparams.cpp index 89945d7..dde144c 100644 --- a/lib-remoteconfig/src/remoteconfigparams.cpp +++ b/lib-remoteconfig/src/remoteconfigparams.cpp @@ -2,7 +2,7 @@ * @file remoteconfigparams.cpp * */ -/* Copyright (C) 2019-2021 by Arjan van Vught mailto:info@orangepi-dmx.nl +/* Copyright (C) 2019-2023 by Arjan van Vught mailto:info@orangepi-dmx.nl * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -46,7 +46,7 @@ RemoteConfigParams::RemoteConfigParams(RemoteConfigParamsStore* pTRemoteConfigPa memset(&m_tRemoteConfigParams, 0, sizeof(struct TRemoteConfigParams)); } -bool RemoteConfigParams::Load() { +void RemoteConfigParams::Load() { m_tRemoteConfigParams.nSetList = 0; #if !defined(DISABLE_FS) @@ -61,11 +61,7 @@ bool RemoteConfigParams::Load() { #endif if (m_pRemoteConfigParamsStore != nullptr) { m_pRemoteConfigParamsStore->Copy(&m_tRemoteConfigParams); - } else { - return false; } - - return true; } void RemoteConfigParams::Load(const char* pBuffer, uint32_t nLength) {