Two quick fixes for sending unicast I-Am - corrected name of handler, and added the destination copy.
This commit is contained in:
@@ -125,11 +125,15 @@ int iam_unicast_encode_pdu(
|
|||||||
int pdu_len = 0;
|
int pdu_len = 0;
|
||||||
BACNET_ADDRESS my_address;
|
BACNET_ADDRESS my_address;
|
||||||
|
|
||||||
|
/* The destination will be the same as the src, so copy it over. */
|
||||||
|
memcpy( dest, src, sizeof( BACNET_ADDRESS ) );
|
||||||
|
dest->net = 0;
|
||||||
|
|
||||||
datalink_get_my_address(&my_address);
|
datalink_get_my_address(&my_address);
|
||||||
/* encode the NPDU portion of the packet */
|
/* encode the NPDU portion of the packet */
|
||||||
npdu_encode_npdu_data(npdu_data, false, MESSAGE_PRIORITY_NORMAL);
|
npdu_encode_npdu_data(npdu_data, false, MESSAGE_PRIORITY_NORMAL);
|
||||||
npdu_len =
|
npdu_len =
|
||||||
npdu_encode_pdu(&buffer[0], src, &my_address,
|
npdu_encode_pdu(&buffer[0], dest, &my_address,
|
||||||
npdu_data);
|
npdu_data);
|
||||||
/* encode the APDU portion of the packet */
|
/* encode the APDU portion of the packet */
|
||||||
apdu_len =
|
apdu_len =
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ extern "C" {
|
|||||||
uint16_t service_len,
|
uint16_t service_len,
|
||||||
BACNET_ADDRESS * src);
|
BACNET_ADDRESS * src);
|
||||||
|
|
||||||
void handler_who_is_whois(
|
void handler_who_is_unicast(
|
||||||
uint8_t * service_request,
|
uint8_t * service_request,
|
||||||
uint16_t service_len,
|
uint16_t service_len,
|
||||||
BACNET_ADDRESS * src);
|
BACNET_ADDRESS * src);
|
||||||
|
|||||||
Reference in New Issue
Block a user