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:
tbrennan3
2010-02-15 20:47:20 +00:00
parent ccb5323721
commit 4c99467009
3 changed files with 96 additions and 7 deletions
+8 -2
View File
@@ -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;