Skip to content

Commit f55669f

Browse files
committed
Update DHCP flag when sending poll reply
Move DHCP status handling out of ArtNetNode::Start() into SendPollReply(). The code now clears and sets the Status2::kIpDhcp/kIpManualy bit just before sending each poll reply, ensuring the DHCP indicator is evaluated per-reply rather than only at startup. Removed the previous DHCP update in Start() to avoid stale status.
1 parent b4034ca commit f55669f

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lib-artnet/src/node/artnetnode.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ void ArtNetNode::Start()
172172
art_poll_reply_.status2 &= static_cast<uint8_t>(~artnet::Status2::kSacnAbleToSwitch);
173173
art_poll_reply_.status2 |=
174174
artnet::Status2::kPortAddress15Bit | (artnet::kVersion >= 4 ? artnet::Status2::kSacnAbleToSwitch : artnet::Status2::kSacnNoSwitch);
175-
art_poll_reply_.status2 &= static_cast<uint8_t>(~artnet::Status2::kIpDhcp);
176-
art_poll_reply_.status2 |= network::iface::Dhcp() ? artnet::Status2::kIpDhcp : artnet::Status2::kIpManualy;
177175
art_poll_reply_.status2 &= static_cast<uint8_t>(~artnet::Status2::kDhcpCapable);
178176
art_poll_reply_.status2 |= network::iface::IsDhcpCapable() ? artnet::Status2::kDhcpCapable : static_cast<uint8_t>(0);
179177
#if defined(ENABLE_HTTPD) && defined(ENABLE_CONTENT)

lib-artnet/src/node/artnetnodehandlepoll.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,9 @@ void ArtNetNode::SendPollReply(uint32_t port_index, uint32_t destination_ip, art
250250
art_poll_reply_.user_lo = static_cast<uint8_t>(kUserData);
251251
art_poll_reply_.user_hi = static_cast<uint8_t>(kUserData >> 8);
252252
}
253+
254+
art_poll_reply_.status2 &= static_cast<uint8_t>(~artnet::Status2::kIpDhcp);
255+
art_poll_reply_.status2 |= network::iface::Dhcp() ? artnet::Status2::kIpDhcp : artnet::Status2::kIpManualy;
253256

254257
ProcessPollReply(port_index);
255258

0 commit comments

Comments
 (0)