Added routing support for virtual network so that source addresses are transmitted when required and the correct object ID is used.
This commit is contained in:
@@ -65,7 +65,11 @@ void Send_I_Have(
|
||||
int bytes_sent = 0;
|
||||
BACNET_I_HAVE_DATA data;
|
||||
BACNET_NPDU_DATA npdu_data;
|
||||
#if BAC_ROUTING
|
||||
BACNET_ADDRESS my_address;
|
||||
|
||||
my_address = *Get_Routed_Device_Address(-1);
|
||||
#endif
|
||||
/* if we are forbidden to send, don't send! */
|
||||
if (!dcc_communication_enabled())
|
||||
return;
|
||||
@@ -73,8 +77,14 @@ void Send_I_Have(
|
||||
datalink_get_broadcast_address(&dest);
|
||||
/* encode the NPDU portion of the packet */
|
||||
npdu_encode_npdu_data(&npdu_data, false, MESSAGE_PRIORITY_NORMAL);
|
||||
pdu_len =
|
||||
npdu_encode_pdu(&Handler_Transmit_Buffer[0], &dest, NULL, &npdu_data);
|
||||
|
||||
#if BAC_ROUTING
|
||||
pdu_len = npdu_encode_pdu(&Handler_Transmit_Buffer[0], &dest, &my_address, &npdu_data);
|
||||
#else
|
||||
pdu_len = npdu_encode_pdu(&Handler_Transmit_Buffer[0], &dest, NULL, &npdu_data);
|
||||
#endif
|
||||
|
||||
pdu_len = npdu_encode_pdu(&Handler_Transmit_Buffer[0], &dest, NULL, &npdu_data);
|
||||
/* encode the APDU portion of the packet */
|
||||
data.device_id.type = OBJECT_DEVICE;
|
||||
data.device_id.instance = device_id;
|
||||
|
||||
Reference in New Issue
Block a user