Skip to content

Commit e329a2e

Browse files
committed
Move DHCP status update to SendPollReply
Update art_poll_reply_.status2 DHCP bit at reply time by moving the network::iface::Dhcp() check from ArtNetNode::Start() into ArtNetNode::SendPollReply(). This ensures the DHCP/manual IP flag reflects the current runtime network state when sending poll replies. Removed the startup-time update and added the check just before processing the poll reply.
1 parent 9fd48a7 commit e329a2e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

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)