diff --git a/bacnet-stack/demo/handler/s_iam.c b/bacnet-stack/demo/handler/s_iam.c index fcb1108a..814230a1 100644 --- a/bacnet-stack/demo/handler/s_iam.c +++ b/bacnet-stack/demo/handler/s_iam.c @@ -125,11 +125,15 @@ int iam_unicast_encode_pdu( int pdu_len = 0; 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); /* encode the NPDU portion of the packet */ npdu_encode_npdu_data(npdu_data, false, MESSAGE_PRIORITY_NORMAL); npdu_len = - npdu_encode_pdu(&buffer[0], src, &my_address, + npdu_encode_pdu(&buffer[0], dest, &my_address, npdu_data); /* encode the APDU portion of the packet */ apdu_len = diff --git a/bacnet-stack/include/handlers.h b/bacnet-stack/include/handlers.h index 54935b15..5f8f96ec 100644 --- a/bacnet-stack/include/handlers.h +++ b/bacnet-stack/include/handlers.h @@ -59,7 +59,7 @@ extern "C" { uint16_t service_len, BACNET_ADDRESS * src); - void handler_who_is_whois( + void handler_who_is_unicast( uint8_t * service_request, uint16_t service_len, BACNET_ADDRESS * src);