From 0f53e4c9e9dc63cff2fa97cb60832cd06c89ef94 Mon Sep 17 00:00:00 2001 From: skarg Date: Mon, 2 Apr 2007 21:31:26 +0000 Subject: [PATCH] Updated the pic18f6720 demo in the ports directory. Added EPICS for the pic18f6720. --- bacnet-stack/demo/server/epics_vts3.tpi | 2 +- .../ports/pic18f6720/BACnet-Server.mcp | 2 +- .../ports/pic18f6720/BACnet-Server.mcw | Bin 54272 -> 54272 bytes bacnet-stack/ports/pic18f6720/bi.c | 19 +- bacnet-stack/ports/pic18f6720/bv.c | 17 +- bacnet-stack/ports/pic18f6720/pic18f6720.tpi | 408 ++++++++++++++++++ 6 files changed, 443 insertions(+), 5 deletions(-) create mode 100644 bacnet-stack/ports/pic18f6720/pic18f6720.tpi diff --git a/bacnet-stack/demo/server/epics_vts3.tpi b/bacnet-stack/demo/server/epics_vts3.tpi index 79a06669..487ea5e4 100644 --- a/bacnet-stack/demo/server/epics_vts3.tpi +++ b/bacnet-stack/demo/server/epics_vts3.tpi @@ -166,7 +166,7 @@ Character Sets Supported: Special Functionality: { Maximum APDU size in octets: 480 -- Arcnet Maximum 501 less NL Header --- Maximum APDU size in octets: 474 +-- Maximum APDU size in octets: 480 -- Segmented Requests Supported, window size: 1 -- Segmented Responses Supported, window size: 1 -- Router diff --git a/bacnet-stack/ports/pic18f6720/BACnet-Server.mcp b/bacnet-stack/ports/pic18f6720/BACnet-Server.mcp index 33546dc4..7be6b8cd 100644 --- a/bacnet-stack/ports/pic18f6720/BACnet-Server.mcp +++ b/bacnet-stack/ports/pic18f6720/BACnet-Server.mcp @@ -6,7 +6,7 @@ dir_src= dir_bin= dir_tmp= dir_sin= -dir_inc=C:\code\bacnet-stack;C:\code\bacnet-stack\demo\handler;C:\code\bacnet-stack\demo\object;C:\code\bacnet-stack\ports\pic18 +dir_inc=C:\code\bacnet-stack;C:\code\bacnet-stack\demo\handler;C:\code\bacnet-stack\demo\object;C:\code\bacnet-stack\ports\pic18f6720 dir_lib=C:\mcc18\lib dir_lkr= [CAT_FILTERS] diff --git a/bacnet-stack/ports/pic18f6720/BACnet-Server.mcw b/bacnet-stack/ports/pic18f6720/BACnet-Server.mcw index 63b379e63aa0ee7b12a5d0823c61309050c1a130..2749ec9d81c42cf400af07169da85e0071bde18c 100644 GIT binary patch delta 3195 zcmaLZeN0nV6aeu1T98tK2?I9Ku|laLIyT45CMv@XBE!v(I5$CuvWj4Z%7+M)Qi_Nl z1uAe9u_}t6Sih~wHnwTZOqQ|5Et9|agXo_lh8brv(-_@-w|zbJY}xyx_vGE*IrqNz z?z^w{LA8BQeWg5PlHK@i_~u$qb%;|9I!&B*5@T$6?Y7F=Z9STJn5QvFCRnTKl%~KR znhbT>gbrR0pQY{%t%RlFQ=6y!{VEIR8Frm&gex01IOgvNO=JHklQJc6!Hq>M9k5@H!X>6_$!934DGh&g~hQ7-pXoG zNViqKlUxHt`0m%uh&CuQriQ$wy3ah7kx!+-y?@DzarC2{DBm;rQBt1GXD3zgjd8Xo zyI@XeAgO4QB$+)8>#wUNEusHqkmzL<36xWuPusV4*@`$kCXn?qa z+0dblg-3yg9@AxJ{-VnrDie$93Cot)y#X%OBk@wQRFM7#B;yVHUR(_fk{b2!i^UL_ZbGAfAb!ScoeMuSCI0$vZH1DX~)hWs$nD6;mCp$W=QrwkWZZIu-8Q^f0{*Q%!Atu8`?a zyek!=cj*F`SGWr+{vH(P?F({MWBs^Cx00Iyw;*#ez&6z$%%&gct=G>qU}wkdP8V?i@st&__tAZ&~yq z(Hg{b zQ9lxQKOwb(EIWq8b&QZYL9&h`aU3V4L6GzTB$fd}8pRuxcmj#(1R+g=M4d!Zc#@E2 zL7oMX{8NOq2r_XBt7M)gq*aiy(@4_J5YomsqZ#n)ndHDemT;Dk-Gbaai$ps}$X-D% z4FKg z9@bsN>h6oklP_WHQerjV4x!`n$FSk@?HJ97ObyuONaF&PJq%ci3RX&LjvaWJZY2}_SSu8A&X@xx4Dr*;H z@S`kEYEh|STEr}=E5Zn?BI4>~e>_JbXof{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@}!lK z-U~>^E^t-a*|yu}z-@QL!I2IqYot$=iy=>yivdChu=EnfE-@B&uPV5GNdwz1V|B-6 z #include @@ -35,7 +35,20 @@ #define MAX_BINARY_INPUTS 8 -static BACNET_BINARY_PV Present_Value[MAX_BINARY_INPUTS]; +static BACNET_BINARY_PV Present_Value[MAX_BINARY_INPUTS]; + +static void Binary_Input_Initialize(void) +{ + static bool initialized = false; + unsigned i; + + if (!initialized) { + initialized = true; + for (i = 0; i < MAX_BINARY_INPUTS; i++) { + Present_Value[i] = BINARY_INACTIVE; + } + } +} /* we simply have 0-n object instances. */ bool Binary_Input_Valid_Instance(uint32_t object_instance) @@ -77,6 +90,7 @@ static BACNET_BINARY_PV Binary_Input_Present_Value(uint32_t BACNET_BINARY_PV value = BINARY_INACTIVE; unsigned index = 0; + Binary_Input_Initialize(); index = Binary_Input_Instance_To_Index(object_instance); if (index < MAX_BINARY_INPUTS) { value = Present_Value[index]; @@ -113,6 +127,7 @@ int Binary_Input_Encode_Property_APDU(uint8_t * apdu, (void) array_index; + Binary_Input_Initialize(); switch (property) { case PROP_OBJECT_IDENTIFIER: apdu_len = encode_tagged_object_id(&apdu[0], OBJECT_BINARY_INPUT, diff --git a/bacnet-stack/ports/pic18f6720/bv.c b/bacnet-stack/ports/pic18f6720/bv.c index 81b65ca1..c56158ab 100644 --- a/bacnet-stack/ports/pic18f6720/bv.c +++ b/bacnet-stack/ports/pic18f6720/bv.c @@ -23,7 +23,7 @@ * *********************************************************************/ -/* Binary Output Objects - customize for your use */ +/* Binary Value Objects - customize for your use */ #include #include @@ -38,6 +38,19 @@ static BACNET_BINARY_PV Present_Value[MAX_BINARY_VALUES]; +static void Binary_Value_Initialize(void) +{ + static bool initialized = false; + unsigned i; + + if (!initialized) { + initialized = true; + for (i = 0; i < MAX_BINARY_VALUES; i++) { + Present_Value[i] = BINARY_INACTIVE; + } + } +} + /* we simply have 0-n object instances. */ bool Binary_Value_Valid_Instance(uint32_t object_instance) { @@ -75,6 +88,7 @@ static BACNET_BINARY_PV Binary_Value_Present_Value(uint32_t { BACNET_BINARY_PV value = BINARY_INACTIVE; + Binary_Value_Initialize(); if (object_instance < MAX_BINARY_VALUES) { value = Present_Value[object_instance]; } @@ -112,6 +126,7 @@ int Binary_Value_Encode_Property_APDU(uint8_t * apdu, unsigned i = 0; bool state = false; + Binary_Value_Initialize(); switch (property) { case PROP_OBJECT_IDENTIFIER: apdu_len = encode_tagged_object_id(&apdu[0], OBJECT_BINARY_VALUE, diff --git a/bacnet-stack/ports/pic18f6720/pic18f6720.tpi b/bacnet-stack/ports/pic18f6720/pic18f6720.tpi new file mode 100644 index 00000000..5370f652 --- /dev/null +++ b/bacnet-stack/ports/pic18f6720/pic18f6720.tpi @@ -0,0 +1,408 @@ +PICS 0 +BACnet Protocol Implementation Conformance Statement + +-- +-- +-- BACnet Stack Demo +-- bacnet.sourceforge.net +-- Author: Steve Karg +-- +-- +Vendor Name: "ASHRAE" +Product Name: "PIC18F6720 Device" +Product Model Number: "GNU Demo" +Product Description: "BACnet Demo" + +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 Execute +-- ReadpropertyConditional Initiate Execute +-- ReadPropertyMultiple Initiate Execute +-- SubscribeCOV Initiate Execute + WriteProperty Execute +-- WritePropertyMultiple Initiate Execute + DeviceCommunicationControl Execute +-- ConfirmedPrivateTransfer Initiate Execute +-- UnconfirmedPrivateTransfer Initiate Execute +-- TimeSynchronization Initiate Execute +-- Who-Has Execute +-- I-Have Initiate + Who-Is Execute + I-Am Initiate +-- VT-Open Initiate Execute +-- VT-Close Initiate Execute +-- VT-Data Initiate Execute +-- ConfirmedTextMessage Initiate Execute +-- UnconfirmedTextMessage Initiate Execute + ReinitializeDevice 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, 19200, 38400, 76800 +-- 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: 50 +-- Maximum APDU size in octets: 480 +-- Segmented Requests Supported, window size: 1 +-- Segmented Responses Supported, window size: 1 +-- Router +} + +List of Objects in test device: +{ + { + object-identifier: (device,12345) + object-name: "PIC18F6720 Device" + object-type: device + system-status: operational + vendor-name: "ASHRAE" + vendor-identifier: 0 + model-name: "GNU Demo" + firmware-revision: "1.00" + application-software-version: "1.00" + location: "USA" + description: "BACnet Demo" + protocol-version: 1 + protocol-conformance-class: 1 + protocol-services-supported: (T,F,F,F,F,F,F,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,F,F,T,F,F,F,F,F) + protocol-object-types-supported: (T,F,T,T,F,T,F,F,T,F,F,F,F,F,F,F,F,F,F,F,F, +F,F,F,F,F,F,F,F,F,F,F) + max-apdu-length-accepted: 50 + segmentation-supported: no-segmentation + local-time: ? + local-date: ? + utc-offset: ? + daylight-savings-status: ? + database-revision: ? + apdu-timeout: 60000 + number-of-apdu-retries: 0 + max-master: 127 + max-info-frames: 1 + device-address-binding: ? + object-list: { + (device,12345),(binary-value,0),(binary-value,1), + (binary-value,2),(binary-value,3),(binary-value,4), + (binary-value,5),(binary-value,6),(binary-value,7), + (analog-value,0),(analog-value,1),(analog-value,2), + (analog-value,3),(analog-input,0),(analog-input,1), + (binary-input,0),(binary-input,1),(binary-input,2), + (binary-input,3) + } + }, + { + object-identifier: (binary-value,0) + object-name: "BV-0" + object-type: binary-value + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + description: "BV-0" + }, + { + object-identifier: (binary-value,1) + object-name: "BV-1" + object-type: binary-value + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + description: "BV-1" + }, + { + object-identifier: (binary-value,2) + object-name: "BV-2" + object-type: binary-value + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + description: "BV-2" + }, + { + object-identifier: (binary-value,3) + object-name: "BV-3" + object-type: binary-value + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + description: "BV-3" + }, + { + object-identifier: (binary-value,4) + object-name: "BV-4" + object-type: binary-value + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + description: "BV-4" + }, + { + object-identifier: (binary-value,5) + object-name: "BV-5" + object-type: binary-value + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + description: "BV-5" + }, + { + object-identifier: (binary-value,6) + object-name: "BV-6" + object-type: binary-value + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + description: "BV-6" + }, + { + object-identifier: (binary-value,7) + object-name: "BV-7" + object-type: binary-value + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + description: "BV-7" + }, + { + object-identifier: (analog-value,0) + object-name: "AV-0" + object-type: analog-value + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + units: percent + description: "AV-0" + }, + { + object-identifier: (analog-value,1) + object-name: "AV-1" + object-type: analog-value + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + units: percent + description: "AV-1" + }, + { + object-identifier: (analog-value,2) + object-name: "AV-2" + object-type: analog-value + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + units: percent + description: "AV-2" + }, + { + object-identifier: (analog-value,3) + object-name: "AV-3" + object-type: analog-value + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + units: percent + description: "AV-3" + }, + { + object-identifier: (analog-input,0) + object-name: "AI-0" + object-type: analog-input + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + units: percent + description: "AI-0" + }, + { + object-identifier: (analog-input,1) + object-name: "AI-1" + object-type: analog-input + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + units: percent + description: "AI-1" + }, + { + object-identifier: (binary-input,0) + object-name: "BI-0" + object-type: binary-input + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + polarity: normal + description: "BI-0" + }, + { + object-identifier: (binary-input,1) + object-name: "BI-1" + object-type: binary-input + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + polarity: normal + description: "BI-1" + }, + { + object-identifier: (binary-input,2) + object-name: "BI-2" + object-type: binary-input + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + polarity: normal + description: "BI-2" + }, + { + object-identifier: (binary-input,3) + object-name: "BI-3" + object-type: binary-input + present-value: ? + status-flags: (F,F,F,F) + event-state: normal + out-of-service: F + polarity: normal + description: "BI-3" + } +} + +End of BACnet Protocol Implementation Conformance Statement