Skip to content

Commit

Permalink
Fixed UDP port endian for zephyr os BACnet/IP
Browse files Browse the repository at this point in the history
  • Loading branch information
skarg committed Apr 5, 2024
1 parent 028f139 commit 7b6dcad
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ports/zephyr/bip-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,10 @@ void bip_set_interface(char *ifname)
BACNET_IP_ADDRESS broadcast = { 0 };

/* Network byte order */
unicast.port = BIP_Port;
broadcast.port = BIP_Port;
unicast.port = ntohs(BIP_Port);
broadcast.port = ntohs(BIP_Port);
LOG_INF("bip_set_interface()");
LOG_INF("UDP port: %d", ntohs(BIP_Port));

LOG_INF("UDP port: %d", unicast.port);
if (ifname) {
index = atoi(ifname);
/* if index is zero, discern between "0" and a parse error */
Expand Down Expand Up @@ -507,8 +506,9 @@ void bip_set_interface(char *ifname)
}
bip_set_addr(&unicast);
bip_set_broadcast_addr(&broadcast);
LOG_INF("BACnet/IP Unicast: %u.%u.%u.%u", unicast.address[0],
unicast.address[1], unicast.address[2], unicast.address[3]);
LOG_INF("BACnet/IP Unicast: %u.%u.%u.%u:%d", unicast.address[0],
unicast.address[1], unicast.address[2], unicast.address[3],
unicast.port);
LOG_INF("BACnet/IP Broadcast: %u.%u.%u.%u", broadcast.address[0],
broadcast.address[1], broadcast.address[2], broadcast.address[3]);
} else {
Expand Down

0 comments on commit 7b6dcad

Please sign in to comment.