Skip to content

Commit

Permalink
artnet: fix artnet poll_reply initialization, add bind_ip
Browse files Browse the repository at this point in the history
  • Loading branch information
SpComb committed Feb 13, 2024
1 parent d5abe73 commit ec94a81
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/artnet/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,13 @@ int artnet_send_poll_reply(struct artnet *artnet, struct artnet_sendrecv *send)
// prepare header fields
send->len = sizeof(send->packet->poll_reply);

memset(reply, 0, sizeof(*reply));
memcpy(reply->id, artnet_id, sizeof(reply->id));
reply->opcode = ARTNET_OP_POLL_REPLY;

// prepare constant fields
memcpy(reply->ip_address, artnet->options.metadata.ip_address, 4);
memcpy(reply->ip_address, artnet->options.metadata.ip_address, sizeof(reply->ip_address));
memcpy(&reply->bind_ip, artnet->options.metadata.ip_address, sizeof(reply->bind_ip));

reply->port_number = artnet_pack_u16lh(artnet->options.port);
reply->net_switch = (artnet->options.address & 0x7F00) >> 8;
Expand Down

0 comments on commit ec94a81

Please sign in to comment.