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
+2 -1
View File
@@ -69,7 +69,8 @@ SRCS = main.c \
$(BACNET_ROOT)/reject.c \ $(BACNET_ROOT)/reject.c \
$(BACNET_ROOT)/bacerror.c \ $(BACNET_ROOT)/bacerror.c \
$(BACNET_ROOT)/apdu.c \ $(BACNET_ROOT)/apdu.c \
$(BACNET_ROOT)/npdu.c $(BACNET_ROOT)/npdu.c \
$(BACNET_ROOT)/version.c
OBJS = ${SRCS:.c=.o} OBJS = ${SRCS:.c=.o}
+2 -1
View File
@@ -61,7 +61,8 @@ SRCS = main.c \
..\..\reject.c \ ..\..\reject.c \
..\..\bacerror.c \ ..\..\bacerror.c \
..\..\apdu.c \ ..\..\apdu.c \
..\..\npdu.c ..\..\npdu.c \
..\..\version.c
OBJS = $(SRCS:.c=.obj) OBJS = $(SRCS:.c=.obj)
+2 -1
View File
@@ -69,7 +69,8 @@ SRCS = main.c \
$(BACNET_ROOT)/reject.c \ $(BACNET_ROOT)/reject.c \
$(BACNET_ROOT)/bacerror.c \ $(BACNET_ROOT)/bacerror.c \
$(BACNET_ROOT)/apdu.c \ $(BACNET_ROOT)/apdu.c \
$(BACNET_ROOT)/npdu.c $(BACNET_ROOT)/npdu.c \
$(BACNET_ROOT)/version.c
OBJS = ${SRCS:.c=.o} OBJS = ${SRCS:.c=.o}
+2 -1
View File
@@ -62,7 +62,8 @@ SRCS = main.c \
..\..\reject.c \ ..\..\reject.c \
..\..\bacerror.c \ ..\..\bacerror.c \
..\..\apdu.c \ ..\..\apdu.c \
..\..\npdu.c ..\..\npdu.c \
..\..\version.c
OBJS = $(SRCS:.c=.obj) OBJS = $(SRCS:.c=.obj)
+3 -16
View File
@@ -42,6 +42,7 @@
#include "lsp.h" /* object list dependency */ #include "lsp.h" /* object list dependency */
#include "mso.h" /* object list dependency */ #include "mso.h" /* object list dependency */
#include "wp.h" /* write property handling */ #include "wp.h" /* write property handling */
#include "version.h"
#include "device.h" /* me */ #include "device.h" /* me */
#if BACFILE #if BACFILE
#include "bacfile.h" /* object list dependency */ #include "bacfile.h" /* object list dependency */
@@ -122,7 +123,6 @@ static char Vendor_Name[16] = "ASHRAE";
/* FIXME: your vendor id assigned by ASHRAE */ /* FIXME: your vendor id assigned by ASHRAE */
static uint16_t Vendor_Identifier = 0; static uint16_t Vendor_Identifier = 0;
static char Model_Name[16] = "GNU"; static char Model_Name[16] = "GNU";
static char Firmware_Revision[16] = "0.3.2";
static char Application_Software_Version[16] = "1.0"; static char Application_Software_Version[16] = "1.0";
static char Location[16] = "USA"; static char Location[16] = "USA";
static char Description[16] = "server"; static char Description[16] = "server";
@@ -265,20 +265,7 @@ bool Device_Set_Model_Name(const char *name, size_t length)
const char *Device_Firmware_Revision(void) const char *Device_Firmware_Revision(void)
{ {
return Firmware_Revision; return BACnet_Version;
}
bool Device_Set_Firmware_Revision(const char *name, size_t length)
{
bool status = false; /*return value */
if (length < sizeof(Firmware_Revision)) {
memmove(Firmware_Revision, name, length);
Firmware_Revision[length] = 0;
status = true;
}
return status;
} }
const char *Device_Application_Software_Version(void) const char *Device_Application_Software_Version(void)
@@ -681,7 +668,7 @@ int Device_Encode_Property_APDU(uint8_t * apdu,
apdu_len = encode_tagged_character_string(&apdu[0], &char_string); apdu_len = encode_tagged_character_string(&apdu[0], &char_string);
break; break;
case PROP_FIRMWARE_REVISION: case PROP_FIRMWARE_REVISION:
characterstring_init_ansi(&char_string, Firmware_Revision); characterstring_init_ansi(&char_string, BACnet_Version);
apdu_len = encode_tagged_character_string(&apdu[0], &char_string); apdu_len = encode_tagged_character_string(&apdu[0], &char_string);
break; break;
case PROP_APPLICATION_SOFTWARE_VERSION: case PROP_APPLICATION_SOFTWARE_VERSION:
-1
View File
@@ -69,7 +69,6 @@ extern "C" {
bool Device_Set_Model_Name(const char *name, size_t length); bool Device_Set_Model_Name(const char *name, size_t length);
const char *Device_Firmware_Revision(void); const char *Device_Firmware_Revision(void);
bool Device_Set_Firmware_Revision(const char *name, size_t length);
const char *Device_Application_Software_Version(void); const char *Device_Application_Software_Version(void);
bool Device_Set_Application_Software_Version(const char *name, bool Device_Set_Application_Software_Version(const char *name,
+8
View File
@@ -88,6 +88,10 @@
<Option compilerVar="CC" /> <Option compilerVar="CC" />
</Unit> </Unit>
<Unit filename="..\..\bacerror.h" /> <Unit filename="..\..\bacerror.h" />
<Unit filename="..\..\bacint.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\..\bacint.h" />
<Unit filename="..\..\bacstr.c"> <Unit filename="..\..\bacstr.c">
<Option compilerVar="CC" /> <Option compilerVar="CC" />
</Unit> </Unit>
@@ -251,6 +255,10 @@
<Option compilerVar="CC" /> <Option compilerVar="CC" />
</Unit> </Unit>
<Unit filename="..\..\timesync.h" /> <Unit filename="..\..\timesync.h" />
<Unit filename="..\..\version.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\..\version.h" />
<Unit filename="..\..\whohas.c"> <Unit filename="..\..\whohas.c">
<Option compilerVar="CC" /> <Option compilerVar="CC" />
</Unit> </Unit>
+4
View File
@@ -45,6 +45,7 @@
#include "net.h" #include "net.h"
#include "txbuf.h" #include "txbuf.h"
#include "lc.h" #include "lc.h"
#include "version.h"
#if defined(BACDL_MSTP) #if defined(BACDL_MSTP)
#include "rs485.h" #include "rs485.h"
#endif #endif
@@ -108,6 +109,7 @@ int main(int argc, char *argv[])
if (argc > 1) if (argc > 1)
Device_Set_Object_Instance_Number(strtol(argv[1], NULL, 0)); Device_Set_Object_Instance_Number(strtol(argv[1], NULL, 0));
#if defined(BACDL_BIP) #if defined(BACDL_BIP)
/* FIXME: really needs to come from a config file */
if (argc > 2) if (argc > 2)
Network_Interface = argv[2]; Network_Interface = argv[2];
if (argc > 3) if (argc > 3)
@@ -125,8 +127,10 @@ int main(int argc, char *argv[])
} }
#endif #endif
printf("BACnet Server Demo\n" printf("BACnet Server Demo\n"
"BACnet Stack Version %s\n"
"BACnet Device ID: %u\n" "BACnet Device ID: %u\n"
"Max APDU: %d\n", "Max APDU: %d\n",
BACnet_Version,
Device_Object_Instance_Number(), Device_Object_Instance_Number(),
MAX_APDU); MAX_APDU);
Init_Service_Handlers(); Init_Service_Handlers();
+17 -17
View File
@@ -1,32 +1,32 @@
To Do List - BACnet Stack at SourceForge To Do List - BACnet Stack at SourceForge
Here are some things to do: Here are some things to do:
1. Finish demo/epics/main.c - EPICS demo. Use object property lists. A. Finish demo/epics/main.c - EPICS demo. Use object property lists.
2. Finish demo/object/lo.c - Lighting Output object demo B. Finish demo/object/lo.c - Lighting Output object demo
3. Complete bvlc.c and use it instead of or in compliment to bip.c C. Complete bvlc.c and use it instead of or in compliment to bip.c
4. Complete client demo for ReadPropertyMultiple from rpm.c D. Complete client demo for ReadPropertyMultiple from rpm.c
5. Add HTTP demo like bacnet4linux E. Add HTTP demo like bacnet4linux
6. Add subscribe COV support in server demo. F. Add subscribe COV support in server demo.
7. Add hooks to increment Database_Revision property G. Add hooks to increment Database_Revision property
8. Add BBMD and FD support to server example for BACnet/IP. H. Add BBMD and FD support to server example for BACnet/IP.
9. Add Foreign Device registration options to client examples. I. Add Foreign Device registration options to client examples.
A. Change bip.c to not use extra buffer (shift data) J. Change bip.c to not use extra buffer (shift data)
B. Add Visual Studio 2005 makefiles or projects for demos. K. Add Visual Studio 2005 makefiles or projects for demos.
C. Add Code::Blocks projects for demos. L. Add Code::Blocks projects for demos.
D. Add function headers to each module and function with M. Add function headers to each module and function with
doc-tags for some document generator like doxygen, robodoc, doc-tags for some document generator like doxygen, robodoc,
or Natural Docs. Wikipedia has a nice comparison at: or Natural Docs. Wikipedia has a comparison of generators at:
http://en.wikipedia.org/wiki/Comparison_of_documentation_generators http://en.wikipedia.org/wiki/Comparison_of_documentation_generators
E. Convert core code into library. N. Convert core code into library.
For example, libbacnet. Includes client and server functionality For example, libbacnet. Includes client and server functionality
and only requires a dummy tsm_free_invoke_id function for servers. and only requires a dummy tsm_free_invoke_id function for servers.
Create bacnet.h file that includes all the necessary includes. Create bacnet.h file that includes all the necessary includes.
Split core functions into files to make library effecient. Split core functions into files to make library effecient.
For example, rp.c becomes rp_client.c, rp_server.c , rp_test.c; For example, rp.c becomes rp_client.c, rp_server.c , rp_test.c;
bacint.c becomes bacint_encode.c, bacint_decode.c, bacint_test.c bacint.c becomes bacint_encode.c, bacint_decode.c, bacint_test.c
F: Change address to store in a file and demos to use file O. Change address to store in a file and demos to use file
instead of having to send who-is for each query. instead of having to send who-is for each query.
Use a config file for interface and interface options. Use a config file for interface and interface options.
These will make scripting cleaner. These will make scripting cleaner.
P. Changed encode_tagged_xx to encode_application_xx in bacdcode.c.
Will I use alphabet (G) or hex (10) for the next item?
+2 -1
View File
@@ -32,6 +32,7 @@
#include "apdu.h" #include "apdu.h"
#include "dlmstp.h" #include "dlmstp.h"
#include "rs485.h" #include "rs485.h"
#include "version.h"
/* objects */ /* objects */
#include "device.h" #include "device.h"
#include "ai.h" #include "ai.h"
@@ -288,7 +289,7 @@ int Device_Encode_Property_APDU(uint8_t * apdu,
apdu_len = encode_tagged_character_string(&apdu[0], &char_string); apdu_len = encode_tagged_character_string(&apdu[0], &char_string);
break; break;
case PROP_FIRMWARE_REVISION: 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); apdu_len = encode_tagged_character_string(&apdu[0], &char_string);
break; break;
case PROP_APPLICATION_SOFTWARE_VERSION: case PROP_APPLICATION_SOFTWARE_VERSION:
+2 -1
View File
@@ -64,7 +64,8 @@ CORESRC = ../../npdu.c \
../../dcc.c \ ../../dcc.c \
../../rd.c \ ../../rd.c \
../../whois.c \ ../../whois.c \
../../iam.c ../../iam.c \
../../version.c
#CSRC = $(PORTSRC) $(DEMOSRC) $(CORESRC) #CSRC = $(PORTSRC) $(DEMOSRC) $(CORESRC)
CSRC = $(PORTSRC) CSRC = $(PORTSRC)
+2 -2
View File
@@ -41,6 +41,7 @@
#include "bv.h" #include "bv.h"
#include "wp.h" #include "wp.h"
#include "dcc.h" #include "dcc.h"
#include "version.h"
/* note: you really only need to define variables for /* note: you really only need to define variables for
properties that are writable or that may change. properties that are writable or that may change.
@@ -299,8 +300,7 @@ int Device_Encode_Property_APDU(uint8_t * apdu,
apdu_len = encode_tagged_character_string(&apdu[0], &char_string); apdu_len = encode_tagged_character_string(&apdu[0], &char_string);
break; break;
case PROP_FIRMWARE_REVISION: case PROP_FIRMWARE_REVISION:
(void) strcpypgm2ram(&string_buffer[0], "0.3.3"); characterstring_init_ansi(&char_string, BACnet_Version);
characterstring_init_ansi(&char_string, string_buffer);
apdu_len = encode_tagged_character_string(&apdu[0], &char_string); apdu_len = encode_tagged_character_string(&apdu[0], &char_string);
break; break;
case PROP_APPLICATION_SOFTWARE_VERSION: case PROP_APPLICATION_SOFTWARE_VERSION:
+36
View File
@@ -0,0 +1,36 @@
/*####COPYRIGHTBEGIN####
-------------------------------------------
Copyright (C) 2007 Steve Karg
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
The Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA.
As a special exception, if other files instantiate templates or
use macros or inline functions from this file, or you compile
this file and link it with other works to produce a work based
on this file, this file does not by itself cause the resulting
work to be covered by the GNU General Public License. However
the source code for this file must still be made available in
accordance with section (3) of the GNU General Public License.
This exception does not invalidate any other reasons why a work
based on this file might be covered by the GNU General Public
License.
-------------------------------------------
####COPYRIGHTEND####*/
#include "version.h"
char *BACnet_Version = "0.3.4";
+47
View File
@@ -0,0 +1,47 @@
/*####COPYRIGHTBEGIN####
-------------------------------------------
Copyright (C) 2007 Steve Karg
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to:
The Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA 02111-1307, USA.
As a special exception, if other files instantiate templates or
use macros or inline functions from this file, or you compile
this file and link it with other works to produce a work based
on this file, this file does not by itself cause the resulting
work to be covered by the GNU General Public License. However
the source code for this file must still be made available in
accordance with section (3) of the GNU General Public License.
This exception does not invalidate any other reasons why a work
based on this file might be covered by the GNU General Public
License.
-------------------------------------------
####COPYRIGHTEND####*/
#ifndef VERSION_H
#define VERSION_H
/* This BACnet protocol stack version 0.0.0 - FF.FF.FF */
#ifndef BACNET_VERSION
#define BACNET_VERSION(x,y,z) (((x)<<16)+((y)<<8)+(z))
#endif
#define BACNET_VERSION_CODE BACNET_VERSION(0,3,4)
#define BACNET_VERSION_MAJOR ((BACNET_VERSION_CODE>>16)&0xFF)
#define BACNET_VERSION_MINOR ((BACNET_VERSION_CODE>>8)&0xFF)
#define BACNET_VERSION_MAINTENANCE (BACNET_VERSION_CODE&0xFF)
extern char *BACnet_Version;
#endif