got a clean compile.

This commit is contained in:
skarg
2005-03-31 19:48:49 +00:00
parent dd5e94641d
commit 78ef4ea5f5
2 changed files with 15 additions and 14 deletions
+13 -12
View File
@@ -36,16 +36,17 @@
#include <stdint.h> #include <stdint.h>
#include <assert.h> #include <assert.h>
#include "bacdef.h" #include "bacdef.h"
#include "bacdcode.h"
#include "bacenum.h" #include "bacenum.h"
#include "config.h" // the custom stuff #include "config.h" // the custom stuff
// vendor id assigned by ASHRAE static uint32_t Object_Instance_Number = 0;
static uint32_t Object_Identifier = 0;
// FIXME: it is likely that this name is configurable, // FIXME: it is likely that this name is configurable,
// so consider a fixed sized string // so consider a fixed sized string
static const char *Object_Name = "SimpleServer"; static const char *Object_Name = "SimpleServer";
static BACNET_DEVICE_STATUS System_Status = STATUS_OPERATIONAL; static BACNET_DEVICE_STATUS System_Status = STATUS_OPERATIONAL;
static const char *Vendor_Name = "ASHRAE"; static const char *Vendor_Name = "ASHRAE";
// vendor id assigned by ASHRAE
static uint16_t Vendor_Identifier = 0; static uint16_t Vendor_Identifier = 0;
static const char *Model_Name = "GNU"; static const char *Model_Name = "GNU";
static const char *Firmware_Revision = "1.0"; static const char *Firmware_Revision = "1.0";
@@ -86,15 +87,15 @@ static uint8_t Database_Revision = 0;
//Profile_Name //Profile_Name
// methods to manipulate the data // methods to manipulate the data
uint32_t Device_Object_Identifier(void) uint32_t Device_Object_Instance_Number(void)
{ {
return Object_Identifier; return Object_Instance_Number;
} }
void Device_Set_Object_Identifier(uint32_t object_id) void Device_Set_Object_Instance_Number(uint32_t object_id)
{ {
// FIXME: bounds check? // FIXME: bounds check?
Object_Identifier = object_id; Object_Instance_Number = object_id;
} }
BACNET_DEVICE_STATUS Device_System_Status(void) BACNET_DEVICE_STATUS Device_System_Status(void)
@@ -238,7 +239,7 @@ int Device_Encode_Property_APDU(
{ {
case PROP_OBJECT_IDENTIFIER: case PROP_OBJECT_IDENTIFIER:
apdu_len = encode_tagged_object_id(&apdu[0], OBJECT_DEVICE, apdu_len = encode_tagged_object_id(&apdu[0], OBJECT_DEVICE,
Object_Identifier); Object_Instance_Number);
break; break;
case PROP_OBJECT_NAME: case PROP_OBJECT_NAME:
apdu_len = encode_tagged_character_string(&apdu[0], Object_Name); apdu_len = encode_tagged_character_string(&apdu[0], Object_Name);
@@ -262,7 +263,7 @@ int Device_Encode_Property_APDU(
apdu_len = encode_tagged_character_string(&apdu[0], Model_Name); apdu_len = encode_tagged_character_string(&apdu[0], Model_Name);
break; break;
case PROP_FIRMWARE_REVISION: case PROP_FIRMWARE_REVISION:
apdu_len = encode_tagged_character_string(&apdu[0], Program_Version); apdu_len = encode_tagged_character_string(&apdu[0], Firmware_Revision);
break; break;
case PROP_APPLICATION_SOFTWARE_VERSION: case PROP_APPLICATION_SOFTWARE_VERSION:
apdu_len = encode_tagged_character_string(&apdu[0], apdu_len = encode_tagged_character_string(&apdu[0],
@@ -290,9 +291,9 @@ int Device_Encode_Property_APDU(
// my_tm->tm_mday, ((my_tm->tm_wday == 0) ? 7 : my_tm->tm_wday)); // my_tm->tm_mday, ((my_tm->tm_wday == 0) ? 7 : my_tm->tm_wday));
break; break;
case PROP_PROTOCOL_VERSION: case PROP_PROTOCOL_VERSION:
apdu_len = encode_tagged_unsigned(&apdu[0], Protocol_Version); apdu_len = encode_tagged_unsigned(&apdu[0], Device_Protocol_Version());
break; break;
// Legacy Support - necessary? // BACnet Legacy Support - necessary?
//case PROP_PROTOCOL_CONFORMANCE_CLASS: //case PROP_PROTOCOL_CONFORMANCE_CLASS:
// apdu_len = encode_tagged_unsigned(&apdu[0], 1); // apdu_len = encode_tagged_unsigned(&apdu[0], 1);
// break; // break;
@@ -329,13 +330,13 @@ int Device_Encode_Property_APDU(
else if (array_index == BACNET_ARRAY_ALL) else if (array_index == BACNET_ARRAY_ALL)
{ {
apdu_len = encode_tagged_object_id(&apdu[0], OBJECT_DEVICE, apdu_len = encode_tagged_object_id(&apdu[0], OBJECT_DEVICE,
Object_Instance); Object_Instance_Number);
} }
else else
{ {
// the first object in the list is at index=1 // the first object in the list is at index=1
apdu_len = encode_tagged_object_id(&apdu[0], OBJECT_DEVICE, apdu_len = encode_tagged_object_id(&apdu[0], OBJECT_DEVICE,
Object_Instance); Object_Instance_Number);
// FIXME: handle the error case of an index beyond the bounds // FIXME: handle the error case of an index beyond the bounds
} }
break; break;
+2 -2
View File
@@ -40,8 +40,8 @@
#include "bacdef.h" #include "bacdef.h"
#include "bacenum.h" #include "bacenum.h"
uint32_t Device_Object_Identifier(void); uint32_t Device_Object_Instance_Number(void);
void Device_Set_Object_Identifier(uint32_t object_id); void Device_Set_Object_Instance_Number(uint32_t object_id);
BACNET_DEVICE_STATUS Device_System_Status(void); BACNET_DEVICE_STATUS Device_System_Status(void);
void Device_Set_System_Status(BACNET_DEVICE_STATUS status); void Device_Set_System_Status(BACNET_DEVICE_STATUS status);