Skip to content

Commit 5e57bf6

Browse files
committed
Add NODE_RDMNET_LLRP_ONLY support and RDM fixes
Enable NODE_RDMNET_LLRP_ONLY across targets and libraries, add necessary includes and conditional inheritance, and fix several RDM/discovery and handler bugs. Changes include: - Toggle NODE_RDMNET_LLRP_ONLY in Common.mk for targets and add EXTRA_INCLUDES in multiple Rules.mk files so lib-rdm headers are available when building LLRP-only nodes. - Integrate LLRPDevice into ArtNet/E131 bridges via conditional inheritance and includes, and update prints to call LLRPDevice::Print() when applicable. - Fix ArtNet and handler bugs: use correct struct member names (kArtAddress->command), use the passed discovery type variable for logging, and correct port index usage in TOD handling. - Refactor rdm::discovery API and state machine: move/format Type enum, add StateMachine IsRunning helper, adjust Discovery run/finish logic and remove/clean several debug prints. - Rename enum entries in RDM handler to prefixed forms (kFullOff, kStandby, kNormal, kCold) and update checks accordingly; restrict GetSupportedParameters behind RDM_RESPONDER. - Minor: bump copyright year in e131bridge.h. These changes prepare and fix build/runtime behavior for LLRP-only RDMNet nodes and clean up discovery/handler logic and diagnostics.
1 parent c7cc510 commit 5e57bf6

15 files changed

Lines changed: 83 additions & 78 deletions

File tree

gd32_emac_artnet_dmx_multi/Common.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ DEFINES+=ARTNET_HAVE_FAILSAFE_RECORD
55
DEFINES+=OUTPUT_DMX_SEND_MULTI
66
DEFINES+=OUTPUT_HAVE_STYLESWITCH
77

8+
#DEFINES+=NODE_RDMNET_LLRP_ONLY
9+
810
DEFINES+=RDM_CONTROLLER
911

1012
DEFINES+=CONFIG_STORE_USE_SPI

gd32_emac_e131_dmx_multi/Common.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
DEFINES+=NODE_RDMNET_LLRP_ONLY
2+
13
DEFINES+=CONFIG_STORE_USE_SPI
24

35
DEFINES+=RTL8201F_LED1_LINK_ALL

lib-artnet/include/artnetrdmcontroller.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,6 @@
3333
#include "rdm_discovery.h"
3434
#include "rdm_device_base.h"
3535
#include "dmxnode.h"
36-
#if defined(NODE_RDMNET_LLRP_ONLY)
37-
#include "rdmdevice.h"
38-
#include "llrp/llrpdevice.h"
39-
#endif
4036

4137
namespace artnet::rdm::controller
4238
{
@@ -46,18 +42,12 @@ void DiscoveryStart(uint32_t port_index);
4642
void DiscoveryDone(uint32_t port_index);
4743
} // namespace artnet::rdm::controller
4844

49-
#if defined(NODE_RDMNET_LLRP_ONLY)
50-
class ArtNetRdmController final : rdm::Discovery, LLRPDevice
51-
#else
5245
class ArtNetRdmController final : rdm::Discovery
53-
#endif
5446
{
5547
public:
5648
ArtNetRdmController()
5749
{
58-
#if defined(NODE_RDMNET_LLRP_ONLY)
59-
rdm::device::Device::Instance().Print();
60-
#else
50+
#if !defined(NODE_RDMNET_LLRP_ONLY)
6151
rdm::device::Base::Instance().Print();
6252
#endif
6353
}

lib-artnet/src/node/artnetnodehandleaddress.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ void ArtNetNode::HandleAddress()
312312
break;
313313
#endif
314314
default:
315-
[[unlikely]] DEBUG_PRINTF("> Not implemented: %u [%x]", kArtAddress->Command, kArtAddress->Command);
315+
[[unlikely]] DEBUG_PRINTF("> Not implemented: %u [%x]", kArtAddress->command, kArtAddress->command);
316316
break;
317317
}
318318

