included ethernet and arcnet in demo for readprop and server on Linux. Corrected the ethernet length. Corrected warnings in s_rp and s_whois.

This commit is contained in:
skarg
2006-08-13 16:53:15 +00:00
parent 3560e3d06f
commit 05abf5be23
5 changed files with 28 additions and 13 deletions
+6 -5
View File
@@ -188,8 +188,9 @@ int ethernet_send_pdu(BACNET_ADDRESS * dest, /* destination address */
BACNET_ADDRESS src = { 0 }; /* source address for npdu*/
uint8_t mtu[MAX_MPDU] = { 0 }; /* our buffer */
int mtu_len = 0;
int len = 0;
int npdu_len = 0;
/* load the BACnet address for NPDU data */
for (i = 0; i < 6; i++) {
src.mac[i] = Ethernet_MAC_Address[i];
src.mac_len++;
@@ -223,16 +224,16 @@ int ethernet_send_pdu(BACNET_ADDRESS * dest, /* destination address */
mtu[14] = 0x82; /* DSAP for BACnet */
mtu[15] = 0x82; /* SSAP for BACnet */
mtu[16] = 0x03; /* Control byte in header */
len = npdu_encode_pdu(&mtu[17], dest, &src, npdu_data);
mtu_len = 17 + len;
npdu_len = npdu_encode_pdu(&mtu[17], dest, &src, npdu_data);
mtu_len = 17 + npdu_len;
if ((mtu_len + pdu_len) > MAX_MPDU) {
fprintf(stderr, "ethernet: PDU is too big to send!\n");
return -4;
}
memcpy(&mtu[mtu_len], pdu, pdu_len);
mtu_len += pdu_len;
/* packet length */
encode_unsigned16(&mtu[12],mtu_len);
/* packet length - only the logical portion, not the address */
encode_unsigned16(&mtu[12], 3 + npdu_len + pdu_len);
/* Send the packet */
bytes =