From 7b1f8c7f5e34f37c15223bec599eef83c1956e39 Mon Sep 17 00:00:00 2001 From: skarg Date: Fri, 1 Apr 2011 22:25:26 +0000 Subject: [PATCH] Updated the example File object to have the same Object_Name API. Moved the File object header file to the demo/object directory with the rest of the demo object header files. --- bacnet-stack/demo/object/bacfile.c | 18 ++++++++++++++++-- .../{include => demo/object}/bacfile.h | 5 +++-- 2 files changed, 19 insertions(+), 4 deletions(-) rename bacnet-stack/{include => demo/object}/bacfile.h (96%) diff --git a/bacnet-stack/demo/object/bacfile.c b/bacnet-stack/demo/object/bacfile.c index 723adb91..bd15980f 100644 --- a/bacnet-stack/demo/object/bacfile.c +++ b/bacnet-stack/demo/object/bacfile.c @@ -94,8 +94,7 @@ void BACfile_Property_Lists( return; } - -char *bacfile_name( +static char * bacfile_name( uint32_t instance) { uint32_t index = 0; @@ -113,6 +112,21 @@ char *bacfile_name( return filename; } +bool bacfile_object_name( + uint32_t instance, + BACNET_CHARACTER_STRING *object_name) +{ + bool status = false; + char *filename = NULL; + + filename = bacfile_name(instance); + if (filename) { + status = characterstring_init_ansi(object_name, filename); + } + + return status; +} + bool bacfile_valid_instance( uint32_t object_instance) { diff --git a/bacnet-stack/include/bacfile.h b/bacnet-stack/demo/object/bacfile.h similarity index 96% rename from bacnet-stack/include/bacfile.h rename to bacnet-stack/demo/object/bacfile.h index 63292fa3..53a02595 100644 --- a/bacnet-stack/include/bacfile.h +++ b/bacnet-stack/demo/object/bacfile.h @@ -52,8 +52,9 @@ extern "C" { const int **pRequired, const int **pOptional, const int **pProprietary); - char *bacfile_name( - uint32_t instance); + bool bacfile_object_name( + uint32_t object_instance, + BACNET_CHARACTER_STRING *object_name); bool bacfile_valid_instance( uint32_t object_instance); uint32_t bacfile_count(