lib-artnet/src/node/rdm/controller/handlerdm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ namespace rdm::discovery
4242
{
4343
void Starting(uint32_t port_index, [[maybe_unused]] Type type)
4444
{
45-
DEBUG_PRINTF("%u:%c", port_index, rdm::discovery::Type::kFull ? 'F' : 'I');
45+
DEBUG_PRINTF("%u:%c", port_index, type == rdm::discovery::Type::kFull ? 'F' : 'I');
4646

4747
auto& artnet = *ArtNetNode::Get();
4848
artnet.StopOutputPort(port_index);
4949
}
5050

5151
void Finished(uint32_t port_index, [[maybe_unused]] Type type)
5252
{
53-
DEBUG_PRINTF("%u:%c", port_index, rdm::discovery::Type::kFull ? 'F' : 'I');
53+
DEBUG_PRINTF("%u:%c", port_index, type == rdm::discovery::Type::kFull ? 'F' : 'I');
5454

5555
auto& artnet = *ArtNetNode::Get();
5656
artnet.SendArtTodData(port_index);
@@ -169,7 +169,7 @@ void ArtNetNode::HandleTodData()
169169
return;
170170
}
171171

172-
DEBUG_PRINTF("bind_index=%u -> port_index=%u, kPortAddress=%u, uid_count=%u", kArtTodData->bind_index, port_index, kPortAddress,
172+
DEBUG_PRINTF("bind_index=%u -> kPortIndex=%u, kPortAddress=%u, uid_count=%u", kArtTodData->bind_index, kPortIndex, kPortAddress,
173173
kArtTodData->uid_count);
174174

175175
for (uint32_t uid_index = 0; uid_index < kArtTodData->uid_count; uid_index++)

lib-displayudf/Rules.mk

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ ifneq ($(MAKE_FLAGS),)
1414
EXTRA_SRCDIR+=src/e131
1515
endif
1616

17+
ifneq (,$(findstring NODE_RDMNET_LLRP_ONLY,$(MAKE_FLAGS)))
18+
EXTRA_INCLUDES+=../lib-rdm/include
19+
endif
20+
1721
ifneq (,$(findstring NODE_DDP_DISPLAY,$(MAKE_FLAGS)))
1822
EXTRA_INCLUDES+=../lib-ddp/include
1923
endif

lib-dmxnode/Rules.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ ifneq ($(MAKE_FLAGS),)
88
ifeq ($(findstring NODE_E131,$(MAKE_FLAGS)), NODE_E131)
99
EXTRA_INCLUDES+=../lib-e131/include
1010
endif
11+
ifneq (,$(findstring NODE_RDMNET_LLRP_ONLY,$(MAKE_FLAGS)))
12+
EXTRA_INCLUDES+=../lib-rdm/include
13+
endif
1114
ifneq (,$(findstring RDM_RESPONDER,$(MAKE_FLAGS)))
1215
EXTRA_INCLUDES+=../lib-rdmsensor/include
1316
endif

lib-e131/Rules.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ ifneq ($(MAKE_FLAGS),)
1919
EXTRA_SRCDIR+=src/controller
2020
endif
2121

22-
ifeq ($(findstring NODE_NODE,$(MAKE_FLAGS)), NODE_NODE)
23-
EXTRA_SRCDIR+=src/node
22+
ifneq (,$(findstring NODE_RDMNET_LLRP_ONLY,$(MAKE_FLAGS)))
23+
EXTRA_INCLUDES+=../lib-rdm/include
2424
endif
2525

2626
ifeq ($(findstring OUTPUT_DMX_SEND,$(MAKE_FLAGS)), OUTPUT_DMX_SEND)

lib-e131/include/e131bridge.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* @file e131bridge.h
33
*/
4-
/* Copyright (C) 2016-2025 by Arjan van Vught mailto:info@gd32-dmx.org
4+
/* Copyright (C) 2016-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,6 +36,9 @@
3636
#include "e131sync.h"
3737
#include "dmxnode_outputtype.h"
3838
#include "softwaretimers.h"
39+
#if defined (NODE_RDMNET_LLRP_ONLY)
40+
#include "llrp/llrpdevice.h"
41+
#endif
3942

4043
#ifndef ALIGNED
4144
#define ALIGNED __attribute__((aligned(4)))
@@ -122,6 +125,9 @@ struct InputPort
122125
} // namespace e131bridge
123126

124127
class E131Bridge
128+
#if defined (NODE_RDMNET_LLRP_ONLY)
129+
: LLRPDevice
130+
#endif
125131
{
126132
public:
127133
E131Bridge();

lib-e131/src/node/e131bridge.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,10 @@ void E131Bridge::Print()
499499
{
500500
printf(" Synchronize is disabled\n");
501501
}
502+
503+
#if defined (NODE_RDMNET_LLRP_ONLY)
504+
LLRPDevice::Print();
505+
#endif
502506
}
503507

504508
#if defined(__GNUC__) && !defined(__clang__)

0 commit comments

Comments
 (0)