Removed checks for previous BVLC messages since that is not correct behavior for BIP, especially when a WhoIs, I-Am, ReadProperty sequence occurs. This was causing messages to be sent as broadcast instead of unicast.
This commit is contained in:
@@ -157,20 +157,16 @@ int bip_send_pdu(
|
|||||||
/* addr and port in host format */
|
/* addr and port in host format */
|
||||||
struct in_addr address;
|
struct in_addr address;
|
||||||
uint16_t port = 0;
|
uint16_t port = 0;
|
||||||
BACNET_BVLC_FUNCTION function;
|
|
||||||
|
|
||||||
|
|
||||||
(void) npdu_data;
|
(void) npdu_data;
|
||||||
/* assumes that the driver has already been initialized */
|
/* assumes that the driver has already been initialized */
|
||||||
if (BIP_Socket < 0)
|
if (BIP_Socket < 0) {
|
||||||
return BIP_Socket;
|
return BIP_Socket;
|
||||||
|
}
|
||||||
|
|
||||||
mtu[0] = BVLL_TYPE_BACNET_IP;
|
mtu[0] = BVLL_TYPE_BACNET_IP;
|
||||||
bip_dest.sin_family = AF_INET;
|
bip_dest.sin_family = AF_INET;
|
||||||
function = bvlc_get_function_code(); /* What type of BVLC was it? */
|
if (dest->net == BACNET_BROADCAST_NETWORK) {
|
||||||
if ( (dest->net == BACNET_BROADCAST_NETWORK) ||
|
|
||||||
(function == BVLC_FORWARDED_NPDU) ||
|
|
||||||
(function == BVLC_ORIGINAL_BROADCAST_NPDU) ) {
|
|
||||||
/* broadcast */
|
/* broadcast */
|
||||||
address.s_addr = BIP_Broadcast_Address.s_addr;
|
address.s_addr = BIP_Broadcast_Address.s_addr;
|
||||||
port = BIP_Port;
|
port = BIP_Port;
|
||||||
|
|||||||
Reference in New Issue
Block a user