Now using Who-Is-Remote() to get the address binding if targeting a routed Device.

Eliminated empty braces for the Device object in its own list of objects.
This commit is contained in:
tbrennan3
2010-12-03 06:54:02 +00:00
parent de4ead47c6
commit b768518a9d
+21 -8
View File
@@ -799,6 +799,7 @@ void PrintUsage(
(" Use \"7F:00:00:01:BA:C0\" for loopback testing \r\n"); (" Use \"7F:00:00:01:BA:C0\" for loopback testing \r\n");
printf printf
(" -n: specify target's DNET if not local BACnet network \r\n"); (" -n: specify target's DNET if not local BACnet network \r\n");
printf(" or on routed Virtual Network \r\n");
printf("\r\n"); printf("\r\n");
printf("Insert the output in your EPICS file as the last section: \r\n"); printf("Insert the output in your EPICS file as the last section: \r\n");
printf("\"List of Objects in test device:\" \r\n"); printf("\"List of Objects in test device:\" \r\n");
@@ -962,14 +963,23 @@ int main(
&Target_Address); &Target_Address);
if (!found) { if (!found) {
if (Provided_Targ_MAC) { if (Provided_Targ_MAC) {
/* Update by adding the MAC address */ if ( Target_Address.net > 0 ) {
if (max_apdu == 0) /* We specified a DNET; call Who-Is to find the full
max_apdu = MAX_APDU; /* Whatever set for this datalink. */ * routed path to this Device */
address_add_binding(Target_Device_Object_Instance, max_apdu, Send_WhoIs_Remote(&Target_Address,
&Target_Address); Target_Device_Object_Instance,
Target_Device_Object_Instance);
} else {
/* Update by adding the MAC address */
if (max_apdu == 0)
max_apdu = MAX_APDU; /* Whatever set for this datalink. */
address_add_binding(Target_Device_Object_Instance, max_apdu,
&Target_Address);
}
} else { } else {
Send_WhoIs(Target_Device_Object_Instance, Send_WhoIs(Target_Device_Object_Instance,
Target_Device_Object_Instance); Target_Device_Object_Instance);
} }
} }
myObject.type = OBJECT_DEVICE; myObject.type = OBJECT_DEVICE;
@@ -1216,10 +1226,13 @@ int main(
Object_List_Index++; Object_List_Index++;
if (Object_List_Index < Keylist_Count(Object_List)) { if (Object_List_Index < Keylist_Count(Object_List)) {
nextKey = Keylist_Key(Object_List, Object_List_Index); nextKey = Keylist_Key(Object_List, Object_List_Index);
/* Closing brace for the previous Object */
printf(" }, \r\n");
myObject.type = KEY_DECODE_TYPE(nextKey); myObject.type = KEY_DECODE_TYPE(nextKey);
myObject.instance = KEY_DECODE_ID(nextKey); myObject.instance = KEY_DECODE_ID(nextKey);
/* Don't re-list the Device Object among its objects */
if (myObject.type == OBJECT_DEVICE)
continue;
/* Closing brace for the previous Object */
printf(" }, \r\n");
/* Opening brace for the new Object */ /* Opening brace for the new Object */
printf(" { \r\n"); printf(" { \r\n");
/* Test code: /* Test code: