Updated documentation. Moved built files to bin directory, and removed the utils directory.

This commit is contained in:
skarg
2008-03-11 15:43:20 +00:00
parent d373f3cc07
commit c8eb5cb012
16 changed files with 94 additions and 75 deletions
+12 -12
View File
@@ -33,38 +33,38 @@ library: lib/Makefile
( cd lib ; make ) ( cd lib ; make )
readprop: demo/readprop/Makefile readprop: demo/readprop/Makefile
( cd demo/readprop ; make ; cp bacrp ../../utils ) ( cd demo/readprop ; make ; cp bacrp ../../bin )
writeprop: demo/writeprop/Makefile writeprop: demo/writeprop/Makefile
( cd demo/writeprop ; make ; cp bacwp ../../utils ) ( cd demo/writeprop ; make ; cp bacwp ../../bin )
readfile: demo/readfile/Makefile readfile: demo/readfile/Makefile
( cd demo/readfile ; make ; cp bacarf ../../utils ) ( cd demo/readfile ; make ; cp bacarf ../../bin )
writefile: demo/writefile/Makefile writefile: demo/writefile/Makefile
( cd demo/writefile ; make ; cp bacawf ../../utils ) ( cd demo/writefile ; make ; cp bacawf ../../bin )
reinit: demo/reinit/Makefile reinit: demo/reinit/Makefile
( cd demo/reinit ; make ; cp bacrd ../../utils ) ( cd demo/reinit ; make ; cp bacrd ../../bin )
server: demo/server/Makefile server: demo/server/Makefile
( cd demo/server ; make ; cp bacserv ../../utils ) ( cd demo/server ; make ; cp bacserv ../../bin )
dcc: demo/dcc/Makefile dcc: demo/dcc/Makefile
( cd demo/dcc ; make ; cp bacdcc ../../utils ) ( cd demo/dcc ; make ; cp bacdcc ../../bin )
whohas: demo/whohas/Makefile whohas: demo/whohas/Makefile
( cd demo/whohas ; make ; cp bacwh ../../utils ) ( cd demo/whohas ; make ; cp bacwh ../../bin )
timesync: demo/timesync/Makefile timesync: demo/timesync/Makefile
( cd demo/timesync ; make ; cp bacts ../../utils ) ( cd demo/timesync ; make ; cp bacts ../../bin )
epics: demo/epics/Makefile epics: demo/epics/Makefile
( cd demo/epics ; make ; cp bacepics ../../utils ) ( cd demo/epics ; make ; cp bacepics ../../bin )
ucov: demo/ucov/Makefile ucov: demo/ucov/Makefile
( cd demo/ucov ; make ; cp bacucov ../../utils ) ( cd demo/ucov ; make ; cp bacucov ../../bin )
whois: demo/whois/Makefile whois: demo/whois/Makefile
( cd demo/whois ; make ; cp bacwi ../../utils ) ( cd demo/whois ; make ; cp bacwi ../../bin )
+1 -1
View File
@@ -70,7 +70,7 @@ all : $(BACNET_LIB) $(BCC_CFG) $(OBJS) $(PRODUCT_EXE)
del $(BCC_CFG) del $(BCC_CFG)
install: $(PRODUCT_EXE) install: $(PRODUCT_EXE)
copy $(PRODUCT_EXE) ..\..\utils\$(PRODUCT_EXE) copy $(PRODUCT_EXE) ..\..\bin\$(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link # Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly. # with a different linker - please change accordingly.
+1 -1
View File
@@ -72,7 +72,7 @@ all : $(BACNET_LIB) $(BCC_CFG) $(OBJS) $(PRODUCT_EXE)
del $(BCC_CFG) del $(BCC_CFG)
install: $(PRODUCT_EXE) install: $(PRODUCT_EXE)
copy $(PRODUCT_EXE) ..\..\utils\$(PRODUCT_EXE) copy $(PRODUCT_EXE) ..\..\bin\$(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link # Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly. # with a different linker - please change accordingly.
+1 -1
View File
@@ -69,7 +69,7 @@ all : $(BACNET_LIB) $(BCC_CFG) $(OBJS) $(PRODUCT_EXE)
del $(BCC_CFG) del $(BCC_CFG)
install: $(PRODUCT_EXE) install: $(PRODUCT_EXE)
copy $(PRODUCT_EXE) ..\..\utils\$(PRODUCT_EXE) copy $(PRODUCT_EXE) ..\..\bin\$(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link # Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly. # with a different linker - please change accordingly.
+1 -1
View File
@@ -69,7 +69,7 @@ all : $(BACNET_LIB) $(BCC_CFG) $(OBJS) $(PRODUCT_EXE)
del $(BCC_CFG) del $(BCC_CFG)
install: $(PRODUCT_EXE) install: $(PRODUCT_EXE)
copy $(PRODUCT_EXE) ..\..\utils\$(PRODUCT_EXE) copy $(PRODUCT_EXE) ..\..\bin\$(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link # Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly. # with a different linker - please change accordingly.
+1 -1
View File
@@ -69,7 +69,7 @@ all : $(BACNET_LIB) $(BCC_CFG) $(OBJS) $(PRODUCT_EXE)
del $(BCC_CFG) del $(BCC_CFG)
install: $(PRODUCT_EXE) install: $(PRODUCT_EXE)
copy $(PRODUCT_EXE) ..\..\utils\$(PRODUCT_EXE) copy $(PRODUCT_EXE) ..\..\bin\$(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link # Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly. # with a different linker - please change accordingly.
+1 -1
View File
@@ -72,7 +72,7 @@ all : $(BACNET_LIB) $(BCC_CFG) $(OBJS) $(PRODUCT_EXE)
del $(BCC_CFG) del $(BCC_CFG)
install: $(PRODUCT_EXE) install: $(PRODUCT_EXE)
copy $(PRODUCT_EXE) ..\..\utils\$(PRODUCT_EXE) copy $(PRODUCT_EXE) ..\..\bin\$(PRODUCT_EXE)
$(BACNET_LIB): $(BACNET_LIB):
cd $(BACNET_LIB_DIR) cd $(BACNET_LIB_DIR)
+1 -1
View File
@@ -69,7 +69,7 @@ all : $(BACNET_LIB) $(BCC_CFG) $(OBJS) $(PRODUCT_EXE)
del $(BCC_CFG) del $(BCC_CFG)
install: $(PRODUCT_EXE) install: $(PRODUCT_EXE)
copy $(PRODUCT_EXE) ..\..\utils\$(PRODUCT_EXE) copy $(PRODUCT_EXE) ..\..\bin\$(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link # Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly. # with a different linker - please change accordingly.
+1 -1
View File
@@ -69,7 +69,7 @@ all : $(BACNET_LIB) $(BCC_CFG) $(OBJS) $(PRODUCT_EXE)
del $(BCC_CFG) del $(BCC_CFG)
install: $(PRODUCT_EXE) install: $(PRODUCT_EXE)
copy $(PRODUCT_EXE) ..\..\utils\$(PRODUCT_EXE) copy $(PRODUCT_EXE) ..\..\bin\$(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link # Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly. # with a different linker - please change accordingly.
+1 -1
View File
@@ -69,7 +69,7 @@ all : $(BACNET_LIB) $(BCC_CFG) $(OBJS) $(PRODUCT_EXE)
del $(BCC_CFG) del $(BCC_CFG)
install: $(PRODUCT_EXE) install: $(PRODUCT_EXE)
copy $(PRODUCT_EXE) ..\..\utils\$(PRODUCT_EXE) copy $(PRODUCT_EXE) ..\..\bin\$(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link # Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly. # with a different linker - please change accordingly.
+1 -1
View File
@@ -69,7 +69,7 @@ all : $(BACNET_LIB) $(BCC_CFG) $(OBJS) $(PRODUCT_EXE)
del $(BCC_CFG) del $(BCC_CFG)
install: $(PRODUCT_EXE) install: $(PRODUCT_EXE)
copy $(PRODUCT_EXE) ..\..\utils\$(PRODUCT_EXE) copy $(PRODUCT_EXE) ..\..\bin\$(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link # Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly. # with a different linker - please change accordingly.
+1 -1
View File
@@ -69,7 +69,7 @@ all : $(BACNET_LIB) $(BCC_CFG) $(OBJS) $(PRODUCT_EXE)
del $(BCC_CFG) del $(BCC_CFG)
install: $(PRODUCT_EXE) install: $(PRODUCT_EXE)
copy $(PRODUCT_EXE) ..\..\utils\$(PRODUCT_EXE) copy $(PRODUCT_EXE) ..\..\bin\$(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link # Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly. # with a different linker - please change accordingly.
+1 -1
View File
@@ -69,7 +69,7 @@ all : $(BACNET_LIB) $(BCC_CFG) $(OBJS) $(PRODUCT_EXE)
del $(BCC_CFG) del $(BCC_CFG)
install: $(PRODUCT_EXE) install: $(PRODUCT_EXE)
copy $(PRODUCT_EXE) ..\..\utils\$(PRODUCT_EXE) copy $(PRODUCT_EXE) ..\..\bin\$(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link # Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly. # with a different linker - please change accordingly.
+67 -49
View File
@@ -2,22 +2,32 @@ FAQ - Frequently Asked Questions about the BACnet Stack
Q-1: Do you know the typical footprint of the stack (MS/TP use)? Q-1: Do you know the typical footprint of the stack (MS/TP use)?
A-1: It fits on a PIC18F6720 (128K bytes flash 3840 bytes RAM) and A-1a: It fits on a PIC18F6720 (128K bytes flash 3840 bytes RAM) and
there is lots of room for the application. In one device with 8 Binary there is lots of room for the application. In one device with 8 Binary
Value objects, 8 Binary Input objects, 1 Analog Input object, and Value objects, 8 Binary Input objects, 1 Analog Input object, and
supporting ReadProperty, WriteProperty, DeviceCommunicationControl, supporting ReadProperty, WriteProperty, DeviceCommunicationControl,
TimeSync, ReinitializeDevice, Who-Is, I-Am services, the BACnet stack TimeSync, ReinitializeDevice, Who-Is, I-Am services, the BACnet stack
used about 32K words of the code space. used about 32K words of the code space.
A-1b: It fits on a ATmega168 (16K bytes flash, 1024 bytes RAM). In one
device with 9 Analog Value objects supporting ReadProperty, Who-Is,
I-Am services, and 128 byte Maximum APDU. Using the Win-AVR (GCC-AVR)
compiler, the AVR Memory Usage:
Program: 16350 bytes (99.8% Full)
Data: 630 bytes (61.5% Full)
Using the IAR compiler, the AVR Memory Usage:
10 055 bytes of CODE memory (+ 36 range fill )
553 bytes of DATA memory (+ 24 absolute )
Q-2: The homepage used to say that the MS/TP code does not work. Still Q-2: The homepage used to say that the MS/TP code does not work. Still
true? true?
A-2: MS/TP works correctly as of the 0.2.6 release. I spent a several A-2: MS/TP works correctly as of the 0.2.6 release. I spent a several
days correcting it while working on the RTOS-32 port, and then a full days correcting it while working on the RTOS-32 port, and then a full
day fine-tuning it while working on the PIC18F6720 that I used at the day fine-tuning it while working on the PIC18F6720 that I used at the
BACnet International plugfest. The only issue at the plugfest was that 2006 BACnet International Plugfest. I also successfully used MS/TP
our unit didn't work at 76800, and that was probably due to me setting with the 0.4.0 release at the 2007 BACnet International Plugfest on an
the UART on the PIC incorrectly. Atmel AVR ATmega168.
Q-3: Does the stack have some specific requirements regarding the Q-3: Does the stack have some specific requirements regarding the
hardware (e.g. non-volatile memory, 32-bit CPU, ...)? hardware (e.g. non-volatile memory, 32-bit CPU, ...)?
@@ -33,34 +43,27 @@ stdbool.h. Most of the APDU size returns are int.
Q-4: Does the stack have some specific requirements regarding OS? What Q-4: Does the stack have some specific requirements regarding OS? What
OS features are used (threads, timers, semaphors, events, mutexes...)? OS features are used (threads, timers, semaphors, events, mutexes...)?
A-4: No, I did not use any OS features (except for the port/rtos32/ A-4: No, I did not use any OS features (except for the the ports to
which uses some tasks). Since my target was embedded, I kept every specific OS's: port/rtos32/, port/win32/ and port/linux/ which uses
thing single-threaded (but multithread safe except where noted) to some tasks or threads for the MS/TP datalink layer or sockets for the
keep it easy to follow and easy to implement in a microcontroller just BACnet/IP layers). Since my target was embedded, I kept every thing
running a main() loop. I expect that when I finish the port to single-threaded (but multithread safe except where noted) to keep it
RTOS-32, I will have some OS specific stuff, but that will end up in easy to follow and easy to implement in a microcontroller just running
the ports/rtos32/ directory. a main() loop.
I started to port the MS/TP state machine to RTOS-32 and it is
currently a single task (other than a timer task). However, it really
needs to have some queues and become multithreaded for effeciency.
Since the 0.2.6 release, I moved the MS/TP files (mstp.c, mstp.h,
dlmstp.c, dlmstp.h, rs485.c, rs485.h) into the ports/ directory so
that the code can be modified to suit the port.
Q-5: What is the difference between the two datalink layers BACnet/IP Q-5: What is the difference between the two datalink layers BACnet/IP
and BACnet Ethernet? In BACnet/IP, is the MAC address needed? and BACnet Ethernet? In BACnet/IP, is the MAC address needed?
A-5: The BACnet/IP uses the BACnet Virtual Link Control (BVLC) for A-5: The BACnet/IP datalink layer uses the BACnet Virtual Link Control
networking using UDP/IP. The IPv4 address (x.x.x.x) and the port (BVLC) for networking using UDP/IP. The IPv4 address (x.x.x.x) and the
number (0xBAC0) is stored as the MAC address. IPv6 would store more port number (0xBAC0) is stored as the MAC address. IPv6 will utilize a
bytes, and devices should be able to store them. See Annex J or bip.c virtual MAC address which will be the Device ID. See Annex J or bip.c
in the BACnet stack. in the BACnet stack.
BACnet Ethernet uses the Ethernet MAC address, and communicates using BACnet Ethernet uses the Ethernet MAC address, and communicates using
the IEEE 802.2/802.3 (see ANSI/ASHRAE 135-2004-7 Data Link/Physical the IEEE 802.2/802.3 (see ANSI/ASHRAE 135-2004-7 Data Link/Physical
Layers: ISO 8802-3 ("Ethernet") LAN). See ethernet.c in the BACnet Layers: ISO 8802-3 ("Ethernet") LAN). See ethernet.c in the
stack. port/linux/ directory of the BACnet stack.
Q-6: What do I need to do to learn about BACnet? Can this project Q-6: What do I need to do to learn about BACnet? Can this project
help? help?
@@ -117,13 +120,13 @@ the file. For each object type:
1. #include the header file for the object 1. #include the header file for the object
2. Device_Object_List_Count() needs to include a call to a 2. Device_Object_List_Count() needs to include a call to a
count function from the object type. count function from the object type.
3. Device_Object_List_Identifier() needs to include some code 3. Device_Object_List_Identifier() needs to include some code
to get the object instance for each object. to get the object instance for each object.
4. Device_Valid_Object_Id() needs to get the object name for 4. Device_Valid_Object_Id() needs to get the object name for
each object. each object.
5. PROP_PROTOCOL_OBJECT_TYPES_SUPPORTED needs to set a bit for 5. PROP_PROTOCOL_OBJECT_TYPES_SUPPORTED needs to set a bit for
each object type supported. each object type supported.
Additionally, for each service that interacts with objects, you will Additionally, for each service that interacts with objects, you will
need to include handling for that object. See demo/handler/h_rp.c to need to include handling for that object. See demo/handler/h_rp.c to
@@ -226,15 +229,16 @@ This limits you to a single MS/TP datalink.
* Change the number of objects that you have. * Change the number of objects that you have.
* Only a Device object is required. * Only a Device object is required.
* Update the Device object * Update the Device object
PROP_PROTOCOL_OBJECT_TYPES_SUPPORTED PROP_PROTOCOL_OBJECT_TYPES_SUPPORTED
4. Remove unused function calls by: 4. Remove unused function calls by:
* #if 0 and #endif around the unused functions * #if 0 and #endif around the unused functions
(especially in bacdcode.c) (especially in bacdcode.c)
* Compile and Link. If the linker fails, then that * Compile and Link. If the linker fails, then that
function was needed. function was needed.
* Some compilers and linkers have garbage collection * Some compilers, like GCC, have garbage collection for
for unused code/functions. GCC has this feature: unused functions and code. If enabled, the linker will eliminate the
http://gcc.gnu.org/ml/gcc-help/2003-08/msg00128.html unused functions and code. Use the GCC compiler and linker directive
to enable this feature.
Q-15: I have downloaded the BACnet stack but can't get demo/server to Q-15: I have downloaded the BACnet stack but can't get demo/server to
work. I am using a single computer. In one console window I run work. I am using a single computer. In one console window I run
@@ -252,35 +256,49 @@ the client application is unable to receive broadcast messages on port
The correct solution is to use BVLC (BACnet Virtual Link Control) The correct solution is to use BVLC (BACnet Virtual Link Control)
where the client applications use BACnet Foreign Device Registration, where the client applications use BACnet Foreign Device Registration,
and some application (probably the server) runs a BBMD (BACnet and some application (probably the server) runs a BBMD (BACnet
Broadcast Management Device). Unfortunately, I don't have bvlc.c Broadcast Management Device).
complete at this time, so that won't work for you today.
You can do one of the following: You can do one of the following:
1. Use QEMU or Bochs or VMWare or some other virtual machine to 1. Use QEMU or Bochs or VMWare or some other virtual machine to
simulate another computer, and run server or client on a virtual simulate another computer, and run server or client on a virtual
computer. computer.
2. Finish the bvlc.c code. Add BBMD support in the demo/server 2. Use the BACnet/IP BACnet Virtual Link Control (BVLC) features.
example. Add Foreign device registration in all the client examples The client demo applications are configured to use environment
when they are built with BACDL_BIP enabled. variables to establish a BBMD connection as a foreign device. Set the
BACNET_BBMD_PORT and BACNET_BBMD_ADDRESS of the BBMD. Note that the
demo/server application is configured as a BBMD.
3. Write npdu router code to route from BACnet/IP to another 3. Write npdu router code to route from BACnet/IP to another
datalink layer. Make server application on one datalink layer and make datalink layer. Make server application on one datalink layer and make
client applications on another datalink layer. client applications on another datalink layer.
4. Add external BACnet router or BACnet devices. Run a BACnet 4. Add external BACnet router or BACnet devices. Run a BACnet
demo/server on another PC. demo/server on another PC.
Q-16: My Linux computer doesn't use eth0 for for the BACnet connection. Q-16: My Linux computer doesn't use eth0 for for the BACnet
My Windows computer has more than one network connnection. How can I connection. My Windows computer has more than one network connnection.
choose the interface to use for the demo applications? How can I choose the interface to use for the demo applications?
A-16: Set the environment variable BACNET_IFACE. For Windows, set A-16: Set the environment variable BACNET_IFACE. For Windows, set
BACNET_IFACE=169.254.119.240 or whatever the address of the interface BACNET_IFACE=169.254.119.240 or whatever the address of the interface
returned by ipconfig command. For Linux, use BACNET_IFACE=eth0 or whatever returned by ipconfig command. For Linux, use BACNET_IFACE=eth0 or
the name of the interface returned by the ifconfig command. whatever the name of the interface returned by the ifconfig command.
Setting the environment variable under Windows can be done on the command Setting the environment variable under Windows can be done on the
line: command line:
> set BACNET_IFACE=169.254.119.240 > set BACNET_IFACE=169.254.119.240
Setting the environment variable under Linux can be done from the command
line: Setting the environment variable under Linux can be done from the
command line:
$ BACNET_IFACE=ath0 $ BACNET_IFACE=ath0
$ export BACNET_IFACE $ export BACNET_IFACE
Q-16: I need to communicate with an MS/TP Slave Node. Can I configure
the demo applications to use a static address binding?
A-16: Yes, static address binding is supported as of 0.4.3. Use a file
called address_cache (which is defined in src/address.c). The file
format is record based as follows:
;DeviceID MAC SNET SADR MAX-APDU
4194302 05 0 0 50
55555 C0:A8:00:18:BA:C0 26001 19 50
+2 -1
View File
@@ -1,6 +1,6 @@
There are a dozen or so demo applications that are built There are a dozen or so demo applications that are built
with the default makefiles. These demo applications are with the default makefiles. These demo applications are
copied to the utils/ directory. They can be used in copied to the bin/ directory. They can be used in
scripts and batch files to test BACnet devices or query scripts and batch files to test BACnet devices or query
information on the BACnet network, as well as simulate information on the BACnet network, as well as simulate
a BACnet device. a BACnet device.
@@ -45,3 +45,4 @@ AC:10:56:06:BA:C0=MAC address (router address) in hex
26001=DNET network number in decimal 26001=DNET network number in decimal
19=DADR MAC address in hex. Use colon to separate multibyte address. 19=DADR MAC address in hex. Use colon to separate multibyte address.
50=Max APDU 50=Max APDU
+1 -1
View File
@@ -13,7 +13,7 @@ MAKE=$(BORLAND_DIR)\bin\make.exe
all: library \ all: library \
readprop writeprop readfile writefile server dcc reinit \ readprop writeprop readfile writefile server dcc reinit \
whois whohas timesync ucov epics whois whohas timesync ucov epics
@echo "demo utilities are in utils directory" @echo "demo utilities are in the bin directory"
clean: lib\makefile.b32 \ clean: lib\makefile.b32 \
demo/readprop/makefile.b32 \ demo/readprop/makefile.b32 \