Release BACnet Protocol Stack 0.3.0

This commit is contained in:
skarg
2007-02-23 13:19:57 +00:00
parent 6c5b409dcf
commit 63e18a0f1f
315 changed files with 57198 additions and 0 deletions
+93
View File
@@ -0,0 +1,93 @@
#Makefile to build BACnet Application for the Linux Port
CC = gcc
BASEDIR = .
#CFLAGS = -Wall -I.
# -g for debugging with gdb
#CFLAGS = -Wall -I. -O2 -g
# Note: you can strip out symbols using the strip command
# to get an idea of how big the compile really is.
#DEFINES = -DBACFILE=1 -DPRINT_ENABLED=1 -DBIG_ENDIAN=0 -DBACDL_ETHERNET=1
#DEFINES = -DBACFILE=1 -DPRINT_ENABLED=1 -DBIG_ENDIAN=0 -DBACDL_ARCNET=1
#DEFINES = -DBACFILE=1 -DPRINT_ENABLED=1 -DBIG_ENDIAN=0 -DBACDL_MSTP=1
DEFINES = -DBACFILE=1 -DPRINT_ENABLED=1 -DBIG_ENDIAN=0 -DBACDL_BIP=1
BACNET_PORT = ../../ports/linux
BACNET_OBJECT = ../object
BACNET_HANDLER = ../handler
BACNET_ROOT = ../..
INCLUDES = -I$(BACNET_ROOT) -I$(BACNET_PORT) -I$(BACNET_OBJECT) -I$(BACNET_HANDLER)
CFLAGS = -Wall -g $(INCLUDES) $(DEFINES)
TARGET = bacserv
SRCS = main.c \
$(BACNET_PORT)/bip-init.c \
$(BACNET_PORT)/ethernet.c \
$(BACNET_PORT)/arcnet.c \
$(BACNET_ROOT)/bip.c \
$(BACNET_HANDLER)/txbuf.c \
$(BACNET_HANDLER)/noserv.c \
$(BACNET_HANDLER)/h_whois.c \
$(BACNET_HANDLER)/h_rp.c \
$(BACNET_HANDLER)/h_wp.c \
$(BACNET_HANDLER)/h_arf.c \
$(BACNET_HANDLER)/h_rd.c \
$(BACNET_HANDLER)/h_dcc.c \
$(BACNET_HANDLER)/h_ts.c \
$(BACNET_HANDLER)/h_whohas.c \
$(BACNET_HANDLER)/s_ihave.c \
$(BACNET_OBJECT)/device.c \
$(BACNET_OBJECT)/ai.c \
$(BACNET_OBJECT)/ao.c \
$(BACNET_OBJECT)/av.c \
$(BACNET_OBJECT)/bi.c \
$(BACNET_OBJECT)/bo.c \
$(BACNET_OBJECT)/bv.c \
$(BACNET_OBJECT)/lc.c \
$(BACNET_OBJECT)/lsp.c \
$(BACNET_OBJECT)/mso.c \
$(BACNET_OBJECT)/bacfile.c \
$(BACNET_ROOT)/filename.c \
$(BACNET_ROOT)/bacdcode.c \
$(BACNET_ROOT)/bacapp.c \
$(BACNET_ROOT)/bacprop.c \
$(BACNET_ROOT)/bacstr.c \
$(BACNET_ROOT)/bactext.c \
$(BACNET_ROOT)/datetime.c \
$(BACNET_ROOT)/indtext.c \
$(BACNET_ROOT)/bigend.c \
$(BACNET_ROOT)/whois.c \
$(BACNET_ROOT)/iam.c \
$(BACNET_ROOT)/whohas.c \
$(BACNET_ROOT)/ihave.c \
$(BACNET_ROOT)/rp.c \
$(BACNET_ROOT)/wp.c \
$(BACNET_ROOT)/arf.c \
$(BACNET_ROOT)/rd.c \
$(BACNET_ROOT)/dcc.c \
$(BACNET_ROOT)/timesync.c \
$(BACNET_ROOT)/abort.c \
$(BACNET_ROOT)/reject.c \
$(BACNET_ROOT)/bacerror.c \
$(BACNET_ROOT)/apdu.c \
$(BACNET_ROOT)/npdu.c
OBJS = ${SRCS:.c=.o}
all: ${TARGET}
${TARGET}: ${OBJS}
${CC} -o $@ ${OBJS}
.c.o:
${CC} -c ${CFLAGS} $*.c -o $@
depend:
rm -f .depend
${CC} -MM ${CFLAGS} *.c >> .depend
clean:
rm -rf core ${TARGET} $(OBJS) *.bak ports/linux/*.bak *.1 *.ini
include: .depend
@@ -0,0 +1,759 @@
PICS 0
BACnet Protocol Implementation Conformance Statement
--
--
-- BACnet Stack Demo
-- bacnet.sourceforge.net
-- Author: Steve Karg
--
--
Vendor Name: "ASHRAE"
Product Name: "SimpleServer"
Product Model Number: "GNU"
Product Description: "server"
BIBBs Supported:
{
-- The BIBBs may be any of:
-- DS-RP-A
DS-RP-B
-- DS-RPM-A DS-RPM-B
-- DS-RPC-A DS-RPC-B
-- DS-WP-A
DS-WP-B
-- DS-WPM-A DS-WPM-B
-- DS-COV-A DS-COV-B
-- DS-COVP-A DS-COVP-B
-- DS-COVU-A DS-COVU-B
-- AE-N-A AE-N-I-B AE-N-E-B
-- AE-ACK-A AE-ACK-B
-- AE-ASUM-A AE-ASUM-B
-- AE-ESUM-A AE-ESUM-B
-- AE-INFO-A AE-INFO-B
-- AE-LS-A AE-LS-B
-- SCHED-A SCHED-I-B SCHED-E-B
-- T-VMT-A T-VMT-I-B T-VMT-E-B
-- T-ATR-A T-ATR-B
-- DM-DDB-A
DM-DDB-B
-- DM-DOB-A
DM-DOB-B
-- DM-DCC-A
DM-DCC-B
-- DM-PT-A DM-PT-B
-- DM-TM-A DM-TM-B
-- DM-TS-A
DM-TS-B
-- DM-UTC-A
DM-UTC-B
-- DM-RD-A
DM-RD-B
-- DM-BR-A DM-BR-B
-- DM-R-A DM-R-B
-- DM-LM-A DM-LM-B
-- DM-OCD-A DM-OCD-B
-- DM-VT-A DM-VT-B
-- NM-CE-A NM-CE-B
-- NM-RC-A NM-RC-B
}
BACnet Standard Application Services Supported:
{
-- AcknowledgeAlarm Initiate Execute
-- ConfirmedCOVNotification Initiate Execute
UnconfirmedCOVNotification Initiate
-- ConfirmedEventNotification Initiate Execute
-- UnconfirmedEventNotification Initiate Execute
-- GetAlarmSummary Initiate Execute
-- GetEnrollmentSummary Initiate Execute
AtomicReadFile Initiate Execute
-- AtomicWriteFile Initiate Execute
-- AddListElement Initiate Execute
-- RemoveListElement Initiate Execute
-- CreateObject Initiate Execute
-- DeleteObject Initiate Execute
ReadProperty Initiate Execute
-- ReadpropertyConditional Initiate Execute
-- ReadPropertyMultiple Initiate Execute
-- SubscribeCOV Initiate Execute
WriteProperty Initiate Execute
-- WritePropertyMultiple Initiate Execute
DeviceCommunicationControl Initiate Execute
-- ConfirmedPrivateTransfer Initiate Execute
-- UnconfirmedPrivateTransfer Initiate Execute
TimeSynchronization Initiate Execute
Who-Has Initiate Execute
I-Have Initiate
Who-Is Initiate Execute
I-Am Initiate
-- VT-Open Initiate Execute
-- VT-Close Initiate Execute
-- VT-Data Initiate Execute
-- ConfirmedTextMessage Initiate Execute
-- UnconfirmedTextMessage Initiate Execute
ReinitializeDevice Initiate Execute
-- RequestKey Initiate Execute
-- Authenticate Initiate Execute
UTCTimeSynchronization Initiate Execute
-- ReadRange Initiate Execute
-- GetEventInformation Initiate Execute
-- LifeSafetyOperation Initiate Execute
-- SubscribeCOVProperty Initiate Execute
-- RequestKey Initiate Execute
-- Authenticate Initiate Execute
}
Standard Object-Types Supported:
{
Analog Input
Analog Output
Analog Value
-- Averaging Createable Deleteable
Binary Input
Binary Output
Binary Value
-- Calendar Createable Deleteable
-- Command Createable Deleteable
Device
-- Event Enrollment Createable Deleteable
File
-- Group Createable Deleteable
-- Loop Createable Deleteable
-- Multi-state Input Createable Deleteable
Multi-state Output
-- Multi-state Value Createable Deleteable
-- Notification Class Createable Deleteable
-- Program Createable Deleteable
-- Schedule Createable Deleteable
Life Safety Point
-- Life Safety Zone Createable Deleteable
-- Trend Log Createable Deleteable
Load Control
}
Data Link Layer Option:
{
-- ISO 8802-3, 10BASE5
-- ISO 8802-3, 10BASE2
-- ISO 8802-3, 10BASET
-- ISO 8802-3, Fiber
-- ARCNET, coax star
-- ARCNET, coax bus
-- ARCNET, twisted pair star
-- ARCNET, twisted pair bus
-- ARCNET, fiber star
-- MS/TP master. Baud rate(s): 9600
-- MS/TP slave. Baud rate(s): 9600
-- Point-To-Point. Modem, Baud rate(s): 14.4k
-- Point-To-Point. Modem, Autobaud range: 9600 to 28.8k
BACnet/IP, 'DIX' Ethernet
-- BACnet/IP, PPP
-- Other
}
Character Sets Supported:
{
ANSI X3.4
-- Other Character Sets not supported
-- IBM/Microsoft DBCS
-- JIS C 6226
-- ISO 10646 (ICS-4)
-- ISO 10646 (UCS2)
}
Special Functionality:
{
Maximum APDU size in octets: 480 -- Arcnet Maximum 501 less NL Header
-- Maximum APDU size in octets: 474
-- Segmented Requests Supported, window size: 1
-- Segmented Responses Supported, window size: 1
-- Router
}
List of Objects in test device:
{
{
object-identifier: (device,123)
object-name: "SimpleServer"
object-type: device
system-status: operational
vendor-name: "ASHRAE"
vendor-identifier: 0
model-name: "GNU"
firmware-revision: "1.0"
application-software-version: "1.0"
protocol-version: 1
protocol-revision: 5
protocol-conformance-class: 1
protocol-services-supported: (F,F,F,F,F,F,T,F,F,F,F,F,T,F,F,T,F,T,F,F,T,F,F,F,F,F,F,F,F,F,F,F,T,T,T,F,T,F,F,F)
protocol-object-types-supported: (T,T,T,T,T,T,F,F,T,F,T,F,F,F,T,F,F,F,F,F,F,T,F,F,F)
max-apdu-length-accepted: 480
segmentation-supported: no-segmentation
apdu-timeout: 3000
number-of-apdu-retries: 3
device-address-binding: ?
local-time: ?
local-date: ?
utc-offset: ?
daylight-savings-status: ?
database-revision: ?
object-list: {
(device,123),(analog-input,0),(analog-input,1),
(analog-input,2),(analog-input,3),(analog-input,4),
(analog-input,5),(analog-input,6),(analog-output,0),
(analog-output,1),(analog-output,2),(analog-output,3),
(analog-value,0),(analog-value,1),(analog-value,2),
(analog-value,3),(binary-input,0),(binary-input,1),
(binary-input,2),(binary-input,3),(binary-input,4),
(binary-output,0),(binary-output,1),(binary-output,2),
(binary-output,3),(binary-output,4),(binary-output,5),
(binary-value,0),(binary-value,1),(life-safety-point,0),
(life-safety-point,1),(life-safety-point,2),(life-safety-point,3),
(life-safety-point,4),(life-safety-point,5),(life-safety-point,6),
(multi-state-output,0),(multi-state-output,1),(multi-state-output,2),
(multi-state-output,3),(file,0),(file,1),
(file,2)
}
},
{
object-identifier: (analog-input,0)
object-name: "ANALOG INPUT 0"
object-type: analog-input
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
units: percent
description: "ANALOG INPUT 0"
},
{
object-identifier: (analog-input,1)
object-name: "ANALOG INPUT 1"
object-type: analog-input
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
units: percent
description: "ANALOG INPUT 1"
},
{
object-identifier: (analog-input,2)
object-name: "ANALOG INPUT 2"
object-type: analog-input
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
units: percent
description: "ANALOG INPUT 2"
},
{
object-identifier: (analog-input,3)
object-name: "ANALOG INPUT 3"
object-type: analog-input
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
units: percent
description: "ANALOG INPUT 3"
},
{
object-identifier: (analog-input,4)
object-name: "ANALOG INPUT 4"
object-type: analog-input
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
units: percent
description: "ANALOG INPUT 4"
},
{
object-identifier: (analog-input,5)
object-name: "ANALOG INPUT 5"
object-type: analog-input
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
units: percent
description: "ANALOG INPUT 5"
},
{
object-identifier: (analog-input,6)
object-name: "ANALOG INPUT 6"
object-type: analog-input
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
units: percent
description: "ANALOG INPUT 6"
},
{
object-identifier: (analog-output,0)
object-name: "ANALOG OUTPUT 0"
object-type: analog-output
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
units: percent
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: 0.000000
description: "ANALOG OUTPUT 0"
},
{
object-identifier: (analog-output,1)
object-name: "ANALOG OUTPUT 1"
object-type: analog-output
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
units: percent
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: 0.000000
description: "ANALOG OUTPUT 1"
},
{
object-identifier: (analog-output,2)
object-name: "ANALOG OUTPUT 2"
object-type: analog-output
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
units: percent
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: 0.000000
description: "ANALOG OUTPUT 2"
},
{
object-identifier: (analog-output,3)
object-name: "ANALOG OUTPUT 3"
object-type: analog-output
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
units: percent
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: 0.000000
description: "ANALOG OUTPUT 3"
},
{
object-identifier: (analog-value,0)
object-name: "ANALOG VALUE 0"
object-type: analog-value
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
units: percent
relinquish-default: 0.000000
description: "ANALOG VALUE 0"
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: 0.000000
},
{
object-identifier: (analog-value,1)
object-name: "ANALOG VALUE 1"
object-type: analog-value
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
units: percent
relinquish-default: 0.000000
description: "ANALOG VALUE 1"
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: 0.000000
},
{
object-identifier: (analog-value,2)
object-name: "ANALOG VALUE 2"
object-type: analog-value
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
units: percent
relinquish-default: 0.000000
description: "ANALOG VALUE 2"
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: 0.000000
},
{
object-identifier: (analog-value,3)
object-name: "ANALOG VALUE 3"
object-type: analog-value
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
units: percent
relinquish-default: 0.000000
description: "ANALOG VALUE 3"
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: 0.000000
},
{
object-identifier: (binary-input,0)
object-name: "BINARY INPUT 0"
object-type: binary-input
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
polarity: normal
description: "BINARY INPUT 0"
},
{
object-identifier: (binary-input,1)
object-name: "BINARY INPUT 1"
object-type: binary-input
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
polarity: normal
description: "BINARY INPUT 1"
},
{
object-identifier: (binary-input,2)
object-name: "BINARY INPUT 2"
object-type: binary-input
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
polarity: normal
description: "BINARY INPUT 2"
},
{
object-identifier: (binary-input,3)
object-name: "BINARY INPUT 3"
object-type: binary-input
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
polarity: normal
description: "BINARY INPUT 3"
},
{
object-identifier: (binary-input,4)
object-name: "BINARY INPUT 4"
object-type: binary-input
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
polarity: normal
description: "BINARY INPUT 4"
},
{
object-identifier: (binary-output,0)
object-name: "BINARY OUTPUT 0"
object-type: binary-output
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
polarity: normal
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: inactive
description: "BINARY OUTPUT 0"
},
{
object-identifier: (binary-output,1)
object-name: "BINARY OUTPUT 1"
object-type: binary-output
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
polarity: normal
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: inactive
description: "BINARY OUTPUT 1"
},
{
object-identifier: (binary-output,2)
object-name: "BINARY OUTPUT 2"
object-type: binary-output
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
polarity: normal
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: inactive
description: "BINARY OUTPUT 2"
},
{
object-identifier: (binary-output,3)
object-name: "BINARY OUTPUT 3"
object-type: binary-output
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
polarity: normal
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: inactive
description: "BINARY OUTPUT 3"
},
{
object-identifier: (binary-output,4)
object-name: "BINARY OUTPUT 4"
object-type: binary-output
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
polarity: normal
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: inactive
description: "BINARY OUTPUT 4"
},
{
object-identifier: (binary-output,5)
object-name: "BINARY OUTPUT 5"
object-type: binary-output
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
polarity: normal
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: inactive
description: "BINARY OUTPUT 5"
},
{
object-identifier: (binary-value,0)
object-name: "BINARY VALUE 0"
object-type: binary-value
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
description: "BINARY VALUE 0"
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: inactive
},
{
object-identifier: (binary-value,1)
object-name: "BINARY VALUE 1"
object-type: binary-value
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
description: "BINARY VALUE 1"
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: inactive
},
{
object-identifier: (life-safety-point,0)
object-name: "LS POINT 0"
object-type: life-safety-point
description: "LS POINT 0"
present-value: ?
device-type: ?
status-flags: (F,F,F,F)
event-state: normal
reliability: ?
out-of-service: F
mode: ? W
silenced: ?
operation-expected: ?
},
{
object-identifier: (life-safety-point,1)
object-name: "LS POINT 1"
object-type: life-safety-point
description: "LS POINT 1"
present-value: ?
device-type: ?
status-flags: (F,F,F,F)
event-state: normal
reliability: ?
out-of-service: F
mode: ? W
silenced: ?
operation-expected: ?
},
{
object-identifier: (life-safety-point,2)
object-name: "LS POINT 2"
object-type: life-safety-point
description: "LS POINT 2"
present-value: ?
device-type: ?
status-flags: (F,F,F,F)
event-state: normal
reliability: ?
out-of-service: F
mode: ? W
silenced: ?
operation-expected: ?
},
{
object-identifier: (life-safety-point,3)
object-name: "LS POINT 3"
object-type: life-safety-point
description: "LS POINT 3"
present-value: ?
device-type: ?
status-flags: (F,F,F,F)
event-state: normal
reliability: ?
out-of-service: F
mode: ? W
silenced: ?
operation-expected: ?
},
{
object-identifier: (life-safety-point,4)
object-name: "LS POINT 4"
object-type: life-safety-point
description: "LS POINT 4"
present-value: ?
device-type: ?
status-flags: (F,F,F,F)
event-state: normal
reliability: ?
out-of-service: F
mode: ? W
silenced: ?
operation-expected: ?
},
{
object-identifier: (life-safety-point,5)
object-name: "LS POINT 5"
object-type: life-safety-point
description: "LS POINT 5"
present-value: ?
device-type: ?
status-flags: (F,F,F,F)
event-state: normal
reliability: ?
out-of-service: F
mode: ? W
silenced: ?
operation-expected: ?
},
{
object-identifier: (life-safety-point,6)
object-name: "LS POINT 6"
object-type: life-safety-point
description: "LS POINT 6"
present-value: ?
device-type: ?
status-flags: (F,F,F,F)
event-state: normal
reliability: ?
out-of-service: F
mode: ? W
silenced: ?
operation-expected: ?
},
{
object-identifier: (multi-state-output,0)
object-name: "MULTISTATE OUTPUT 0"
object-type: multi-state-output
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: inactive
number-of-states: 254
description: "MULTISTATE OUTPUT 0"
},
{
object-identifier: (multi-state-output,1)
object-name: "MULTISTATE OUTPUT 1"
object-type: multi-state-output
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: inactive
number-of-states: 254
description: "MULTISTATE OUTPUT 1"
},
{
object-identifier: (multi-state-output,2)
object-name: "MULTISTATE OUTPUT 2"
object-type: multi-state-output
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: inactive
number-of-states: 254
description: "MULTISTATE OUTPUT 2"
},
{
object-identifier: (multi-state-output,3)
object-name: "MULTISTATE OUTPUT 3"
object-type: multi-state-output
present-value: ?
status-flags: (F,F,F,F)
event-state: normal
out-of-service: F
priority-array: {?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?}
relinquish-default: inactive
number-of-states: 254
description: "MULTISTATE OUTPUT 3"
},
{
object-identifier: (file,0)
object-name: "FILE 0"
object-type: file
file-type: "TEXT"
file-size: 0
modification-date: ?
archive: ? W
read-only: T
file-access-method: stream-access
description: "test.log"
},
{
object-identifier: (file,1)
object-name: "FILE 1"
object-type: file
file-type: "TEXT"
file-size: 0
modification-date: ?
archive: ? W
read-only: T
file-access-method: stream-access
description: "script.txt"
},
{
object-identifier: (file,2)
object-name: "FILE 2"
object-type: file
file-type: "TEXT"
file-size: 39582
modification-date: ?
archive: ? W
read-only: T
file-access-method: stream-access
description: "bacenum.h"
}
}
End of BACnet Protocol Implementation Conformance Statement
+168
View File
@@ -0,0 +1,168 @@
/**************************************************************************
*
* Copyright (C) 2006 Steve Karg <skarg@users.sourceforge.net>
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*********************************************************************/
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <time.h>
#include "config.h"
#include "address.h"
#include "bacdef.h"
#include "handlers.h"
#include "client.h"
#include "bacdcode.h"
#include "npdu.h"
#include "apdu.h"
#include "iam.h"
#include "tsm.h"
#include "device.h"
#include "bacfile.h"
#include "datalink.h"
#include "dcc.h"
#include "net.h"
#include "txbuf.h"
#include "lc.h"
/* This is an example server application using the BACnet Stack */
/* buffers used for receiving */
static uint8_t Rx_Buf[MAX_MPDU] = { 0 };
static void Init_Service_Handlers(void)
{
/* we need to handle who-is to support dynamic device binding */
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_WHO_IS,
handler_who_is);
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_WHO_HAS,
handler_who_has);
/* set the handler for all the services we don't implement */
/* It is required to send the proper reject message... */
apdu_set_unrecognized_service_handler_handler
(handler_unrecognized_service);
/* Set the handlers for any confirmed services that we support. */
/* We must implement read property - it's required! */
apdu_set_confirmed_handler(SERVICE_CONFIRMED_READ_PROPERTY,
handler_read_property);
apdu_set_confirmed_handler(SERVICE_CONFIRMED_WRITE_PROPERTY,
handler_write_property);
apdu_set_confirmed_handler(SERVICE_CONFIRMED_ATOMIC_READ_FILE,
handler_atomic_read_file);
apdu_set_confirmed_handler(SERVICE_CONFIRMED_REINITIALIZE_DEVICE,
handler_reinitialize_device);
apdu_set_unconfirmed_handler
(SERVICE_UNCONFIRMED_UTC_TIME_SYNCHRONIZATION,
handler_timesync_utc);
apdu_set_unconfirmed_handler(SERVICE_UNCONFIRMED_TIME_SYNCHRONIZATION,
handler_timesync);
/* handle communication so we can shutup when asked */
apdu_set_confirmed_handler
(SERVICE_CONFIRMED_DEVICE_COMMUNICATION_CONTROL,
handler_device_communication_control);
}
static void cleanup(void)
{
datalink_cleanup();
}
static void print_address(char *name, BACNET_ADDRESS * dest)
{ /* destination address */
int i = 0; /* counter */
if (dest) {
printf("%s: ", name);
for (i = 0; i < dest->mac_len; i++) {
printf("%02X", dest->mac[i]);
}
printf("\n");
}
}
int main(int argc, char *argv[])
{
BACNET_ADDRESS src = { 0 }; /* address where message came from */
uint16_t pdu_len = 0;
unsigned timeout = 100; /* milliseconds */
BACNET_ADDRESS my_address, broadcast_address;
time_t last_seconds = 0;
time_t current_seconds = 0;
/* allow the device ID to be set */
if (argc > 1)
Device_Set_Object_Instance_Number(strtol(argv[1], NULL, 0));
#if defined(BACDL_BIP)
if (argc > 2)
bip_set_port(strtol(argv[2], NULL, 0));
#endif
printf("BACnet Server Demo - Device #%u\r\n",
Device_Object_Instance_Number());
Init_Service_Handlers();
#ifdef BACDL_ETHERNET
/* init the physical layer */
if (!ethernet_init("eth0"))
return 1;
#endif
#ifdef BACDL_BIP
bip_set_interface("eth0");
if (!bip_init())
return 1;
printf("bip: using port %hu\r\n", bip_get_port());
#endif
#ifdef BACDL_ARCNET
if (!arcnet_init("arc0"))
return 1;
#endif
datalink_get_broadcast_address(&broadcast_address);
print_address("Broadcast", &broadcast_address);
datalink_get_my_address(&my_address);
print_address("Address", &my_address);
atexit(cleanup);
/* configure the timeout values */
last_seconds = time(NULL);
/* broadcast an I-Am on startup */
iam_send(&Handler_Transmit_Buffer[0]);
/* loop forever */
for (;;) {
/* input */
current_seconds = time(NULL);
/* returns 0 bytes on timeout */
pdu_len = datalink_receive(&src, &Rx_Buf[0], MAX_MPDU, timeout);
/* process */
if (pdu_len) {
npdu_handler(&src, &Rx_Buf[0], pdu_len);
}
/* at least one second has passed */
if (current_seconds != last_seconds) {
dcc_timer_seconds(current_seconds - last_seconds);
Load_Control_State_Machine_Handler();
}
/* output */
/* blink LEDs, Turn on or off outputs, etc */
}
}
+164
View File
@@ -0,0 +1,164 @@
#
# Simple makefile to build an executable for Win32
#
# This makefile assumes Borland bcc32 development environment
# on Windows NT/9x/2000/XP
#
!ifndef BORLAND_DIR
BORLAND_DIR_Not_Defined:
@echo .
@echo You must define environment variable BORLAND_DIR to compile.
!endif
PRODUCT = bacserv
PRODUCT_EXE = $(PRODUCT).exe
# Choose the Data Link Layer to Enable
# Note: unless some other drivers are installed, BIP is the only
# datalink layer that Win32 supports
DEFINES = -DBACDL_BIP=1;USE_INADDR=1;PRINT_ENABLED=1;BIG_ENDIAN=0
SRCS = main.c \
..\..\ports\win32\bip-init.c \
..\..\bip.c \
..\..\demo\handler\txbuf.c \
..\..\demo\handler\noserv.c \
..\..\demo\handler\h_whois.c \
..\..\demo\handler\h_rp.c \
..\..\demo\handler\h_wp.c \
..\..\demo\handler\h_arf.c \
..\..\demo\handler\h_rd.c \
..\..\demo\handler\h_dcc.c \
..\..\demo\handler\h_ts.c \
..\..\demo\handler\h_whohas.c \
..\..\demo\handler\s_ihave.c \
..\..\bacdcode.c \
..\..\bacapp.c \
..\..\bacstr.c \
..\..\bactext.c \
..\..\datetime.c \
..\..\indtext.c \
..\..\bigend.c \
..\..\whois.c \
..\..\iam.c \
..\..\whohas.c \
..\..\ihave.c \
..\..\rp.c \
..\..\wp.c \
..\..\arf.c \
..\..\awf.c \
..\..\rd.c \
..\..\dcc.c \
..\..\timesync.c \
..\..\demo\object\bacfile.c \
..\..\demo\object\device.c \
..\..\demo\object\ai.c \
..\..\demo\object\ao.c \
..\..\demo\object\av.c \
..\..\demo\object\bi.c \
..\..\demo\object\bo.c \
..\..\demo\object\bv.c \
..\..\demo\object\lc.c \
..\..\demo\object\lsp.c \
..\..\demo\object\mso.c \
..\..\abort.c \
..\..\reject.c \
..\..\bacerror.c \
..\..\apdu.c \
..\..\npdu.c
OBJS = $(SRCS:.c=.obj)
# Compiler definitions
#
BCC_CFG = bcc32.cfg
CC = $(BORLAND_DIR)\bin\bcc32 +$(BCC_CFG)
#LINK = $(BORLAND_DIR)\bin\tlink32
LINK = $(BORLAND_DIR)\bin\ilink32
TLIB = $(BORLAND_DIR)\bin\tlib
#
# Include directories
#
CC_DIR = $(BORLAND_DIR)\BIN
INCL_DIRS = -I$(BORLAND_DIR)\include;..\..\;..\..\demo\object\;..\..\demo\handler\;..\..\ports\win32\;.
CFLAGS = $(INCL_DIRS) $(CS_FLAGS) $(DEFINES)
# Libraries
#
C_LIB_DIR = $(BORLAND_DIR)\lib
LIBS = $(C_LIB_DIR)\IMPORT32.lib \
$(C_LIB_DIR)\CW32MT.lib
#
# Main target
#
# This should be the first one in the makefile
all : $(BCC_CFG) $(PRODUCT_EXE)
install: $(PRODUCT_EXE)
copy $(PRODUCT_EXE) ..\..\utils\$(PRODUCT_EXE)
# Linker specific: the link below is for BCC linker/compiler. If you link
# with a different linker - please change accordingly.
#
# need a temp response file (@&&) because command line is too long
$(PRODUCT_EXE) : $(OBJS)
@echo Running Linker for $(PRODUCT_EXE)
$(LINK) -L$(C_LIB_DIR) -m -c -s -v @&&| # temp response file, starts with |
$(BORLAND_DIR)\lib\c0x32.obj $** # $** lists each dependency
$<
$*.map
$(LIBS)
| # end of temp response file
#
# Utilities
clean :
@echo Deleting obj files, $(PRODUCT_EXE) and map files.
# del $(OBJS) # command too long, bummer!
del *.obj
del ..\..\*.obj
del ..\..\demo\handler\*.obj
del ..\..\demo\object\*.obj
del ..\..\ports\win32\*.obj
del $(PRODUCT_EXE)
del *.map
del $(BCC_CFG)
#
# Generic rules
#
.SUFFIXES: .cpp .c .sbr .obj
#
# cc generic rule
#
.c.obj:
$(CC) -o$@ $<
# Compiler configuration file
$(BCC_CFG) :
Copy &&|
$(CFLAGS)
-c
-y #include line numbers in OBJ's
-v #include debug info
-w+ #turn on all warnings
-Od #disable all optimizations
#-a4 #32 bit data alignment
#-M # generate link map
#-ls # linker options
#-WM- #not multithread
-WM #multithread
-w-aus # ignore warning assigned a value that is never used
-w-sig # ignore warning conversion may lose sig digits
| $@
# EOF: makefile