Skip to content

Commit 86f6b7e

Browse files
committed
Refactor Art-Net, RDM and build system
Large refactor across Art-Net, RDM, DMX node utilities and build files: - Rename and relocate lib-dmxnode/include/dmxnode_utils.h -> common/include/common/utils/utils_port.h; change namespace json -> common and remove static qualifiers from PortSet/PortGet. - Update makefiles: add Timestamp.mk (adds -D_TIME_STAMP_ with epoch seconds), include it from gd32/Validate.mk; other small make tweaks and conditional source inclusion in lib-artnet/Rules.mk. - Bump copyright years in sources. - Remove/replace direct RdmDevice initialization/printing from several firmware mains; add product category/detail defines in gd32_rdm_responder/Common.mk instead and adjust LLRP-only behavior (print LLRP device, adjust FirmwareVersion construction). - Major rework of lib-artnet/include/artnet.h: rename many struct fields and constants to snake_case/clearer names, add port address bounds, add OpCodes (ArtCommand, ArtDataRequest/Reply), add ArtCommand struct, refine comments and bit/flag names, and other API/ABI-preserving layout clarifications. - Add/rename multiple RDM headers and sources (new rdm_device_*.h, discovery/statemachine renames, gd32 RDM device implementation), reorganize rdm-related source filenames. - Misc: several firmware mains adjusted for RDM/L RRP handling and minor cleanup across many modules. These changes standardize naming, improve build timestamping, consolidate utility code, and reorganize RDM/Art-Net interfaces for clearer semantics and conditional builds. Developers should verify ABI compatibility where packets/structs are serialized and update any code that referenced old identifiers.
1 parent 234f101 commit 86f6b7e

83 files changed

Lines changed: 2845 additions & 2273 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,25 @@
2323
* THE SOFTWARE.
2424
*/
2525

26-
#ifndef DMXNODE_UTILS_H_
27-
#define DMXNODE_UTILS_H_
26+
#ifndef COMMON_UTILS_UTILS_PORT_H_
27+
#define COMMON_UTILS_UTILS_PORT_H_
2828

2929
#include <cstdint>
3030

31-
namespace json
31+
namespace common
3232
{
33-
template <class S> static void PortSet(uint32_t port_index, S s, uint16_t& n)
33+
template <class S> void PortSet(uint32_t port_index, S s, uint16_t& n)
3434
{
3535
uint16_t value = n; // Create a local copy
3636
value &= static_cast<uint16_t>(~(0x3 << (port_index * 2)));
3737
value |= static_cast<uint16_t>((static_cast<uint32_t>(s) & 0x3) << (port_index * 2));
3838
n = value; // Write back to the original field
3939
}
4040

41-
template <class S> static S PortGet(uint32_t port_index, uint16_t n)
41+
template <class S> S PortGet(uint32_t port_index, uint16_t n)
4242
{
4343
return static_cast<S>((n >> (port_index * 2)) & 0x3);
4444
}
45-
} // namespace json
45+
} // namespace common
4646

47-
#endif // DMXNODE_UTILS_H_
47+
#endif // COMMON_UTILS_UTILS_PORT_H_

common/make/Timestamp.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ $(info "Timestamp.mk")
22

33
ifneq ($(findstring _TIME_STAMP_YEAR_,$(DEFINES)), _TIME_STAMP_YEAR_)
44
DEFINES += \
5-
-D_TIME_STAMP_YEAR_=$(shell date +"%Y") \
5+
-D_TIME_STAMP_=$(shell date "+%s") \
6+
-D_TIME_STAMP_YEAR_=$(shell date +"%Y") \
67
-D_TIME_STAMP_MONTH_=$(shell date +"%m" | sed 's/^0*//') \
78
-D_TIME_STAMP_DAY_=$(shell date +"%d" | sed 's/^0*//')
89
endif

common/make/gd32/Validate.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ifeq ($(FLAGS),)
88
endif
99

1010
ifneq ($(findstring _TIME_STAMP_YEAR_,$(FLAGS)),_TIME_STAMP_YEAR_)
11-
DEFINES+=-D_TIME_STAMP_YEAR_=$(shell date +"%Y") -D_TIME_STAMP_MONTH_=$(shell date +"%-m") -D_TIME_STAMP_DAY_=$(shell date +"%-d")
11+
include ../common/make/Timestamp.mk
1212
endif
1313

