Added Send_I_Am_Unicast() and used it in inhandler_who_is(). Sends directly back to the source address instead of a broadcast, per Addendum 135-2008q-1.
This commit is contained in:
@@ -39,6 +39,12 @@
|
||||
|
||||
/** @file h_whois.c Handles Who-Is requests. */
|
||||
|
||||
/** Handler for Who-Is requests.
|
||||
* @note: Now using Unicast to send I-Am response.
|
||||
* @param service_request [in] The received message to be handled.
|
||||
* @param service_len [in] Length of the service_request message.
|
||||
* @param src [in] The BACNET_ADDRESS of the message's source.
|
||||
*/
|
||||
void handler_who_is(
|
||||
uint8_t * service_request,
|
||||
uint16_t service_len,
|
||||
@@ -53,7 +59,7 @@ void handler_who_is(
|
||||
whois_decode_service_request(service_request, service_len, &low_limit,
|
||||
&high_limit);
|
||||
if (len == 0)
|
||||
Send_I_Am(&Handler_Transmit_Buffer[0]);
|
||||
Send_I_Am_Unicast(&Handler_Transmit_Buffer[0], src);
|
||||
else if (len != -1) {
|
||||
/* is my device id within the limits? */
|
||||
if (((Device_Object_Instance_Number() >= (uint32_t) low_limit) &&
|
||||
@@ -62,7 +68,7 @@ void handler_who_is(
|
||||
/* BACnet wildcard is the max instance number - everyone responds */
|
||||
((BACNET_MAX_INSTANCE >= (uint32_t) low_limit) &&
|
||||
(BACNET_MAX_INSTANCE <= (uint32_t) high_limit)))
|
||||
Send_I_Am(&Handler_Transmit_Buffer[0]);
|
||||
Send_I_Am_Unicast(&Handler_Transmit_Buffer[0], src);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user