22 * @file configstore.h
33 *
44 */
5- /* Copyright (C) 2025 by Arjan van Vught mailto:info@gd32-dmx.org
5+ /* Copyright (C) 2025-2026 by Arjan van Vught mailto:info@gd32-dmx.org
66 *
77 * Permission is hereby granted, free of charge, to any person obtaining a copy
88 * of this software and associated documentation files (the "Software"), to deal
@@ -211,9 +211,9 @@ class ConfigStore : StoreDevice
211211 void SetFlagDmxSend (uint32_t flag) { SetFlagInternal (GetStore ()->dmx_send , &common::store::DmxSend::flags, flag); }
212212 void SetFlagDmxLed (uint32_t flag) { SetFlagInternal (GetStore ()->dmx_led , &common::store::DmxLed::flags, flag); }
213213 void SetFlagDmxPwm (uint32_t flag) { SetFlagInternal (GetStore ()->dmx_pwm , &common::store::DmxPwm::flags, flag); }
214- void SetFlagDmxSerial (uint32_t flag) { SetFlagInternal (GetStore ()->dmx_serial , &common::store::DmxSerial::set_list , flag); }
215- void SetFlagDmxMonitor (uint32_t flag) { SetFlagInternal (GetStore ()->dmx_monitor , &common::store::DmxMonitor::set_list , flag); }
216- void SetFlagRdmDevice (uint32_t flag) { SetFlagInternal (GetStore ()->rdm_device , &common::store::RdmDevice::set_list , flag); }
214+ void SetFlagDmxSerial (uint32_t flag) { SetFlagInternal (GetStore ()->dmx_serial , &common::store::DmxSerial::flags , flag); }
215+ void SetFlagDmxMonitor (uint32_t flag) { SetFlagInternal (GetStore ()->dmx_monitor , &common::store::DmxMonitor::flags , flag); }
216+ void SetFlagRdmDevice (uint32_t flag) { SetFlagInternal (GetStore ()->rdm_device , &common::store::RdmDevice::flags , flag); }
217217 void SetFlagShowFile (uint32_t flag) { SetFlagInternal (GetStore ()->show_file , &common::store::ShowFile::flags, flag); }
218218 void SetFlagLtc (uint32_t flag) { SetFlagInternal (GetStore ()->ltc , &common::store::Ltc::flags, flag); }
219219 void SetFlagLtcDisplay (uint32_t flag) { SetFlagInternal (GetStore ()->ltc_display , &common::store::LtcDisplay::flags, flag); }
@@ -233,9 +233,9 @@ class ConfigStore : StoreDevice
233233 void ClearFlagDmxSend (uint32_t flag) { ClearFlagInternal (GetStore ()->dmx_send , &common::store::DmxSend::flags, flag); }
234234 void ClearFlagDmxLed (uint32_t flag) { ClearFlagInternal (GetStore ()->dmx_led , &common::store::DmxLed::flags, flag); }
235235 void ClearFlagDmxPwm (uint32_t flag) { ClearFlagInternal (GetStore ()->dmx_pwm , &common::store::DmxPwm::flags, flag); }
236- void ClearFlagDmxSerial (uint32_t flag) { ClearFlagInternal (GetStore ()->dmx_serial , &common::store::DmxSerial::set_list , flag); }
237- void ClearFlagDmxMonitor (uint32_t flag) { ClearFlagInternal (GetStore ()->dmx_monitor , &common::store::DmxMonitor::set_list , flag); }
238- void ClearFlagRdmDevice (uint32_t flag) { ClearFlagInternal (GetStore ()->rdm_device , &common::store::RdmDevice::set_list , flag); }
236+ void ClearFlagDmxSerial (uint32_t flag) { ClearFlagInternal (GetStore ()->dmx_serial , &common::store::DmxSerial::flags , flag); }
237+ void ClearFlagDmxMonitor (uint32_t flag) { ClearFlagInternal (GetStore ()->dmx_monitor , &common::store::DmxMonitor::flags , flag); }
238+ void ClearFlagRdmDevice (uint32_t flag) { ClearFlagInternal (GetStore ()->rdm_device , &common::store::RdmDevice::flags , flag); }
239239 void ClearFlagShowFile (uint32_t flag) { ClearFlagInternal (GetStore ()->show_file , &common::store::ShowFile::flags, flag); }
240240 void ClearFlagLtc (uint32_t flag) { ClearFlagInternal (GetStore ()->ltc , &common::store::Ltc::flags, flag); }
241241 void ClearFlagLtcDisplay (uint32_t flag) { ClearFlagInternal (GetStore ()->ltc_display , &common::store::LtcDisplay::flags, flag); }
@@ -255,9 +255,9 @@ class ConfigStore : StoreDevice
255255 bool IsFlagSetDmxSend (uint32_t flag) const { return IsFlagSetInternal (GetStore ()->dmx_send , &common::store::DmxSend::flags, flag); }
256256 bool IsFlagSetDmxLed (uint32_t flag) const { return IsFlagSetInternal (GetStore ()->dmx_led , &common::store::DmxLed::flags, flag); }
257257 bool IsFlagSetDmxPwm (uint32_t flag) const { return IsFlagSetInternal (GetStore ()->dmx_pwm , &common::store::DmxPwm::flags, flag); }
258- bool IsFlagSetDmxSerial (uint32_t flag) const { return IsFlagSetInternal (GetStore ()->dmx_serial , &common::store::DmxSerial::set_list , flag); }
259- bool IsFlagSetDmxMonitor (uint32_t flag) const { return IsFlagSetInternal (GetStore ()->dmx_monitor , &common::store::DmxMonitor::set_list , flag); }
260- bool IsFlagSetRdmDevice (uint32_t flag) const { return IsFlagSetInternal (GetStore ()->rdm_device , &common::store::RdmDevice::set_list , flag); }
258+ bool IsFlagSetDmxSerial (uint32_t flag) const { return IsFlagSetInternal (GetStore ()->dmx_serial , &common::store::DmxSerial::flags , flag); }
259+ bool IsFlagSetDmxMonitor (uint32_t flag) const { return IsFlagSetInternal (GetStore ()->dmx_monitor , &common::store::DmxMonitor::flags , flag); }
260+ bool IsFlagSetRdmDevice (uint32_t flag) const { return IsFlagSetInternal (GetStore ()->rdm_device , &common::store::RdmDevice::flags , flag); }
261261 bool IsFlagSetShowFile (uint32_t flag) const { return IsFlagSetInternal (GetStore ()->show_file , &common::store::ShowFile::flags, flag); }
262262 bool IsFlagSetLtc (uint32_t flag) const { return IsFlagSetInternal (GetStore ()->ltc , &common::store::Ltc::flags, flag); }
263263 bool IsFlagSetLtcDisplay (uint32_t flag) const { return IsFlagSetInternal (GetStore ()->ltc_display , &common::store::LtcDisplay::flags, flag); }
@@ -289,10 +289,16 @@ class ConfigStore : StoreDevice
289289 static_assert (N == common::store::ltc::display::kMaxInfoMessage , " Size mismatch" );
290290 memcpy (dest, (GetStore ()->ltc_display .*field), N);
291291 }
292+
293+ template <std::size_t N> void RdmDeviceCopyArray (uint8_t (&dest)[N], const uint8_t (common::store::RdmDevice::*field)[N]) const
294+ {
295+ static_assert (N == common::store::rdmdevice::kLabelMaxLength , " Size mismatch" );
296+ memcpy (dest, (GetStore ()->rdm_device .*field), N);
297+ }
292298
293- template <std::size_t N> void RdmDeviceUpdateArray (uint8_t (common::store::RdmDevice::*field)[N], const char * src, uint32_t length)
299+ template <std::size_t N> void RdmDeviceUpdateArray (uint8_t (common::store::RdmDevice::*field)[N], const uint8_t * src, uint32_t length)
294300 {
295- UpdateArray (GetStore ()->rdm_device , field, reinterpret_cast < const uint8_t *>( src) , length);
301+ UpdateArray (GetStore ()->rdm_device , field, src, length);
296302 }
297303
298304 uint8_t RdmSensorsIndexedGetType (uint32_t index) const
@@ -329,7 +335,7 @@ class ConfigStore : StoreDevice
329335 template <std::size_t N>
330336 void DmxNodeUpdateLabel (uint8_t (common::store::DmxNode::*field)[common::store::dmxnode::kParamPorts][N], uint32_t index, const char* src, uint32_t length)
331337 {
332- static_assert (N == common::store::dmxnode::kLabelNameLength , " Label size mismatch" );
338+ static_assert (N == common::store::dmxnode::kPortNameLength , " Label size mismatch" );
333339 assert (index < common::store::dmxnode::kParamPorts );
334340 assert (src != nullptr );
335341
0 commit comments