Added version files.

This commit is contained in:
skarg
2007-08-13 16:42:43 +00:00
parent 89d5edba62
commit 1b9a00e238
14 changed files with 156 additions and 69 deletions
+13 -12
View File
@@ -32,6 +32,7 @@
#include "apdu.h"
#include "dlmstp.h"
#include "rs485.h"
#include "version.h"
/* objects */
#include "device.h"
#include "ai.h"
@@ -41,8 +42,8 @@
#include "wp.h"
#include "dcc.h"
/* note: you really only need to define variables for
properties that are writable or that may change.
/* note: you really only need to define variables for
properties that are writable or that may change.
The properties that are constant can be hard coded
into the read-property encoding. */
static uint32_t Object_Instance_Number = 12345;
@@ -63,9 +64,9 @@ void Device_Init(void)
Reinitialize_State = REINITIALIZED_STATE_IDLE;
dcc_set_status_duration(COMMUNICATION_ENABLE, 0);
/* FIXME: Get the data from the eeprom */
/* I2C_Read_Block(EEPROM_DEVICE_ADDRESS,
(char *)&Object_Instance_Number,
sizeof(Object_Instance_Number),
/* I2C_Read_Block(EEPROM_DEVICE_ADDRESS,
(char *)&Object_Instance_Number,
sizeof(Object_Instance_Number),
EEPROM_BACNET_ID_ADDR); */
}
@@ -83,9 +84,9 @@ bool Device_Set_Object_Instance_Number(uint32_t object_id)
Object_Instance_Number = object_id;
/* FIXME: Write the data to the eeprom */
/* I2C_Write_Block(
EEPROM_DEVICE_ADDRESS,
(char *)&Object_Instance_Number,
sizeof(Object_Instance_Number),
EEPROM_DEVICE_ADDRESS,
(char *)&Object_Instance_Number,
sizeof(Object_Instance_Number),
EEPROM_BACNET_ID_ADDR); */
} else
status = false;
@@ -182,9 +183,9 @@ bool Device_Object_List_Identifier(unsigned array_index,
}
/* normalize the index since
we know it is not the previous objects */
/* array index starts at 1 */
/* array index starts at 1 */
object_index = array_index - 1;
/* 1 for the device object */
/* 1 for the device object */
object_count = 1;
/* FIXME: add objects as needed */
/* binary value objects */
@@ -288,7 +289,7 @@ int Device_Encode_Property_APDU(uint8_t * apdu,
apdu_len = encode_tagged_character_string(&apdu[0], &char_string);
break;
case PROP_FIRMWARE_REVISION:
characterstring_init_ansi(&char_string, "0.3.3");
characterstring_init_ansi(&char_string, BACnet_Version);
apdu_len = encode_tagged_character_string(&apdu[0], &char_string);
break;
case PROP_APPLICATION_SOFTWARE_VERSION:
@@ -528,7 +529,7 @@ bool Device_Write_Property(BACNET_WRITE_PROPERTY_DATA * wp_data,
/* Display_Set_Name(
characterstring_value(&value.type.Character_String)); */
/* FIXME: All the object names in a device must be unique.
Disallow setting the Device Object Name to any objects in
Disallow setting the Device Object Name to any objects in
the device. */
} else {
*error_class = ERROR_CLASS_PROPERTY;
+6 -5
View File
@@ -12,7 +12,7 @@ AR=arm-elf-ar
LDSCRIPT=at91sam7s256.ld
BACNET_FLAGS = -DBACDL_MSTP=1 -DPRINT_ENABLED=0 -DBIG_ENDIAN=0 -DMAX_APDU=480 -DDLMSTP_TEST
INCLUDES = -I. -I../.. -I../../demo/handler -I../../demo/object
INCLUDES = -I. -I../.. -I../../demo/handler -I../../demo/object
#OPTIMIZATION = -O0
OPTIMIZATION = -Os
CFLAGS = -fno-common $(OPTIMIZATION) $(INCLUDES) $(BACNET_FLAGS) -Wall -g
@@ -64,7 +64,8 @@ CORESRC = ../../npdu.c \
../../dcc.c \
../../rd.c \
../../whois.c \
../../iam.c
../../iam.c \
../../version.c
#CSRC = $(PORTSRC) $(DEMOSRC) $(CORESRC)
CSRC = $(PORTSRC)
@@ -80,12 +81,12 @@ $(TARGET).bin: $(TARGET).elf
$(OBJCOPY) $(TARGET).elf $(CPFLAGS) $(TARGET).bin
$(TARGET).elf: $(COBJ) $(AOBJ) $(LIBRARY) Makefile
$(CC) $(CFLAGS) $(AOBJ) $(COBJ) $(LDFLAGS) -o $@
$(CC) $(CFLAGS) $(AOBJ) $(COBJ) $(LDFLAGS) -o $@
lib: $(LIBRARY)
$(LIBRARY): $(COREOBJ) Makefile
$(AR) rcs $@ $(COREOBJ)
$(AR) rcs $@ $(COREOBJ)
$(COBJ): %.o : %.c Makefile
$(CC) -c $(CFLAGS) $< -o $@
@@ -95,7 +96,7 @@ $(AOBJ): %.o : %.s Makefile
clean:
touch Makefile
rm $(COBJ) $(AOBJ) $(COREOBJ)
rm $(COBJ) $(AOBJ) $(COREOBJ)
rm $(TARGET).elf $(TARGET).bin $(TARGET).dmp $(TARGET).map
rm $(LIBRARY)
rm *.lst
+13 -13
View File
@@ -41,9 +41,10 @@
#include "bv.h"
#include "wp.h"
#include "dcc.h"
#include "version.h"
/* note: you really only need to define variables for
properties that are writable or that may change.
/* note: you really only need to define variables for
properties that are writable or that may change.
The properties that are constant can be hard coded
into the read-property encoding. */
static uint32_t Object_Instance_Number = 12345;
@@ -63,9 +64,9 @@ void Device_Init(void)
Reinitialize_State = REINITIALIZED_STATE_IDLE;
dcc_set_status_duration(COMMUNICATION_ENABLE, 0);
/* FIXME: Get the data from the eeprom */
/* I2C_Read_Block(EEPROM_DEVICE_ADDRESS,
(char *)&Object_Instance_Number,
sizeof(Object_Instance_Number),
/* I2C_Read_Block(EEPROM_DEVICE_ADDRESS,
(char *)&Object_Instance_Number,
sizeof(Object_Instance_Number),
EEPROM_BACNET_ID_ADDR); */
}
@@ -83,9 +84,9 @@ bool Device_Set_Object_Instance_Number(uint32_t object_id)
Object_Instance_Number = object_id;
/* FIXME: Write the data to the eeprom */
/* I2C_Write_Block(
EEPROM_DEVICE_ADDRESS,
(char *)&Object_Instance_Number,
sizeof(Object_Instance_Number),
EEPROM_DEVICE_ADDRESS,
(char *)&Object_Instance_Number,
sizeof(Object_Instance_Number),
EEPROM_BACNET_ID_ADDR); */
} else
status = false;
@@ -186,9 +187,9 @@ bool Device_Object_List_Identifier(unsigned array_index,
}
/* normalize the index since
we know it is not the previous objects */
/* array index starts at 1 */
/* array index starts at 1 */
object_index = array_index - 1;
/* 1 for the device object */
/* 1 for the device object */
object_count = 1;
/* FIXME: add objects as needed */
/* binary value objects */
@@ -299,8 +300,7 @@ int Device_Encode_Property_APDU(uint8_t * apdu,
apdu_len = encode_tagged_character_string(&apdu[0], &char_string);
break;
case PROP_FIRMWARE_REVISION:
(void) strcpypgm2ram(&string_buffer[0], "0.3.3");
characterstring_init_ansi(&char_string, string_buffer);
characterstring_init_ansi(&char_string, BACnet_Version);
apdu_len = encode_tagged_character_string(&apdu[0], &char_string);
break;
case PROP_APPLICATION_SOFTWARE_VERSION:
@@ -541,7 +541,7 @@ bool Device_Write_Property(BACNET_WRITE_PROPERTY_DATA * wp_data,
/* Display_Set_Name(
characterstring_value(&value.type.Character_String)); */
/* FIXME: All the object names in a device must be unique.
Disallow setting the Device Object Name to any objects in
Disallow setting the Device Object Name to any objects in
the device. */
} else {
*error_class = ERROR_CLASS_PROPERTY;