Quick fixes for BACNET_CHARACTER_STRING uses with routing. (Mostly just reverting to ANSI with this demo code.)

This commit is contained in:
tbrennan3
2011-08-22 19:55:05 +00:00
parent 1e3b14802f
commit c1f148dc61
2 changed files with 8 additions and 2 deletions
+3 -1
View File
@@ -281,9 +281,11 @@ static void Init_Service_Handlers(
#if BAC_ROUTING
uint32_t Object_Instance;
BACNET_CHARACTER_STRING name_string;
/* Put this client Device into the Routing table (first entry) */
Object_Instance = Device_Object_Instance_Number();
Add_Routed_Device(Object_Instance, Device_Object_Name(),
Device_Object_Name(Object_Instance, &name_string);
Add_Routed_Device(Object_Instance, &name_string,
Device_Description());
#endif
+5 -1
View File
@@ -126,6 +126,7 @@ void Devices_Init(
int i;
char nameText[MAX_DEV_NAME_LEN];
char descText[MAX_DEV_DESC_LEN];
BACNET_CHARACTER_STRING name_string;
/* Gateway Device has already been initialized.
* But give it a better Description. */
@@ -141,8 +142,9 @@ void Devices_Init(
snprintf(nameText, MAX_DEV_NAME_LEN, "%s %d", DEV_NAME_BASE, i + 1);
snprintf(descText, MAX_DEV_DESC_LEN, "%s %d", DEV_DESCR_REMOTE, i);
#endif
characterstring_init_ansi(&name_string, nameText);
Add_Routed_Device((first_object_instance + i), nameText, descText);
Add_Routed_Device((first_object_instance + i), &name_string, descText);
}
}
@@ -365,6 +367,8 @@ int main(
/* blink LEDs, Turn on or off outputs, etc */
}
// Dummy return
return 0;
}
/* @} */