1414
ifneq (,$(findstring OUTPUT_DMX_SEND,$(FLAGS))$(findstring CONFIG_RDM,$(FLAGS))$(findstring RDM_CONTROLLER,$(FLAGS))$(findstring LTC,$(FLAGS)))

gd32_emac_artnet_pixel_multi/firmware/main.cpp

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @file main.cpp
33
*/
4-
/* Copyright (C) 2022-2025 by Arjan van Vught mailto:info@gd32-dmx.org
4+
/* Copyright (C) 2022-2026 by Arjan van Vught mailto:info@gd32-dmx.org
55
*
66
* Permission is hereby granted, free of charge, to any person obtaining a copy
77
* of this software and associated documentation files (the "Software"), to deal
@@ -36,22 +36,17 @@
3636
#include "artnettriggerhandler.h"
3737
#include "firmware/pixeldmx/show.h"
3838
#include "common/utils/utils_enum.h"
39-
#include "pixeltype.h"
4039
#include "pixeltestpattern.h"
4140
#include "json/pixeldmxparams.h"
4241
#include "pixeldmxmulti.h"
43-
#if defined(NODE_RDMNET_LLRP_ONLY)
44-
#include "rdmnetdevice.h"
45-
#include "rdmdevice.h"
46-
#endif
4742
#if defined(NODE_SHOWFILE)
4843
#include "showfile.h"
4944
#endif
5045
#include "remoteconfig.h"
5146
#include "configstore.h"
5247
#include "firmwareversion.h"
5348
#include "software_version.h"
54-
#include "software_version_id.h"
49+
5550

5651
namespace hal
5752
{
@@ -68,7 +63,7 @@ int main() // NOLINT
6863
DisplayUdf display;
6964
ConfigStore config_store;
7065
network::Init();
71-
FirmwareVersion fw(SOFTWARE_VERSION, __DATE__, __TIME__, DEVICE_SOFTWARE_VERSION_ID);
66+
FirmwareVersion fw(SOFTWARE_VERSION, __DATE__, __TIME__);
7267

7368
fw.Print("Art-Net 4 Pixel controller {" STR(CONFIG_DMXNODE_PIXEL_MAX_PORTS) " Ports}");
7469

@@ -96,18 +91,6 @@ int main() // NOLINT
9691

9792
ArtNetTriggerHandler trigger_handler(&pixeldmx_multi);
9893

99-
#if defined(NODE_RDMNET_LLRP_ONLY)
100-
auto& rdm_device = RdmDevice::Get();
101-
rdm_device.SetProductCategory(E120_PRODUCT_CATEGORY_FIXTURE);
102-
rdm_device.SetProductDetail(E120_PRODUCT_DETAIL_LED);
103-
rdm_device.Init();
104-
rdm_device.Print();
105-
106-
RDMNetDevice llrp_only_device;
107-
108-
dmxnode_node.SetRdmUID(rdm_device.GetUID(), true);
109-
#endif
110-
11194
#if defined(NODE_SHOWFILE)
11295
ShowFile showfile;
11396
showfile.Print();

gd32_emac_ddp_pixel_multi/firmware/main.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,11 @@
4343
#include "pixeldmxmulti.h"
4444
#if defined(NODE_RDMNET_LLRP_ONLY)
4545
#include "rdmnetdevice.h"
46-
#include "rdmdevice.h"
47-
#include "rdm_e120.h"
4846
#endif
4947
#include "remoteconfig.h"
5048
#include "configstore.h"
5149
#include "firmwareversion.h"
5250
#include "software_version.h"
53-
#include "software_version_id.h"
5451
#include "common/utils/utils_flags.h"
5552
#include "configurationstore.h"
5653

@@ -69,7 +66,7 @@ int main() // NOLINT
6966
DisplayUdf display;
7067
ConfigStore config_store;
7168
network::Init();
72-
FirmwareVersion fw(SOFTWARE_VERSION, __DATE__, __TIME__, DEVICE_SOFTWARE_VERSION_ID);
69+
FirmwareVersion fw(SOFTWARE_VERSION, __DATE__, __TIME__);
7370

7471
fw.Print("DDP Pixel controller {8x 4 Universes}");
7572

@@ -94,13 +91,8 @@ int main() // NOLINT
9491
ddpdisplay.Print();
9592

9693
#if defined(NODE_RDMNET_LLRP_ONLY)
97-
auto& rdm_device = RdmDevice::Get();
98-
rdm_device.SetProductCategory(E120_PRODUCT_CATEGORY_FIXTURE);
99-
rdm_device.SetProductDetail(E120_PRODUCT_DETAIL_LED);
100-
rdm_device.Init();
101-
rdm_device.Print();
102-
10394
RDMNetDevice llrp_only_device;
95+
llrp_only_device.Print();
10496
#endif
10597

10698
display.SetTitle("DDP Pixel %d", kActivePorts);

gd32_emac_e131_dmx_multi/firmware/main.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
#include "dmxnodemsgconst.h"
3636
#if defined(NODE_RDMNET_LLRP_ONLY)
3737
#include "rdmnetdevice.h"
38-
#include "rdmdevice.h"
39-
#include "rdm_e120.h"
4038
#endif
4139
#if defined(NODE_SHOWFILE)
4240
#include "showfile.h"
@@ -45,7 +43,6 @@
4543
#include "configstore.h"
4644
#include "firmwareversion.h"
4745
#include "software_version.h"
48-
#include "software_version_id.h"
4946

5047
namespace hal
5148
{
@@ -62,7 +59,7 @@ int main() // NOLINT
6259
DisplayUdf display;
6360
ConfigStore config_store;
6461
network::Init();
65-
FirmwareVersion fw(SOFTWARE_VERSION, __DATE__, __TIME__, DEVICE_SOFTWARE_VERSION_ID);
62+
FirmwareVersion fw(SOFTWARE_VERSION, __DATE__, __TIME__);
6663

6764
fw.Print("sACN E1.31 DMX {" STR(DMXNODE_PORTS) " Universes}");
6865

@@ -87,13 +84,8 @@ int main() // NOLINT
8784
const auto kActivePorts = dmxnode_node.GetActiveInputPorts() + dmxnode_node.GetActiveOutputPorts();
8885

8986
#if defined(NODE_RDMNET_LLRP_ONLY)
90-
auto& rdm_device = RdmDevice::Get();
91-
rdm_device.SetProductCategory(E120_PRODUCT_CATEGORY_DATA_DISTRIBUTION);
92-
rdm_device.SetProductDetail(E120_PRODUCT_DETAIL_ETHERNET_NODE);
93-
rdm_device.Init();
94-
rdm_device.Print();
95-
9687
RDMNetDevice llrp_only_device;
88+
llrp_only_device.Print();
9789
#endif
9890

9991
#if defined(NODE_SHOWFILE)

gd32_emac_e131_pixel_multi/firmware/main.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@
4242
#include "pixeldmxmulti.h"
4343
#if defined(NODE_RDMNET_LLRP_ONLY)
4444
#include "rdmnetdevice.h"
45-
#include "rdmdevice.h"
46-
#include "rdm_e120.h"
4745
#endif
4846
#if defined(NODE_SHOWFILE)
4947
#include "showfile.h"
@@ -52,7 +50,6 @@
5250
#include "configstore.h"
5351
#include "firmwareversion.h"
5452
#include "software_version.h"
55-
#include "software_version_id.h"
5653
#include "common/utils/utils_flags.h"
5754
#include "configurationstore.h"
5855

@@ -71,7 +68,7 @@ int main() // NOLINT
7168
DisplayUdf display;
7269
ConfigStore config_store;
7370
network::Init();
74-
FirmwareVersion fw(SOFTWARE_VERSION, __DATE__, __TIME__, DEVICE_SOFTWARE_VERSION_ID);
71+
FirmwareVersion fw(SOFTWARE_VERSION, __DATE__, __TIME__);
7572

7673
fw.Print("sACN Pixel controller {" STR(CONFIG_DMXNODE_PIXEL_MAX_PORTS) " Ports}");
7774

@@ -97,13 +94,8 @@ int main() // NOLINT
9794
}
9895

9996
#if defined(NODE_RDMNET_LLRP_ONLY)
100-
auto& rdm_device = RdmDevice::Get();
101-
rdm_device.SetProductCategory(E120_PRODUCT_CATEGORY_FIXTURE);
102-
rdm_device.SetProductDetail(E120_PRODUCT_DETAIL_LED);
103-
rdm_device.Init();
104-
rdm_device.Print();
105-
10697
RDMNetDevice llrp_only_device;
98+
llrp_only_device.Print();
10799
#endif
108100

109101
#if defined(NODE_SHOWFILE)

gd32_emac_llrp/firmware/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
#include "hwclock.h"
4242
#include "firmwareversion.h"
4343
#include "software_version.h"
44-
#include "software_version_id.h"
44+
4545

4646
namespace hal
4747
{
@@ -57,7 +57,7 @@ int main() // NOLINT
5757
DisplayUdf display;
5858
ConfigStore config_store;
5959
network::Init();
60-
FirmwareVersion fw(SOFTWARE_VERSION, __DATE__, __TIME__, DEVICE_SOFTWARE_VERSION_ID);
60+
FirmwareVersion fw(SOFTWARE_VERSION, __DATE__, __TIME__);
6161

6262
fw.Print("RDMNet LLRP device only");
6363

gd32_emac_pp_pixel_multi/firmware/main.cpp

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,11 @@
4343
#include "pixeldmxmulti.h"
4444
#if defined(NODE_RDMNET_LLRP_ONLY)
4545
#include "rdmnetdevice.h"
46-
#include "rdmdevice.h"
47-
#include "rdm_e120.h"
4846
#endif
4947
#include "remoteconfig.h"
5048
#include "configstore.h"
5149
#include "firmwareversion.h"
5250
#include "software_version.h"
53-
#include "software_version_id.h"
5451
#include "common/utils/utils_flags.h"
5552
#include "configurationstore.h"
5653

@@ -69,7 +66,7 @@ int main() // NOLINT
6966
DisplayUdf display;
7067
ConfigStore config_store;
7168
network::Init();
72-
FirmwareVersion fw(SOFTWARE_VERSION, __DATE__, __TIME__, DEVICE_SOFTWARE_VERSION_ID);
69+
FirmwareVersion fw(SOFTWARE_VERSION, __DATE__, __TIME__);
7370

7471
fw.Print("PixelPusher controller {8x 4 Universes}");
7572

@@ -97,13 +94,8 @@ int main() // NOLINT
9794
pp.Print();
9895

9996
#if defined(NODE_RDMNET_LLRP_ONLY)
100-
auto& rdm_device = RdmDevice::Get();
101-
rdm_device.SetProductCategory(E120_PRODUCT_CATEGORY_FIXTURE);
102-
rdm_device.SetProductDetail(E120_PRODUCT_DETAIL_LED);
103-
rdm_device.Init();
104-
rdm_device.Print();
105-
10697
RDMNetDevice llrp_only_device;
98+
llrp_only_device.Print();
10799
#endif
108100

109101
display.SetTitle("PixelPusher %d", kActivePorts);

lib-artnet/Rules.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ ifneq ($(MAKE_FLAGS),)
1313
ifeq ($(findstring RDM_CONTROLLER,$(MAKE_FLAGS)), RDM_CONTROLLER)
1414
EXTRA_SRCDIR+=src/node/rdm
1515
EXTRA_SRCDIR+=src/node/rdm/controller
16+
ifeq ($(findstring ARTNET_HAVE_DMXIN,$(MAKE_FLAGS)), ARTNET_HAVE_DMXIN)
17+
EXTRA_SRCDIR+=src/node/rdm/controller/rdmin
18+
endif
1619
EXTRA_INCLUDES+=../lib-rdm/include ../lib-dmx/include
1720
ifeq ($(findstring ENABLE_HTTPD,$(MAKE_FLAGS)), ENABLE_HTTPD)
1821
EXTRA_SRCDIR+=src/node/rdm/controller/json

0 commit comments

Comments
 (0)