├── .astylerc ├── .gdbinit ├── .gitignore ├── .hgeol ├── .hgignore ├── .indent.pro ├── .splintrc ├── BACnet-stack.doxyfile ├── Makefile ├── bin ├── abort-reason.sh ├── bacroute.sh ├── bacrpd.bat ├── bacrpd.sh ├── bvlc.bat ├── bvlc.sh ├── door-status.sh ├── error-code.sh ├── event-state.sh ├── event-type.sh ├── lock-status.sh ├── object-type.sh ├── program-request.sh ├── program-state.sh ├── property-states.sh ├── property_id.sh ├── readme.txt ├── reliability.sh ├── restart-reason.sh ├── units.sh └── vendor-id.sh ├── borland.bat ├── build.bat ├── build.sh ├── comment.sh ├── demo ├── BACnetDemo.workspace ├── Makefile ├── abort │ ├── Makefile │ └── main.c ├── dcc │ ├── Makefile │ ├── main.c │ ├── makefile.b32 │ ├── makefile.g++ │ └── tmake.pro ├── epics │ ├── Makefile │ ├── bacepics.cbp │ ├── bacepics.h │ ├── main.c │ └── makefile.b32 ├── error │ ├── Makefile │ └── main.c ├── gateway │ ├── Makefile │ ├── gateway.h │ ├── main.c │ └── makefile.b32 ├── getevent │ ├── Makefile │ └── main.c ├── handler │ ├── dlenv.c │ ├── h_alarm_ack.c │ ├── h_arf.c │ ├── h_arf_a.c │ ├── h_awf.c │ ├── h_bbmd6.c │ ├── h_ccov.c │ ├── h_cov.c │ ├── h_dcc.c │ ├── h_gas_a.c │ ├── h_get_alarm_sum.c │ ├── h_getevent.c │ ├── h_getevent_a.c │ ├── h_iam.c │ ├── h_ihave.c │ ├── h_lso.c │ ├── h_npdu.c │ ├── h_pt.c │ ├── h_pt_a.c │ ├── h_rd.c │ ├── h_routed_npdu.c │ ├── h_rp.c │ ├── h_rp_a.c │ ├── h_rpm.c │ ├── h_rpm_a.c │ ├── h_rr.c │ ├── h_rr_a.c │ ├── h_ts.c │ ├── h_ucov.c │ ├── h_upt.c │ ├── h_whohas.c │ ├── h_whois.c │ ├── h_wp.c │ ├── h_wpm.c │ ├── noserv.c │ ├── objects.c │ ├── s_abort.c │ ├── s_ack_alarm.c │ ├── s_arfs.c │ ├── s_awfs.c │ ├── s_cevent.c │ ├── s_cov.c │ ├── s_dcc.c │ ├── s_error.c │ ├── s_get_alarm_sum.c │ ├── s_get_event.c │ ├── s_getevent.c │ ├── s_iam.c │ ├── s_ihave.c │ ├── s_lso.c │ ├── s_ptransfer.c │ ├── s_rd.c │ ├── s_readrange.c │ ├── s_router.c │ ├── s_rp.c │ ├── s_rpm.c │ ├── s_ts.c │ ├── s_uevent.c │ ├── s_upt.c │ ├── s_whohas.c │ ├── s_whois.c │ ├── s_wp.c │ ├── s_wpm.c │ └── txbuf.c ├── iam │ ├── Makefile │ ├── main.c │ └── makefile.b32 ├── iamrouter │ ├── Makefile │ ├── main.c │ └── makefile.b32 ├── initrouter │ ├── Makefile │ ├── main.c │ └── makefile.b32 ├── mstpcap │ ├── Makefile │ ├── main.c │ ├── makefile.b32 │ └── mstpcap.txt ├── mstpcrc │ ├── Makefile │ ├── build.bat │ ├── main.c │ ├── makefile.b32 │ └── readme.txt ├── object │ ├── access_credential.c │ ├── access_credential.h │ ├── access_credential.mak │ ├── access_door.c │ ├── access_door.h │ ├── access_door.mak │ ├── access_point.c │ ├── access_point.h │ ├── access_point.mak │ ├── access_rights.c │ ├── access_rights.h │ ├── access_rights.mak │ ├── access_user.c │ ├── access_user.h │ ├── access_user.mak │ ├── access_zone.c │ ├── access_zone.h │ ├── access_zone.mak │ ├── ai.c │ ├── ai.h │ ├── ai.mak │ ├── ao.c │ ├── ao.h │ ├── ao.mak │ ├── av.c │ ├── av.h │ ├── av.mak │ ├── bacfile.c │ ├── bacfile.h │ ├── bi.c │ ├── bi.h │ ├── bi.mak │ ├── bo.c │ ├── bo.h │ ├── bo.mak │ ├── bv.c │ ├── bv.h │ ├── bv.mak │ ├── channel.c │ ├── channel.h │ ├── command.c │ ├── command.h │ ├── command.mak │ ├── credential_data_input.c │ ├── credential_data_input.h │ ├── credential_data_input.mak │ ├── csv.c │ ├── csv.h │ ├── csv.mak │ ├── device-client.c │ ├── device.c │ ├── device.h │ ├── device.mak │ ├── gw_device.c │ ├── iv.c │ ├── iv.h │ ├── lc.c │ ├── lc.h │ ├── lc.ide │ ├── lc.mak │ ├── lo.c │ ├── lo.h │ ├── lo.mak │ ├── lsp.c │ ├── lsp.h │ ├── lsp.mak │ ├── msi.c │ ├── msi.h │ ├── msi.mak │ ├── mso.c │ ├── mso.h │ ├── mso.mak │ ├── msv.c │ ├── msv.h │ ├── msv.mak │ ├── nc.c │ ├── nc.h │ ├── osv.c │ ├── osv.h │ ├── osv.mak │ ├── piv.c │ ├── piv.h │ ├── piv.mak │ ├── schedule.c │ ├── schedule.h │ ├── schedule.mak │ ├── trendlog.c │ └── trendlog.h ├── perl │ ├── Documentation │ │ ├── index.html │ │ ├── jquery.js │ │ ├── syntax.css │ │ └── syntax.js │ ├── bacnet.pl │ ├── example_readprop.pl │ ├── perl_bindings.c │ └── readme.txt ├── piface │ ├── Makefile │ ├── configure.sh │ ├── device.c │ ├── main.c │ └── readme.txt ├── ptransfer │ ├── Makefile │ ├── main.c │ ├── makefile.b32 │ ├── ptransfer.sln │ └── rdproperty.vcproj ├── readbdt │ ├── Makefile │ ├── main.c │ └── makefile.b32 ├── readfile │ ├── Makefile │ ├── main.c │ ├── main.ide │ └── makefile.b32 ├── readprop │ ├── Makefile │ ├── bacrp.cbp │ ├── main.c │ └── makefile.b32 ├── readpropm │ ├── Makefile │ ├── bacrpm.cbp │ ├── main.c │ └── makefile.b32 ├── readrange │ ├── Makefile │ ├── main.c │ └── readrange │ │ ├── readrange.sln │ │ └── readrange.vcproj ├── reinit │ ├── Makefile │ ├── main.c │ └── makefile.b32 ├── router-ipv6 │ ├── Makefile │ ├── main.c │ └── readme.txt ├── router │ ├── Makefile │ ├── init.cfg │ ├── ipmodule.c │ ├── ipmodule.h │ ├── main.c │ ├── msgqueue.c │ ├── msgqueue.h │ ├── mstpmodule.c │ ├── mstpmodule.h │ ├── network_layer.c │ ├── network_layer.h │ ├── portthread.c │ ├── portthread.h │ └── readme.txt ├── scov │ ├── Makefile │ ├── main.c │ └── makefile.b32 ├── server │ ├── .gdbinit │ ├── Makefile │ ├── PICS.odt │ ├── bacserv.cbp │ ├── epics_vts3.tpi │ ├── main.c │ ├── makefile.b32 │ └── server.h ├── timesync │ ├── Makefile │ ├── main.c │ └── makefile.b32 ├── ucov │ ├── Makefile │ ├── main.c │ └── makefile.b32 ├── uevent │ ├── Makefile │ └── main.c ├── uptransfer │ ├── Makefile │ ├── main.c │ └── makefile.b32 ├── whohas │ ├── Makefile │ ├── main.c │ └── makefile.b32 ├── whois │ ├── Makefile │ ├── bacwi.dsp │ ├── main.c │ └── makefile.b32 ├── whoisrouter │ ├── Makefile │ ├── main.c │ └── makefile.b32 ├── writefile │ ├── Makefile │ ├── main.c │ ├── main.ide │ └── makefile.b32 ├── writeprop │ ├── Makefile │ ├── main.c │ └── makefile.b32 └── writepropm │ ├── Makefile │ └── main.c ├── doc ├── BACnet-Protocol-Diagram.odg ├── BACnetCollapsedArchitecture.flw ├── README.build ├── README.codeblocks ├── README.developer ├── README.doxygen ├── README.faq ├── README.msvc ├── README.msvs ├── README.release ├── README.sloc ├── README.subversion ├── README.todo ├── README.ubuntu ├── README.utils ├── RPM-Handler.flw ├── bac_stack_footer.html ├── bac_stack_header.html ├── bacnet_dev.config ├── code-standard.txt ├── htdocs │ ├── images │ │ └── BACnet.png │ └── index.html ├── man │ ├── bacrp.1 │ ├── bacwi.1 │ └── bacwp.1 └── output │ ├── BAC_stack.html │ └── html │ └── BACnet_sm.png ├── export.sh ├── fixup.bat ├── fixup.sh ├── include ├── abort.h ├── access_rule.h ├── address.h ├── alarm_ack.h ├── apdu.h ├── arcnet.h ├── arf.h ├── assigned_access_rights.h ├── authentication_factor.h ├── authentication_factor_format.h ├── awf.h ├── bacaddr.h ├── bacapp.h ├── bacdcode.h ├── bacdef.h ├── bacdevobjpropref.h ├── bacenum.h ├── bacerror.h ├── bacint.h ├── bacnet.h ├── bacprop.h ├── bacpropstates.h ├── bacreal.h ├── bacsec.h ├── bacstr.h ├── bactext.h ├── bactimevalue.h ├── bigend.h ├── bip.h ├── bip6.h ├── bits.h ├── bvlc.h ├── bvlc6.h ├── bytes.h ├── client.h ├── config.h ├── cov.h ├── crc.h ├── credential_authentication_factor.h ├── datalink.h ├── datetime.h ├── dcc.h ├── debug.h ├── dlenv.h ├── dlmstp.h ├── ethernet.h ├── event.h ├── fifo.h ├── filename.h ├── get_alarm_sum.h ├── getevent.h ├── handlers.h ├── iam.h ├── ihave.h ├── indtext.h ├── key.h ├── keylist.h ├── lighting.h ├── lso.h ├── memcopy.h ├── mstp.h ├── mstpdef.h ├── mstptext.h ├── mydata.h ├── npdu.h ├── objects.h ├── proplist.h ├── ptransfer.h ├── rd.h ├── readrange.h ├── reject.h ├── ringbuf.h ├── rp.h ├── rpm.h ├── sbuf.h ├── timestamp.h ├── timesync.h ├── tsm.h ├── txbuf.h ├── ucix.h ├── version.h ├── vmac.h ├── whohas.h ├── whois.h ├── wp.h └── wpm.h ├── indent-all.bat ├── indent.bat ├── indent.sh ├── lib ├── Makefile ├── bacnet.cbp ├── bacnetdll.cbp ├── main.cpp ├── main.h └── makefile.b32 ├── license ├── gpl-2.txt └── readme.txt ├── makefile.b32 ├── ports ├── arduino_uno │ ├── Makefile │ ├── apdu.c │ ├── av.c │ ├── av.h │ ├── bip-init.c │ ├── bip.c │ ├── bip.h │ ├── bv.c │ ├── bv.h │ ├── bvlc-arduino.c │ ├── bvlc-arduino.h │ ├── datalink.h │ ├── device.c │ ├── device.h │ ├── external │ │ └── Arduino │ │ │ ├── Ethernet │ │ │ ├── Makefile │ │ │ ├── include │ │ │ │ ├── SPI.h │ │ │ │ ├── util.h │ │ │ │ ├── w5100.h │ │ │ │ └── w5100Wrapper.h │ │ │ └── src │ │ │ │ ├── SPI.cpp │ │ │ │ ├── socket.cpp │ │ │ │ ├── w5100.cpp │ │ │ │ └── w5100Wrapper.cpp │ │ │ └── core │ │ │ └── include │ │ │ ├── Arduino.h │ │ │ ├── HardwareSerial.h │ │ │ ├── Server.h │ │ │ ├── USBAPI.h │ │ │ ├── USBCore.h │ │ │ ├── Udp.h │ │ │ ├── binary.h │ │ │ ├── new.h │ │ │ ├── pins_arduino.h │ │ │ └── wiring_private.h │ ├── h_rp.c │ ├── h_whois.c │ ├── h_wp.c │ ├── main.c │ ├── stdbool.h │ ├── stdint.h │ ├── txbuf.h │ ├── uart.c │ └── uart.h ├── arm7 │ ├── _stdint.h │ ├── bip.c │ ├── net.h │ └── stdbool.h ├── at91sam7s │ ├── .gdbinit │ ├── Makefile │ ├── ai.c │ ├── at91sam7s256.h │ ├── at91sam7s256.ld │ ├── av.c │ ├── bacnet.ewp │ ├── bacnet.eww │ ├── bi.c │ ├── blinker.c │ ├── board.h │ ├── bv.c │ ├── crt.s │ ├── device.c │ ├── dlmstp.c │ ├── init.c │ ├── irq.c │ ├── isr.c │ ├── isr.h │ ├── main.c │ ├── readme.txt │ ├── rs485.c │ ├── rs485.h │ ├── timer.c │ └── timer.h ├── atmega168 │ ├── .splintrc │ ├── Makefile │ ├── PICS.odt │ ├── ai.c │ ├── ai.h │ ├── apdu.c │ ├── av.c │ ├── av.h │ ├── avr035.h │ ├── bacnet.aps │ ├── bacnet.ewp │ ├── bacnet.eww │ ├── bv.c │ ├── bv.h │ ├── device.c │ ├── device.h │ ├── dlmstp.c │ ├── h_rp.c │ ├── h_whois.c │ ├── h_wp.c │ ├── hardware.h │ ├── hardware.ods │ ├── iar2gcc.h │ ├── main.c │ ├── readme.txt │ ├── rs485.c │ ├── rs485.h │ ├── stack.c │ ├── stack.h │ ├── stdbool.h │ ├── stdint.h │ ├── timer.c │ └── timer.h ├── atmega8 │ ├── Makefile │ ├── apdu.c │ ├── avr035.h │ ├── bacnet.ewp │ ├── bacnet.eww │ ├── device.c │ ├── dlmstp.c │ ├── hardware.h │ ├── hardware.ods │ ├── iar2gcc.h │ ├── main.c │ ├── readme.txt │ ├── rs485.c │ ├── rs485.h │ ├── stdbool.h │ ├── stdint.h │ ├── timer.c │ └── timer.h ├── bdk-atxx4-mstp │ ├── Makefile │ ├── PICS.odt │ ├── adc-block.c │ ├── adc.c │ ├── adc.h │ ├── ai.c │ ├── av.c │ ├── avrosp │ │ ├── AVRBootloader.cpp │ │ ├── AVRBootloader.hpp │ │ ├── AVRDevice.cpp │ │ ├── AVRDevice.hpp │ │ ├── AVRInSystemProg.cpp │ │ ├── AVRInSystemProg.hpp │ │ ├── AVROSP.dev │ │ ├── AVRProgrammer.cpp │ │ ├── AVRProgrammer.hpp │ │ ├── CommChannel.cpp │ │ ├── CommChannel.hpp │ │ ├── ErrorMsg.cpp │ │ ├── ErrorMsg.hpp │ │ ├── HEXParser.cpp │ │ ├── HEXParser.hpp │ │ ├── JobInfo.cpp │ │ ├── JobInfo.hpp │ │ ├── SerialPort.cpp │ │ ├── SerialPort.hpp │ │ ├── Utility.cpp │ │ ├── Utility.hpp │ │ ├── XMLParser.cpp │ │ ├── XMLParser.hpp │ │ ├── main.cpp │ │ └── readme.txt │ ├── bacnet.aps │ ├── bacnet.atsln │ ├── bacnet.c │ ├── bacnet.cproj │ ├── bacnet.ewp │ ├── bacnet.eww │ ├── bacnet.h │ ├── bacnet.hzp │ ├── bi.c │ ├── bname.c │ ├── bname.h │ ├── bo.c │ ├── bootloader │ │ ├── Makefile │ │ ├── bootloader.aps │ │ ├── defines.h │ │ ├── flash.h │ │ ├── main.c │ │ ├── parts.txt │ │ ├── preprocessor.sh │ │ ├── preprocessor.xls │ │ ├── serial.c │ │ └── serial.h │ ├── crossworks │ │ └── stdbool.h │ ├── device.c │ ├── dlmstp.c │ ├── eeprom.c │ ├── eeprom.h │ ├── epics_vts3.tpi │ ├── fuses.c │ ├── hardware.h │ ├── hardware.ods │ ├── iar2gcc.h │ ├── init.c │ ├── init.h │ ├── input.c │ ├── input.h │ ├── led.c │ ├── led.h │ ├── main.c │ ├── nvdata.h │ ├── rs485.c │ ├── rs485.h │ ├── seeprom.c │ ├── seeprom.h │ ├── serial.c │ ├── serial.h │ ├── stack.c │ ├── stack.h │ ├── test.c │ ├── test.h │ ├── timer.c │ ├── timer.h │ ├── timer2.c │ ├── watchdog.c │ └── watchdog.h ├── bsd │ ├── bip-init.c │ ├── bip6.c │ ├── main.c │ ├── net.h │ ├── readme.txt │ ├── stdbool.h │ ├── timer.c │ └── timer.h ├── dos │ ├── bacnet.prj │ ├── dlmstp.c │ ├── extkword.h │ ├── main.c │ ├── mk_fp.h │ ├── pchwio.c │ ├── pchwio.h │ ├── queue.c │ ├── queue.h │ ├── readme.txt │ ├── rs485.c │ ├── rs485.h │ ├── serial.c │ ├── serial.h │ ├── stdbool.h │ ├── stdint.h │ ├── timer.c │ └── timer.h ├── esp32 │ ├── lib │ │ └── readme.txt │ ├── platformio.ini │ ├── readme.txt │ └── src │ │ ├── ai.c │ │ ├── ai.h │ │ ├── bip_init.c │ │ ├── bo.c │ │ ├── bo.h │ │ ├── device.c │ │ ├── device.h │ │ ├── main.c │ │ └── sdkconfig.h ├── linux │ ├── arcnet.c │ ├── bacnet_ipv6.lua │ ├── bacsec_linux.c │ ├── bip-init.c │ ├── bip6.c │ ├── dlmstp.c │ ├── dlmstp.mak │ ├── dlmstp_linux.c │ ├── dlmstp_linux.h │ ├── ethernet.c │ ├── mstpsnap.c │ ├── mstpsnap.mak │ ├── net.h │ ├── readme.txt │ ├── rs485.c │ ├── rs485.h │ ├── rs485.mak │ ├── rx_fsm.c │ ├── rx_fsm.mak │ ├── timer.c │ └── timer.h ├── lwip │ ├── bip.c │ └── net.h ├── pic18f6720 │ ├── 18F6720.lkr │ ├── BACnet-Server.X │ │ ├── Makefile │ │ └── nbproject │ │ │ ├── Makefile-default.mk │ │ │ ├── Makefile-genesis.properties │ │ │ ├── Makefile-impl.mk │ │ │ ├── Makefile-local-default.mk │ │ │ ├── Makefile-variables.mk │ │ │ ├── Package-default.bash │ │ │ ├── configurations.xml │ │ │ ├── project.properties │ │ │ └── project.xml │ ├── BACnet-Server.mcp │ ├── BACnet-Server.mcw │ ├── Makefile │ ├── ai.c │ ├── apdu.c │ ├── av.c │ ├── bi.c │ ├── bv.c │ ├── device.c │ ├── dlmstp.c │ ├── dlmstp.h │ ├── hardware.h │ ├── isr.c │ ├── main.c │ ├── mstp.c │ ├── mstp.h │ ├── pic18f6720.tpi │ ├── readme.txt │ ├── rs485.c │ ├── rs485.h │ ├── stdbool.h │ └── stdint.h ├── pic18f97j60 │ ├── BACnet-Server.X │ │ ├── Makefile │ │ └── nbproject │ │ │ ├── Makefile-default.mk │ │ │ ├── Makefile-genesis.properties │ │ │ ├── Makefile-impl.mk │ │ │ ├── Makefile-local-default.mk │ │ │ ├── Makefile-variables.mk │ │ │ ├── Package-default.bash │ │ │ ├── configurations.xml │ │ │ ├── private │ │ │ ├── configurations.xml │ │ │ └── private.xml │ │ │ ├── project.properties │ │ │ └── project.xml │ ├── Makefile │ ├── ai.c │ ├── apdu.c │ ├── av.c │ ├── bi.c │ ├── bv.c │ ├── device.c │ ├── dlmstp.c │ ├── dlmstp.h │ ├── hardware.h │ ├── isr.c │ ├── main.c │ ├── mstp.c │ ├── mstp.h │ ├── readme.txt │ ├── rs485.c │ ├── rs485.h │ ├── stdbool.h │ └── stdint.h ├── rtos32 │ ├── bip-init.c │ ├── dlmstp.c │ ├── ethernet.c │ ├── hardware.cfg │ ├── init.c │ ├── main.c │ ├── makefile.mak │ ├── monitor.cfg │ ├── mstp.c │ ├── mstp.h │ ├── net.h │ ├── netcfg.h │ ├── rs485.c │ ├── rs485.h │ ├── setvars.bat │ ├── software.cfg │ ├── stdbool.h │ └── stdint.h ├── rx62n │ ├── BACnet_Ethernet_RX62N.hwp │ ├── bacnet.c │ ├── bacnet.h │ ├── bo.c │ ├── device.c │ ├── ethernet.c │ ├── hardware.h │ ├── led.c │ ├── led.h │ ├── main.c │ ├── readme.txt │ ├── timer-hdw.c │ ├── timer.c │ └── timer.h ├── stm32f10x │ ├── CMSIS │ │ ├── CMSIS debug support.htm │ │ ├── CMSIS_Core.htm │ │ ├── CMSIS_changes.htm │ │ ├── License.doc │ │ ├── TrueSTUDIO │ │ │ ├── startup_stm32f10x_cl.s │ │ │ ├── startup_stm32f10x_hd.s │ │ │ ├── startup_stm32f10x_hd_vl.s │ │ │ ├── startup_stm32f10x_ld.s │ │ │ ├── startup_stm32f10x_ld_vl.s │ │ │ ├── startup_stm32f10x_md.s │ │ │ ├── startup_stm32f10x_md_vl.s │ │ │ └── startup_stm32f10x_xl.s │ │ ├── arm │ │ │ ├── startup_stm32f10x_cl.s │ │ │ ├── startup_stm32f10x_hd.s │ │ │ ├── startup_stm32f10x_hd_vl.s │ │ │ ├── startup_stm32f10x_ld.s │ │ │ ├── startup_stm32f10x_ld_vl.s │ │ │ ├── startup_stm32f10x_md.s │ │ │ ├── startup_stm32f10x_md_vl.s │ │ │ └── startup_stm32f10x_xl.s │ │ ├── core_cm3.c │ │ ├── core_cm3.h │ │ ├── gcc_ride7 │ │ │ ├── startup_stm32f10x_cl.s │ │ │ ├── startup_stm32f10x_hd.s │ │ │ ├── startup_stm32f10x_hd_vl.s │ │ │ ├── startup_stm32f10x_ld.s │ │ │ ├── startup_stm32f10x_ld_vl.s │ │ │ ├── startup_stm32f10x_md.s │ │ │ ├── startup_stm32f10x_md_vl.s │ │ │ └── startup_stm32f10x_xl.s │ │ ├── iar │ │ │ ├── startup_stm32f10x_cl.s │ │ │ ├── startup_stm32f10x_hd.s │ │ │ ├── startup_stm32f10x_hd_vl.s │ │ │ ├── startup_stm32f10x_ld.s │ │ │ ├── startup_stm32f10x_ld_vl.s │ │ │ ├── startup_stm32f10x_md.s │ │ │ ├── startup_stm32f10x_md_vl.s │ │ │ └── startup_stm32f10x_xl.s │ │ ├── stm32f10x.h │ │ └── system_stm32f10x.h │ ├── Makefile │ ├── STM32_BACnet_Demo.svg │ ├── STM32_BACnet_Software.svg │ ├── automac.c │ ├── automac.h │ ├── bacnet.c │ ├── bacnet.ewp │ ├── bacnet.eww │ ├── bacnet.h │ ├── bo.c │ ├── device.c │ ├── dlmstp.c │ ├── drivers │ │ ├── Release_Notes_for_STM32F10x_StdPeriph_Driver.html │ │ ├── inc │ │ │ ├── stm32f10x_adc.h │ │ │ ├── stm32f10x_bkp.h │ │ │ ├── stm32f10x_can.h │ │ │ ├── stm32f10x_cec.h │ │ │ ├── stm32f10x_crc.h │ │ │ ├── stm32f10x_dac.h │ │ │ ├── stm32f10x_dbgmcu.h │ │ │ ├── stm32f10x_dma.h │ │ │ ├── stm32f10x_exti.h │ │ │ ├── stm32f10x_flash.h │ │ │ ├── stm32f10x_fsmc.h │ │ │ ├── stm32f10x_gpio.h │ │ │ ├── stm32f10x_i2c.h │ │ │ ├── stm32f10x_iwdg.h │ │ │ ├── stm32f10x_misc.h │ │ │ ├── stm32f10x_pwr.h │ │ │ ├── stm32f10x_rcc.h │ │ │ ├── stm32f10x_rtc.h │ │ │ ├── stm32f10x_sdio.h │ │ │ ├── stm32f10x_spi.h │ │ │ ├── stm32f10x_tim.h │ │ │ ├── stm32f10x_usart.h │ │ │ └── stm32f10x_wwdg.h │ │ └── src │ │ │ ├── stm32f10x_adc.c │ │ │ ├── stm32f10x_bkp.c │ │ │ ├── stm32f10x_can.c │ │ │ ├── stm32f10x_cec.c │ │ │ ├── stm32f10x_crc.c │ │ │ ├── stm32f10x_dac.c │ │ │ ├── stm32f10x_dbgmcu.c │ │ │ ├── stm32f10x_dma.c │ │ │ ├── stm32f10x_exti.c │ │ │ ├── stm32f10x_flash.c │ │ │ ├── stm32f10x_fsmc.c │ │ │ ├── stm32f10x_gpio.c │ │ │ ├── stm32f10x_i2c.c │ │ │ ├── stm32f10x_iwdg.c │ │ │ ├── stm32f10x_misc.c │ │ │ ├── stm32f10x_pwr.c │ │ │ ├── stm32f10x_rcc.c │ │ │ ├── stm32f10x_rtc.c │ │ │ ├── stm32f10x_sdio.c │ │ │ ├── stm32f10x_spi.c │ │ │ ├── stm32f10x_tim.c │ │ │ ├── stm32f10x_usart.c │ │ │ ├── stm32f10x_wwdg.c │ │ │ └── syscalls.c │ ├── hardware.h │ ├── led.c │ ├── led.h │ ├── main.c │ ├── readme.txt │ ├── rs485.c │ ├── rs485.h │ ├── stm32-rs485-daughter.brd │ ├── stm32-rs485-daughter.ods │ ├── stm32-rs485-daughter.sch │ ├── stm32f10x.ld │ ├── stm32f10x_conf.h │ ├── stm32f10x_flash.icf │ ├── stm32f10x_it.c │ ├── stm32f10x_it.h │ ├── system_stm32f10x.c │ ├── timer.c │ ├── timer.h │ └── timer_sys.c ├── win32 │ ├── MAKEFILE.MAK │ ├── Microsoft Visual Studio 2010 │ │ ├── BACnet Handler Library │ │ │ ├── BACnet Handler Library.vcxproj │ │ │ └── BACnet Handler Library.vcxproj.filters │ │ ├── BACnet Object Definitions │ │ │ ├── BACnet Object Definitions.vcproj │ │ │ ├── BACnet Object Definitions.vcxproj │ │ │ └── BACnet Object Definitions.vcxproj.filters │ │ ├── BACnet Stack Development.sln │ │ ├── BACnet Stack Library │ │ │ ├── BACnet Stack Library.vcproj │ │ │ ├── BACnet Stack Library.vcxproj │ │ │ └── BACnet Stack Library.vcxproj.filters │ │ ├── Server │ │ │ ├── Server.vcproj │ │ │ └── Server.vcxproj │ │ ├── Who-Is │ │ │ ├── Who-Is.vcproj │ │ │ └── Who-Is.vcxproj │ │ ├── dcc │ │ │ ├── dcc.vcxproj │ │ │ └── dcc.vcxproj.filters │ │ └── writeprop │ │ │ ├── writeprop.vcxproj │ │ │ └── writeprop.vcxproj.filters │ ├── Microsoft Visual Studio 2015 │ │ ├── BACnet Solution Settings.props │ │ ├── BACnet Stack Development.sln │ │ ├── BACnet_Handler_Library │ │ │ ├── BACnet_Handler_Library.vcxproj │ │ │ └── BACnet_Handler_Library.vcxproj.filters │ │ ├── BACnet_Object_Definitions │ │ │ ├── BACnet_Object_Definitions.vcxproj │ │ │ └── BACnet_Object_Definitions.vcxproj.filters │ │ ├── BACnet_Stack_Library │ │ │ ├── BACnet_Stack_Library.vcxproj │ │ │ └── BACnet_Stack_Library.vcxproj.filters │ │ └── Server │ │ │ ├── Server.vcxproj │ │ │ └── Server.vcxproj.filters │ ├── bacnet.cbp │ ├── bacnet.ide │ ├── bip-init.c │ ├── bip6.c │ ├── borland.bat │ ├── dlmstp-mm.c │ ├── dlmstp.c │ ├── dlmstp.cbp │ ├── ethernet.c │ ├── main.c │ ├── makefile.mgw │ ├── net.h │ ├── readme.txt │ ├── rs485.c │ ├── rs485.cbp │ ├── rs485.h │ ├── rs485.mak │ ├── rx_fsm.c │ ├── rx_fsm.cbp │ ├── rx_fsm.mak │ ├── setvars.bat │ ├── stdbool.h │ ├── stdint.h │ ├── timer.c │ └── timer.h └── xplained │ ├── ASF │ ├── common │ │ ├── boards │ │ │ └── board.h │ │ ├── drivers │ │ │ └── nvm │ │ │ │ ├── common_nvm.h │ │ │ │ └── xmega │ │ │ │ └── xmega_nvm.c │ │ ├── services │ │ │ ├── clock │ │ │ │ ├── genclk.h │ │ │ │ ├── osc.h │ │ │ │ ├── pll.h │ │ │ │ ├── sysclk.h │ │ │ │ └── xmega │ │ │ │ │ ├── osc.h │ │ │ │ │ ├── pll.h │ │ │ │ │ ├── sysclk.c │ │ │ │ │ └── sysclk.h │ │ │ ├── delay │ │ │ │ ├── delay.h │ │ │ │ └── xmega │ │ │ │ │ └── cycle_counter.h │ │ │ ├── gpio │ │ │ │ ├── gpio.h │ │ │ │ └── xmega_gpio │ │ │ │ │ └── xmega_gpio.h │ │ │ ├── ioport │ │ │ │ ├── ioport.h │ │ │ │ └── xmega │ │ │ │ │ ├── ioport.h │ │ │ │ │ ├── ioport_compat.c │ │ │ │ │ └── ioport_compat.h │ │ │ ├── serial │ │ │ │ ├── serial.h │ │ │ │ ├── usart_serial.c │ │ │ │ └── xmega_usart │ │ │ │ │ └── usart_serial.h │ │ │ └── sleepmgr │ │ │ │ ├── sleepmgr.h │ │ │ │ └── xmega │ │ │ │ ├── sleepmgr.c │ │ │ │ └── sleepmgr.h │ │ └── utils │ │ │ ├── interrupt.h │ │ │ ├── interrupt │ │ │ └── interrupt_avr8.h │ │ │ ├── make │ │ │ └── Makefile.avr.in │ │ │ ├── parts.h │ │ │ └── stdio │ │ │ ├── read.c │ │ │ ├── stdio_serial │ │ │ └── stdio_serial.h │ │ │ └── write.c │ └── xmega │ │ ├── boards │ │ └── xmega_a3bu_xplained │ │ │ ├── init.c │ │ │ ├── led.h │ │ │ └── xmega_a3bu_xplained.h │ │ ├── drivers │ │ ├── adc │ │ │ ├── adc.c │ │ │ ├── adc.h │ │ │ └── xmega_aau │ │ │ │ └── adc_aau.c │ │ ├── cpu │ │ │ ├── ccp.h │ │ │ ├── ccp.s │ │ │ └── xmega_reset_cause.h │ │ ├── nvm │ │ │ ├── nvm.c │ │ │ ├── nvm.h │ │ │ └── nvm_asm.s │ │ ├── pmic │ │ │ └── pmic.h │ │ ├── rtc32 │ │ │ ├── rtc32.c │ │ │ └── rtc32.h │ │ ├── sleep │ │ │ └── sleep.h │ │ ├── tc │ │ │ ├── tc.c │ │ │ └── tc.h │ │ ├── twi │ │ │ ├── twi_common.h │ │ │ ├── twim.c │ │ │ ├── twim.h │ │ │ ├── twis.c │ │ │ └── twis.h │ │ ├── usart │ │ │ ├── usart.c │ │ │ └── usart.h │ │ └── wdt │ │ │ ├── wdt.c │ │ │ └── wdt.h │ │ ├── services │ │ ├── pwm │ │ │ ├── pwm.c │ │ │ └── pwm.h │ │ └── timeout │ │ │ ├── timeout.c │ │ │ └── timeout.h │ │ └── utils │ │ ├── assembler.h │ │ ├── assembler │ │ └── gas.h │ │ ├── bit_handling │ │ └── clz_ctz.h │ │ ├── compiler.h │ │ ├── preprocessor │ │ ├── mrepeat.h │ │ ├── preprocessor.h │ │ ├── stringz.h │ │ └── tpaste.h │ │ ├── progmem.h │ │ └── status_codes.h │ ├── adc-hdw.c │ ├── adc-hdw.h │ ├── ai.c │ ├── asf.h │ ├── bacnet.atsln │ ├── bacnet.c │ ├── bacnet.cproj │ ├── bacnet.h │ ├── bname.c │ ├── bname.h │ ├── config │ ├── conf_adc.h │ ├── conf_board.h │ ├── conf_clock.h │ ├── conf_nvm.h │ ├── conf_rtc32.h │ ├── conf_sleepmgr.h │ ├── conf_timeout.h │ ├── conf_twim.h │ └── conf_usart_serial.h │ ├── device.c │ ├── dlmstp.c │ ├── led.c │ ├── led.h │ ├── main.c │ ├── nvmdata.c │ ├── nvmdata.h │ ├── readme.txt │ ├── rs485-shield │ ├── rs485-shield.brd │ └── rs485-shield.sch │ ├── rs485.c │ ├── rs485.h │ ├── stack.c │ ├── stack.h │ ├── timer.c │ ├── timer.h │ └── timer1.c ├── readme.txt ├── rebuild.sh ├── release.sh ├── splint.sh ├── src ├── abort.c ├── access_rule.c ├── address.c ├── alarm_ack.c ├── apdu.c ├── arf.c ├── assigned_access_rights.c ├── authentication_factor.c ├── authentication_factor_format.c ├── awf.c ├── bacaddr.c ├── bacapp.c ├── bacdcode.c ├── bacdevobjpropref.c ├── bacerror.c ├── bacint.c ├── bacprop.c ├── bacpropstates.c ├── bacreal.c ├── bacsec.c ├── bacstr.c ├── bactext.c ├── bactimevalue.c ├── bigend.c ├── bip.c ├── bvlc.c ├── bvlc6.c ├── cov.c ├── crc.c ├── credential_authentication_factor.c ├── datalink.c ├── datetime.c ├── dcc.c ├── debug.c ├── event.c ├── fifo.c ├── filename.c ├── get_alarm_sum.c ├── getevent.c ├── iam.c ├── ihave.c ├── indtext.c ├── key.c ├── keylist.c ├── lighting.c ├── lso.c ├── memcopy.c ├── mstp.c ├── mstptext.c ├── npdu.c ├── proplist.c ├── ptransfer.c ├── rd.c ├── readrange.c ├── reject.c ├── ringbuf.c ├── rp.c ├── rpm.c ├── sbuf.c ├── timestamp.c ├── timesync.c ├── tsm.c ├── ucix.c ├── version.c ├── vmac.c ├── whohas.c ├── whois.c ├── wp.c └── wpm.c ├── svn2cl.xsl ├── test.mak ├── test ├── abort.mak ├── address.cbp ├── address.mak ├── arf.mak ├── awf.mak ├── bacapp.ide ├── bacapp.mak ├── bacdcode.ide ├── bacdcode.mak ├── bacdevobjpropref.mak ├── bacerror.mak ├── bacint.cbp ├── bacint.mak ├── bacstr.mak ├── bbmd6.mak ├── bvlc.cbp ├── bvlc.mak ├── bvlc6.mak ├── cov.cbp ├── cov.mak ├── crc.ide ├── crc.mak ├── ctest.c ├── ctest.h ├── datetime.ide ├── datetime.mak ├── dcc.mak ├── event.mak ├── fifo.mak ├── filename.ide ├── filename.mak ├── getevent.mak ├── iam.mak ├── ihave.mak ├── indtext.mak ├── key.mak ├── keylist.mak ├── lighting.mak ├── lso.mak ├── memcopy.mak ├── mstp.ide ├── mstp.mak ├── npdu.mak ├── objects.cbp ├── objects.mak ├── proplist.mak ├── ptransfer.mak ├── rd.cbp ├── rd.mak ├── reject.mak ├── ringbuf.mak ├── rp.mak ├── rpm.mak ├── sbuf.mak ├── timer.mak ├── timesync.cbp ├── timesync.mak ├── vmac.mak ├── whohas.cbp ├── whohas.mak ├── whois.mak └── wp.mak ├── unittest.bat └── unittest.sh /.astylerc: -------------------------------------------------------------------------------- 1 | #--indent-cases 2 | --indent-classes 3 | --indent-switches 4 | --indent=spaces=4 5 | #--max-instatement-indent=4 6 | #--min-conditional-indent=0 7 | --brackets=linux 8 | --convert-tabs 9 | --mode=c 10 | -------------------------------------------------------------------------------- /.gdbinit: -------------------------------------------------------------------------------- 1 | set print pretty on 2 | set print union on 3 | set print address on 4 | list 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | *.so 4 | *.dylib 5 | .DS_Store 6 | .AppleDouble 7 | .LSOverride 8 | # Thumbnails 9 | ._* 10 | .Spotlight-V100 11 | .Trashes 12 | *.swp 13 | *.lock 14 | *~ 15 | bacarf 16 | bacdcc 17 | baciamr 18 | bacrbdt 19 | bacrp 20 | bacscov 21 | bacts 22 | bacupt 23 | bacwi 24 | bacwp 25 | bacawf 26 | bacepics 27 | bacinitr 28 | bacrd 29 | bacrpm 30 | bacserv 31 | bacucov 32 | bacwh 33 | bacwir 34 | -------------------------------------------------------------------------------- /.hgeol: -------------------------------------------------------------------------------- 1 | [patterns] 2 | ** = native 3 | -------------------------------------------------------------------------------- /.hgignore: -------------------------------------------------------------------------------- 1 | # use glob syntax. 2 | syntax: glob 3 | 4 | *.o 5 | *.exe 6 | *.bak 7 | *~ 8 | *.dep 9 | *.orig 10 | *.hex 11 | *.map 12 | *.bin 13 | *.out 14 | *.sim 15 | *.dbgdt 16 | *.dni 17 | *.jlink 18 | *.wsdt 19 | *.config 20 | *.pbd 21 | *.ewd 22 | *.d 23 | *.r90 24 | *.s90 25 | *.pbi 26 | *.cap 27 | *.pcapng 28 | *.pcap 29 | *.patch 30 | *.suo 31 | *.sdf 32 | *.lastbuildstate 33 | *.obj 34 | *.pdb 35 | *.tlog 36 | *.log 37 | *.idb 38 | *.lib 39 | *.ilk 40 | *.opendb 41 | -------------------------------------------------------------------------------- /.indent.pro: -------------------------------------------------------------------------------- 1 | -kr -nut -nlp -ip4 -cli4 -bfda -nbc -nbbo -c0 -cd0 -cp0 -di0 -l79 -nhnl 2 | -------------------------------------------------------------------------------- /.splintrc: -------------------------------------------------------------------------------- 1 | -Iinclude -Idemo/object -Iports/linux -castfcnptr -fullinitblock -initallelements -weak +posixlib 2 | -------------------------------------------------------------------------------- /bin/abort-reason.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BACNET_APDU_RETRIES=0 3 | export BACNET_APDU_TIMEOUT=0 4 | 5 | # bacabort [abort-reason invoke-id server] 6 | 7 | # BACnetAbortReason 8 | for reason in {0..64} 9 | do 10 | ./bin/bacabort ${reason} 11 | done 12 | -------------------------------------------------------------------------------- /bin/bacroute.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo Setting parameters for Router 3 | BACNET_IP_PORT=47808 4 | export BACNET_IP_PORT 5 | #BACNET_BBMD_PORT=47809 6 | #export BACNET_BBMD_PORT 7 | BACNET_IFACE=${1} 8 | export BACNET_IFACE 9 | BACNET_IP6_PORT=47808 10 | export BACNET_IP6_PORT 11 | BACNET_BIP6_BROADCAST=FF05::BAC0 12 | export BACNET_BIP6_BROADCAST 13 | BACNET_BIP6_IFACE=${1} 14 | export BACNET_BIP6_IFACE 15 | # Network Numbers 16 | BACNET_IP_NET=1 17 | export BACNET_IP_NET 18 | BACNET_IP6_NET=2 19 | export BACNET_IP6_NET 20 | -------------------------------------------------------------------------------- /bin/bacrpd.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :Test_Start 3 | echo Test: Read Required Properties of Device Object %1 4 | bacrp.exe %1 8 %1 75 5 | bacrp.exe %1 8 %1 77 6 | bacrp.exe %1 8 %1 79 7 | bacrp.exe %1 8 %1 112 8 | bacrp.exe %1 8 %1 121 9 | bacrp.exe %1 8 %1 120 10 | bacrp.exe %1 8 %1 70 11 | bacrp.exe %1 8 %1 44 12 | bacrp.exe %1 8 %1 12 13 | bacrp.exe %1 8 %1 98 14 | bacrp.exe %1 8 %1 139 15 | bacrp.exe %1 8 %1 97 16 | bacrp.exe %1 8 %1 96 17 | bacrp.exe %1 8 %1 76 0 18 | bacrp.exe %1 8 %1 76 19 | bacrp.exe %1 8 %1 62 20 | bacrp.exe %1 8 %1 107 21 | bacrp.exe %1 8 %1 11 22 | bacrp.exe %1 8 %1 73 23 | bacrp.exe %1 8 %1 30 24 | bacrp.exe %1 8 %1 155 25 | 26 | echo Test: Read Optional Properties of Device Object %1 27 | bacrp.exe %1 8 %1 58 28 | bacrp.exe %1 8 %1 28 29 | bacrp.exe %1 8 %1 167 30 | bacrp.exe %1 8 %1 122 31 | bacrp.exe %1 8 %1 5 32 | bacrp.exe %1 8 %1 57 33 | bacrp.exe %1 8 %1 56 34 | bacrp.exe %1 8 %1 119 35 | bacrp.exe %1 8 %1 24 36 | bacrp.exe %1 8 %1 10 37 | bacrp.exe %1 8 %1 55 38 | bacrp.exe %1 8 %1 116 39 | bacrp.exe %1 8 %1 64 40 | bacrp.exe %1 8 %1 63 41 | bacrp.exe %1 8 %1 1 42 | bacrp.exe %1 8 %1 154 43 | bacrp.exe %1 8 %1 157 44 | bacrp.exe %1 8 %1 153 45 | bacrp.exe %1 8 %1 152 46 | bacrp.exe %1 8 %1 172 47 | bacrp.exe %1 8 %1 170 48 | bacrp.exe %1 8 %1 169 49 | bacrp.exe %1 8 %1 171 50 | bacrp.exe %1 8 %1 168 51 | -------------------------------------------------------------------------------- /bin/bvlc.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo Example of parameters for Foreign Device Registration 3 | echo This CMD window will use port 47809 to communicate 4 | @echo on 5 | set BACNET_IP_PORT=47809 6 | @echo off 7 | echo The BBMD is located at the standard port 47808 and at 8 | echo the dotted IP address passed in on the command line. 9 | echo When the demo client applications see the BBMD address, 10 | echo they register as a Foreign Device to it. 11 | @echo on 12 | set BACNET_BBMD_PORT=47808 13 | set BACNET_BBMD_ADDRESS=%1 14 | 15 | -------------------------------------------------------------------------------- /bin/bvlc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo Example of parameters for Foreign Device Registration 3 | BACNET_IP_PORT=47809 4 | export BACNET_IP_PORT 5 | echo This console will use port ${BACNET_IP_PORT} to communicate. 6 | echo 7 | BACNET_BBMD_PORT=47808 8 | export BACNET_BBMD_PORT 9 | echo The BBMD is located at the port ${BACNET_BBMD_PORT} and 10 | echo is at the dotted IP address passed on the command line. 11 | BACNET_BBMD_ADDRESS=${1} 12 | export BACNET_BBMD_ADDRESS 13 | echo The BBMD IP address is ${BACNET_BBMD_ADDRESS} 14 | echo When the demo client applications see the BBMD address, 15 | echo they register as a Foreign Device to it. 16 | echo 17 | echo Launching new shell using the BBMD environment... 18 | /bin/bash 19 | -------------------------------------------------------------------------------- /bin/door-status.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BACNET_APDU_RETRIES=0 3 | export BACNET_APDU_TIMEOUT=0 4 | 5 | # bacucov: pid device-id object-type object-instance time-remaining 6 | # property tag value [priority] [index] 7 | 8 | # BACnetDoorStatus 9 | for door_status in {0..1023} 10 | do 11 | ./bin/bacucov 1 2 30 4 5 231 9 ${door_status} 12 | done 13 | -------------------------------------------------------------------------------- /bin/error-code.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BACNET_APDU_RETRIES=0 3 | export BACNET_APDU_TIMEOUT=0 4 | 5 | # bacabort [invoke-id abort-reason server] 6 | 7 | # BACnetErrorCode 8 | export error_class=0 9 | for error_code in {0..256} 10 | do 11 | ./bin/bacerror ${error_class} ${error_code} 12 | done 13 | -------------------------------------------------------------------------------- /bin/event-state.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BACNET_APDU_RETRIES=0 3 | export BACNET_APDU_TIMEOUT=0 4 | 5 | # bacucov: pid device-id object-type object-instance time-remaining 6 | # property tag value [priority] [index] 7 | 8 | # BACnetEventState 9 | # Event_State (36) 10 | for event_state in {0..64} 11 | do 12 | ./bin/bacucov 1 2 0 1 5 36 9 ${event_state} 13 | done 14 | -------------------------------------------------------------------------------- /bin/event-type.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BACNET_APDU_RETRIES=0 3 | export BACNET_APDU_TIMEOUT=0 4 | 5 | # bacucov: pid device-id object-type object-instance time-remaining 6 | # property tag value [priority] [index] 7 | 8 | # BACnetEventType 9 | # PROP_EVENT_TYPE = 37 10 | # OBJECT_EVENT_ENROLLMENT = 9 11 | # BACNET_APPLICATION_TAG_ENUMERATED = 9 12 | for event_type in {0..64} 13 | do 14 | ./bin/bacucov 1 1 9 1 5 37 9 ${event_type} 15 | done 16 | -------------------------------------------------------------------------------- /bin/lock-status.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BACNET_APDU_RETRIES=0 3 | export BACNET_APDU_TIMEOUT=0 4 | 5 | # bacucov: pid device-id object-type object-instance time-remaining 6 | # property tag value [priority] [index] 7 | 8 | # BACnetLockStatus 9 | for lock_status in {0..4} 10 | do 11 | ./bin/bacucov 1 2 30 4 5 233 9 ${lock_status} 12 | done 13 | -------------------------------------------------------------------------------- /bin/object-type.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BACNET_APDU_RETRIES=0 3 | export BACNET_APDU_TIMEOUT=0 4 | 5 | for object_type in {0..127} 6 | do 7 | ./bin/bacucov 1 2 ${object_type} 4 5 85 0 0 8 | done 9 | -------------------------------------------------------------------------------- /bin/program-request.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BACNET_APDU_RETRIES=0 3 | export BACNET_APDU_TIMEOUT=0 4 | 5 | # bacucov: pid device-id object-type object-instance time-remaining 6 | # property tag value [priority] [index] 7 | 8 | # BACnetProgramRequest 9 | # PROP_PROGRAM_CHANGE = 90 10 | # OBJECT_PROGRAM = 16 11 | # BACNET_APPLICATION_TAG_ENUMERATED = 9 12 | for program_request in {0..16} 13 | do 14 | ./bin/bacucov 1 2 16 1 5 90 9 ${program_request} 15 | done 16 | -------------------------------------------------------------------------------- /bin/program-state.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BACNET_APDU_RETRIES=0 3 | export BACNET_APDU_TIMEOUT=0 4 | 5 | # bacucov: pid device-id object-type object-instance time-remaining 6 | # property tag value [priority] [index] 7 | 8 | # BACnetProgramState 9 | # PROP_PROGRAM_STATE = 92, 10 | # OBJECT_PROGRAM = 16 11 | # BACNET_APPLICATION_TAG_ENUMERATED = 9 12 | for program_state in {0..16} 13 | do 14 | ./bin/bacucov 1 2 16 1 5 92 9 ${program_state} 15 | done 16 | -------------------------------------------------------------------------------- /bin/property-states.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BACNET_APDU_RETRIES=0 3 | export BACNET_APDU_TIMEOUT=0 4 | 5 | # BACnetPropertyStates 6 | #BACnetNotificationParameters ::= CHOICE { 7 | #-- These choices have a one-to-one correspondence with the Event_Type 8 | #-- enumeration with the exception of the 9 | #-- complex-event-type, which is used for proprietary event types. 10 | #change-of-state - [1] SEQUENCE { 11 | # new-state [0] BACnetPropertyStates, 12 | # status-flags [1] BACnetStatusFlags 13 | #}, 14 | for property_states in {0..63} 15 | do 16 | ./bin/bacuevent 1 15 1 0 1 99 1 16 1 ${property_states} 1 0000 "Tribble!" 1 0 0 0 17 | done 18 | -------------------------------------------------------------------------------- /bin/property_id.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BACNET_APDU_RETRIES=0 3 | export BACNET_APDU_TIMEOUT=0 4 | 5 | for property_id in {0..512} 6 | do 7 | ./bin/bacrp --dnet 65535 0 8 0 ${property_id} 8 | done 9 | -------------------------------------------------------------------------------- /bin/reliability.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BACNET_APDU_RETRIES=0 3 | export BACNET_APDU_TIMEOUT=0 4 | 5 | # bacucov: pid device-id object-type object-instance time-remaining 6 | # property tag value [priority] [index] 7 | 8 | # BACnetReliability 9 | # PROP_RELIABILITY = 103, 10 | # OBJECT_ANALOG_INPUT = 0 11 | # BACNET_APPLICATION_TAG_ENUMERATED = 9 12 | for reliability in {0..64} 13 | do 14 | ./bin/bacucov 1 2 0 1 5 103 9 ${reliability} 15 | done 16 | -------------------------------------------------------------------------------- /bin/restart-reason.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BACNET_APDU_RETRIES=0 3 | export BACNET_APDU_TIMEOUT=0 4 | 5 | # bacucov: pid device-id object-type object-instance time-remaining 6 | # property tag value [priority] [index] 7 | 8 | # BACnetRestartReason 9 | # PROP_LAST_RESTART_REASON = 196 10 | # OBJECT_DEVICE = 8 11 | # BACNET_APPLICATION_TAG_ENUMERATED = 9 12 | for reason in {0..64} 13 | do 14 | ./bin/bacucov 1 1 8 1 5 196 9 ${reason} 15 | done 16 | -------------------------------------------------------------------------------- /bin/units.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | export BACNET_APDU_RETRIES=0 3 | export BACNET_APDU_TIMEOUT=0 4 | 5 | for units in {0..255} 6 | do 7 | ./bin/bacucov 1 2 3 4 5 117 9 ${units} 8 | done 9 | -------------------------------------------------------------------------------- /bin/vendor-id.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | for vendor_id in {0..999} 3 | do 4 | ./bin/baciam 4194303 ${vendor_id} 5 | done 6 | -------------------------------------------------------------------------------- /borland.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo Build for Borland 5.5 tools 3 | set BORLAND_DIR=c:\borland\bcc55 4 | %BORLAND_DIR%\bin\make -f makefile.b32 clean 5 | %BORLAND_DIR%\bin\make -f makefile.b32 all 6 | 7 | 8 | -------------------------------------------------------------------------------- /build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo Build with MinGW and MSYS: mingw.sourceforge.net 3 | rem set PATH=C:\MinGW\msys\1.0\bin;C:\MinGW\bin 4 | rem assumes rm, cp, size are already in path 5 | set CC=gcc 6 | set AR=ar 7 | set MAKE=make 8 | make BACNET_PORT=win32 BUILD=release clean all 9 | 10 | rem Build for MinGW debug 11 | rem make BACNET_PORT=win32 BUILD=debug clean all 12 | 13 | rem Build for MinGW MS/TP 14 | rem make BACNET_PORT=win32 BACDL_DEFINE=-DBACDL_MSTP=1 clean all 15 | rem make BACNET_PORT=win32 BACDL_DEFINE=-DBACDL_BIP6=1 clean all 16 | 17 | rem On Linux, install mingw32 and use this: 18 | rem make BACNET_PORT=win32 CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar clean all 19 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Build script for MinGW 3 | echo "Build with MinGW and MSYS: mingw.sourceforge.net" 4 | # set PATH=C:\MinGW\msys\1.0\bin;C:\MinGW\bin 5 | # assumes rm, cp, size are already in path 6 | CC=gcc 7 | AR=ar 8 | MAKE=make 9 | export CC AR MAKE 10 | make BACNET_PORT=win32 BUILD=release clean all > /dev/null 11 | 12 | # Build for MinGW debug 13 | # make BACNET_PORT=win32 BUILD=debug clean all 14 | 15 | # Build for MinGW MS/TP 16 | # make BACNET_PORT=win32 BACDL_DEFINE=-DBACDL_MSTP=1 clean all 17 | # make BACNET_PORT=win32 BACDL_DEFINE=-DBACDL_BIP6=1 clean all 18 | # make BACDL_DEFINE=-DBACDL_BIP6=1 BUILD=debug clean all 19 | 20 | # On Linux, install mingw32 and use this: 21 | # make BACNET_PORT=win32 CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar clean all 22 | 23 | echo "Complete!" 24 | -------------------------------------------------------------------------------- /comment.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This script converts any C++ comments to C comments 3 | # using the ccmtcnvt tool from the liwc package 4 | 5 | CONVERTER=/usr/bin/ccmtcnvt 6 | # silent fail if the tool is not installed 7 | [ -x ${CONVERTER} ] || exit 0 8 | 9 | directory=${1-`pwd`} 10 | for filename in $( find ${directory} -name '*.c' ) 11 | do 12 | echo Converting ${filename} 13 | TEMPFILE="/tmp/ccmtcnvt.$RANDOM.txt" 14 | ${CONVERTER} ${filename} > ${TEMPFILE} 15 | mv ${TEMPFILE} ${filename} 16 | done 17 | 18 | for filename in $( find ${directory} -name '*.h' ) 19 | do 20 | echo Converting ${filename} 21 | TEMPFILE="/tmp/ccmtcnvt.$RANDOM.txt" 22 | ${CONVERTER} ${filename} > ${TEMPFILE} 23 | mv ${TEMPFILE} ${filename} 24 | done 25 | 26 | -------------------------------------------------------------------------------- /demo/BACnetDemo.workspace: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /demo/abort/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | TARGET = bacabort 8 | 9 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 10 | 11 | SRCS = main.c \ 12 | ../object/device-client.c 13 | 14 | OBJS = ${SRCS:.c=.o} 15 | 16 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 17 | 18 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 19 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 20 | size $@ 21 | cp $@ ../../bin 22 | 23 | lib: ${BACNET_LIB_TARGET} 24 | 25 | ${BACNET_LIB_TARGET}: 26 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 27 | 28 | .c.o: 29 | ${CC} -c ${CFLAGS} $*.c -o $@ 30 | 31 | depend: 32 | rm -f .depend 33 | ${CC} -MM ${CFLAGS} *.c >> .depend 34 | 35 | clean: 36 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 37 | 38 | include: .depend 39 | -------------------------------------------------------------------------------- /demo/dcc/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for GCC compiler 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | TARGET = bacdcc 8 | 9 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 10 | 11 | SRCS = main.c \ 12 | ../object/device-client.c 13 | 14 | OBJS = ${SRCS:.c=.o} 15 | 16 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 17 | 18 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 19 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 20 | size $@ 21 | cp $@ ../../bin 22 | 23 | lib: ${BACNET_LIB_TARGET} 24 | 25 | ${BACNET_LIB_TARGET}: 26 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 27 | 28 | .c.o: 29 | ${CC} -c ${CFLAGS} $*.c -o $@ 30 | 31 | depend: 32 | rm -f .depend 33 | ${CC} -MM ${CFLAGS} *.c >> .depend 34 | 35 | clean: 36 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 37 | 38 | include: .depend 39 | 40 | -------------------------------------------------------------------------------- /demo/epics/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | TARGET = bacepics 8 | 9 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 10 | 11 | SRCS = main.c \ 12 | ../object/device-client.c 13 | 14 | OBJS = ${SRCS:.c=.o} 15 | 16 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 17 | 18 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 19 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 20 | size $@ 21 | cp $@ ../../bin 22 | 23 | lib: ${BACNET_LIB_TARGET} 24 | 25 | ${BACNET_LIB_TARGET}: 26 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 27 | 28 | .c.o: 29 | ${CC} -c ${CFLAGS} $*.c -o $@ 30 | 31 | depend: 32 | rm -f .depend 33 | ${CC} -MM ${CFLAGS} *.c >> .depend 34 | 35 | clean: 36 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 37 | 38 | include: .depend 39 | -------------------------------------------------------------------------------- /demo/error/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | TARGET = bacerror 8 | 9 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 10 | 11 | SRCS = main.c \ 12 | ../object/device-client.c 13 | 14 | OBJS = ${SRCS:.c=.o} 15 | 16 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 17 | 18 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 19 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 20 | size $@ 21 | cp $@ ../../bin 22 | 23 | lib: ${BACNET_LIB_TARGET} 24 | 25 | ${BACNET_LIB_TARGET}: 26 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 27 | 28 | .c.o: 29 | ${CC} -c ${CFLAGS} $*.c -o $@ 30 | 31 | depend: 32 | rm -f .depend 33 | ${CC} -MM ${CFLAGS} *.c >> .depend 34 | 35 | clean: 36 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 37 | 38 | include: .depend 39 | -------------------------------------------------------------------------------- /demo/getevent/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application using GCC compiler 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | # AR = ar 7 | # MAKE = make 8 | # SIZE = size 9 | # 10 | # Assumes rm and cp are available 11 | 12 | # Executable file name 13 | TARGET = bacge 14 | 15 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 16 | 17 | SRCS = main.c \ 18 | ../object/device-client.c 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 23 | 24 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 25 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 26 | size $@ 27 | cp $@ ../../bin 28 | 29 | lib: ${BACNET_LIB_TARGET} 30 | 31 | ${BACNET_LIB_TARGET}: 32 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 33 | 34 | .c.o: 35 | ${CC} -c ${CFLAGS} $*.c -o $@ 36 | 37 | depend: 38 | rm -f .depend 39 | ${CC} -MM ${CFLAGS} *.c >> .depend 40 | 41 | clean: 42 | rm -rf core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} 43 | 44 | include: .depend 45 | -------------------------------------------------------------------------------- /demo/iam/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | TARGET = baciam 8 | 9 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 10 | 11 | SRCS = main.c \ 12 | ../object/device-client.c 13 | 14 | OBJS = ${SRCS:.c=.o} 15 | 16 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 17 | 18 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 19 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 20 | size $@ 21 | cp $@ ../../bin 22 | 23 | lib: ${BACNET_LIB_TARGET} 24 | 25 | ${BACNET_LIB_TARGET}: 26 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 27 | 28 | .c.o: 29 | ${CC} -c ${CFLAGS} $*.c -o $@ 30 | 31 | depend: 32 | rm -f .depend 33 | ${CC} -MM ${CFLAGS} *.c >> .depend 34 | 35 | clean: 36 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 37 | 38 | include: .depend 39 | -------------------------------------------------------------------------------- /demo/iamrouter/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | TARGET = baciamr 8 | 9 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 10 | 11 | SRCS = main.c \ 12 | ../object/device-client.c 13 | 14 | OBJS = ${SRCS:.c=.o} 15 | 16 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 17 | 18 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 19 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 20 | size $@ 21 | cp $@ ../../bin 22 | 23 | lib: ${BACNET_LIB_TARGET} 24 | 25 | ${BACNET_LIB_TARGET}: 26 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 27 | 28 | .c.o: 29 | ${CC} -c ${CFLAGS} $*.c -o $@ 30 | 31 | depend: 32 | rm -f .depend 33 | ${CC} -MM ${CFLAGS} *.c >> .depend 34 | 35 | clean: 36 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 37 | 38 | include: .depend 39 | -------------------------------------------------------------------------------- /demo/initrouter/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | TARGET = bacinitr 8 | 9 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 10 | 11 | SRCS = main.c \ 12 | ../object/device-client.c 13 | 14 | OBJS = ${SRCS:.c=.o} 15 | 16 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 17 | 18 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 19 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 20 | size $@ 21 | cp $@ ../../bin 22 | 23 | lib: ${BACNET_LIB_TARGET} 24 | 25 | ${BACNET_LIB_TARGET}: 26 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 27 | 28 | .c.o: 29 | ${CC} -c ${CFLAGS} $*.c -o $@ 30 | 31 | depend: 32 | rm -f .depend 33 | ${CC} -MM ${CFLAGS} *.c >> .depend 34 | 35 | clean: 36 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 37 | 38 | include: .depend 39 | -------------------------------------------------------------------------------- /demo/mstpcap/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | # Executable file name 8 | TARGET = mstpcap 9 | 10 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 11 | 12 | # This demo seems to be a little unique 13 | DEFINES = $(BACNET_DEFINES) -DBACDL_MSTP 14 | BACNET_SOURCE_DIR = ../../src 15 | 16 | SRCS = main.c \ 17 | ${BACNET_PORT_DIR}/rs485.c \ 18 | ${BACNET_PORT_DIR}/timer.c \ 19 | ${BACNET_SOURCE_DIR}/fifo.c \ 20 | ${BACNET_SOURCE_DIR}/mstp.c \ 21 | ${BACNET_SOURCE_DIR}/mstptext.c \ 22 | ${BACNET_SOURCE_DIR}/debug.c \ 23 | ${BACNET_SOURCE_DIR}/indtext.c \ 24 | ${BACNET_SOURCE_DIR}/ringbuf.c \ 25 | ${BACNET_SOURCE_DIR}/bacdcode.c \ 26 | ${BACNET_SOURCE_DIR}/iam.c \ 27 | ${BACNET_SOURCE_DIR}/crc.c 28 | 29 | OBJS = ${SRCS:.c=.o} 30 | 31 | all: Makefile ${TARGET_BIN} 32 | 33 | ${TARGET_BIN}: ${OBJS} Makefile 34 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 35 | size $@ 36 | cp $@ ../../bin 37 | 38 | .c.o: 39 | ${CC} -c ${CFLAGS} $*.c -o $@ 40 | 41 | depend: 42 | rm -f .depend 43 | ${CC} -MM ${CFLAGS} *.c >> .depend 44 | 45 | clean: 46 | rm -f core ${TARGET_BIN} ${OBJS} $(TARGET).map 47 | 48 | include: .depend 49 | -------------------------------------------------------------------------------- /demo/mstpcap/mstpcap.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/demo/mstpcap/mstpcap.txt -------------------------------------------------------------------------------- /demo/mstpcrc/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | # Executable file name 8 | TARGET = mstpcrc 9 | 10 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 11 | 12 | # This demo seems to be a little unique 13 | DEFINES = $(BACNET_DEFINES) 14 | BACNET_SOURCE_DIR = ../../src 15 | 16 | #libraries used 17 | LIBRARIES=-lgcc,-lm 18 | 19 | #build for release (default) or debug 20 | DEBUGGING = 21 | OPTIMIZATION = -Os 22 | ifeq (${BUILD},debug) 23 | OPTIMIZATION = -O0 24 | DEBUGGING = -g 25 | endif 26 | 27 | # search order for included libraries 28 | INCLUDES = -I$(BACNET_INCLUDE_DIR) 29 | 30 | SRCS = main.c \ 31 | ${BACNET_PORT_DIR}/timer.c \ 32 | ${BACNET_SOURCE_DIR}/crc.c 33 | 34 | OBJS = ${SRCS:.c=.o} 35 | 36 | all: Makefile ${TARGET_BIN} 37 | 38 | ${TARGET_BIN}: ${OBJS} Makefile 39 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 40 | size $@ 41 | cp $@ ../../bin 42 | 43 | .c.o: 44 | ${CC} -c ${CFLAGS} $*.c -o $@ 45 | 46 | depend: 47 | rm -f .depend 48 | ${CC} -MM ${CFLAGS} *.c >> .depend 49 | 50 | clean: 51 | rm -f core ${TARGET_BIN} ${OBJS} $(TARGET).map 52 | 53 | include: .depend 54 | -------------------------------------------------------------------------------- /demo/mstpcrc/build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo Build with MinGW and MSYS: mingw.sourceforge.net 3 | rem set PATH=C:\MinGW\msys\1.0\bin;C:\MinGW\bin 4 | rem assumes rm, cp, size are already in path 5 | set CC=gcc 6 | set AR=ar 7 | set MAKE=make 8 | set TARGET_EXT=.exe 9 | make BACNET_PORT=win32 clean all 10 | -------------------------------------------------------------------------------- /demo/mstpcrc/readme.txt: -------------------------------------------------------------------------------- 1 | BACnet MS/TP CRC Calculator 2 | 3 | This tool receives MS/TP bytes and generates a CRC for those bytes 4 | 5 | mstpcrc [options] <00 00 00 00...> 6 | perform MS/TP CRC on data bytes. 7 | options: 8 | [-x] interprete the arguments as ascii hex (default) 9 | [-d] interprete the argument as ascii decimal 10 | [-8] calculate the MS/TP 8-bit Header CRC (default) 11 | [-16] calculate the MS/TP 16-bit Data CRC 12 | 13 | Here is a sample of the tool running (use CTRL-C to quit): 14 | D:\code\bacnet-stack\demo\mstpcrc>mstpcrc 06 ff 01 00 15 15 | 0x06 16 | 0xFF 17 | 0x01 18 | 0x00 19 | 0x15 20 | 0x8E Header CRC 21 | -------------------------------------------------------------------------------- /demo/object/access_credential.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_ACCESS_CREDENTIAL 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = access_credential.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/lighting.c \ 17 | $(SRC_DIR)/bacapp.c \ 18 | $(SRC_DIR)/bacdevobjpropref.c \ 19 | $(SRC_DIR)/assigned_access_rights.c \ 20 | $(SRC_DIR)/authentication_factor.c \ 21 | $(SRC_DIR)/credential_authentication_factor.c \ 22 | $(SRC_DIR)/bactext.c \ 23 | $(SRC_DIR)/indtext.c \ 24 | $(TEST_DIR)/ctest.c 25 | 26 | TARGET = access_credential 27 | 28 | all: ${TARGET} 29 | 30 | OBJS = ${SRCS:.c=.o} 31 | 32 | ${TARGET}: ${OBJS} 33 | ${CC} -o $@ ${OBJS} 34 | 35 | .c.o: 36 | ${CC} -c ${CFLAGS} $*.c -o $@ 37 | 38 | depend: 39 | rm -f .depend 40 | ${CC} -MM ${CFLAGS} *.c >> .depend 41 | 42 | clean: 43 | rm -rf core ${TARGET} $(OBJS) 44 | 45 | include: .depend 46 | -------------------------------------------------------------------------------- /demo/object/access_door.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_ACCESS_DOOR 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = access_door.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/lighting.c \ 17 | $(SRC_DIR)/bacapp.c \ 18 | $(SRC_DIR)/bacdevobjpropref.c \ 19 | $(SRC_DIR)/bactext.c \ 20 | $(SRC_DIR)/indtext.c \ 21 | $(TEST_DIR)/ctest.c 22 | 23 | TARGET = access_door 24 | 25 | all: ${TARGET} 26 | 27 | OBJS = ${SRCS:.c=.o} 28 | 29 | ${TARGET}: ${OBJS} 30 | ${CC} -o $@ ${OBJS} 31 | 32 | .c.o: 33 | ${CC} -c ${CFLAGS} $*.c -o $@ 34 | 35 | depend: 36 | rm -f .depend 37 | ${CC} -MM ${CFLAGS} *.c >> .depend 38 | 39 | clean: 40 | rm -rf core ${TARGET} $(OBJS) 41 | 42 | include: .depend 43 | -------------------------------------------------------------------------------- /demo/object/access_point.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_ACCESS_POINT 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = access_point.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/lighting.c \ 17 | $(SRC_DIR)/bacapp.c \ 18 | $(SRC_DIR)/bacdevobjpropref.c \ 19 | $(SRC_DIR)/bactext.c \ 20 | $(SRC_DIR)/indtext.c \ 21 | $(SRC_DIR)/timestamp.c \ 22 | $(TEST_DIR)/ctest.c 23 | 24 | TARGET = access_point 25 | 26 | all: ${TARGET} 27 | 28 | OBJS = ${SRCS:.c=.o} 29 | 30 | ${TARGET}: ${OBJS} 31 | ${CC} -o $@ ${OBJS} 32 | 33 | .c.o: 34 | ${CC} -c ${CFLAGS} $*.c -o $@ 35 | 36 | depend: 37 | rm -f .depend 38 | ${CC} -MM ${CFLAGS} *.c >> .depend 39 | 40 | clean: 41 | rm -rf core ${TARGET} $(OBJS) 42 | 43 | include: .depend 44 | -------------------------------------------------------------------------------- /demo/object/access_rights.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_ACCESS_RIGHTS 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = access_rights.c \ 11 | $(SRC_DIR)/access_rule.c \ 12 | $(SRC_DIR)/bacdcode.c \ 13 | $(SRC_DIR)/bacint.c \ 14 | $(SRC_DIR)/bacstr.c \ 15 | $(SRC_DIR)/bacreal.c \ 16 | $(SRC_DIR)/datetime.c \ 17 | $(SRC_DIR)/lighting.c \ 18 | $(SRC_DIR)/bacapp.c \ 19 | $(SRC_DIR)/bacdevobjpropref.c \ 20 | $(SRC_DIR)/bactext.c \ 21 | $(SRC_DIR)/indtext.c \ 22 | $(TEST_DIR)/ctest.c 23 | 24 | TARGET = access_rights 25 | 26 | all: ${TARGET} 27 | 28 | OBJS = ${SRCS:.c=.o} 29 | 30 | ${TARGET}: ${OBJS} 31 | ${CC} -o $@ ${OBJS} 32 | 33 | .c.o: 34 | ${CC} -c ${CFLAGS} $*.c -o $@ 35 | 36 | depend: 37 | rm -f .depend 38 | ${CC} -MM ${CFLAGS} *.c >> .depend 39 | 40 | clean: 41 | rm -rf core ${TARGET} $(OBJS) 42 | 43 | include: .depend 44 | -------------------------------------------------------------------------------- /demo/object/access_user.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_ACCESS_USER 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = access_user.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/lighting.c \ 17 | $(SRC_DIR)/bacapp.c \ 18 | $(SRC_DIR)/bacdevobjpropref.c \ 19 | $(SRC_DIR)/bactext.c \ 20 | $(SRC_DIR)/indtext.c \ 21 | $(TEST_DIR)/ctest.c 22 | 23 | TARGET = access_user 24 | 25 | all: ${TARGET} 26 | 27 | OBJS = ${SRCS:.c=.o} 28 | 29 | ${TARGET}: ${OBJS} 30 | ${CC} -o $@ ${OBJS} 31 | 32 | .c.o: 33 | ${CC} -c ${CFLAGS} $*.c -o $@ 34 | 35 | depend: 36 | rm -f .depend 37 | ${CC} -MM ${CFLAGS} *.c >> .depend 38 | 39 | clean: 40 | rm -rf core ${TARGET} $(OBJS) 41 | 42 | include: .depend 43 | -------------------------------------------------------------------------------- /demo/object/access_zone.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_ACCESS_ZONE 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = access_zone.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/lighting.c \ 17 | $(SRC_DIR)/bacapp.c \ 18 | $(SRC_DIR)/bacdevobjpropref.c \ 19 | $(SRC_DIR)/bactext.c \ 20 | $(SRC_DIR)/indtext.c \ 21 | $(TEST_DIR)/ctest.c 22 | 23 | TARGET = access_zone 24 | 25 | all: ${TARGET} 26 | 27 | OBJS = ${SRCS:.c=.o} 28 | 29 | ${TARGET}: ${OBJS} 30 | ${CC} -o $@ ${OBJS} 31 | 32 | .c.o: 33 | ${CC} -c ${CFLAGS} $*.c -o $@ 34 | 35 | depend: 36 | rm -f .depend 37 | ${CC} -MM ${CFLAGS} *.c >> .depend 38 | 39 | clean: 40 | rm -rf core ${TARGET} $(OBJS) 41 | 42 | include: .depend 43 | -------------------------------------------------------------------------------- /demo/object/ai.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | HANDLER_DIR = ../handler 6 | INCLUDES = -I../../include -I$(TEST_DIR) -I. -I$(HANDLER_DIR) 7 | DEFINES = -DBIG_ENDIAN=0 -DBACDL_ALL -DTEST -DTEST_ANALOG_INPUT 8 | 9 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 10 | 11 | SRCS = ai.c \ 12 | $(SRC_DIR)/bacdcode.c \ 13 | $(SRC_DIR)/bacint.c \ 14 | $(SRC_DIR)/bacstr.c \ 15 | $(SRC_DIR)/bacreal.c \ 16 | $(SRC_DIR)/bacapp.c \ 17 | $(SRC_DIR)/bactext.c \ 18 | $(SRC_DIR)/indtext.c \ 19 | $(SRC_DIR)/datetime.c \ 20 | $(TEST_DIR)/ctest.c 21 | 22 | TARGET = analog_input 23 | 24 | all: ${TARGET} 25 | 26 | OBJS = ${SRCS:.c=.o} 27 | 28 | ${TARGET}: ${OBJS} 29 | ${CC} -o $@ ${OBJS} 30 | 31 | .c.o: 32 | ${CC} -c ${CFLAGS} $*.c -o $@ 33 | 34 | depend: 35 | rm -f .depend 36 | ${CC} -MM ${CFLAGS} *.c >> .depend 37 | 38 | clean: 39 | rm -rf core ${TARGET} $(OBJS) 40 | 41 | include: .depend 42 | -------------------------------------------------------------------------------- /demo/object/ao.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_ANALOG_OUTPUT 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = ao.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/bacapp.c \ 17 | $(SRC_DIR)/bactext.c \ 18 | $(SRC_DIR)/indtext.c \ 19 | $(TEST_DIR)/ctest.c 20 | 21 | TARGET = analog_output 22 | 23 | all: ${TARGET} 24 | 25 | OBJS = ${SRCS:.c=.o} 26 | 27 | ${TARGET}: ${OBJS} 28 | ${CC} -o $@ ${OBJS} 29 | 30 | .c.o: 31 | ${CC} -c ${CFLAGS} $*.c -o $@ 32 | 33 | depend: 34 | rm -f .depend 35 | ${CC} -MM ${CFLAGS} *.c >> .depend 36 | 37 | clean: 38 | rm -rf core ${TARGET} $(OBJS) 39 | 40 | include: .depend 41 | -------------------------------------------------------------------------------- /demo/object/av.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_ANALOG_VALUE 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = av.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/bacapp.c \ 17 | $(SRC_DIR)/bactext.c \ 18 | $(SRC_DIR)/indtext.c \ 19 | $(TEST_DIR)/ctest.c 20 | 21 | TARGET = analog_value 22 | 23 | all: ${TARGET} 24 | 25 | OBJS = ${SRCS:.c=.o} 26 | 27 | ${TARGET}: ${OBJS} 28 | ${CC} -o $@ ${OBJS} 29 | 30 | .c.o: 31 | ${CC} -c ${CFLAGS} $*.c -o $@ 32 | 33 | depend: 34 | rm -f .depend 35 | ${CC} -MM ${CFLAGS} *.c >> .depend 36 | 37 | clean: 38 | rm -rf core ${TARGET} $(OBJS) 39 | 40 | include: .depend 41 | -------------------------------------------------------------------------------- /demo/object/bi.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_BINARY_INPUT 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = bi.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/bacapp.c \ 16 | $(SRC_DIR)/bactext.c \ 17 | $(SRC_DIR)/indtext.c \ 18 | $(SRC_DIR)/datetime.c \ 19 | $(TEST_DIR)/ctest.c 20 | 21 | TARGET = binary_input 22 | 23 | all: ${TARGET} 24 | 25 | OBJS = ${SRCS:.c=.o} 26 | 27 | ${TARGET}: ${OBJS} 28 | ${CC} -o $@ ${OBJS} 29 | 30 | .c.o: 31 | ${CC} -c ${CFLAGS} $*.c -o $@ 32 | 33 | depend: 34 | rm -f .depend 35 | ${CC} -MM ${CFLAGS} *.c >> .depend 36 | 37 | clean: 38 | rm -rf core ${TARGET} $(OBJS) 39 | 40 | include: .depend 41 | -------------------------------------------------------------------------------- /demo/object/bo.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_BINARY_OUTPUT 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = bo.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/bacapp.c \ 17 | $(SRC_DIR)/bactext.c \ 18 | $(SRC_DIR)/indtext.c \ 19 | $(TEST_DIR)/ctest.c 20 | 21 | TARGET = binary_output 22 | 23 | all: ${TARGET} 24 | 25 | OBJS = ${SRCS:.c=.o} 26 | 27 | ${TARGET}: ${OBJS} 28 | ${CC} -o $@ ${OBJS} 29 | 30 | .c.o: 31 | ${CC} -c ${CFLAGS} $*.c -o $@ 32 | 33 | depend: 34 | rm -f .depend 35 | ${CC} -MM ${CFLAGS} *.c >> .depend 36 | 37 | clean: 38 | rm -rf core ${TARGET} $(OBJS) 39 | 40 | include: .depend 41 | -------------------------------------------------------------------------------- /demo/object/bv.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_BINARY_VALUE 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = bv.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/bacapp.c \ 17 | $(SRC_DIR)/bactext.c \ 18 | $(SRC_DIR)/indtext.c \ 19 | $(TEST_DIR)/ctest.c 20 | 21 | TARGET = binary_value 22 | 23 | all: ${TARGET} 24 | 25 | OBJS = ${SRCS:.c=.o} 26 | 27 | ${TARGET}: ${OBJS} 28 | ${CC} -o $@ ${OBJS} 29 | 30 | .c.o: 31 | ${CC} -c ${CFLAGS} $*.c -o $@ 32 | 33 | depend: 34 | rm -f .depend 35 | ${CC} -MM ${CFLAGS} *.c >> .depend 36 | 37 | clean: 38 | rm -rf core ${TARGET} $(OBJS) 39 | 40 | include: .depend 41 | -------------------------------------------------------------------------------- /demo/object/command.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | HANDLER_DIR = ../handler 6 | INCLUDES = -I../../include -I$(TEST_DIR) -I. -I$(HANDLER_DIR) 7 | DEFINES = -DBIG_ENDIAN=0 -DBACDL_ALL -DTEST -DTEST_COMMAND 8 | 9 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 10 | 11 | SRCS = command.c \ 12 | $(SRC_DIR)/bacdcode.c \ 13 | $(SRC_DIR)/bacint.c \ 14 | $(SRC_DIR)/bacstr.c \ 15 | $(SRC_DIR)/bacreal.c \ 16 | $(SRC_DIR)/bacapp.c \ 17 | $(SRC_DIR)/bacdevobjpropref.c \ 18 | $(SRC_DIR)/bactext.c \ 19 | $(SRC_DIR)/indtext.c \ 20 | $(SRC_DIR)/datetime.c \ 21 | $(SRC_DIR)/lighting.c \ 22 | $(TEST_DIR)/ctest.c 23 | 24 | TARGET = command 25 | 26 | all: ${TARGET} 27 | 28 | OBJS = ${SRCS:.c=.o} 29 | 30 | ${TARGET}: ${OBJS} 31 | ${CC} -o $@ ${OBJS} 32 | 33 | .c.o: 34 | ${CC} -c ${CFLAGS} $*.c -o $@ 35 | 36 | depend: 37 | rm -f .depend 38 | ${CC} -MM ${CFLAGS} *.c >> .depend 39 | 40 | clean: 41 | rm -rf core ${TARGET} $(OBJS) 42 | 43 | include: .depend 44 | -------------------------------------------------------------------------------- /demo/object/credential_data_input.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_CREDENTIAL_DATA_INPUT 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = credential_data_input.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/lighting.c \ 17 | $(SRC_DIR)/bacapp.c \ 18 | $(SRC_DIR)/bacdevobjpropref.c \ 19 | $(SRC_DIR)/bactext.c \ 20 | $(SRC_DIR)/indtext.c \ 21 | $(SRC_DIR)/authentication_factor.c \ 22 | $(SRC_DIR)/authentication_factor_format.c \ 23 | $(SRC_DIR)/timestamp.c \ 24 | $(TEST_DIR)/ctest.c 25 | 26 | TARGET = credential_data_input 27 | 28 | all: ${TARGET} 29 | 30 | OBJS = ${SRCS:.c=.o} 31 | 32 | ${TARGET}: ${OBJS} 33 | ${CC} -o $@ ${OBJS} 34 | 35 | .c.o: 36 | ${CC} -c ${CFLAGS} $*.c -o $@ 37 | 38 | depend: 39 | rm -f .depend 40 | ${CC} -MM ${CFLAGS} *.c >> .depend 41 | 42 | clean: 43 | rm -rf core ${TARGET} $(OBJS) 44 | 45 | include: .depend 46 | -------------------------------------------------------------------------------- /demo/object/csv.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_CHARACTERSTRING_VALUE 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = csv.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/bacapp.c \ 17 | $(SRC_DIR)/bacdevobjpropref.c \ 18 | $(SRC_DIR)/bactext.c \ 19 | $(SRC_DIR)/indtext.c \ 20 | $(SRC_DIR)/lighting.c \ 21 | $(TEST_DIR)/ctest.c 22 | 23 | TARGET = characterstring_value 24 | 25 | all: ${TARGET} 26 | 27 | OBJS = ${SRCS:.c=.o} 28 | 29 | ${TARGET}: ${OBJS} 30 | ${CC} -o $@ ${OBJS} 31 | 32 | .c.o: 33 | ${CC} -c ${CFLAGS} $*.c -o $@ 34 | 35 | depend: 36 | rm -f .depend 37 | ${CC} -MM ${CFLAGS} *.c >> .depend 38 | 39 | clean: 40 | rm -rf core ${TARGET} $(OBJS) 41 | 42 | include: .depend 43 | -------------------------------------------------------------------------------- /demo/object/device.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | PORTS_DIR = ../../ports/linux 6 | INCLUDES = -I../../include -I$(TEST_DIR) -I$(PORTS_DIR) -I. 7 | DEFINES = -DBIG_ENDIAN=0 8 | DEFINES += -DTEST -DBACDL_TEST 9 | DEFINES += -DBACAPP_ALL 10 | DEFINES += -DMAX_TSM_TRANSACTIONS=0 11 | DEFINES += -DTEST_DEVICE 12 | DEFINES += -DBACNET_PROPERTY_LISTS=1 13 | 14 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 15 | 16 | SRCS = device.c \ 17 | $(SRC_DIR)/bacdcode.c \ 18 | $(SRC_DIR)/bacint.c \ 19 | $(SRC_DIR)/bacstr.c \ 20 | $(SRC_DIR)/bacreal.c \ 21 | $(SRC_DIR)/datetime.c \ 22 | $(SRC_DIR)/bacapp.c \ 23 | $(SRC_DIR)/bacdevobjpropref.c \ 24 | $(SRC_DIR)/bactext.c \ 25 | $(SRC_DIR)/indtext.c \ 26 | $(SRC_DIR)/proplist.c \ 27 | $(SRC_DIR)/lighting.c \ 28 | $(SRC_DIR)/apdu.c \ 29 | $(SRC_DIR)/address.c \ 30 | $(SRC_DIR)/bacaddr.c \ 31 | $(SRC_DIR)/dcc.c \ 32 | $(SRC_DIR)/version.c \ 33 | $(TEST_DIR)/ctest.c 34 | 35 | TARGET = device 36 | 37 | all: ${TARGET} 38 | 39 | OBJS = ${SRCS:.c=.o} 40 | 41 | ${TARGET}: ${OBJS} 42 | ${CC} -o $@ ${OBJS} 43 | 44 | .c.o: 45 | ${CC} -c ${CFLAGS} $*.c -o $@ 46 | 47 | depend: 48 | rm -f .depend 49 | ${CC} -MM ${CFLAGS} *.c >> .depend 50 | 51 | clean: 52 | rm -rf core ${TARGET} $(OBJS) 53 | 54 | include: .depend 55 | -------------------------------------------------------------------------------- /demo/object/lc.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/demo/object/lc.ide -------------------------------------------------------------------------------- /demo/object/lc.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_LOAD_CONTROL 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = lc.c ao.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/bacapp.c \ 17 | $(SRC_DIR)/bacdevobjpropref.c \ 18 | $(SRC_DIR)/bactext.c \ 19 | $(SRC_DIR)/indtext.c \ 20 | $(SRC_DIR)/lighting.c \ 21 | $(TEST_DIR)/ctest.c 22 | 23 | TARGET = load_control 24 | 25 | all: ${TARGET} 26 | 27 | OBJS = ${SRCS:.c=.o} 28 | 29 | ${TARGET}: ${OBJS} 30 | ${CC} -o $@ ${OBJS} 31 | 32 | .c.o: 33 | ${CC} -c ${CFLAGS} $*.c -o $@ 34 | 35 | depend: 36 | rm -f .depend 37 | ${CC} -MM ${CFLAGS} *.c >> .depend 38 | 39 | clean: 40 | rm -rf core ${TARGET} $(OBJS) 41 | 42 | include: .depend 43 | -------------------------------------------------------------------------------- /demo/object/lo.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_LIGHTING_OUTPUT 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = lo.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/bacapp.c \ 17 | $(SRC_DIR)/bacdevobjpropref.c \ 18 | $(SRC_DIR)/bactext.c \ 19 | $(SRC_DIR)/indtext.c \ 20 | $(SRC_DIR)/lighting.c \ 21 | $(TEST_DIR)/ctest.c 22 | 23 | TARGET = lighting_output 24 | 25 | all: ${TARGET} 26 | 27 | OBJS = ${SRCS:.c=.o} 28 | 29 | ${TARGET}: ${OBJS} 30 | ${CC} -o $@ ${OBJS} 31 | 32 | .c.o: 33 | ${CC} -c ${CFLAGS} $*.c -o $@ 34 | 35 | depend: 36 | rm -f .depend 37 | ${CC} -MM ${CFLAGS} *.c >> .depend 38 | 39 | clean: 40 | rm -rf core ${TARGET} $(OBJS) 41 | 42 | include: .depend 43 | -------------------------------------------------------------------------------- /demo/object/lsp.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_LIFE_SAFETY_POINT 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = lsp.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/bacapp.c \ 17 | $(SRC_DIR)/bacdevobjpropref.c \ 18 | $(SRC_DIR)/bactext.c \ 19 | $(SRC_DIR)/indtext.c \ 20 | $(SRC_DIR)/lighting.c \ 21 | $(TEST_DIR)/ctest.c 22 | 23 | TARGET = life_safety_point 24 | 25 | all: ${TARGET} 26 | 27 | OBJS = ${SRCS:.c=.o} 28 | 29 | ${TARGET}: ${OBJS} 30 | ${CC} -o $@ ${OBJS} 31 | 32 | .c.o: 33 | ${CC} -c ${CFLAGS} $*.c -o $@ 34 | 35 | depend: 36 | rm -f .depend 37 | ${CC} -MM ${CFLAGS} *.c >> .depend 38 | 39 | clean: 40 | rm -rf core ${TARGET} $(OBJS) 41 | 42 | include: .depend 43 | -------------------------------------------------------------------------------- /demo/object/msi.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_MULTISTATE_INPUT 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = msi.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/bacapp.c \ 17 | $(SRC_DIR)/bactext.c \ 18 | $(SRC_DIR)/indtext.c \ 19 | $(TEST_DIR)/ctest.c 20 | 21 | TARGET = multistate_input 22 | 23 | all: ${TARGET} 24 | 25 | OBJS = ${SRCS:.c=.o} 26 | 27 | ${TARGET}: ${OBJS} 28 | ${CC} -o $@ ${OBJS} 29 | 30 | .c.o: 31 | ${CC} -c ${CFLAGS} $*.c -o $@ 32 | 33 | depend: 34 | rm -f .depend 35 | ${CC} -MM ${CFLAGS} *.c >> .depend 36 | 37 | clean: 38 | rm -rf core ${TARGET} $(OBJS) 39 | 40 | include: .depend 41 | -------------------------------------------------------------------------------- /demo/object/mso.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_MULTISTATE_OUTPUT 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = mso.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/bacapp.c \ 17 | $(SRC_DIR)/bactext.c \ 18 | $(SRC_DIR)/indtext.c \ 19 | $(TEST_DIR)/ctest.c 20 | 21 | TARGET = multistate_output 22 | 23 | all: ${TARGET} 24 | 25 | OBJS = ${SRCS:.c=.o} 26 | 27 | ${TARGET}: ${OBJS} 28 | ${CC} -o $@ ${OBJS} 29 | 30 | .c.o: 31 | ${CC} -c ${CFLAGS} $*.c -o $@ 32 | 33 | depend: 34 | rm -f .depend 35 | ${CC} -MM ${CFLAGS} *.c >> .depend 36 | 37 | clean: 38 | rm -rf core ${TARGET} $(OBJS) 39 | 40 | include: .depend 41 | -------------------------------------------------------------------------------- /demo/object/msv.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_MULTISTATE_VALUE 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = msv.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/bacapp.c \ 17 | $(SRC_DIR)/bactext.c \ 18 | $(SRC_DIR)/indtext.c \ 19 | $(TEST_DIR)/ctest.c 20 | 21 | TARGET = multistate_value 22 | 23 | all: ${TARGET} 24 | 25 | OBJS = ${SRCS:.c=.o} 26 | 27 | ${TARGET}: ${OBJS} 28 | ${CC} -o $@ ${OBJS} 29 | 30 | .c.o: 31 | ${CC} -c ${CFLAGS} $*.c -o $@ 32 | 33 | depend: 34 | rm -f .depend 35 | ${CC} -MM ${CFLAGS} *.c >> .depend 36 | 37 | clean: 38 | rm -rf core ${TARGET} $(OBJS) 39 | 40 | include: .depend 41 | -------------------------------------------------------------------------------- /demo/object/osv.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DBACNET_PROPERTY_LISTS -DTEST_OCTETSTRING_VALUE 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = osv.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/bacdevobjpropref.c \ 16 | $(SRC_DIR)/datetime.c \ 17 | $(SRC_DIR)/proplist.c \ 18 | $(SRC_DIR)/lighting.c \ 19 | $(SRC_DIR)/bacapp.c \ 20 | $(SRC_DIR)/bactext.c \ 21 | $(SRC_DIR)/indtext.c \ 22 | $(TEST_DIR)/ctest.c 23 | 24 | TARGET = octetstring_value 25 | 26 | all: ${TARGET} 27 | 28 | OBJS = ${SRCS:.c=.o} 29 | 30 | ${TARGET}: ${OBJS} 31 | ${CC} -o $@ ${OBJS} 32 | 33 | .c.o: 34 | ${CC} -c ${CFLAGS} $*.c -o $@ 35 | 36 | depend: 37 | rm -f .depend 38 | ${CC} -MM ${CFLAGS} *.c >> .depend 39 | 40 | clean: 41 | rm -rf core ${TARGET} $(OBJS) 42 | 43 | include: .depend 44 | -------------------------------------------------------------------------------- /demo/object/piv.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_POSITIVEINTEGER_VALUE 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = piv.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/bacdevobjpropref.c \ 16 | $(SRC_DIR)/datetime.c \ 17 | $(SRC_DIR)/lighting.c \ 18 | $(SRC_DIR)/bacapp.c \ 19 | $(SRC_DIR)/bactext.c \ 20 | $(SRC_DIR)/indtext.c \ 21 | $(TEST_DIR)/ctest.c 22 | 23 | TARGET = positiveinteger_value 24 | 25 | all: ${TARGET} 26 | 27 | OBJS = ${SRCS:.c=.o} 28 | 29 | ${TARGET}: ${OBJS} 30 | ${CC} -o $@ ${OBJS} 31 | 32 | .c.o: 33 | ${CC} -c ${CFLAGS} $*.c -o $@ 34 | 35 | depend: 36 | rm -f .depend 37 | ${CC} -MM ${CFLAGS} *.c >> .depend 38 | 39 | clean: 40 | rm -rf core ${TARGET} $(OBJS) 41 | 42 | include: .depend 43 | -------------------------------------------------------------------------------- /demo/object/schedule.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../../src 4 | TEST_DIR = ../../test 5 | INCLUDES = -I../../include -I$(TEST_DIR) -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_SCHEDULE 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = schedule.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/bacdevobjpropref.c \ 16 | $(SRC_DIR)/bactimevalue.c \ 17 | $(SRC_DIR)/datetime.c \ 18 | $(SRC_DIR)/lighting.c \ 19 | $(SRC_DIR)/bacapp.c \ 20 | $(SRC_DIR)/bactext.c \ 21 | $(SRC_DIR)/indtext.c \ 22 | $(TEST_DIR)/ctest.c 23 | 24 | TARGET = schedule 25 | 26 | all: ${TARGET} 27 | 28 | OBJS = ${SRCS:.c=.o} 29 | 30 | ${TARGET}: ${OBJS} 31 | ${CC} -o $@ ${OBJS} 32 | 33 | .c.o: 34 | ${CC} -c ${CFLAGS} $*.c -o $@ 35 | 36 | depend: 37 | rm -f .depend 38 | ${CC} -MM ${CFLAGS} *.c >> .depend 39 | 40 | clean: 41 | rm -rf core ${TARGET} $(OBJS) 42 | 43 | include: .depend 44 | -------------------------------------------------------------------------------- /demo/perl/Documentation/syntax.css: -------------------------------------------------------------------------------- 1 | pre{ 2 | font-family: "Courier New", Courier, monospace, sans-serif; 3 | text-align: left; 4 | line-height: 1.6em; 5 | font-size: 11px; 6 | padding: 0.1em 0.5em 0.3em 0.7em; 7 | border: 2px solid #888; 8 | margin: 1.7em 0 1.7em 0.3em; 9 | overflow: auto; 10 | width: 93%; 11 | background: #EEEEEE; 12 | } 13 | h1 { 14 | font-size: 20pt; 15 | counter-increment: counter-h1; 16 | counter-reset: counter-h2; 17 | } 18 | h2 { 19 | font-size: 17pt; 20 | counter-increment: counter-h2; 21 | counter-reset: counter-h3; 22 | } 23 | h3 { 24 | font-size: 14pt; 25 | counter-increment: counter-h3; 26 | counter-reset: counter-h4; 27 | } 28 | h1:before { 29 | content: counter(counter-h1) ". "; 30 | } 31 | h2:before { 32 | content: counter(counter-h1) "." counter(counter-h2) ". "; 33 | } 34 | h3:before { 35 | content: counter(counter-h1) "." counter(counter-h2) "." counter(counter-h3) ". "; 36 | } 37 | ul { 38 | list-style-type: circle; 39 | } 40 | .quotedString 41 | { 42 | color: #0000FF; 43 | } 44 | .comment 45 | { 46 | color: #999999; 47 | } 48 | .operator 49 | { 50 | color: #00CCCC; 51 | } 52 | .builtinVariable 53 | { 54 | color: #CCCC00; 55 | } 56 | .variableSpecifier 57 | { 58 | color: #FF0000; 59 | } 60 | .keyword 61 | { 62 | color: #AA0033; 63 | } 64 | .builtinFunction 65 | { 66 | color: #AA00AA; 67 | } 68 | .identifier 69 | { 70 | color: #009900; 71 | } 72 | .number 73 | { 74 | color: #9999FF; 75 | } 76 | -------------------------------------------------------------------------------- /demo/perl/readme.txt: -------------------------------------------------------------------------------- 1 | The BACnet Scriptable (using Perl) Tool. 2 | 3 | * Running this tool assumes that the library has been already built. The 4 | library should be built with a command similar to 5 | 6 | CC=/mingw/bin/gcc BACNET_DEFINES="-DPRINT_ENABLED -DBACAPP_ALL -DBACFILE 7 | -DINTRINSIC_REPORTING" BBMD_DEFINE=-DBBMD_ENABLED\=1 BACNET_PORT=win32 make 8 | clean library 9 | 10 | * Currently, the tool assumes only win32 port, but should be easily modifiable 11 | for any port build. 12 | * This tool has to be run from a path without any spaces. The presence of the 13 | .Inline directory is required. 14 | * Run the tool without any arguments to see usage instructions 15 | * To run the example ReapProperty script (which reads Analog Value 0 Present 16 | Value) for Device at instance 1234 run the following command 17 | 18 | perl bacnet.pl --script example_readprop.pl -- 1234 19 | 20 | 21 | -------------------------------------------------------------------------------- /demo/piface/configure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # A script to download and build the libpifacedigital for PiFace 3 | # The library is located at github.com/piface 4 | # Since the PiFace library is GPLv3, we have to keep it separate. 5 | 6 | git clone https://github.com/piface/libmcp23s17.git 7 | git clone https://github.com/piface/libpifacedigital.git 8 | 9 | # Build the library 10 | 11 | make -C libmcp23s17 12 | make -C libpifacedigital 13 | 14 | -------------------------------------------------------------------------------- /demo/piface/readme.txt: -------------------------------------------------------------------------------- 1 | This demo is designed for a Raspberry Pi connected to a PiFace card. 2 | 3 | The demo uses libpifacedigital from github.com/piface repository. 4 | 5 | To build, start with the configure script: 6 | 7 | $ ./configure.sh 8 | $ make clean all 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/ptransfer/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application using GCC compiler 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | # AR = ar 7 | # MAKE = make 8 | # SIZE = size 9 | # 10 | # Assumes rm and cp are available 11 | 12 | # Executable file name 13 | TARGET = ptransfer 14 | 15 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 16 | 17 | SRCS = main.c \ 18 | ../object/device-client.c 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 23 | 24 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 25 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 26 | size $@ 27 | cp $@ ../../bin 28 | 29 | lib: ${BACNET_LIB_TARGET} 30 | 31 | ${BACNET_LIB_TARGET}: 32 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 33 | 34 | .c.o: 35 | ${CC} -c ${CFLAGS} $*.c -o $@ 36 | 37 | depend: 38 | rm -f .depend 39 | ${CC} -MM ${CFLAGS} *.c >> .depend 40 | 41 | clean: 42 | rm -rf core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} 43 | 44 | include: .depend 45 | -------------------------------------------------------------------------------- /demo/ptransfer/ptransfer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rdproperty", "rdproperty.vcproj", "{7AC60281-278A-4060-B900-A1343E438701}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {7AC60281-278A-4060-B900-A1343E438701}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {7AC60281-278A-4060-B900-A1343E438701}.Debug|Win32.Build.0 = Debug|Win32 14 | {7AC60281-278A-4060-B900-A1343E438701}.Release|Win32.ActiveCfg = Release|Win32 15 | {7AC60281-278A-4060-B900-A1343E438701}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /demo/readbdt/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the GCC Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | TARGET = bacrbdt 8 | 9 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 10 | 11 | SRCS = main.c \ 12 | ../object/device-client.c 13 | 14 | OBJS = ${SRCS:.c=.o} 15 | 16 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 17 | 18 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 19 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 20 | size $@ 21 | cp $@ ../../bin 22 | 23 | lib: ${BACNET_LIB_TARGET} 24 | 25 | ${BACNET_LIB_TARGET}: 26 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 27 | 28 | .c.o: 29 | ${CC} -c ${CFLAGS} $*.c -o $@ 30 | 31 | depend: 32 | rm -f .depend 33 | ${CC} -MM ${CFLAGS} *.c >> .depend 34 | 35 | clean: 36 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 37 | 38 | include: .depend 39 | -------------------------------------------------------------------------------- /demo/readfile/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | TARGET = bacarf 8 | 9 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 10 | 11 | SRCS = main.c \ 12 | ../object/device-client.c 13 | 14 | OBJS = ${SRCS:.c=.o} 15 | 16 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 17 | 18 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 19 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 20 | size $@ 21 | cp $@ ../../bin 22 | 23 | lib: ${BACNET_LIB_TARGET} 24 | 25 | ${BACNET_LIB_TARGET}: 26 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 27 | 28 | .c.o: 29 | ${CC} -c ${CFLAGS} $*.c -o $@ 30 | 31 | depend: 32 | rm -f .depend 33 | ${CC} -MM ${CFLAGS} *.c >> .depend 34 | 35 | clean: 36 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 37 | 38 | include: .depend 39 | -------------------------------------------------------------------------------- /demo/readfile/main.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/demo/readfile/main.ide -------------------------------------------------------------------------------- /demo/readprop/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application using GCC compiler 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | # AR = ar 7 | # MAKE = make 8 | # SIZE = size 9 | # 10 | # Assumes rm and cp are available 11 | 12 | # Executable file name 13 | TARGET = bacrp 14 | 15 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 16 | 17 | SRCS = main.c \ 18 | ../object/device-client.c 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 23 | 24 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 25 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 26 | size $@ 27 | cp $@ ../../bin 28 | 29 | lib: ${BACNET_LIB_TARGET} 30 | 31 | ${BACNET_LIB_TARGET}: 32 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 33 | 34 | .c.o: 35 | ${CC} -c ${CFLAGS} $*.c -o $@ 36 | 37 | depend: 38 | rm -f .depend 39 | ${CC} -MM ${CFLAGS} *.c >> .depend 40 | 41 | clean: 42 | rm -rf core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} 43 | 44 | include: .depend 45 | -------------------------------------------------------------------------------- /demo/readpropm/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | # Executable file name 8 | TARGET = bacrpm 9 | 10 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 11 | 12 | SRCS = main.c \ 13 | ../object/device-client.c 14 | 15 | OBJS = ${SRCS:.c=.o} 16 | 17 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 18 | 19 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 20 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 21 | size $@ 22 | cp $@ ../../bin 23 | 24 | lib: ${BACNET_LIB_TARGET} 25 | 26 | ${BACNET_LIB_TARGET}: 27 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 28 | 29 | .c.o: 30 | ${CC} -c ${CFLAGS} $*.c -o $@ 31 | 32 | depend: 33 | rm -f .depend 34 | ${CC} -MM ${CFLAGS} *.c >> .depend 35 | 36 | clean: 37 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 38 | 39 | include: .depend 40 | -------------------------------------------------------------------------------- /demo/readrange/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application using GCC compiler 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | # AR = ar 7 | # MAKE = make 8 | # SIZE = size 9 | # 10 | # Assumes rm and cp are available 11 | 12 | # Executable file name 13 | TARGET = bacrr 14 | 15 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 16 | 17 | SRCS = main.c \ 18 | ../object/device-client.c 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 23 | 24 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 25 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 26 | size $@ 27 | cp $@ ../../bin 28 | 29 | lib: ${BACNET_LIB_TARGET} 30 | 31 | ${BACNET_LIB_TARGET}: 32 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 33 | 34 | .c.o: 35 | ${CC} -c ${CFLAGS} $*.c -o $@ 36 | 37 | depend: 38 | rm -f .depend 39 | ${CC} -MM ${CFLAGS} *.c >> .depend 40 | 41 | clean: 42 | rm -rf core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} 43 | 44 | include: .depend 45 | -------------------------------------------------------------------------------- /demo/readrange/readrange/readrange.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "readrange", "readrange.vcproj", "{6017A2EA-1296-4E67-995F-6344A3CC27C2}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {6017A2EA-1296-4E67-995F-6344A3CC27C2}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {6017A2EA-1296-4E67-995F-6344A3CC27C2}.Debug|Win32.Build.0 = Debug|Win32 14 | {6017A2EA-1296-4E67-995F-6344A3CC27C2}.Release|Win32.ActiveCfg = Release|Win32 15 | {6017A2EA-1296-4E67-995F-6344A3CC27C2}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /demo/reinit/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | # Executable file name 8 | TARGET = bacrd 9 | 10 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 11 | 12 | SRCS = main.c \ 13 | ../object/device-client.c 14 | 15 | OBJS = ${SRCS:.c=.o} 16 | 17 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 18 | 19 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 20 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 21 | size $@ 22 | cp $@ ../../bin 23 | 24 | lib: ${BACNET_LIB_TARGET} 25 | 26 | ${BACNET_LIB_TARGET}: 27 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 28 | 29 | .c.o: 30 | ${CC} -c ${CFLAGS} $*.c -o $@ 31 | 32 | depend: 33 | rm -f .depend 34 | ${CC} -MM ${CFLAGS} *.c >> .depend 35 | 36 | clean: 37 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 38 | 39 | include: .depend 40 | -------------------------------------------------------------------------------- /demo/router-ipv6/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the GCC port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | # Executable file name 8 | TARGET = bacroute 9 | 10 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 11 | 12 | CFLAGS += -DPRINT_ENABLED=1 13 | 14 | BACNET_SOURCE_DIR = ../../src 15 | BACNET_HANDLER_DIR = ../handler 16 | BACNET_OBJECT_DIR = ../object 17 | 18 | SRC = main.c \ 19 | $(BACNET_OBJECT_DIR)/device-client.c 20 | 21 | PORT_BIP6_SRC = \ 22 | $(BACNET_PORT_DIR)/bip6.c \ 23 | $(BACNET_SOURCE_DIR)/bvlc6.c \ 24 | $(BACNET_HANDLER_DIR)/h_bbmd6.c \ 25 | $(BACNET_SOURCE_DIR)/vmac.c 26 | 27 | SRCS = ${SRC} ${PORT_BIP6_SRC} 28 | 29 | OBJS = ${SRCS:.c=.o} 30 | 31 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 32 | 33 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 34 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 35 | size $@ 36 | cp $@ ../../bin 37 | 38 | lib: ${BACNET_LIB_TARGET} 39 | 40 | ${BACNET_LIB_TARGET}: 41 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 42 | 43 | .c.o: 44 | ${CC} -c ${CFLAGS} $*.c -o $@ 45 | 46 | depend: 47 | rm -f .depend 48 | ${CC} -MM ${CFLAGS} *.c >> .depend 49 | 50 | clean: 51 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 52 | 53 | include: .depend 54 | -------------------------------------------------------------------------------- /demo/router-ipv6/readme.txt: -------------------------------------------------------------------------------- 1 | BACnet Simple Router Demo 2 | ========================= 3 | 4 | The Simple Router demo connects one BACnet/IP and one BACnet/IPv6 network. 5 | It also includes a BBMD so that Foreign Device Registration can be used 6 | to tunnel local command line demos to BACnet/IP and BACnet IPv6 networks. 7 | 8 | Configuration 9 | ============= 10 | 11 | It uses environment variables to configure 12 | the BACnet/IP port and BACnet/IPv6 address on Linux: 13 | 14 | export BACNET_IFACE=eth0 15 | export BACNET_BIP6_IFACE=eth0 16 | 17 | Also uses these configurations, but defaults to these values if not set: 18 | export BACNET_IP_PORT=47808 19 | export BACNET_BIP6_PORT=47808 20 | export BACNET_BIP6_BROADCAST=FF05 21 | export BACNET_IP_NET=1 22 | export BACNET_IP6_NET=2 23 | -------------------------------------------------------------------------------- /demo/router/mstpmodule.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @author Andriy Sukhynyuk, Vasyl Tkhir, Andriy Ivasiv 4 | * @date 2012 5 | * @brief Datalink for MS/TP module 6 | * 7 | * @section LICENSE 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining 10 | * a copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject to 15 | * the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included 18 | * in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 21 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | * 28 | */ 29 | #ifndef MSTPMODULE_H 30 | #define MSTPMODULE_H 31 | 32 | #include "portthread.h" 33 | 34 | void *dl_mstp_thread( 35 | void *pArgs); 36 | 37 | #endif /* end of MSTPMODULE_H */ 38 | -------------------------------------------------------------------------------- /demo/scov/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application using GCC compiler 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | # AR = ar 7 | # MAKE = make 8 | # SIZE = size 9 | # 10 | # Assumes rm and cp are available 11 | 12 | # Executable file name 13 | TARGET = bacscov 14 | 15 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 16 | 17 | SRCS = main.c \ 18 | ../object/device-client.c 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 23 | 24 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 25 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 26 | size $@ 27 | cp $@ ../../bin 28 | 29 | lib: ${BACNET_LIB_TARGET} 30 | 31 | ${BACNET_LIB_TARGET}: 32 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 33 | 34 | .c.o: 35 | ${CC} -c ${CFLAGS} $*.c -o $@ 36 | 37 | depend: 38 | rm -f .depend 39 | ${CC} -MM ${CFLAGS} *.c >> .depend 40 | 41 | clean: 42 | rm -rf core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} 43 | 44 | include: .depend 45 | -------------------------------------------------------------------------------- /demo/server/.gdbinit: -------------------------------------------------------------------------------- 1 | set print pretty on 2 | set print union on 3 | set print address on 4 | list 5 | -------------------------------------------------------------------------------- /demo/server/PICS.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/demo/server/PICS.odt -------------------------------------------------------------------------------- /demo/timesync/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | # Executable file name 8 | TARGET = bacts 9 | 10 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 11 | 12 | SRCS = main.c \ 13 | ../object/device-client.c 14 | 15 | OBJS = ${SRCS:.c=.o} 16 | 17 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 18 | 19 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 20 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 21 | size $@ 22 | cp $@ ../../bin 23 | 24 | lib: ${BACNET_LIB_TARGET} 25 | 26 | ${BACNET_LIB_TARGET}: 27 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 28 | 29 | .c.o: 30 | ${CC} -c ${CFLAGS} $*.c -o $@ 31 | 32 | depend: 33 | rm -f .depend 34 | ${CC} -MM ${CFLAGS} *.c >> .depend 35 | 36 | clean: 37 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 38 | 39 | include: .depend 40 | -------------------------------------------------------------------------------- /demo/ucov/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | # Executable file name 8 | TARGET = bacucov 9 | 10 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 11 | 12 | SRCS = main.c \ 13 | ../object/device-client.c 14 | 15 | OBJS = ${SRCS:.c=.o} 16 | 17 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 18 | 19 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 20 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 21 | size $@ 22 | cp $@ ../../bin 23 | 24 | lib: ${BACNET_LIB_TARGET} 25 | 26 | ${BACNET_LIB_TARGET}: 27 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 28 | 29 | .c.o: 30 | ${CC} -c ${CFLAGS} $*.c -o $@ 31 | 32 | depend: 33 | rm -f .depend 34 | ${CC} -MM ${CFLAGS} *.c >> .depend 35 | 36 | clean: 37 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 38 | 39 | include: .depend 40 | -------------------------------------------------------------------------------- /demo/uevent/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application with GNU Make 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | # Executable file name 8 | TARGET = bacuevent 9 | 10 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 11 | 12 | SRCS = main.c \ 13 | ../object/device-client.c 14 | 15 | OBJS = ${SRCS:.c=.o} 16 | 17 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 18 | 19 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 20 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 21 | size $@ 22 | cp $@ ../../bin 23 | 24 | lib: ${BACNET_LIB_TARGET} 25 | 26 | ${BACNET_LIB_TARGET}: 27 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 28 | 29 | .c.o: 30 | ${CC} -c ${CFLAGS} $*.c -o $@ 31 | 32 | depend: 33 | rm -f .depend 34 | ${CC} -MM ${CFLAGS} *.c >> .depend 35 | 36 | clean: 37 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 38 | 39 | include: .depend 40 | -------------------------------------------------------------------------------- /demo/uptransfer/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application using GCC compiler 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | # AR = ar 7 | # MAKE = make 8 | # SIZE = size 9 | # 10 | # Assumes rm and cp are available 11 | 12 | # Executable file name 13 | TARGET = bacupt 14 | 15 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 16 | 17 | SRCS = main.c \ 18 | ../object/device-client.c 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 23 | 24 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 25 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 26 | size $@ 27 | cp $@ ../../bin 28 | 29 | lib: ${BACNET_LIB_TARGET} 30 | 31 | ${BACNET_LIB_TARGET}: 32 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 33 | 34 | .c.o: 35 | ${CC} -c ${CFLAGS} $*.c -o $@ 36 | 37 | depend: 38 | rm -f .depend 39 | ${CC} -MM ${CFLAGS} *.c >> .depend 40 | 41 | clean: 42 | rm -rf core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} 43 | 44 | include: .depend 45 | -------------------------------------------------------------------------------- /demo/whohas/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | # Executable file name 8 | TARGET = bacwh 9 | 10 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 11 | 12 | SRCS = main.c \ 13 | ../object/device-client.c 14 | 15 | OBJS = ${SRCS:.c=.o} 16 | 17 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 18 | 19 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 20 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 21 | size $@ 22 | cp $@ ../../bin 23 | 24 | lib: ${BACNET_LIB_TARGET} 25 | 26 | ${BACNET_LIB_TARGET}: 27 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 28 | 29 | .c.o: 30 | ${CC} -c ${CFLAGS} $*.c -o $@ 31 | 32 | depend: 33 | rm -f .depend 34 | ${CC} -MM ${CFLAGS} *.c >> .depend 35 | 36 | clean: 37 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 38 | 39 | include: .depend 40 | -------------------------------------------------------------------------------- /demo/whois/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | TARGET = bacwi 8 | 9 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 10 | 11 | SRCS = main.c \ 12 | ../object/device-client.c 13 | 14 | OBJS = ${SRCS:.c=.o} 15 | 16 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 17 | 18 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 19 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 20 | size $@ 21 | cp $@ ../../bin 22 | 23 | lib: ${BACNET_LIB_TARGET} 24 | 25 | ${BACNET_LIB_TARGET}: 26 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 27 | 28 | .c.o: 29 | ${CC} -c ${CFLAGS} $*.c -o $@ 30 | 31 | depend: 32 | rm -f .depend 33 | ${CC} -MM ${CFLAGS} *.c >> .depend 34 | 35 | clean: 36 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 37 | 38 | include: .depend 39 | -------------------------------------------------------------------------------- /demo/whoisrouter/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | TARGET = bacwir 8 | 9 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 10 | 11 | SRCS = main.c \ 12 | ../object/device-client.c 13 | 14 | OBJS = ${SRCS:.c=.o} 15 | 16 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 17 | 18 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 19 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 20 | size $@ 21 | cp $@ ../../bin 22 | 23 | lib: ${BACNET_LIB_TARGET} 24 | 25 | ${BACNET_LIB_TARGET}: 26 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 27 | 28 | .c.o: 29 | ${CC} -c ${CFLAGS} $*.c -o $@ 30 | 31 | depend: 32 | rm -f .depend 33 | ${CC} -MM ${CFLAGS} *.c >> .depend 34 | 35 | clean: 36 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 37 | 38 | include: .depend 39 | -------------------------------------------------------------------------------- /demo/writefile/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | # Executable file name 8 | TARGET = bacawf 9 | 10 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 11 | 12 | SRCS = main.c \ 13 | ../object/device-client.c 14 | 15 | OBJS = ${SRCS:.c=.o} 16 | 17 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 18 | 19 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 20 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 21 | size $@ 22 | cp $@ ../../bin 23 | 24 | lib: ${BACNET_LIB_TARGET} 25 | 26 | ${BACNET_LIB_TARGET}: 27 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 28 | 29 | .c.o: 30 | ${CC} -c ${CFLAGS} $*.c -o $@ 31 | 32 | depend: 33 | rm -f .depend 34 | ${CC} -MM ${CFLAGS} *.c >> .depend 35 | 36 | clean: 37 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 38 | 39 | include: .depend 40 | -------------------------------------------------------------------------------- /demo/writefile/main.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/demo/writefile/main.ide -------------------------------------------------------------------------------- /demo/writeprop/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | # Executable file name 8 | TARGET = bacwp 9 | 10 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 11 | 12 | SRCS = main.c \ 13 | ../object/device-client.c 14 | 15 | OBJS = ${SRCS:.c=.o} 16 | 17 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 18 | 19 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 20 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 21 | size $@ 22 | cp $@ ../../bin 23 | 24 | lib: ${BACNET_LIB_TARGET} 25 | 26 | ${BACNET_LIB_TARGET}: 27 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 28 | 29 | .c.o: 30 | ${CC} -c ${CFLAGS} $*.c -o $@ 31 | 32 | depend: 33 | rm -f .depend 34 | ${CC} -MM ${CFLAGS} *.c >> .depend 35 | 36 | clean: 37 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 38 | 39 | include: .depend 40 | -------------------------------------------------------------------------------- /demo/writepropm/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to build BACnet Application for the Linux Port 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | 7 | # Executable file name 8 | TARGET = bacwpm 9 | 10 | TARGET_BIN = ${TARGET}$(TARGET_EXT) 11 | 12 | SRCS = main.c \ 13 | ../object/device-client.c 14 | 15 | OBJS = ${SRCS:.c=.o} 16 | 17 | all: ${BACNET_LIB_TARGET} Makefile ${TARGET_BIN} 18 | 19 | ${TARGET_BIN}: ${OBJS} Makefile ${BACNET_LIB_TARGET} 20 | ${CC} ${PFLAGS} ${OBJS} ${LFLAGS} -o $@ 21 | size $@ 22 | cp $@ ../../bin 23 | 24 | lib: ${BACNET_LIB_TARGET} 25 | 26 | ${BACNET_LIB_TARGET}: 27 | ( cd ${BACNET_LIB_DIR} ; $(MAKE) clean ; $(MAKE) ) 28 | 29 | .c.o: 30 | ${CC} -c ${CFLAGS} $*.c -o $@ 31 | 32 | depend: 33 | rm -f .depend 34 | ${CC} -MM ${CFLAGS} *.c >> .depend 35 | 36 | clean: 37 | rm -f core ${TARGET_BIN} ${OBJS} ${BACNET_LIB_TARGET} $(TARGET).map 38 | 39 | include: .depend 40 | -------------------------------------------------------------------------------- /doc/BACnet-Protocol-Diagram.odg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/doc/BACnet-Protocol-Diagram.odg -------------------------------------------------------------------------------- /doc/BACnetCollapsedArchitecture.flw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/doc/BACnetCollapsedArchitecture.flw -------------------------------------------------------------------------------- /doc/README.build: -------------------------------------------------------------------------------- 1 | BACnet Stack 2 | Developer Build 3 | 4 | This BACnet Stack is designed as a library for an embedded product. 5 | However, there are a number of example applications in the demo/ directory 6 | that show how it can be used for client and server applications. 7 | 8 | The demos can be built using makefiles in the root directory, or by 9 | using individual makefiles in the demo directories. 10 | 11 | Launch the demo/server/bacserv example. Use the client demos to query 12 | the server. Note that the server should be on a different computer or 13 | virtual machine. 14 | -------------------------------------------------------------------------------- /doc/README.codeblocks: -------------------------------------------------------------------------------- 1 | BACnet Stack @ SourceForge.net 2 | Build using Code Blocks 3 | 4 | Q1: GNU GCC Compiler, undefined reference to closesocket 5 | 6 | A1: Under Project->Build Options->Linker settings, 7 | add "ws2_32" to Link Libraries. 8 | 9 | Q2: GNU GCC Compiler, creating a DLL 10 | 11 | A2: Under Project->Build Options->Linker settings, 12 | add "user32" to Link Libraries. 13 | 14 | Q3: GNU GCC Compiler, undefined reference to _GetAdaptersInfo 15 | 16 | A3: Under Project->Build Options->Linker settings, 17 | add "iphlpapi" to Link Libraries. 18 | -------------------------------------------------------------------------------- /doc/README.faq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/doc/README.faq -------------------------------------------------------------------------------- /doc/README.msvc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/doc/README.msvc -------------------------------------------------------------------------------- /doc/README.msvs: -------------------------------------------------------------------------------- 1 | BACnet Stack - SourceForge.net 2 | Build for Visual Studio 2005 Express Edition 3 | 4 | Q1: Cannot open include file: 'winsock2.h' 5 | 6 | A1: Install the Microsoft Platform SDK: 7 | http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/default.aspx 8 | -------------------------------------------------------------------------------- /doc/README.release: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/doc/README.release -------------------------------------------------------------------------------- /doc/README.ubuntu: -------------------------------------------------------------------------------- 1 | Add the ability to compile, edit, and maintain code 2 | 3 | Here are the compilers and their documents 4 | $ sudo apt-get install build-essential subversion-tools gcc-4.2-doc glibc-doc manpages-dev 5 | $ sudo apt-get install mingw32 mingw32-binutils mingw32-runtime 6 | I need access to subversion and XSLT ChangeLog tools 7 | $ sudo apt-get install subversion-tools 8 | $ sudo apt-get install xsltproc 9 | I install a couple of editors, useful for various things. Kate is already installed. 10 | $ sudo apt-get install scite 11 | $ sudo apt-get install vim-full 12 | Useful tools for cleaning up code, converting comments and line endings, and code statistics: 13 | $ sudo apt-get install splint 14 | $ sudo apt-get install sloccount 15 | $ sudo apt-get install indent 16 | $ sudo apt-get install liwc 17 | $ sudo apt-get install tofrodos -------------------------------------------------------------------------------- /doc/RPM-Handler.flw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/doc/RPM-Handler.flw -------------------------------------------------------------------------------- /doc/bac_stack_footer.html: -------------------------------------------------------------------------------- 1 |
2 | BACnet logo 3 | 4 | BACnet-stack API documentation
5 | Generated on $datetime for $projectname by doxygen $doxygenversion
6 | 7 | 8 | -------------------------------------------------------------------------------- /doc/bac_stack_header.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | $title 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /doc/bacnet_dev.config: -------------------------------------------------------------------------------- 1 | 2 | config dev '0' 3 | option Description 'Simple BACnet Device' 4 | option Name 'SampleDevice' 5 | option Id 10042 6 | -------------------------------------------------------------------------------- /doc/htdocs/images/BACnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/doc/htdocs/images/BACnet.png -------------------------------------------------------------------------------- /doc/output/BAC_stack.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BAC-stack 6 | 7 | 8 | 9 | 10 | 11 | <body> 12 | <a href="html/main.html">Frames are disabled. Click here to go to the main page.</a> 13 | </body> 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /doc/output/html/BACnet_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/doc/output/html/BACnet_sm.png -------------------------------------------------------------------------------- /export.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Release helper for this project 3 | 4 | SVN_PROJECT=trunk/bacnet-stack 5 | SVN_BASE_URL=https://svn.code.sf.net/p/bacnet/code/ 6 | SVN_TRUNK_NAME=${SVN_BASE_URL}${SVN_PROJECT} 7 | 8 | if [ -z "$1" ] 9 | then 10 | echo "Usage: `basename $0` export-directory" 11 | echo "Exports HEAD of ${SVN_PROJECT} in Windows CRLF format" 12 | exit 1 13 | fi 14 | 15 | echo "Getting another clean version out of subversion for Windows zip" 16 | svn export --native-eol CRLF ${SVN_TRUNK_NAME} ${1} 17 | echo "done." 18 | 19 | echo "Complete!" 20 | -------------------------------------------------------------------------------- /fixup.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem fix DOS/Unix names and Subversion EOL-Style 3 | rem unix2dos.exe from MSYS: mingw.sourceforge.net 4 | rem svn.exe from Subversion Tools 5 | call :treeProcess 6 | goto :eof 7 | 8 | :treeProcess 9 | rem fix all the specific files of this subdirectory: 10 | for %%f in (*.c) do ( 11 | unix2dos.exe "%%f" 12 | svn.exe propset svn:eol-style native "%%f" 13 | svn.exe propset svn:mime-type text/plain "%%f" 14 | ) 15 | for %%f in (*.h) do ( 16 | unix2dos.exe "%%f" 17 | svn.exe propset svn:eol-style native "%%f" 18 | svn.exe propset svn:mime-type text/plain "%%f" 19 | ) 20 | for %%f in (*.bat) do ( 21 | unix2dos.exe "%%f" 22 | svn.exe propset svn:eol-style native "%%f" 23 | svn.exe propset svn:mime-type text/plain "%%f" 24 | ) 25 | rem loop over all directories and sub directories 26 | for /D %%d in (*) do ( 27 | cd %%d 28 | call :treeProcess 29 | cd .. 30 | ) 31 | exit /b 32 | -------------------------------------------------------------------------------- /include/mydata.h: -------------------------------------------------------------------------------- 1 | /* Sample data structure for confirmed private transfer 2 | We have a simple data structure which can be written to 3 | and read from by sending a confirmed private transfer 4 | request with the appropriate parameters. 5 | */ 6 | 7 | #define MY_MAX_STR 32 8 | #define MY_MAX_BLOCK 8 9 | 10 | #define MY_SVC_READ 0 11 | #define MY_SVC_WRITE 1 12 | 13 | #define MY_ERR_OK 0 14 | #define MY_ERR_BAD_INDEX 1 15 | 16 | typedef struct MyData { 17 | uint8_t cMyByte1; 18 | uint8_t cMyByte2; 19 | float fMyReal; 20 | int8_t sMyString[MY_MAX_STR + 1]; /* A little extra for the nul */ 21 | } DATABLOCK; 22 | -------------------------------------------------------------------------------- /include/vmac.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @author Steve Karg 4 | * @date 2016 5 | */ 6 | #ifndef VMAC_H 7 | #define VMAC_H 8 | 9 | #include 10 | #include 11 | 12 | /* define the max MAC as big as IPv6 + port number */ 13 | #define VMAC_MAC_MAX 18 14 | /** 15 | * VMAC data structure 16 | * 17 | * @{ 18 | */ 19 | struct vmac_data { 20 | uint8_t mac[18]; 21 | uint8_t mac_len; 22 | }; 23 | /** @} */ 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif /* __cplusplus */ 28 | 29 | unsigned int VMAC_Count(void); 30 | struct vmac_data *VMAC_Find_By_Key(uint32_t device_id); 31 | bool VMAC_Find_By_Data(struct vmac_data *vmac, uint32_t *device_id); 32 | bool VMAC_Add(uint32_t device_id, struct vmac_data *pVMAC); 33 | bool VMAC_Delete(uint32_t device_id); 34 | bool VMAC_Different( 35 | struct vmac_data *vmac1, 36 | struct vmac_data *vmac2); 37 | bool VMAC_Match( 38 | struct vmac_data *vmac1, 39 | struct vmac_data *vmac2); 40 | void VMAC_Cleanup(void); 41 | void VMAC_Init(void); 42 | 43 | #ifdef TEST 44 | #include "ctest.h" 45 | void testVMAC( 46 | Test * pTest); 47 | #endif 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif /* __cplusplus */ 52 | #endif 53 | -------------------------------------------------------------------------------- /indent.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # indent uses a local indent.pro file if it exists 3 | # File must be in consistent unix format before indenting 4 | 5 | #DOS2UNIX=/usr/bin/dos2unix 6 | DOS2UNIX=/usr/bin/fromdos 7 | INDENT=/usr/bin/indent 8 | REMOVE=/bin/rm 9 | 10 | # exit silently if utility is not installed 11 | [ -x ${INDENT} ] || exit 0 12 | [ -x ${DOS2UNIX} ] || exit 0 13 | 14 | INDENTRC=".indent.pro" 15 | if [ ! -e ${INDENTRC} ] 16 | then 17 | echo No ${INDENTRC} file found. Creating ${INDENTRC} file. 18 | echo "-kr -nut -nlp -ip4 -cli4 -bfda -nbc -nbbo -c0 -cd0 -cp0 -di0 -l79 -nhnl" > ${INDENTRC} 19 | fi 20 | 21 | directory=${1-`pwd`} 22 | for filename in $( find $directory -name '*.c' ) 23 | do 24 | echo Fixing DOS/Unix $filename 25 | ${DOS2UNIX} $filename 26 | echo Indenting $filename 27 | ${INDENT} $filename 28 | done 29 | 30 | for filename in $( find $directory -name '*.h' ) 31 | do 32 | echo Fixing DOS/Unix $filename 33 | ${DOS2UNIX} $filename 34 | echo Indenting $filename 35 | ${INDENT} $filename 36 | done 37 | 38 | for filename in $( find $directory -name '*~' ) 39 | do 40 | echo Removing backup $filename 41 | ${REMOVE} $filename 42 | done 43 | 44 | -------------------------------------------------------------------------------- /lib/main.cpp: -------------------------------------------------------------------------------- 1 | #include "main.h" 2 | 3 | /** @file lib/main.cpp Provides DLLMain for Win32 build of library. */ 4 | 5 | // a sample exported function 6 | void SomeFunction(const LPCSTR sometext) 7 | { 8 | MessageBoxA(0, sometext, "DLL Message", MB_OK | MB_ICONINFORMATION); 9 | } 10 | 11 | BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) 12 | { 13 | switch (fdwReason) 14 | { 15 | case DLL_PROCESS_ATTACH: 16 | // attach to process 17 | // return FALSE to fail DLL load 18 | break; 19 | 20 | case DLL_PROCESS_DETACH: 21 | // detach from process 22 | break; 23 | 24 | case DLL_THREAD_ATTACH: 25 | // attach to thread 26 | break; 27 | 28 | case DLL_THREAD_DETACH: 29 | // detach from thread 30 | break; 31 | } 32 | return TRUE; // succesful 33 | } 34 | -------------------------------------------------------------------------------- /lib/main.h: -------------------------------------------------------------------------------- 1 | #ifndef __MAIN_H__ 2 | #define __MAIN_H__ 3 | 4 | #include 5 | 6 | /* To use this exported function of dll, include this header 7 | * in your project. 8 | */ 9 | 10 | #ifdef BUILD_DLL 11 | #define DLL_EXPORT __declspec(dllexport) 12 | #else 13 | #define DLL_EXPORT __declspec(dllimport) 14 | #endif 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif /* __cplusplus */ 19 | 20 | void DLL_EXPORT SomeFunction( 21 | const LPCSTR sometext); 22 | 23 | #ifdef __cplusplus 24 | } 25 | #endif /* __cplusplus */ 26 | #endif 27 | -------------------------------------------------------------------------------- /ports/arduino_uno/bvlc-arduino.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @author Miguel Fernandes 4 | * @date 6 de Jun de 2013 5 | * @brief BACnet Virtual Link Control for Wiznet on Arduino-Uno 6 | */ 7 | #ifndef BVLCARDUINO_H_ 8 | #define BVLCARDUINO_H_ 9 | 10 | #include 11 | #include "bacenum.h" 12 | #include "bacdef.h" 13 | #include "npdu.h" 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif /* __cplusplus */ 18 | 19 | uint16_t bvlc_for_non_bbmd(uint8_t * addr, 20 | uint16_t * port, 21 | uint8_t * npdu, 22 | uint16_t received_bytes); 23 | 24 | BACNET_BVLC_FUNCTION bvlc_get_function_code(void); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif /* __cplusplus */ 29 | #endif /* BVLCARDUINO_H_ */ 30 | -------------------------------------------------------------------------------- /ports/arduino_uno/external/Arduino/Ethernet/include/util.h: -------------------------------------------------------------------------------- 1 | #ifndef UTIL_H 2 | #define UTIL_H 3 | 4 | #define htons(x) ( ((x)<<8) | (((x)>>8)&0xFF) ) 5 | #define ntohs(x) htons(x) 6 | 7 | #define htonl(x) ( ((x)<<24 & 0xFF000000UL) | \ 8 | ((x)<< 8 & 0x00FF0000UL) | \ 9 | ((x)>> 8 & 0x0000FF00UL) | \ 10 | ((x)>>24 & 0x000000FFUL) ) 11 | #define ntohl(x) htonl(x) 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /ports/arduino_uno/external/Arduino/core/include/Server.h: -------------------------------------------------------------------------------- 1 | #ifndef server_h 2 | #define server_h 3 | 4 | class Server:public Print { 5 | public: 6 | virtual void begin() = 0; 7 | }; 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /ports/arduino_uno/external/Arduino/core/include/new.h: -------------------------------------------------------------------------------- 1 | /* Header to define new/delete operators as they aren't provided by avr-gcc by default 2 | Taken from http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=59453 3 | */ 4 | 5 | #ifndef NEW_H 6 | #define NEW_H 7 | 8 | #include 9 | 10 | void *operator new(size_t size); 11 | void operator delete(void *ptr); 12 | 13 | __extension__ typedef int __guard __attribute__ ((mode(__DI__))); 14 | 15 | extern "C" int __cxa_guard_acquire(__guard *); 16 | extern "C" void __cxa_guard_release(__guard *); 17 | extern "C" void __cxa_guard_abort(__guard *); 18 | 19 | extern "C" void __cxa_pure_virtual(void); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /ports/arduino_uno/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef STDBOOL_H 2 | #define STDBOOL_H 3 | 4 | /* C99 Boolean types for compilers without C99 support */ 5 | 6 | #ifndef __cplusplus 7 | /* typedef char _Bool; */ 8 | #ifndef bool 9 | #define bool _Bool 10 | #endif 11 | #ifndef true 12 | #define true 1 13 | #endif 14 | #ifndef false 15 | #define false 0 16 | #endif 17 | #define __bool_true_false_are_defined 1 18 | #endif 19 | 20 | #ifndef FALSE 21 | #define FALSE 0 22 | #endif 23 | 24 | #ifndef TRUE 25 | #define TRUE 1 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ports/arduino_uno/stdint.h: -------------------------------------------------------------------------------- 1 | /* Defines the standard integer types that are used in code */ 2 | 3 | #ifndef STDINT_H 4 | #define STDINT_H 1 5 | 6 | #include 7 | 8 | typedef unsigned char uint8_t; /* 1 byte 0 to 255 */ 9 | typedef signed char int8_t; /* 1 byte -127 to 127 */ 10 | typedef unsigned short uint16_t; /* 2 bytes 0 to 65535 */ 11 | typedef signed short int16_t; /* 2 bytes -32767 to 32767 */ 12 | typedef unsigned long uint32_t; /* 4 bytes 0 to 4294967295 */ 13 | typedef signed long int32_t; /* 4 bytes -2147483647 to 2147483647 */ 14 | 15 | #endif /* STDINT_H */ 16 | -------------------------------------------------------------------------------- /ports/arduino_uno/uart.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @author Miguel Fernandes 4 | * @date 6 de Jun de 2013 5 | * @brief For redirecting stdout, stdin and stderr 6 | * see http://www.appelsiini.net/2011/simple-usart-with-avr-libc 7 | */ 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "hardware.h" 13 | #include "uart.h" 14 | 15 | void uart_init(void) 16 | { 17 | UBRR0H = UBRRH_VALUE; 18 | UBRR0L = UBRRL_VALUE; 19 | 20 | #if USE_2X 21 | UCSR0A |= _BV(U2X0); 22 | #else 23 | UCSR0A &= ~(_BV(U2X0)); 24 | #endif 25 | 26 | UCSR0C = _BV(UCSZ01) | _BV(UCSZ00); /* 8-bit data */ 27 | UCSR0B = _BV(RXEN0) | _BV(TXEN0); /* Enable RX and TX */ 28 | } 29 | 30 | void uart_putchar(char c, 31 | FILE * stream) 32 | { 33 | if (c == '\n') { 34 | uart_putchar('\r', stream); 35 | } 36 | loop_until_bit_is_set(UCSR0A, UDRE0); 37 | UDR0 = c; 38 | } 39 | 40 | char uart_getchar(FILE * stream) 41 | { 42 | loop_until_bit_is_set(UCSR0A, RXC0); /* Wait until data exists. */ 43 | return UDR0; 44 | } 45 | -------------------------------------------------------------------------------- /ports/arduino_uno/uart.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @author Miguel Fernandes 4 | * @date 6 de Jun de 2013 5 | * @brief BACnet Virtual Link Control for Wiznet on Arduino-Uno 6 | */ 7 | #ifndef UART_H_ 8 | #define UART_H_ 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif /* __cplusplus */ 18 | 19 | void uart_init(void); 20 | void uart_putchar(char c, 21 | FILE * stream); 22 | char uart_getchar(FILE * stream); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif /* __cplusplus */ 27 | #endif 28 | -------------------------------------------------------------------------------- /ports/arm7/_stdint.h: -------------------------------------------------------------------------------- 1 | /* Defines the standard integer types that are used in code */ 2 | 3 | #ifndef STDINT_H 4 | #define STDINT_H 5 | 6 | #include 7 | 8 | typedef unsigned char uint8_t; /* 1 byte 0 to 255 */ 9 | typedef signed char int8_t; /* 1 byte -127 to 127 */ 10 | typedef unsigned short uint16_t; /* 2 bytes 0 to 65535 */ 11 | typedef signed short int16_t; /* 2 bytes -32767 to 32767 */ 12 | /*typedef unsigned short long uint24_t; // 3 bytes 0 to 16777215 */ 13 | typedef unsigned long uint32_t; /* 4 bytes 0 to 4294967295 */ 14 | typedef signed long int32_t; /* 4 bytes -2147483647 to 2147483647 */ 15 | /* typedef signed long long int64_t; */ 16 | /* typedef unsigned long long uint64_t; */ 17 | 18 | #endif /* STDINT_H */ 19 | -------------------------------------------------------------------------------- /ports/arm7/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef STDBOOL_H 2 | #define STDBOOL_H 3 | 4 | /* C99 Boolean types for compilers without C99 support */ 5 | 6 | #ifndef __cplusplus 7 | 8 | /*typedef int _Bool; */ 9 | #ifndef bool 10 | #define bool _Bool 11 | #endif 12 | #ifndef true 13 | #define true 1 14 | #endif 15 | #ifndef false 16 | #define false 0 17 | #endif 18 | #define __bool_true_false_are_defined 1 19 | #endif 20 | 21 | #ifndef FALSE 22 | #define FALSE 0 23 | #endif 24 | 25 | #ifndef TRUE 26 | #define TRUE 1 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ports/at91sam7s/.gdbinit: -------------------------------------------------------------------------------- 1 | # gdb setup for J-Link - start JLinkGDBServer first 2 | target remote localhost:2331 3 | monitor reset 4 | monitor speed 5 5 | monitor speed auto 6 | monitor long 0xffffff60 0x00320100 7 | monitor long 0xfffffd44 0xa0008000 8 | monitor long 0xfffffc20 0xa0000601 9 | monitor sleep 100 10 | monitor long 0xfffffc2c 0x00480a0e 11 | monitor sleep 200 12 | monitor long 0xfffffc30 0x7 13 | monitor sleep 100 14 | monitor long 0xfffffd08 0xa5000401 15 | monitor sleep 100 16 | 17 | -------------------------------------------------------------------------------- /ports/at91sam7s/bacnet.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\bacnet.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ports/at91sam7s/blinker.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | blinker.c 3 | 4 | Endless loop blinks a code for crash analysis 5 | 6 | Inputs: Code - blink code to display 7 | 1 = undefined instruction (one blinks ........ long pause) 8 | 2 = prefetch abort (two blinks ........ long pause) 9 | 3 = data abort (three blinks ...... long pause) 10 | 11 | Author: James P Lynch May 12, 2007 12 | *****************************************************************************/ 13 | #include "board.h" 14 | 15 | /* global variables */ 16 | unsigned long blinkcount; 17 | 18 | void blinker( 19 | unsigned char code) 20 | { 21 | 22 | volatile AT91PS_PIO pPIO = AT91C_BASE_PIOA; /* pointer to PIO register structure */ 23 | volatile unsigned int j, k; /* loop counters */ 24 | 25 | /* endless loop */ 26 | while (1) { 27 | /* count out the proper number of blinks */ 28 | for (j = code; j != 0; j--) { 29 | /* turn LED1 (DS1) on */ 30 | pPIO->PIO_CODR = LED1; 31 | /* wait 250 msec */ 32 | for (k = 600000; k != 0; k--); 33 | /* turn LED1 (DS1) off */ 34 | pPIO->PIO_SODR = LED1; 35 | /* wait 250 msec */ 36 | for (k = 600000; k != 0; k--); 37 | } 38 | /* wait 2 seconds */ 39 | for (k = 5000000; (code != 0) && (k != 0); k--); 40 | blinkcount++; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ports/at91sam7s/irq.c: -------------------------------------------------------------------------------- 1 | /* The following functions must be written in ARM mode */ 2 | /* these functions are called directly by an exception vector */ 3 | 4 | /*------------------------------------------------------------------------------ */ 5 | /* Internal functions */ 6 | /*------------------------------------------------------------------------------ */ 7 | /*------------------------------------------------------------------------------ */ 8 | /* Default spurious interrupt handler. Infinite loop. */ 9 | /*------------------------------------------------------------------------------ */ 10 | void AT91F_Spurious_handler( 11 | void) 12 | { 13 | while (1); 14 | } 15 | 16 | /*------------------------------------------------------------------------------ */ 17 | /* Default handler for fast interrupt requests. Infinite loop. */ 18 | /*------------------------------------------------------------------------------ */ 19 | void AT91F_Default_FIQ_handler( 20 | void) 21 | { 22 | while (1); 23 | } 24 | 25 | /*------------------------------------------------------------------------------ */ 26 | /* Default handler for standard interrupt requests. Infinite loop. */ 27 | /*------------------------------------------------------------------------------ */ 28 | void AT91F_Default_IRQ_handler( 29 | void) 30 | { 31 | while (1); 32 | } 33 | -------------------------------------------------------------------------------- /ports/atmega168/.splintrc: -------------------------------------------------------------------------------- 1 | -sysdirs C:\WinAVR~1\avr\include;C:\WinAVR~1\lib\gcc\avr\4.2.2\include;C:\WinAVR~1\avr\include\avr;C:\WinAVR~1\avr\include\compat;C:\WinAVR~1\avr\include\util 2 | -IC:\WinAVR~1\avr\include 3 | -IC:\WinAVR~1\avr\include\avr 4 | -IC:\WinAVR~1\avr\include\compat 5 | -IC:\WinAVR~1\avr\include\util 6 | -IC:\WinAVR~1\lib\gcc\avr\4.2.2\include 7 | -I../../include 8 | -I. 9 | -castfcnptr 10 | -fullinitblock 11 | -weak 12 | -D__AVR_ATmega168__ 13 | -D__GNUC__ 14 | -------------------------------------------------------------------------------- /ports/atmega168/PICS.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/atmega168/PICS.odt -------------------------------------------------------------------------------- /ports/atmega168/avr035.h: -------------------------------------------------------------------------------- 1 | #ifndef AVR035_H 2 | #define AVR035_H 3 | 4 | /* from AVR035: Efficient C Coding for AVR */ 5 | 6 | /* a=register, b=bit number to act upon */ 7 | #define BIT_SET(a,b) ((a) |= (1<<(b))) 8 | #define BIT_CLEAR(a,b) ((a) &= ~(1<<(b))) 9 | #define BIT_FLIP(a,b) ((a) ^= (1<<(b))) 10 | #define BIT_CHECK(a,b) ((a) & (1<<(b))) 11 | 12 | /* x=target variable, y=mask */ 13 | #define BITMASK_SET(x,y) ((x) |= (y)) 14 | #define BITMASK_CLEAR(x,y) ((x) &= (~(y))) 15 | #define BITMASK_FLIP(x,y) ((x) ^= (y)) 16 | #define BITMASK_CHECK(x,y) ((x) & (y)) 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /ports/atmega168/bacnet.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\bacnet.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ports/atmega168/hardware.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/atmega168/hardware.ods -------------------------------------------------------------------------------- /ports/atmega168/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/atmega168/readme.txt -------------------------------------------------------------------------------- /ports/atmega168/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef STDBOOL_H 2 | #define STDBOOL_H 3 | 4 | /* C99 Boolean types for compilers without C99 support */ 5 | 6 | #ifndef __cplusplus 7 | /* typedef char _Bool; */ 8 | #ifndef bool 9 | #define bool _Bool 10 | #endif 11 | #ifndef true 12 | #define true 1 13 | #endif 14 | #ifndef false 15 | #define false 0 16 | #endif 17 | #define __bool_true_false_are_defined 1 18 | #endif 19 | 20 | #ifndef FALSE 21 | #define FALSE 0 22 | #endif 23 | 24 | #ifndef TRUE 25 | #define TRUE 1 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ports/atmega168/stdint.h: -------------------------------------------------------------------------------- 1 | /* Defines the standard integer types that are used in code */ 2 | 3 | #ifndef STDINT_H 4 | #define STDINT_H 1 5 | 6 | #include 7 | 8 | typedef unsigned char uint8_t; /* 1 byte 0 to 255 */ 9 | typedef signed char int8_t; /* 1 byte -127 to 127 */ 10 | typedef unsigned short uint16_t; /* 2 bytes 0 to 65535 */ 11 | typedef signed short int16_t; /* 2 bytes -32767 to 32767 */ 12 | typedef unsigned long uint32_t; /* 4 bytes 0 to 4294967295 */ 13 | typedef signed long int32_t; /* 4 bytes -2147483647 to 2147483647 */ 14 | 15 | #endif /* STDINT_H */ 16 | -------------------------------------------------------------------------------- /ports/atmega8/avr035.h: -------------------------------------------------------------------------------- 1 | #ifndef AVR035_H 2 | #define AVR035_H 3 | 4 | /* from AVR035: Efficient C Coding for AVR */ 5 | 6 | /* a=register, b=bit number to act upon */ 7 | #define BIT_SET(a,b) ((a) |= (1<<(b))) 8 | #define BIT_CLEAR(a,b) ((a) &= ~(1<<(b))) 9 | #define BIT_FLIP(a,b) ((a) ^= (1<<(b))) 10 | #define BIT_CHECK(a,b) ((a) & (1<<(b))) 11 | 12 | /* x=target variable, y=mask */ 13 | #define BITMASK_SET(x,y) ((x) |= (y)) 14 | #define BITMASK_CLEAR(x,y) ((x) &= (~(y))) 15 | #define BITMASK_FLIP(x,y) ((x) ^= (y)) 16 | #define BITMASK_CHECK(x,y) ((x) & (y)) 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /ports/atmega8/bacnet.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\bacnet.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ports/atmega8/hardware.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/atmega8/hardware.ods -------------------------------------------------------------------------------- /ports/atmega8/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef STDBOOL_H 2 | #define STDBOOL_H 3 | 4 | /* C99 Boolean types for compilers without C99 support */ 5 | 6 | #ifndef __cplusplus 7 | /* typedef char _Bool; */ 8 | #ifndef bool 9 | #define bool _Bool 10 | #endif 11 | #ifndef true 12 | #define true 1 13 | #endif 14 | #ifndef false 15 | #define false 0 16 | #endif 17 | #define __bool_true_false_are_defined 1 18 | #endif 19 | 20 | #ifndef FALSE 21 | #define FALSE 0 22 | #endif 23 | 24 | #ifndef TRUE 25 | #define TRUE 1 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ports/atmega8/stdint.h: -------------------------------------------------------------------------------- 1 | /* Defines the standard integer types that are used in code */ 2 | 3 | #ifndef STDINT_H 4 | #define STDINT_H 1 5 | 6 | #include 7 | 8 | typedef unsigned char uint8_t; /* 1 byte 0 to 255 */ 9 | typedef signed char int8_t; /* 1 byte -127 to 127 */ 10 | typedef unsigned short uint16_t; /* 2 bytes 0 to 65535 */ 11 | typedef signed short int16_t; /* 2 bytes -32767 to 32767 */ 12 | typedef unsigned long uint32_t; /* 4 bytes 0 to 4294967295 */ 13 | typedef signed long int32_t; /* 4 bytes -2147483647 to 2147483647 */ 14 | 15 | #endif /* STDINT_H */ 16 | -------------------------------------------------------------------------------- /ports/bdk-atxx4-mstp/PICS.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/bdk-atxx4-mstp/PICS.odt -------------------------------------------------------------------------------- /ports/bdk-atxx4-mstp/avrosp/CommChannel.cpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * Atmel Corporation 4 | * 5 | * File : CommChannel.cpp 6 | * Compiler : Dev-C++ 4.9.8.0 - http://bloodshed.net/dev/ 7 | * Revision : $Revision: 1163 $ 8 | * Date : $Date: 2006-08-02 15:38:16 +0200 (on, 02 aug 2006) $ 9 | * Updated by : $Author: ohlia $ 10 | * 11 | * Support mail : avr@atmel.com 12 | * 13 | * Target platform : Win32 14 | * 15 | * AppNote : AVR911 - AVR Open-source Programmer 16 | * 17 | * Description : An abstract class for general byte-by-byte communication. 18 | * Serialport, USB, TCP/IP or similar implementations can be derived 19 | * from this class to create a technology-independent 20 | * communication interface. 21 | * 22 | * This abstract class does not provide any constructor as it is 23 | * too specific for this generalized class. Derived classes should 24 | * implement their own constructors for specific communication devices. 25 | * 26 | * 27 | ****************************************************************************/ 28 | #include "CommChannel.hpp" 29 | 30 | 31 | /* Destructor */ 32 | CommChannel::~CommChannel() 33 | { 34 | /* no code here */ 35 | } 36 | 37 | /* end of file */ 38 | 39 | -------------------------------------------------------------------------------- /ports/bdk-atxx4-mstp/avrosp/ErrorMsg.cpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * Atmel Corporation 4 | * 5 | * File : ErrorMsg.cpp 6 | * Compiler : Dev-C++ 4.9.8.0 - http://bloodshed.net/dev/ 7 | * Revision : $Revision: 1163 $ 8 | * Date : $Date: 2006-08-02 15:38:16 +0200 (on, 02 aug 2006) $ 9 | * Updated by : $Author: ohlia $ 10 | * 11 | * Support mail : avr@atmel.com 12 | * 13 | * Target platform : Win32 14 | * 15 | * AppNote : AVR911 - AVR Open-source Programmer 16 | * 17 | * Description : A class providing a container for general error messages. This 18 | * class can be thrown as an exception. 19 | * 20 | * 21 | ****************************************************************************/ 22 | #include "ErrorMsg.hpp" 23 | 24 | 25 | ErrorMsg::ErrorMsg( const string & _message ) : 26 | message( _message ) 27 | { 28 | // No code here. 29 | } 30 | 31 | 32 | /* Destructor */ 33 | ErrorMsg::~ErrorMsg() 34 | { 35 | // No code here. 36 | } 37 | 38 | 39 | /* Get message */ 40 | const string & ErrorMsg::What() 41 | { 42 | return message; 43 | } 44 | 45 | /* end of file */ 46 | 47 | -------------------------------------------------------------------------------- /ports/bdk-atxx4-mstp/avrosp/ErrorMsg.hpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * Atmel Corporation 4 | * 5 | * File : ErrorMsg.hpp 6 | * Compiler : Dev-C++ 4.9.8.0 - http://bloodshed.net/dev/ 7 | * Revision : $Revision: 1163 $ 8 | * Date : $Date: 2006-08-02 15:38:16 +0200 (on, 02 aug 2006) $ 9 | * Updated by : $Author: ohlia $ 10 | * 11 | * Support mail : avr@atmel.com 12 | * 13 | * Target platform : Win32 14 | * 15 | * AppNote : AVR911 - AVR Open-source Programmer 16 | * 17 | * Description : A class providing a container for general error messages. This 18 | * class can be thrown as an exception. 19 | * 20 | * 21 | ****************************************************************************/ 22 | #ifndef ERRORMSG_HPP 23 | #define ERRORMSG_HPP 24 | 25 | using namespace std; 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | 32 | class ErrorMsg 33 | { 34 | protected: 35 | string message; // Contains the error message. 36 | 37 | public: 38 | // Constructors taking the string as parameter. 39 | ErrorMsg( const string & _message ); 40 | 41 | // Destructor 42 | ~ErrorMsg(); 43 | 44 | // Function returning the error msg. 45 | virtual const string & What(); 46 | }; 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /ports/bdk-atxx4-mstp/avrosp/main.cpp: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * Atmel Corporation 4 | * 5 | * File : main.cpp 6 | * Compiler : Dev-C++ 4.9.8.0 - http://bloodshed.net/dev/ 7 | * Revision : $Revision: 1163 $ 8 | * Date : $Date: 2006-08-02 15:38:16 +0200 (on, 02 aug 2006) $ 9 | * Updated by : $Author: ohlia $ 10 | * 11 | * Support mail : avr@atmel.com 12 | * 13 | * Target platform : Win32 14 | * 15 | * AppNote : AVR911 - AVR Open-source Programmer 16 | * 17 | * Description : AVROSP main entry function. 18 | * 19 | * 20 | ****************************************************************************/ 21 | #include "JobInfo.hpp" 22 | #include 23 | #include 24 | 25 | using namespace std; 26 | 27 | 28 | int main(int argc, char *argv[]) 29 | { 30 | JobInfo j; 31 | 32 | try 33 | { 34 | j.parseCommandline( argc, argv ); 35 | j.doJob(); 36 | } 37 | catch( ErrorMsg * e ) 38 | { 39 | cout << endl << "An error occurred:" << endl; 40 | cout << " [" << e->What() << "]" << endl; 41 | 42 | delete e; 43 | } 44 | 45 | return 0; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /ports/bdk-atxx4-mstp/avrosp/readme.txt: -------------------------------------------------------------------------------- 1 | Made with the free Dev-C++ IDE 2 | 3 | http://bloodshed.net/dev/ 4 | -------------------------------------------------------------------------------- /ports/bdk-atxx4-mstp/bacnet.atsln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Atmel Studio Solution File, Format Version 11.00 4 | Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "BACnet Development Kit", "bacnet.cproj", "{1CEFD571-4B50-48FD-B75E-0E968EBBD698}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|AVR = Debug|AVR 9 | Release|AVR = Release|AVR 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {1CEFD571-4B50-48FD-B75E-0E968EBBD698}.Debug|AVR.ActiveCfg = Debug|AVR 13 | {1CEFD571-4B50-48FD-B75E-0E968EBBD698}.Debug|AVR.Build.0 = Debug|AVR 14 | {1CEFD571-4B50-48FD-B75E-0E968EBBD698}.Release|AVR.ActiveCfg = Release|AVR 15 | {1CEFD571-4B50-48FD-B75E-0E968EBBD698}.Release|AVR.Build.0 = Release|AVR 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /ports/bdk-atxx4-mstp/bacnet.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\bacnet.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ports/bdk-atxx4-mstp/bootloader/preprocessor.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/bdk-atxx4-mstp/bootloader/preprocessor.xls -------------------------------------------------------------------------------- /ports/bdk-atxx4-mstp/bootloader/serial.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * Atmel Corporation 4 | * 5 | * File : serial.c 6 | * Compiler : IAR C 3.10C Kickstart, AVR-GCC/avr-libc(>= 1.2.5) 7 | * Revision : $Revision: 1.7 $ 8 | * Date : $Date: Tuesday, June 07, 200 $ 9 | * Updated by : $Author: raapeland $ 10 | * 11 | * Support mail : avr@atmel.com 12 | * 13 | * Target platform : All AVRs with bootloader support 14 | * 15 | * AppNote : AVR109 - Self-programming 16 | * 17 | * Description : UART communication routines 18 | ****************************************************************************/ 19 | #include "defines.h" 20 | 21 | 22 | void initbootuart( 23 | void) 24 | { 25 | BAUD_RATE_LOW_REG = BRREG_VALUE; 26 | UART_CONTROL_REG = (1 << ENABLE_RECEIVER_BIT) | (1 << ENABLE_TRANSMITTER_BIT); /* enable receive and transmit */ 27 | } 28 | 29 | 30 | void sendchar( 31 | unsigned char c) 32 | { 33 | UART_DATA_REG = c; /* prepare transmission */ 34 | while (!(UART_STATUS_REG & (1 << TRANSMIT_COMPLETE_BIT))); /* wait until byte sendt */ 35 | UART_STATUS_REG |= (1 << TRANSMIT_COMPLETE_BIT); /* delete TXCflag */ 36 | } 37 | 38 | 39 | unsigned char recchar( 40 | void) 41 | { 42 | while (!(UART_STATUS_REG & (1 << RECEIVE_COMPLETE_BIT))); /* wait for data */ 43 | return UART_DATA_REG; 44 | } 45 | -------------------------------------------------------------------------------- /ports/bdk-atxx4-mstp/bootloader/serial.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * 3 | * Atmel Corporation 4 | * 5 | * File : serial.h 6 | * Compiler : IAR C 3.10C Kickstart, AVR-GCC/avr-libc(>= 1.2.5) 7 | * Revision : $Revision: 1.7 $ 8 | * Date : $Date: Tuesday, June 07, 200 $ 9 | * Updated by : $Author: raapeland $ 10 | * 11 | * Support mail : avr@atmel.com 12 | * 13 | * Target platform : All AVRs with bootloader support 14 | * 15 | * AppNote : AVR109 - Self-programming 16 | * 17 | * Description : Header file for serial.c 18 | ****************************************************************************/ 19 | 20 | void initbootuart( 21 | void); 22 | void sendchar( 23 | unsigned char); 24 | unsigned char recchar( 25 | void); 26 | -------------------------------------------------------------------------------- /ports/bdk-atxx4-mstp/crossworks/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef STDBOOL_H 2 | #define STDBOOL_H 3 | 4 | /* C99 Boolean types for compilers without C99 support */ 5 | 6 | #ifndef __cplusplus 7 | typedef char _Bool; 8 | #ifndef bool 9 | #define bool _Bool 10 | #endif 11 | #ifndef true 12 | #define true 1 13 | #endif 14 | #ifndef false 15 | #define false 0 16 | #endif 17 | #define __bool_true_false_are_defined 1 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ports/bdk-atxx4-mstp/hardware.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/bdk-atxx4-mstp/hardware.ods -------------------------------------------------------------------------------- /ports/bsd/readme.txt: -------------------------------------------------------------------------------- 1 | This is a port to MAC OS X for testing. 2 | The unit tests can be run via the test.sh script. 3 | -------------------------------------------------------------------------------- /ports/bsd/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef STDBOOL_H 2 | #define STDBOOL_H 3 | 4 | /* C99 Boolean types for compilers without C99 support */ 5 | 6 | #ifndef __cplusplus 7 | 8 | /*typedef int _Bool; */ 9 | #ifndef bool 10 | #define bool _Bool 11 | #endif 12 | #ifndef true 13 | #define true 1 14 | #endif 15 | #ifndef false 16 | #define false 0 17 | #endif 18 | #define __bool_true_false_are_defined 1 19 | #endif 20 | 21 | #ifndef FALSE 22 | #define FALSE 0 23 | #endif 24 | 25 | #ifndef TRUE 26 | #define TRUE 1 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /ports/dos/bacnet.prj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/dos/bacnet.prj -------------------------------------------------------------------------------- /ports/dos/mk_fp.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** MK_FP.H 3 | ** 4 | ** Standard header file making sure this pesky Intel macro is defined! 5 | */ 6 | 7 | #ifndef MK_FP__H 8 | #define MK_FP__H 9 | 10 | #include "extkword.h" 11 | 12 | #if defined(__WATCOMC__) 13 | #include 14 | #elif !defined(__PACIFIC__) 15 | #include 16 | #endif 17 | 18 | #if !defined(MK_FP) 19 | #define MK_FP(seg,off) \ 20 | ((void FAR *)(((unsigned long)(seg) << 16)|(unsigned)(off))) 21 | #endif 22 | 23 | #endif /* MK_FP__H */ 24 | -------------------------------------------------------------------------------- /ports/dos/queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | +----------------------------------------------------+ 3 | | Thunderbird Software | 4 | +----------------------------------------------------+ 5 | | Filespec : QUEUE.H | 6 | | Date : August 30, 1994 | 7 | | Time : 5:40 PM | 8 | | Revision : 0.0 | 9 | +----------------------------------------------------+ 10 | | Programmer: Scott Andrews | 11 | | Address : 5358 Summit RD SW | 12 | | City/State: Pataskala, Ohio | 13 | | Zip : 43062 | 14 | +----------------------------------------------------+ 15 | | Released to the Public Domain | 16 | +----------------------------------------------------+ 17 | */ 18 | 19 | #ifndef QUEUE__H 20 | #define QUEUE__H 21 | 22 | /* Needed by Serial.C */ 23 | 24 | typedef struct { 25 | int size; 26 | int head; 27 | int tail; 28 | int avail; 29 | char *buffer; 30 | } QUEUE; 31 | 32 | #define queue_empty(queue) (queue)->head == (queue)->tail 33 | #define queue_avail(queue) (queue)->avail 34 | 35 | QUEUE *alloc_queue( 36 | int size); 37 | int en_queue( 38 | QUEUE * queue_ptr, 39 | char data); 40 | int de_queue( 41 | QUEUE * queue_ptr); 42 | 43 | /* End of Queue.H */ 44 | 45 | #endif /* QUEUE__H */ 46 | -------------------------------------------------------------------------------- /ports/dos/readme.txt: -------------------------------------------------------------------------------- 1 | This is a port to DOS using the BACnet MS/TP datalink layer. 2 | It utilizes some serial routines from snippets.org. 3 | It was tested and compiled with Turbo C++ 1.01 which is 4 | freely available from http://dn.codegear.com/article/21751 5 | It was targeting the TS-3100 from Technologic Systems. 6 | -------------------------------------------------------------------------------- /ports/dos/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDBOOL_H 2 | #define _STDBOOL_H 3 | 4 | /* C99 Boolean types for compilers without C99 support */ 5 | /* http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html */ 6 | #if !defined(__cplusplus) 7 | 8 | #if !defined(__GNUC__) 9 | /* _Bool builtin type is included in GCC */ 10 | typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; 11 | #endif 12 | 13 | #define bool _Bool 14 | #define true 1 15 | #define false 0 16 | #define __bool_true_false_are_defined 1 17 | 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /ports/dos/stdint.h: -------------------------------------------------------------------------------- 1 | /* Defines the standard integer types that are used in code */ 2 | /* for the x86 processor and Borland Compiler */ 3 | 4 | #ifndef _STDINT_H 5 | #define _STDINT_H 6 | 7 | #include 8 | 9 | typedef unsigned char uint8_t; /* 1 byte 0 to 255 */ 10 | typedef signed char int8_t; /* 1 byte -127 to 127 */ 11 | typedef unsigned short uint16_t; /* 2 bytes 0 to 65535 */ 12 | typedef signed short int16_t; /* 2 bytes -32767 to 32767 */ 13 | /*typedef unsigned short long uint24_t; // 3 bytes 0 to 16777215 */ 14 | typedef unsigned long uint32_t; /* 4 bytes 0 to 4294967295 */ 15 | typedef signed long int32_t; /* 4 bytes -2147483647 to 2147483647 */ 16 | /* typedef signed long long int64_t; */ 17 | /* typedef unsigned long long uint64_t; */ 18 | 19 | #define INT8_MIN (-128) 20 | #define INT16_MIN (-32768) 21 | #define INT32_MIN (-2147483647 - 1) 22 | 23 | #define INT8_MAX 127 24 | #define INT16_MAX 32767 25 | #define INT32_MAX 2147483647 26 | 27 | #define UINT8_MAX 0xff /* 255U */ 28 | #define UINT16_MAX 0xffff /* 65535U */ 29 | #define UINT32_MAX 0xffffffff /* 4294967295U */ 30 | 31 | #endif /* STDINT_H */ 32 | -------------------------------------------------------------------------------- /ports/dos/timer.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/dos/timer.c -------------------------------------------------------------------------------- /ports/esp32/lib/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | This directory is intended for the project specific (private) libraries. 3 | PlatformIO will compile them to static libraries and link to executable file. 4 | 5 | The source code of each library should be placed in separate directory, like 6 | "lib/private_lib/[here are source files]". 7 | 8 | For example, see how can be organized `Foo` and `Bar` libraries: 9 | 10 | |--lib 11 | | |--Bar 12 | | | |--docs 13 | | | |--examples 14 | | | |--src 15 | | | |- Bar.c 16 | | | |- Bar.h 17 | | |--Foo 18 | | | |- Foo.c 19 | | | |- Foo.h 20 | | |- readme.txt --> THIS FILE 21 | |- platformio.ini 22 | |--src 23 | |- main.c 24 | 25 | Then in `src/main.c` you should use: 26 | 27 | #include 28 | #include 29 | 30 | // rest H/C/CPP code 31 | 32 | PlatformIO will find your libraries automatically, configure preprocessor's 33 | include paths and build them. 34 | 35 | More information about PlatformIO Library Dependency Finder 36 | - http://docs.platformio.org/page/librarymanager/ldf.html 37 | -------------------------------------------------------------------------------- /ports/esp32/platformio.ini: -------------------------------------------------------------------------------- 1 | ; PlatformIO Project Configuration File 2 | ; 3 | ; Build options: build flags, source filter 4 | ; Upload options: custom upload port, speed and extra flags 5 | ; Library options: dependencies, extra library storages 6 | ; Advanced options: extra scripting 7 | ; 8 | ; Please visit documentation for the other options and examples 9 | ; http://docs.platformio.org/page/projectconf.html 10 | 11 | [env:esp32thing] 12 | platform = espressif32 13 | board = esp32thing 14 | framework = espidf 15 | 16 | upload_port = COM7 17 | upload_speed = 1152000 18 | 19 | monitor_baud = 115200 -------------------------------------------------------------------------------- /ports/esp32/src/bip_init.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyleft F.Chaxel 2017 3 | // 4 | 5 | #include "esp_log.h" 6 | #include "esp_wifi.h" 7 | 8 | #include "lwip/sockets.h" 9 | #include "lwip/netdb.h" 10 | 11 | #include "bip.h" 12 | 13 | long bip_getaddrbyname( 14 | const char *host_name) 15 | { 16 | return 0; 17 | } 18 | 19 | void bip_set_interface(char *ifname) 20 | { 21 | } 22 | 23 | void bip_cleanup (void) 24 | { 25 | close(bip_socket()); 26 | bip_set_socket(-1); 27 | } 28 | 29 | bool bip_init(char *ifname) 30 | { 31 | 32 | tcpip_adapter_ip_info_t ip_info = { 0 }; 33 | 34 | int value = 1; 35 | 36 | tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip_info); 37 | 38 | bip_set_interface(ifname); 39 | bip_set_port(htons(0xBAC0)); 40 | bip_set_addr(ip_info.ip.addr); 41 | bip_set_broadcast_addr((ip_info.ip.addr&ip_info.netmask.addr)|(~ip_info.netmask.addr)); 42 | 43 | int sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP); 44 | struct sockaddr_in saddr = { 0 }; 45 | 46 | saddr.sin_family = PF_INET; 47 | saddr.sin_port = htons(0xBAC0); 48 | saddr.sin_addr.s_addr = htonl(INADDR_ANY); 49 | bind(sock, (struct sockaddr *)&saddr, sizeof(struct sockaddr_in)); 50 | 51 | setsockopt(sock, SOL_SOCKET, SO_BROADCAST, (char *) &value, sizeof(value)); 52 | setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *) &value, sizeof(value)); 53 | 54 | bip_set_socket(sock); 55 | 56 | return true; 57 | } -------------------------------------------------------------------------------- /ports/linux/dlmstp.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | BASEDIR = . 4 | # -g for debugging with gdb 5 | DEFINES = -DBIG_ENDIAN=0 -DBACDL_MSTP=1 -DTEST_DLMSTP 6 | INCLUDES = -I. -I../../ 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = rs485.c \ 10 | dlmstp.c \ 11 | ../../mstp.c \ 12 | ../../crc.c 13 | 14 | OBJS = ${SRCS:.c=.o} 15 | 16 | TARGET = dlmstp 17 | 18 | all: ${TARGET} 19 | 20 | ${TARGET}: ${OBJS} 21 | ${CC} -pthread -o $@ ${OBJS} 22 | 23 | .c.o: 24 | ${CC} -c ${CFLAGS} $*.c -o $@ 25 | 26 | depend: 27 | rm -f .depend 28 | ${CC} -MM ${CFLAGS} *.c >> .depend 29 | 30 | clean: 31 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 32 | 33 | include: .depend 34 | -------------------------------------------------------------------------------- /ports/linux/readme.txt: -------------------------------------------------------------------------------- 1 | This is a port to Linux for testing. 2 | The unit tests can be run via the test.sh script. -------------------------------------------------------------------------------- /ports/linux/rs485.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | #CC = gcc 3 | TARGET = rs485 4 | 5 | # Directories 6 | BACNET_SOURCE_DIR = ../../src 7 | BACNET_INCLUDE = ../../include 8 | 9 | # -g for debugging with gdb 10 | DEFINES = -DBIG_ENDIAN=0 -DTEST_RS485 -DBACDL_TEST 11 | INCLUDES = -I. -I../../ -I$(BACNET_INCLUDE) 12 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 13 | LIBRARIES=-lc,-lgcc,-lrt,-lm 14 | LFLAGS = -Wl,-Map=$(TARGET).map,$(LIBRARIES),--gc-sections 15 | 16 | SRCS = rs485.c \ 17 | ${BACNET_SOURCE_DIR}/fifo.c 18 | 19 | OBJS = ${SRCS:.c=.o} 20 | 21 | all: ${TARGET} 22 | 23 | ${TARGET}: ${OBJS} 24 | ${CC} ${OBJS} ${LFLAGS} -o $@ 25 | 26 | .c.o: 27 | ${CC} -c ${CFLAGS} $*.c -o $@ 28 | 29 | depend: 30 | rm -f .depend 31 | ${CC} -MM ${CFLAGS} *.c >> .depend 32 | 33 | clean: 34 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 35 | 36 | include: .depend 37 | -------------------------------------------------------------------------------- /ports/linux/rx_fsm.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRCDIR = ../../src 4 | INCDIR = ../../include 5 | # -g for debugging with gdb 6 | DEFINES = -DBIG_ENDIAN=0 -DBACDL_MSTP=1 7 | INCLUDES = -I. -I$(INCDIR) 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = rs485.c \ 11 | rx_fsm.c \ 12 | $(SRCDIR)/mstp.c \ 13 | $(SRCDIR)/mstptext.c \ 14 | $(SRCDIR)/indtext.c \ 15 | $(SRCDIR)/crc.c 16 | 17 | OBJS = ${SRCS:.c=.o} 18 | 19 | TARGET = rx_fsm 20 | 21 | all: ${TARGET} 22 | 23 | ${TARGET}: ${OBJS} 24 | ${CC} -pthread -o $@ ${OBJS} 25 | 26 | .c.o: 27 | ${CC} -c ${CFLAGS} $*.c -o $@ 28 | 29 | depend: 30 | rm -f .depend 31 | ${CC} -MM ${CFLAGS} *.c >> .depend 32 | 33 | clean: 34 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 35 | 36 | include: .depend 37 | -------------------------------------------------------------------------------- /ports/pic18f6720/BACnet-Server.X/nbproject/Makefile-genesis.properties: -------------------------------------------------------------------------------- 1 | # 2 | #Mon May 30 09:47:38 CDT 2016 3 | default.com-microchip-mplab-nbide-toolchainC18-C18LanguageToolchain.md5=21ae92f54c0f89bc027339aedc19b7f9 4 | default.languagetoolchain.dir=C\:\\Program Files (x86)\\Microchip\\mplabc18\\v3.40\\bin 5 | com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=ef199adcc8f049579a105cca20571dcb 6 | default.languagetoolchain.version=3.40 7 | host.platform=windows 8 | conf.ids=default 9 | -------------------------------------------------------------------------------- /ports/pic18f6720/BACnet-Server.X/nbproject/Makefile-variables.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Generated - do not edit! 3 | # 4 | # NOCDDL 5 | # 6 | CND_BASEDIR=`pwd` 7 | # default configuration 8 | CND_ARTIFACT_DIR_default=dist/default/production 9 | CND_ARTIFACT_NAME_default=BACnet-Server.X.production.hex 10 | CND_ARTIFACT_PATH_default=dist/default/production/BACnet-Server.X.production.hex 11 | CND_PACKAGE_DIR_default=${CND_DISTDIR}/default/package 12 | CND_PACKAGE_NAME_default=bacnet-server.x.tar 13 | CND_PACKAGE_PATH_default=${CND_DISTDIR}/default/package/bacnet-server.x.tar 14 | -------------------------------------------------------------------------------- /ports/pic18f6720/BACnet-Server.X/nbproject/project.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/pic18f6720/BACnet-Server.X/nbproject/project.properties -------------------------------------------------------------------------------- /ports/pic18f6720/BACnet-Server.X/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.microchip.mplab.nbide.embedded.makeproject 4 | 5 | 6 | BACnet-Server 7 | e54ca906-513b-4f74-a23b-6b0204c4509a 8 | 0 9 | c 10 | 11 | h 12 | ISO-8859-1 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /ports/pic18f6720/BACnet-Server.mcw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/pic18f6720/BACnet-Server.mcw -------------------------------------------------------------------------------- /ports/pic18f6720/hardware.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/pic18f6720/hardware.h -------------------------------------------------------------------------------- /ports/pic18f6720/readme.txt: -------------------------------------------------------------------------------- 1 | BACnet Stack - SourceForge.net 2 | Build for MPLAB IDE 3 | 4 | These are some settings that are important when building 5 | the BACnet Stack using MPLAB IDE and MCC18 Compiler, 6 | 7 | 1. Add the files to the project that you need: 8 | abort.c, apdu.c, bacapp.c, bacdcode.c, bacerror.c, 9 | bacstr.c, crc.c, datetime.c, dcc.c, iam.c, 10 | npdu.c, rd.c, reject.c, rp.c, whois.c, wp.c 11 | 12 | From ports/picxx: isr.c, main.c, rs485.c, mstp.c, dlmstp.c 13 | 14 | From demo/object/: device.c or dev_tiny.c 15 | objects as needed: ai.c, ao.c, etc. 16 | 17 | From demo/handler/: txbuf.c, h_dcc.c, h_rd.c, h_rp.c or h_rp_tiny.c 18 | Additional handlers as needed: h_wp.c 19 | 20 | 2. Project->Options->Project 21 | 22 | General Tab: Include Path: 23 | C:\code\bacnet-stack\;C:\code\bacnet-stack\demo\handler\;C:\code\bacnet-stack\demo\object\;C:\code\bacnet-stack\ports\pic18f6720\ 24 | 25 | MPLAB C18 Tab: Memory Model: 26 | Code: Large Code Model 27 | Data: Large Data Model 28 | Stack: Multi-bank Model 29 | 30 | MPLAB C18 Tab: General: Macro Definitions: 31 | PRINT_ENABLED=0 32 | BACDL_MSTP=1 33 | TSM_ENABLED=0 34 | BIG_ENDIAN=0 35 | 36 | 3. The linker script must reserve some extra stack space. 37 | 38 | //DATABANK NAME=gpr12 START=0xC00 END=0xCFF 39 | //DATABANK NAME=gpr13 START=0xD00 END=0xDFF 40 | DATABANK NAME=stackreg START=0xC00 END=0xDFF PROTECTED 41 | 42 | //STACK SIZE=0x100 RAM=gpr13 43 | STACK SIZE=0x200 RAM=stackreg 44 | 45 | -------------------------------------------------------------------------------- /ports/pic18f6720/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef STDBOOL_H 2 | #define STDBOOL_H 3 | 4 | /* C99 Boolean types for compilers without C99 support */ 5 | 6 | #ifndef __cplusplus 7 | typedef char _Bool; 8 | #ifndef bool 9 | #define bool _Bool 10 | #endif 11 | #ifndef true 12 | #define true 1 13 | #endif 14 | #ifndef false 15 | #define false 0 16 | #endif 17 | #define __bool_true_false_are_defined 1 18 | #endif 19 | 20 | #ifndef FALSE 21 | #define FALSE 0 22 | #endif 23 | 24 | #ifndef TRUE 25 | #define TRUE 1 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ports/pic18f6720/stdint.h: -------------------------------------------------------------------------------- 1 | /* Defines the standard integer types that are used in code */ 2 | 3 | #ifndef STDINT_H 4 | #define STDINT_H 1 5 | 6 | #include 7 | 8 | typedef unsigned char uint8_t; /* 1 byte 0 to 255 */ 9 | typedef signed char int8_t; /* 1 byte -127 to 127 */ 10 | typedef unsigned short uint16_t; /* 2 bytes 0 to 65535 */ 11 | typedef signed short int16_t; /* 2 bytes -32767 to 32767 */ 12 | /*typedef unsigned short long uint24_t; // 3 bytes 0 to 16777215 */ 13 | typedef unsigned long uint32_t; /* 4 bytes 0 to 4294967295 */ 14 | typedef signed long int32_t; /* 4 bytes -2147483647 to 2147483647 */ 15 | /* typedef signed long long int64_t; */ 16 | /* typedef unsigned long long uint64_t; */ 17 | 18 | #endif /* STDINT_H */ 19 | -------------------------------------------------------------------------------- /ports/pic18f97j60/BACnet-Server.X/nbproject/Makefile-genesis.properties: -------------------------------------------------------------------------------- 1 | # 2 | #Mon May 30 09:28:30 CDT 2016 3 | default.com-microchip-mplab-nbide-toolchainC18-C18LanguageToolchain.md5=21ae92f54c0f89bc027339aedc19b7f9 4 | default.languagetoolchain.dir=C\:\\Program Files (x86)\\Microchip\\mplabc18\\v3.40\\bin 5 | com-microchip-mplab-nbide-embedded-makeproject-MakeProject.md5=ef199adcc8f049579a105cca20571dcb 6 | default.languagetoolchain.version=3.40 7 | host.platform=windows 8 | conf.ids=default 9 | -------------------------------------------------------------------------------- /ports/pic18f97j60/BACnet-Server.X/nbproject/Makefile-variables.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Generated - do not edit! 3 | # 4 | # NOCDDL 5 | # 6 | CND_BASEDIR=`pwd` 7 | # default configuration 8 | CND_ARTIFACT_DIR_default=dist/default/production 9 | CND_ARTIFACT_NAME_default=BACnet-Server.X.production.hex 10 | CND_ARTIFACT_PATH_default=dist/default/production/BACnet-Server.X.production.hex 11 | CND_PACKAGE_DIR_default=${CND_DISTDIR}/default/package 12 | CND_PACKAGE_NAME_default=bacnet-server.x.tar 13 | CND_PACKAGE_PATH_default=${CND_DISTDIR}/default/package/bacnet-server.x.tar 14 | -------------------------------------------------------------------------------- /ports/pic18f97j60/BACnet-Server.X/nbproject/private/configurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Makefile 4 | 0 5 | 6 | 7 | 8 | 9 | 10 | place holder 1 11 | place holder 2 12 | 13 | 14 | 15 | 16 | true 17 | 0 18 | 0 19 | 0 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ports/pic18f97j60/BACnet-Server.X/nbproject/private/private.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | file:/D:/code/bacnet-stack/ports/pic18f97j60/main.c 6 | file:/D:/code/bacnet-stack/ports/pic18f97j60/isr.c 7 | file:/D:/code/bacnet-stack/ports/pic18f97j60/rs485.h 8 | file:/D:/code/bacnet-stack/ports/pic18f97j60/rs485.c 9 | file:/D:/code/bacnet-stack/ports/pic18f97j60/hardware.h 10 | 11 | 12 | -------------------------------------------------------------------------------- /ports/pic18f97j60/BACnet-Server.X/nbproject/project.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/pic18f97j60/BACnet-Server.X/nbproject/project.properties -------------------------------------------------------------------------------- /ports/pic18f97j60/BACnet-Server.X/nbproject/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.microchip.mplab.nbide.embedded.makeproject 4 | 5 | 6 | BACnet-Server 7 | e54ca906-513b-4f74-a23b-6b0204c4509a 8 | 0 9 | c 10 | 11 | h 12 | ISO-8859-1 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /ports/pic18f97j60/hardware.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/pic18f97j60/hardware.h -------------------------------------------------------------------------------- /ports/pic18f97j60/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef STDBOOL_H 2 | #define STDBOOL_H 3 | 4 | /* C99 Boolean types for compilers without C99 support */ 5 | 6 | #ifndef __cplusplus 7 | typedef char _Bool; 8 | #ifndef bool 9 | #define bool _Bool 10 | #endif 11 | #ifndef true 12 | #define true 1 13 | #endif 14 | #ifndef false 15 | #define false 0 16 | #endif 17 | #define __bool_true_false_are_defined 1 18 | #endif 19 | 20 | #ifndef FALSE 21 | #define FALSE 0 22 | #endif 23 | 24 | #ifndef TRUE 25 | #define TRUE 1 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ports/pic18f97j60/stdint.h: -------------------------------------------------------------------------------- 1 | /* Defines the standard integer types that are used in code */ 2 | 3 | #ifndef STDINT_H 4 | #define STDINT_H 1 5 | 6 | #include 7 | 8 | typedef unsigned char uint8_t; /* 1 byte 0 to 255 */ 9 | typedef signed char int8_t; /* 1 byte -127 to 127 */ 10 | typedef unsigned short uint16_t; /* 2 bytes 0 to 65535 */ 11 | typedef signed short int16_t; /* 2 bytes -32767 to 32767 */ 12 | /*typedef unsigned short long uint24_t; // 3 bytes 0 to 16777215 */ 13 | typedef unsigned long uint32_t; /* 4 bytes 0 to 4294967295 */ 14 | typedef signed long int32_t; /* 4 bytes -2147483647 to 2147483647 */ 15 | /* typedef signed long long int64_t; */ 16 | /* typedef unsigned long long uint64_t; */ 17 | 18 | #endif /* STDINT_H */ 19 | -------------------------------------------------------------------------------- /ports/rtos32/hardware.cfg: -------------------------------------------------------------------------------- 1 | // * The target computer is IBM-PC-AT compatible. 2 | // * There is a minimum of 4 MB of RAM installed. 3 | 4 | #ifdef DEBUGDOS 5 | Region RealModeVectors 0 1k RAM NoAccess // interrupt vectors 6 | Region BIOSDataArea 1k 3k RAM ReadOnly // BIOS data area 7 | Region DOSMem 4k 252k RAM 8 | Region LowMem 256k 256k RAM 9 | #else 10 | Region = RealModeVectors 0, 4k, RAM, NoAccess // interrupt vectors 11 | // note: locate only has 4k granularity so the 0-1k will be readonly 12 | // Region = RealModeVectors 0, 1k, RAM, NoAccess // interrupt vectors 13 | // Region = BIOSDataArea 1k, 3k, RAM, ReadOnly // BIOS data area 14 | Region = LowMem 4k, 508k, RAM, Assign // Conventional memory 15 | #endif 16 | Region = MoreLowMem 512k, 128k, RAM, Assign // Reserved BIOS ext 17 | Region = MonoText B0000h 4k, Device, ReadWrite // Mono text video mem 18 | Region = ColorText B8000h, 4k, Device, ReadWrite // Text mode video ram 19 | Region = DiskOnChip D0000h, 8k, Device, ReadWrite // Driver Ampro Card 20 | Region = DiskOnChip1 E8000h, 32k, Device, ReadWrite // Driver WinSys Card 21 | Region = HighMem 1M, 3M, RAM, Assign // 3mb ext mem on target 22 | Virtual HeapMem 1G 23 | Virtual StackMem 2G 24 | Virtual ProgMem 3G 25 | -------------------------------------------------------------------------------- /ports/rtos32/setvars.bat: -------------------------------------------------------------------------------- 1 | set BORLAND_DIR=\bc5 2 | set RTOS32_DIR=\code\rtos32 3 | 4 | -------------------------------------------------------------------------------- /ports/rtos32/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef STDBOOL_H 2 | #define STDBOOL_H 3 | 4 | /* C99 Boolean types for compilers without C99 support */ 5 | 6 | #ifndef __cplusplus 7 | typedef char _Bool; 8 | #ifndef bool 9 | #define bool _Bool 10 | #endif 11 | #ifndef true 12 | #define true 1 13 | #endif 14 | #ifndef false 15 | #define false 0 16 | #endif 17 | #define __bool_true_false_are_defined 1 18 | #endif 19 | 20 | #ifndef FALSE 21 | #define FALSE 0 22 | #endif 23 | 24 | #ifndef TRUE 25 | #define TRUE 1 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /ports/rtos32/stdint.h: -------------------------------------------------------------------------------- 1 | /* Defines the standard integer types that are used in code */ 2 | /* for the x86 processor and Borland Compiler */ 3 | 4 | #ifndef STDINT_H 5 | #define STDINT_H 6 | 7 | #include 8 | 9 | typedef unsigned char uint8_t; /* 1 byte 0 to 255 */ 10 | typedef signed char int8_t; /* 1 byte -127 to 127 */ 11 | typedef unsigned short uint16_t; /* 2 bytes 0 to 65535 */ 12 | typedef signed short int16_t; /* 2 bytes -32767 to 32767 */ 13 | /*typedef unsigned short long uint24_t; // 3 bytes 0 to 16777215 */ 14 | typedef unsigned long uint32_t; /* 4 bytes 0 to 4294967295 */ 15 | typedef signed long int32_t; /* 4 bytes -2147483647 to 2147483647 */ 16 | /* typedef signed long long int64_t; */ 17 | /* typedef unsigned long long uint64_t; */ 18 | 19 | #endif /* STDINT_H */ 20 | -------------------------------------------------------------------------------- /ports/rx62n/readme.txt: -------------------------------------------------------------------------------- 1 | BACnet Etherent 2 | Demonstrates the Ethernet peripheral by implmenting BACnet over Ethernet 3 | on the RX62N Development Kit. The project is compiled with the RX Standard 4 | Toolchain, and the default drivers included with the RX62N kit. 5 |   6 | The project does not use any additional hardware. 7 |   8 | The project was tested using a BACnet/IP to BACnet Ethernet router, using the bacnet-tools from the BACnet Protocol Stack site. 9 | -------------------------------------------------------------------------------- /ports/stm32f10x/CMSIS/CMSIS debug support.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/CMSIS/CMSIS debug support.htm -------------------------------------------------------------------------------- /ports/stm32f10x/CMSIS/CMSIS_Core.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/CMSIS/CMSIS_Core.htm -------------------------------------------------------------------------------- /ports/stm32f10x/CMSIS/License.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/CMSIS/License.doc -------------------------------------------------------------------------------- /ports/stm32f10x/bacnet.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\bacnet.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ports/stm32f10x/drivers/inc/stm32f10x_fsmc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/drivers/inc/stm32f10x_fsmc.h -------------------------------------------------------------------------------- /ports/stm32f10x/drivers/src/stm32f10x_adc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/drivers/src/stm32f10x_adc.c -------------------------------------------------------------------------------- /ports/stm32f10x/drivers/src/stm32f10x_can.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/drivers/src/stm32f10x_can.c -------------------------------------------------------------------------------- /ports/stm32f10x/drivers/src/stm32f10x_dac.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/drivers/src/stm32f10x_dac.c -------------------------------------------------------------------------------- /ports/stm32f10x/drivers/src/stm32f10x_dma.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/drivers/src/stm32f10x_dma.c -------------------------------------------------------------------------------- /ports/stm32f10x/drivers/src/stm32f10x_exti.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/drivers/src/stm32f10x_exti.c -------------------------------------------------------------------------------- /ports/stm32f10x/drivers/src/stm32f10x_flash.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/drivers/src/stm32f10x_flash.c -------------------------------------------------------------------------------- /ports/stm32f10x/drivers/src/stm32f10x_fsmc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/drivers/src/stm32f10x_fsmc.c -------------------------------------------------------------------------------- /ports/stm32f10x/drivers/src/stm32f10x_i2c.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/drivers/src/stm32f10x_i2c.c -------------------------------------------------------------------------------- /ports/stm32f10x/drivers/src/stm32f10x_rcc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/drivers/src/stm32f10x_rcc.c -------------------------------------------------------------------------------- /ports/stm32f10x/drivers/src/stm32f10x_rtc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/drivers/src/stm32f10x_rtc.c -------------------------------------------------------------------------------- /ports/stm32f10x/drivers/src/stm32f10x_sdio.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/drivers/src/stm32f10x_sdio.c -------------------------------------------------------------------------------- /ports/stm32f10x/drivers/src/stm32f10x_tim.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/drivers/src/stm32f10x_tim.c -------------------------------------------------------------------------------- /ports/stm32f10x/drivers/src/stm32f10x_usart.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/drivers/src/stm32f10x_usart.c -------------------------------------------------------------------------------- /ports/stm32f10x/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/readme.txt -------------------------------------------------------------------------------- /ports/stm32f10x/stm32-rs485-daughter.brd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/stm32-rs485-daughter.brd -------------------------------------------------------------------------------- /ports/stm32f10x/stm32-rs485-daughter.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/stm32f10x/stm32-rs485-daughter.ods -------------------------------------------------------------------------------- /ports/stm32f10x/stm32f10x_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000 ; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x080FFFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20017FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x800; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | 17 | define memory mem with size = 4G; 18 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 19 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 20 | 21 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 22 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 23 | 24 | initialize by copy { readwrite }; 25 | do not initialize { section .noinit }; 26 | 27 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 28 | 29 | place in ROM_region { readonly }; 30 | place in RAM_region { readwrite, 31 | block CSTACK, block HEAP }; -------------------------------------------------------------------------------- /ports/win32/Microsoft Visual Studio 2010/dcc/dcc.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | -------------------------------------------------------------------------------- /ports/win32/Microsoft Visual Studio 2010/writeprop/writeprop.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | 10 | 11 | Source Files 12 | 13 | 14 | -------------------------------------------------------------------------------- /ports/win32/Microsoft Visual Studio 2015/BACnet Solution Settings.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | <_PropertySheetDisplayName>BACnet Solution Settings 7 | ..\..;..\..\..\..\include;..\..\..\..\demo\object;..\..\..\..\demo\handler;$(IncludePath) 8 | 9 | 10 | 11 | _DEBUG;_CONSOLE;PRINT_ENABLED=1;BIP_DEBUG;INTRINSIC_REPORTING=1;BBMD_ENABLED=1;DEBUG_ENABLED=1;BACFILE;WIN32;_MBCS;%(PreprocessorDefinitions) 12 | MultiThreaded 13 | Default 14 | Level4 15 | true 16 | 17 | 18 | 4214;4245;4389;4244;4996;4018;4100;4267;4701;4189; 19 | CompileAsC 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /ports/win32/Microsoft Visual Studio 2015/Server/Server.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {a99eabbe-5157-4999-8c10-9f9f93f1778d} 6 | 7 | 8 | 9 | 10 | Source Files 11 | 12 | 13 | Source Files 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ports/win32/bacnet.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/ports/win32/bacnet.ide -------------------------------------------------------------------------------- /ports/win32/borland.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo Build for Borland 5.5 tools 3 | set BORLAND_DIR=c:\borland\bcc55 4 | %BORLAND_DIR%\bin\make -f makefile.mak clean 5 | %BORLAND_DIR%\bin\make -f makefile.mak all 6 | 7 | 8 | -------------------------------------------------------------------------------- /ports/win32/readme.txt: -------------------------------------------------------------------------------- 1 | BACnet Stack - Win32 2 | 3 | This directory contains a demo program that compiles with a Win32 compiler. 4 | It was tested with the freely downloadable Borland C++ 5.5, as well as 5 | Borland C++ 5 and Visual C++ 6.0. 6 | 7 | The makefile.mak file is used with the Borland command line tools. 8 | Run setvars.bat to configure the environment for the Borland tools. 9 | Edit it if necessary to set the correct location of your tools. 10 | 11 | The bacnet.ide file is used with the Borland IDE. 12 | 13 | The bacnet directory is used with Visual C++ 6 tools, and there is a 14 | workspace file bacnet.dsw that is used to compile the demo program. 15 | 16 | -------------------------------------------------------------------------------- /ports/win32/setvars.bat: -------------------------------------------------------------------------------- 1 | set BORLAND_DIR=\bcc55 2 | 3 | -------------------------------------------------------------------------------- /ports/win32/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDBOOL_H 2 | #define _STDBOOL_H 3 | 4 | #include 5 | 6 | /* C99 Boolean types for compilers without C99 support */ 7 | /* http://www.opengroup.org/onlinepubs/009695399/basedefs/stdbool.h.html */ 8 | 9 | #if !defined(__cplusplus) 10 | 11 | #if !defined(__GNUC__) 12 | /* _Bool builtin type is included in GCC */ 13 | /* ISO C Standard: 5.2.5 An object declared as 14 | type _Bool is large enough to store 15 | the values 0 and 1. */ 16 | /* We choose 8 bit to match C++ */ 17 | /* It must also promote to integer */ 18 | #if _MSC_VER < 1600 19 | typedef int8_t _Bool; 20 | #endif /* _MSC_VER < 1600 VS 2010 and earlier */ 21 | #endif 22 | 23 | /* ISO C Standard: 7.16 Boolean type */ 24 | #define bool _Bool 25 | #define true 1 26 | #define false 0 27 | #define __bool_true_false_are_defined 1 28 | 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /ports/win32/stdint.h: -------------------------------------------------------------------------------- 1 | /* Defines the standard integer types that are used in code */ 2 | /* for the x86 processor and Borland Compiler */ 3 | 4 | #ifndef _STDINT_H 5 | #define _STDINT_H 6 | 7 | #include 8 | 9 | typedef unsigned char uint8_t; /* 1 byte 0 to 255 */ 10 | typedef signed char int8_t; /* 1 byte -127 to 127 */ 11 | typedef unsigned short uint16_t; /* 2 bytes 0 to 65535 */ 12 | typedef signed short int16_t; /* 2 bytes -32767 to 32767 */ 13 | /*typedef unsigned short long uint24_t; // 3 bytes 0 to 16777215 */ 14 | typedef unsigned uint32_t; /* 4 bytes 0 to 4294967295 */ 15 | typedef int int32_t; /* 4 bytes -2147483647 to 2147483647 */ 16 | /* typedef signed long long int64_t; */ 17 | /* typedef unsigned long long uint64_t; */ 18 | 19 | #define INT8_MIN (-128) 20 | #define INT16_MIN (-32768) 21 | #define INT32_MIN (-2147483647 - 1) 22 | 23 | #define INT8_MAX 127 24 | #define INT16_MAX 32767 25 | #define INT32_MAX 2147483647 26 | 27 | #define UINT8_MAX 0xff /* 255U */ 28 | #define UINT16_MAX 0xffff /* 65535U */ 29 | #define UINT32_MAX 0xffffffff /* 4294967295U */ 30 | 31 | #endif /* STDINT_H */ 32 | -------------------------------------------------------------------------------- /ports/xplained/bacnet.atsln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Atmel Studio Solution File, Format Version 11.00 4 | Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "bacnet", "bacnet.cproj", "{EA031B72-CE11-41CC-BFDC-00625D02A537}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|AVR = Debug|AVR 9 | Debug-XPLAINED|AVR = Debug-XPLAINED|AVR 10 | Release|AVR = Release|AVR 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {EA031B72-CE11-41CC-BFDC-00625D02A537}.Debug|AVR.ActiveCfg = Debug|AVR 14 | {EA031B72-CE11-41CC-BFDC-00625D02A537}.Debug|AVR.Build.0 = Debug|AVR 15 | {EA031B72-CE11-41CC-BFDC-00625D02A537}.Debug-XPLAINED|AVR.ActiveCfg = Debug-XPLAINED|AVR 16 | {EA031B72-CE11-41CC-BFDC-00625D02A537}.Debug-XPLAINED|AVR.Build.0 = Debug-XPLAINED|AVR 17 | {EA031B72-CE11-41CC-BFDC-00625D02A537}.Release|AVR.ActiveCfg = Release|AVR 18 | {EA031B72-CE11-41CC-BFDC-00625D02A537}.Release|AVR.Build.0 = Release|AVR 19 | EndGlobalSection 20 | GlobalSection(SolutionProperties) = preSolution 21 | HideSolutionNode = FALSE 22 | EndGlobalSection 23 | EndGlobal 24 | -------------------------------------------------------------------------------- /ports/xplained/main.c: -------------------------------------------------------------------------------- 1 | /** 2 | * \file 3 | * 4 | * \brief XMEGA-A3BU BACnet application 5 | * 6 | */ 7 | #include 8 | #include "timer.h" 9 | #include "rs485.h" 10 | #include "led.h" 11 | #include "adc-hdw.h" 12 | #include "dlmstp.h" 13 | #include "bacnet.h" 14 | 15 | /** 16 | * \brief Main function. 17 | * 18 | * Initializes the board, and runs the application in an infinite loop. 19 | */ 20 | int main(void) 21 | { 22 | /* hardware initialization */ 23 | sysclk_init(); 24 | board_init(); 25 | pmic_init(); 26 | timer_init(); 27 | rs485_init(); 28 | led_init(); 29 | adc_init(); 30 | #ifdef CONF_BOARD_ENABLE_RS485_XPLAINED 31 | // Enable display backlight 32 | gpio_set_pin_high(NHD_C12832A1Z_BACKLIGHT); 33 | #endif 34 | // Workaround for known issue: Enable RTC32 sysclk 35 | sysclk_enable_module(SYSCLK_PORT_GEN, SYSCLK_RTC); 36 | while (RTC32.SYNCCTRL & RTC32_SYNCBUSY_bm) { 37 | // Wait for RTC32 sysclk to become stable 38 | } 39 | cpu_irq_enable(); 40 | /* application initialization */ 41 | rs485_baud_rate_set(38400); 42 | bacnet_init(); 43 | /* run forever - timed tasks */ 44 | timer_callback(bacnet_task_timed, 5); 45 | for (;;) { 46 | bacnet_task(); 47 | led_task(); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /ports/xplained/nvmdata.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * @author Steve Karg 4 | * @date 2013 5 | * @brief Store and retrieve non-volatile data 6 | * 7 | */ 8 | #include 9 | #include 10 | #include "nvmdata.h" 11 | #include "dlmstp.h" 12 | #include "device.h" 13 | 14 | /** 15 | * Initializes the non-volatile memory module 16 | */ 17 | void nvm_data_init(void) 18 | { 19 | uint32_t device_id = 127; 20 | uint8_t max_master = 127; 21 | uint8_t mac_address = 127; 22 | 23 | nvm_read(NVM_MAC_ADDRESS, &mac_address, 1); 24 | if (mac_address == 255) { 25 | /* uninitialized */ 26 | mac_address = 123; 27 | } 28 | dlmstp_set_mac_address(mac_address); 29 | nvm_read(NVM_MAX_MASTER, &max_master, 1); 30 | if (max_master > 127) { 31 | max_master = 127; 32 | } 33 | dlmstp_set_max_master(max_master); 34 | /* Get the device ID from the EEPROM */ 35 | nvm_read(NVM_DEVICE_0, (uint8_t *) & device_id, sizeof(device_id)); 36 | if (device_id < BACNET_MAX_INSTANCE) { 37 | Device_Set_Object_Instance_Number(device_id); 38 | } else { 39 | Device_Set_Object_Instance_Number(mac_address); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /ports/xplained/readme.txt: -------------------------------------------------------------------------------- 1 | BACnet MS/TP on Atmel XMEGA-A3BU XPLAINED evaluation board. 2 | 3 | An RS-485 add-on board (daughterboard, shield) was designed 4 | to handle the RS-485 interface and some LEDs. See rs485-shield/ 5 | folder for EAGLE CAD design files. 6 | 7 | Use the Configuration "Debug-XPLAINED" and not in "Debug" or "Release". 8 | "CONF_BOARD_ENABLE_RS485_XPLAINED" is defined and used in led.c, rs485.c, 9 | and main.c for specific board I/O. When it is not defined, the I/O is 10 | either removed (i.e. led.c, main.c) or altered (rs485.c). 11 | 12 | There are other defines in the "Debug-XPLAINED" Configuration 13 | which include other parts of the XPLAINED platform code. 14 | 15 | For your own board, you could just change rs485.c, main.c, and led.c 16 | to use the I/O that you want to use, and not worry about the 17 | "CONF_BOARD_ENABLE_RS485_XPLAINED". Or you can leave the 18 | "CONF_BOARD_ENABLE_RS485_XPLAINED" in the files so that you can 19 | always test on the XPLAINED platform with Debug-XPLAINED, and use 20 | "Debug" or "Release" for your project. -------------------------------------------------------------------------------- /rebuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Re-Build script for MinGW (Make only, no clean first) 3 | echo "Re-Build with MinGW and MSYS: mingw.sourceforge.net" 4 | # set PATH=C:\MinGW\msys\1.0\bin;C:\MinGW\bin 5 | # assumes rm, cp, size are already in path 6 | CC=gcc 7 | AR=ar 8 | MAKE=make 9 | export CC AR MAKE 10 | make BACNET_PORT=win32 BUILD=release all 11 | 12 | # Build for MinGW debug 13 | # make BACNET_PORT=win32 BUILD=debug all 14 | 15 | # Build for MinGW MS/TP 16 | # make BACNET_PORT=win32 BACDL_DEFINE=-DBACDL_MSTP=1 all 17 | 18 | # On Linux, install mingw32 and use this: 19 | # make BACNET_PORT=win32 CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar all 20 | 21 | echo "Complete!" 22 | -------------------------------------------------------------------------------- /splint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # splint is a static code checker 3 | 4 | SPLINT=/usr/bin/splint 5 | 6 | [ -x ${SPLINT} ] || exit 0 7 | 8 | DEFINES="-D__signed__=signed -D__gnuc_va_list=va_list" 9 | INCLUDES="-Iinclude -Idemo/object -Iports/linux" 10 | SETTINGS="-castfcnptr -fullinitblock -initallelements -weak -warnposixheaders" 11 | SPLINT_LOGFILE=splint_output.txt 12 | 13 | if [ ! -e .splintrc ] 14 | then 15 | echo ${DEFINES} ${INCLUDES} ${SETTINGS} > .splintrc 16 | fi 17 | 18 | directory=${1-`pwd`}/src 19 | rm -f splint_output.txt 20 | touch splint_output.txt 21 | for filename in $( find $directory -name '*.c' ) 22 | do 23 | echo splinting ${filename} 24 | echo splinting ${filename} >> ${SPLINT_LOGFILE} 25 | ${SPLINT} ${filename} >> ${SPLINT_LOGFILE} 2>&1 26 | done 27 | 28 | -------------------------------------------------------------------------------- /src/bvlc6.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/src/bvlc6.c -------------------------------------------------------------------------------- /test/abort.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_ABORT 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/abort.c \ 14 | ctest.c 15 | 16 | TARGET = abort 17 | 18 | all: ${TARGET} 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf ${TARGET} $(OBJS) 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/address.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_ADDRESS 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/address.c \ 10 | $(SRC_DIR)/bacaddr.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | $(SRC_DIR)/bacapp.c \ 16 | $(SRC_DIR)/bacdevobjpropref.c \ 17 | $(SRC_DIR)/datetime.c \ 18 | $(SRC_DIR)/lighting.c \ 19 | $(SRC_DIR)/bactext.c \ 20 | $(SRC_DIR)/indtext.c \ 21 | ctest.c 22 | 23 | OBJS = ${SRCS:.c=.o} 24 | 25 | TARGET = address 26 | 27 | all: ${TARGET} 28 | 29 | ${TARGET}: ${OBJS} 30 | ${CC} -o $@ ${OBJS} 31 | 32 | .c.o: 33 | ${CC} -c ${CFLAGS} $*.c -o $@ 34 | 35 | depend: 36 | rm -f .depend 37 | ${CC} -MM ${CFLAGS} *.c >> .depend 38 | 39 | clean: 40 | rm -rf ${TARGET} $(OBJS) 41 | 42 | include: .depend 43 | -------------------------------------------------------------------------------- /test/arf.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. -I../demo/object 5 | DEFINES = -DBACFILE=1 -DBIG_ENDIAN=0 -DTEST -DTEST_ATOMIC_READ_FILE 6 | DEFINES += -DBACNET_READ_FILE_RECORD_COUNT=2 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/arf.c \ 14 | ctest.c 15 | 16 | OBJS = ${SRCS:.c=.o} 17 | 18 | TARGET = arf 19 | 20 | all: ${TARGET} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf ${TARGET} $(OBJS) 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/awf.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | 4 | SRC_DIR = ../src 5 | INCLUDES = -I../include -I. -I../demo/object 6 | DEFINES = -DBACFILE=1 -DBIG_ENDIAN=0 -DTEST -DTEST_ATOMIC_WRITE_FILE 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/awf.c \ 14 | ctest.c 15 | 16 | OBJS = ${SRCS:.c=.o} 17 | 18 | TARGET = awf 19 | 20 | all: ${TARGET} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf ${TARGET} $(OBJS) 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/bacapp.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/test/bacapp.ide -------------------------------------------------------------------------------- /test/bacapp.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | 4 | SRC_DIR = ../src 5 | INCLUDES = -I../include -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_BACNET_APPLICATION_DATA 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/bacapp.c \ 14 | $(SRC_DIR)/bacdevobjpropref.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/bactext.c \ 17 | $(SRC_DIR)/lighting.c \ 18 | $(SRC_DIR)/indtext.c \ 19 | ctest.c 20 | 21 | OBJS = ${SRCS:.c=.o} 22 | 23 | TARGET = bacapp 24 | 25 | all: ${TARGET} 26 | 27 | ${TARGET}: ${OBJS} 28 | ${CC} -o $@ ${OBJS} 29 | 30 | .c.o: 31 | ${CC} -c ${CFLAGS} $*.c -o $@ 32 | 33 | depend: 34 | rm -f .depend 35 | ${CC} -MM ${CFLAGS} *.c >> .depend 36 | 37 | clean: 38 | rm -rf ${TARGET} $(OBJS) 39 | 40 | include: .depend 41 | -------------------------------------------------------------------------------- /test/bacdcode.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/test/bacdcode.ide -------------------------------------------------------------------------------- /test/bacdcode.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build unit tests 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_DECODE -DMAX_APDU=50 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | TARGET = bacdcode 10 | 11 | SRCS = $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacstr.c \ 14 | $(SRC_DIR)/bacreal.c \ 15 | ctest.c 16 | 17 | OBJS = ${SRCS:.c=.o} 18 | 19 | all: ${TARGET} 20 | 21 | ${TARGET}: ${OBJS} 22 | ${CC} -o $@ ${OBJS} 23 | 24 | .c.o: 25 | ${CC} -c ${CFLAGS} $*.c -o $@ 26 | 27 | depend: 28 | rm -f .depend 29 | ${CC} -MM ${CFLAGS} *.c >> .depend 30 | 31 | clean: 32 | rm -rf ${OBJS} ${TARGET} 33 | 34 | include: .depend 35 | -------------------------------------------------------------------------------- /test/bacdevobjpropref.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | 4 | SRC_DIR = ../src 5 | INCLUDES = -I../include -I. 6 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_DEV_ID_PROP_REF 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/bacapp.c \ 14 | $(SRC_DIR)/bacdevobjpropref.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/bactext.c \ 17 | $(SRC_DIR)/lighting.c \ 18 | $(SRC_DIR)/indtext.c \ 19 | ctest.c 20 | 21 | OBJS = ${SRCS:.c=.o} 22 | 23 | TARGET = bacdevobjpropref 24 | 25 | all: ${TARGET} 26 | 27 | ${TARGET}: ${OBJS} 28 | ${CC} -o $@ ${OBJS} 29 | 30 | .c.o: 31 | ${CC} -c ${CFLAGS} $*.c -o $@ 32 | 33 | depend: 34 | rm -f .depend 35 | ${CC} -MM ${CFLAGS} *.c >> .depend 36 | 37 | clean: 38 | rm -rf ${TARGET} $(OBJS) 39 | 40 | include: .depend 41 | -------------------------------------------------------------------------------- /test/bacerror.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_BACERROR 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/bacerror.c \ 14 | ctest.c 15 | 16 | OBJS = ${SRCS:.c=.o} 17 | 18 | TARGET = bacerror 19 | 20 | all: ${TARGET} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf ${TARGET} $(OBJS) 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/bacint.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build unit tests 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_BACINT 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | TARGET = bacint 10 | 11 | SRCS = $(SRC_DIR)/bacint.c \ 12 | $(SRC_DIR)/bacstr.c \ 13 | ctest.c 14 | 15 | OBJS = ${SRCS:.c=.o} 16 | 17 | all: ${TARGET} 18 | 19 | ${TARGET}: ${OBJS} 20 | ${CC} -o $@ ${OBJS} 21 | 22 | .c.o: 23 | ${CC} -c ${CFLAGS} $*.c -o $@ 24 | 25 | depend: 26 | rm -f .depend 27 | ${CC} -MM ${CFLAGS} *.c >> .depend 28 | 29 | clean: 30 | rm -rf ${OBJS} ${TARGET} 31 | 32 | include: .depend 33 | -------------------------------------------------------------------------------- /test/bacstr.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build unit tests 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_BACSTR 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | TARGET = bacstr 10 | 11 | SRCS = $(SRC_DIR)/bacstr.c \ 12 | ctest.c 13 | 14 | OBJS = ${SRCS:.c=.o} 15 | 16 | all: ${TARGET} 17 | 18 | ${TARGET}: ${OBJS} 19 | ${CC} -o $@ ${OBJS} 20 | 21 | .c.o: 22 | ${CC} -c ${CFLAGS} $*.c -o $@ 23 | 24 | depend: 25 | rm -f .depend 26 | ${CC} -MM ${CFLAGS} *.c >> .depend 27 | 28 | clean: 29 | rm -rf core ${OBJS} ${TARGET} *.bak 30 | 31 | include: .depend 32 | -------------------------------------------------------------------------------- /test/bbmd6.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | SRC_INC = ../include 5 | DEMO_DIR = ../demo/handler 6 | DEMO_INC = ../demo/object 7 | INCLUDES = -I. -I$(SRC_INC) -I$(DEMO_INC) 8 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_BBMD6 9 | 10 | CFLAGS = -Wall -Wmissing-prototypes $(INCLUDES) $(DEFINES) -g 11 | 12 | SRCS = $(SRC_DIR)/bacdcode.c \ 13 | $(SRC_DIR)/bacint.c \ 14 | $(SRC_DIR)/bacstr.c \ 15 | $(SRC_DIR)/bacreal.c \ 16 | $(SRC_DIR)/bvlc6.c \ 17 | $(SRC_DIR)/debug.c \ 18 | $(SRC_DIR)/keylist.c \ 19 | $(SRC_DIR)/vmac.c \ 20 | $(DEMO_DIR)/h_bbmd6.c \ 21 | ctest.c 22 | 23 | TARGET = bbmd6 24 | 25 | all: ${TARGET} 26 | 27 | OBJS = ${SRCS:.c=.o} 28 | 29 | ${TARGET}: ${OBJS} 30 | ${CC} -o $@ ${OBJS} 31 | 32 | .c.o: 33 | ${CC} -c ${CFLAGS} $*.c -o $@ 34 | 35 | depend: 36 | rm -f .depend 37 | ${CC} -MM ${CFLAGS} *.c >> .depend 38 | 39 | clean: 40 | rm -rf ${TARGET} $(OBJS) 41 | 42 | include: .depend 43 | -------------------------------------------------------------------------------- /test/bvlc.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. -I../ports/linux 5 | DEFINES = -DBACDL_BIP -DBIG_ENDIAN=0 -DTEST -DTEST_BVLC 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/bvlc.c \ 14 | ctest.c 15 | 16 | OBJS = ${SRCS:.c=.o} 17 | 18 | TARGET = bvlc 19 | 20 | all: ${TARGET} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/bvlc6.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_BVLC6 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/bvlc6.c \ 14 | ctest.c 15 | 16 | TARGET = bvlc6 17 | 18 | all: ${TARGET} 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf ${TARGET} $(OBJS) 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/cov.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. -I../demo/object 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_COV -DBACAPP_ALL 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/datetime.c \ 14 | $(SRC_DIR)/bacapp.c \ 15 | $(SRC_DIR)/bacdevobjpropref.c \ 16 | $(SRC_DIR)/lighting.c \ 17 | $(SRC_DIR)/indtext.c \ 18 | $(SRC_DIR)/memcopy.c \ 19 | $(SRC_DIR)/bactext.c \ 20 | $(SRC_DIR)/cov.c \ 21 | ctest.c 22 | 23 | OBJS = ${SRCS:.c=.o} 24 | 25 | TARGET = cov 26 | 27 | all: ${TARGET} 28 | 29 | ${TARGET}: ${OBJS} 30 | ${CC} -o $@ ${OBJS} 31 | 32 | .c.o: 33 | ${CC} -c ${CFLAGS} $*.c -o $@ 34 | 35 | depend: 36 | rm -f .depend 37 | ${CC} -MM ${CFLAGS} *.c >> .depend 38 | 39 | clean: 40 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 41 | 42 | include: .depend 43 | -------------------------------------------------------------------------------- /test/crc.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/test/crc.ide -------------------------------------------------------------------------------- /test/crc.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build CRC tests 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. -I../demo/object 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_CRC 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/crc.c \ 10 | ctest.c 11 | 12 | OBJS = ${SRCS:.c=.o} 13 | 14 | TARGET = crc 15 | 16 | all: ${TARGET} 17 | 18 | ${TARGET}: ${OBJS} 19 | ${CC} -o $@ ${OBJS} 20 | 21 | .c.o: 22 | ${CC} -c ${CFLAGS} $*.c -o $@ 23 | 24 | depend: 25 | rm -f .depend 26 | ${CC} -MM ${CFLAGS} *.c >> .depend 27 | 28 | clean: 29 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 30 | 31 | include: .depend 32 | 33 | -------------------------------------------------------------------------------- /test/datetime.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/test/datetime.ide -------------------------------------------------------------------------------- /test/datetime.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_DATE_TIME 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/datetime.c \ 10 | $(SRC_DIR)/bacdcode.c \ 11 | $(SRC_DIR)/bacint.c \ 12 | $(SRC_DIR)/bacstr.c \ 13 | $(SRC_DIR)/bacreal.c \ 14 | $(SRC_DIR)/bacapp.c \ 15 | $(SRC_DIR)/bacdevobjpropref.c \ 16 | $(SRC_DIR)/lighting.c \ 17 | $(SRC_DIR)/bactext.c \ 18 | $(SRC_DIR)/indtext.c \ 19 | ctest.c 20 | 21 | OBJS = ${SRCS:.c=.o} 22 | 23 | TARGET = datetime 24 | 25 | all: ${TARGET} 26 | 27 | ${TARGET}: ${OBJS} 28 | ${CC} -o $@ ${OBJS} 29 | 30 | .c.o: 31 | ${CC} -c ${CFLAGS} $*.c -o $@ 32 | 33 | depend: 34 | rm -f .depend 35 | ${CC} -MM ${CFLAGS} *.c >> .depend 36 | 37 | clean: 38 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 39 | 40 | include: .depend 41 | -------------------------------------------------------------------------------- /test/dcc.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_DEVICE_COMMUNICATION_CONTROL 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/dcc.c \ 14 | ctest.c 15 | 16 | TARGET = dcc 17 | 18 | all: ${TARGET} 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/event.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. -I../demo/object 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_EVENT 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/bacerror.c \ 14 | $(SRC_DIR)/bacapp.c \ 15 | $(SRC_DIR)/bactext.c \ 16 | $(SRC_DIR)/indtext.c \ 17 | $(SRC_DIR)/datetime.c \ 18 | $(SRC_DIR)/lighting.c \ 19 | $(SRC_DIR)/memcopy.c \ 20 | $(SRC_DIR)/timestamp.c \ 21 | $(SRC_DIR)/bacpropstates.c \ 22 | $(SRC_DIR)/bacdevobjpropref.c \ 23 | $(SRC_DIR)/event.c \ 24 | ctest.c 25 | 26 | TARGET = event 27 | 28 | all: ${TARGET} 29 | 30 | OBJS = ${SRCS:.c=.o} 31 | 32 | ${TARGET}: ${OBJS} 33 | ${CC} -o $@ ${OBJS} 34 | 35 | .c.o: 36 | ${CC} -c ${CFLAGS} $*.c -o $@ 37 | 38 | depend: 39 | rm -f .depend 40 | ${CC} -MM ${CFLAGS} *.c >> .depend 41 | 42 | clean: 43 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 44 | 45 | include: .depend 46 | -------------------------------------------------------------------------------- /test/fifo.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_FIFO_BUFFER 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/fifo.c \ 10 | ctest.c 11 | 12 | TARGET = fifo 13 | 14 | all: ${TARGET} 15 | 16 | OBJS = ${SRCS:.c=.o} 17 | 18 | ${TARGET}: ${OBJS} 19 | ${CC} -o $@ ${OBJS} 20 | 21 | .c.o: 22 | ${CC} -c ${CFLAGS} $*.c -o $@ 23 | 24 | depend: 25 | rm -f .depend 26 | ${CC} -MM ${CFLAGS} *.c >> .depend 27 | 28 | clean: 29 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 30 | 31 | include: .depend 32 | 33 | -------------------------------------------------------------------------------- /test/filename.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/test/filename.ide -------------------------------------------------------------------------------- /test/filename.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build filename tests 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_FILENAME 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/filename.c \ 10 | ctest.c 11 | 12 | OBJS = ${SRCS:.c=.o} 13 | 14 | TARGET = filename 15 | 16 | all: ${TARGET} 17 | 18 | ${TARGET}: ${OBJS} 19 | ${CC} -o $@ ${OBJS} 20 | 21 | .c.o: 22 | ${CC} -c ${CFLAGS} $*.c -o $@ 23 | 24 | depend: 25 | rm -f .depend 26 | ${CC} -MM ${CFLAGS} *.c >> .depend 27 | 28 | clean: 29 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 30 | 31 | include: .depend 32 | 33 | -------------------------------------------------------------------------------- /test/getevent.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_GET_EVENT_INFORMATION 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/bacapp.c \ 14 | $(SRC_DIR)/bacdevobjpropref.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/lighting.c \ 17 | $(SRC_DIR)/bactext.c \ 18 | $(SRC_DIR)/indtext.c \ 19 | $(SRC_DIR)/timestamp.c \ 20 | $(SRC_DIR)/getevent.c \ 21 | ctest.c 22 | 23 | TARGET = getevent 24 | 25 | all: ${TARGET} 26 | 27 | OBJS = ${SRCS:.c=.o} 28 | 29 | ${TARGET}: ${OBJS} 30 | ${CC} -o $@ ${OBJS} 31 | 32 | .c.o: 33 | ${CC} -c ${CFLAGS} $*.c -o $@ 34 | 35 | depend: 36 | rm -f .depend 37 | ${CC} -MM ${CFLAGS} *.c >> .depend 38 | 39 | clean: 40 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 41 | 42 | include: .depend 43 | -------------------------------------------------------------------------------- /test/iam.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. -I../demo/object 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_IAM 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/iam.c \ 14 | ctest.c 15 | 16 | OBJS = ${SRCS:.c=.o} 17 | 18 | TARGET = iam 19 | 20 | all: ${TARGET} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/ihave.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_I_HAVE 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/ihave.c \ 14 | ctest.c 15 | 16 | OBJS = ${SRCS:.c=.o} 17 | 18 | TARGET = ihave 19 | 20 | all: ${TARGET} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/indtext.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build unit tests 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_INDEX_TEXT 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/indtext.c \ 10 | ctest.c 11 | 12 | OBJS = ${SRCS:.c=.o} 13 | 14 | TARGET = indtext 15 | 16 | all: ${TARGET} 17 | 18 | ${TARGET}: ${OBJS} 19 | ${CC} -o $@ ${OBJS} 20 | 21 | .c.o: 22 | ${CC} -c ${CFLAGS} $*.c -o $@ 23 | 24 | depend: 25 | rm -f .depend 26 | ${CC} -MM ${CFLAGS} *.c >> .depend 27 | 28 | clean: 29 | rm -rf core ${OBJS} ${TARGET} *.bak 30 | 31 | include: .depend 32 | -------------------------------------------------------------------------------- /test/key.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build unit tests 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_KEY 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/key.c \ 10 | ctest.c 11 | 12 | TARGET = key 13 | 14 | OBJS = ${SRCS:.c=.o} 15 | 16 | all: ${TARGET} 17 | 18 | ${TARGET}: ${OBJS} 19 | ${CC} -o $@ ${OBJS} 20 | 21 | .c.o: 22 | ${CC} -c ${CFLAGS} $*.c -o $@ 23 | 24 | depend: 25 | rm -f .depend 26 | ${CC} -MM ${CFLAGS} *.c >> .depend 27 | 28 | clean: 29 | rm -rf core ${TARGET} $(OBJS) 30 | 31 | include: .depend 32 | -------------------------------------------------------------------------------- /test/keylist.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build unit tests 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_KEYLIST 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/keylist.c \ 10 | ctest.c 11 | 12 | TARGET = keylist 13 | 14 | OBJS = ${SRCS:.c=.o} 15 | 16 | all: ${TARGET} 17 | 18 | ${TARGET}: ${OBJS} 19 | ${CC} -o $@ ${OBJS} 20 | 21 | .c.o: 22 | ${CC} -c ${CFLAGS} $*.c -o $@ 23 | 24 | depend: 25 | rm -f .depend 26 | ${CC} -MM ${CFLAGS} *.c >> .depend 27 | 28 | clean: 29 | rm -rf core ${TARGET} $(OBJS) 30 | 31 | include: .depend 32 | -------------------------------------------------------------------------------- /test/lighting.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_LIGHTING_COMMAND 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/lighting.c \ 14 | ctest.c 15 | 16 | TARGET = lighting 17 | 18 | all: ${TARGET} 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/lso.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_LSO 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/bacerror.c \ 14 | $(SRC_DIR)/bacapp.c \ 15 | $(SRC_DIR)/bacdevobjpropref.c \ 16 | $(SRC_DIR)/bactext.c \ 17 | $(SRC_DIR)/indtext.c \ 18 | $(SRC_DIR)/datetime.c \ 19 | $(SRC_DIR)/lighting.c \ 20 | $(SRC_DIR)/memcopy.c \ 21 | $(SRC_DIR)/lso.c \ 22 | ctest.c 23 | 24 | TARGET = lso 25 | 26 | all: ${TARGET} 27 | 28 | OBJS = ${SRCS:.c=.o} 29 | 30 | ${TARGET}: ${OBJS} 31 | ${CC} -o $@ ${OBJS} 32 | 33 | .c.o: 34 | ${CC} -c ${CFLAGS} $*.c -o $@ 35 | 36 | depend: 37 | rm -f .depend 38 | ${CC} -MM ${CFLAGS} *.c >> .depend 39 | 40 | clean: 41 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 42 | 43 | include: .depend 44 | -------------------------------------------------------------------------------- /test/memcopy.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_MEM_COPY 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/memcopy.c \ 10 | ctest.c 11 | 12 | TARGET = memcopy 13 | 14 | all: ${TARGET} 15 | 16 | OBJS = ${SRCS:.c=.o} 17 | 18 | ${TARGET}: ${OBJS} 19 | ${CC} -o $@ ${OBJS} 20 | 21 | .c.o: 22 | ${CC} -c ${CFLAGS} $*.c -o $@ 23 | 24 | depend: 25 | rm -f .depend 26 | ${CC} -MM ${CFLAGS} *.c >> .depend 27 | 28 | clean: 29 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 30 | 31 | include: .depend 32 | 33 | -------------------------------------------------------------------------------- /test/mstp.ide: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stargieg/bacnet-stack/56034b7b11f53efba749a162447a71d10b6fcc3a/test/mstp.ide -------------------------------------------------------------------------------- /test/mstp.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. -I../ports/linux 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_MSTP 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/mstp.c \ 10 | $(SRC_DIR)/mstptext.c \ 11 | $(SRC_DIR)/indtext.c \ 12 | $(SRC_DIR)/crc.c \ 13 | $(SRC_DIR)/ringbuf.c \ 14 | ctest.c 15 | 16 | TARGET = mstp 17 | 18 | all: ${TARGET} 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf core ${TARGET} $(OBJS) 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/npdu.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_NPDU 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/npdu.c \ 14 | $(SRC_DIR)/apdu.c \ 15 | $(SRC_DIR)/dcc.c \ 16 | ctest.c 17 | 18 | TARGET = npdu 19 | 20 | all: ${TARGET} 21 | 22 | OBJS = ${SRCS:.c=.o} 23 | 24 | ${TARGET}: ${OBJS} 25 | ${CC} -o $@ ${OBJS} 26 | 27 | .c.o: 28 | ${CC} -c ${CFLAGS} $*.c -o $@ 29 | 30 | depend: 31 | rm -f .depend 32 | ${CC} -MM ${CFLAGS} *.c >> .depend 33 | 34 | clean: 35 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 36 | 37 | include: .depend 38 | -------------------------------------------------------------------------------- /test/objects.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_OBJECT_LIST 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/objects.c \ 10 | $(SRC_DIR)/keylist.c \ 11 | $(SRC_DIR)/key.c \ 12 | ctest.c 13 | 14 | TARGET = rp 15 | 16 | all: ${TARGET} 17 | 18 | OBJS = ${SRCS:.c=.o} 19 | 20 | ${TARGET}: ${OBJS} 21 | ${CC} -o $@ ${OBJS} 22 | 23 | .c.o: 24 | ${CC} -c ${CFLAGS} $*.c -o $@ 25 | 26 | depend: 27 | rm -f .depend 28 | ${CC} -MM ${CFLAGS} *.c >> .depend 29 | 30 | clean: 31 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 32 | 33 | include: .depend 34 | 35 | -------------------------------------------------------------------------------- /test/proplist.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build unit tests 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_PROPLIST 6 | DEFINES += -DBACNET_PROPERTY_LISTS=1 7 | 8 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 9 | 10 | SRCS = $(SRC_DIR)/proplist.c \ 11 | $(SRC_DIR)/bacdcode.c \ 12 | $(SRC_DIR)/bacint.c \ 13 | $(SRC_DIR)/bacreal.c \ 14 | $(SRC_DIR)/bacstr.c \ 15 | $(SRC_DIR)/datetime.c \ 16 | $(SRC_DIR)/lighting.c \ 17 | ctest.c 18 | 19 | TARGET = proplist 20 | 21 | OBJS = ${SRCS:.c=.o} 22 | 23 | all: ${TARGET} 24 | 25 | ${TARGET}: ${OBJS} 26 | ${CC} -o $@ ${OBJS} 27 | 28 | .c.o: 29 | ${CC} -c ${CFLAGS} $*.c -o $@ 30 | 31 | depend: 32 | rm -f .depend 33 | ${CC} -MM ${CFLAGS} *.c >> .depend 34 | 35 | clean: 36 | rm -rf core ${TARGET} $(OBJS) 37 | 38 | include: .depend 39 | -------------------------------------------------------------------------------- /test/ptransfer.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DPRINT_ENABLE=1 -DTEST -DTEST_PRIVATE_TRANSFER 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacapp.c \ 11 | $(SRC_DIR)/bacdevobjpropref.c \ 12 | $(SRC_DIR)/bactext.c \ 13 | $(SRC_DIR)/indtext.c \ 14 | $(SRC_DIR)/bacint.c \ 15 | $(SRC_DIR)/bacstr.c \ 16 | $(SRC_DIR)/bacreal.c \ 17 | $(SRC_DIR)/datetime.c \ 18 | $(SRC_DIR)/lighting.c \ 19 | $(SRC_DIR)/ptransfer.c \ 20 | ctest.c 21 | 22 | TARGET = ptransfer 23 | 24 | all: ${TARGET} 25 | 26 | OBJS = ${SRCS:.c=.o} 27 | 28 | ${TARGET}: ${OBJS} 29 | ${CC} -o $@ ${OBJS} 30 | 31 | .c.o: 32 | ${CC} -c ${CFLAGS} $*.c -o $@ 33 | 34 | depend: 35 | rm -f .depend 36 | ${CC} -MM ${CFLAGS} *.c >> .depend 37 | 38 | clean: 39 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 40 | 41 | include: .depend 42 | -------------------------------------------------------------------------------- /test/rd.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_REINITIALIZE_DEVICE 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/rd.c \ 14 | ctest.c 15 | 16 | TARGET = rd 17 | 18 | all: ${TARGET} 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/reject.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_REJECT 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/reject.c \ 14 | ctest.c 15 | 16 | TARGET = reject 17 | 18 | all: ${TARGET} 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/ringbuf.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_RING_BUFFER 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/ringbuf.c \ 10 | ctest.c 11 | 12 | TARGET = ringbuf 13 | 14 | all: ${TARGET} 15 | 16 | OBJS = ${SRCS:.c=.o} 17 | 18 | ${TARGET}: ${OBJS} 19 | ${CC} -o $@ ${OBJS} 20 | 21 | .c.o: 22 | ${CC} -c ${CFLAGS} $*.c -o $@ 23 | 24 | depend: 25 | rm -f .depend 26 | ${CC} -MM ${CFLAGS} *.c >> .depend 27 | 28 | clean: 29 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 30 | 31 | include: .depend 32 | 33 | -------------------------------------------------------------------------------- /test/rp.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_READ_PROPERTY 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/rp.c \ 14 | ctest.c 15 | 16 | TARGET = rp 17 | 18 | all: ${TARGET} 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/rpm.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_READ_PROPERTY_MULTIPLE 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/bacerror.c \ 14 | $(SRC_DIR)/bacapp.c \ 15 | $(SRC_DIR)/bacdevobjpropref.c \ 16 | $(SRC_DIR)/bactext.c \ 17 | $(SRC_DIR)/indtext.c \ 18 | $(SRC_DIR)/datetime.c \ 19 | $(SRC_DIR)/lighting.c \ 20 | $(SRC_DIR)/memcopy.c \ 21 | $(SRC_DIR)/rpm.c \ 22 | ctest.c 23 | 24 | TARGET = rpm 25 | 26 | all: ${TARGET} 27 | 28 | OBJS = ${SRCS:.c=.o} 29 | 30 | ${TARGET}: ${OBJS} 31 | ${CC} -o $@ ${OBJS} 32 | 33 | .c.o: 34 | ${CC} -c ${CFLAGS} $*.c -o $@ 35 | 36 | depend: 37 | rm -f .depend 38 | ${CC} -MM ${CFLAGS} *.c >> .depend 39 | 40 | clean: 41 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 42 | 43 | include: .depend 44 | -------------------------------------------------------------------------------- /test/sbuf.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_STATIC_BUFFER 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/sbuf.c \ 10 | ctest.c 11 | 12 | TARGET = sbuf 13 | 14 | all: ${TARGET} 15 | 16 | OBJS = ${SRCS:.c=.o} 17 | 18 | ${TARGET}: ${OBJS} 19 | ${CC} -o $@ ${OBJS} 20 | 21 | .c.o: 22 | ${CC} -c ${CFLAGS} $*.c -o $@ 23 | 24 | depend: 25 | rm -f .depend 26 | ${CC} -MM ${CFLAGS} *.c >> .depend 27 | 28 | clean: 29 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 30 | 31 | include: .depend 32 | 33 | -------------------------------------------------------------------------------- /test/timer.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../ports/bdk-atxx4-mstp 4 | INCLUDES = -I../include -I${SRC_DIR} -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_TIMER 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/timer.c \ 10 | ctest.c 11 | 12 | TARGET = timer 13 | 14 | all: ${TARGET} 15 | 16 | OBJS = ${SRCS:.c=.o} 17 | 18 | ${TARGET}: ${OBJS} 19 | ${CC} -o $@ ${OBJS} 20 | 21 | .c.o: 22 | ${CC} -c ${CFLAGS} $*.c -o $@ 23 | 24 | depend: 25 | rm -f .depend 26 | ${CC} -MM ${CFLAGS} *.c >> .depend 27 | 28 | clean: 29 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 30 | 31 | include: .depend 32 | 33 | -------------------------------------------------------------------------------- /test/timesync.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | 3 | # tools - only if you need them. 4 | # Most platforms have this already defined 5 | # CC = gcc 6 | # AR = ar 7 | # MAKE = make 8 | # SIZE = size 9 | # 10 | # Assumes rm and cp are available 11 | 12 | SRC_DIR := ../src 13 | INCLUDES := -I../include -I. 14 | DEFINES := -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_TIMESYNC 15 | 16 | CFLAGS := $(INCLUDES) $(DEFINES) -g 17 | CFLAGS += -Wall 18 | 19 | TARGET := timesync 20 | 21 | SRCS := $(SRC_DIR)/bacdcode.c \ 22 | $(SRC_DIR)/bacint.c \ 23 | $(SRC_DIR)/bacstr.c \ 24 | $(SRC_DIR)/bacreal.c \ 25 | $(SRC_DIR)/bacerror.c \ 26 | $(SRC_DIR)/bacapp.c \ 27 | $(SRC_DIR)/bacdevobjpropref.c \ 28 | $(SRC_DIR)/bactext.c \ 29 | $(SRC_DIR)/indtext.c \ 30 | $(SRC_DIR)/datetime.c \ 31 | $(SRC_DIR)/lighting.c \ 32 | $(SRC_DIR)/timesync.c \ 33 | ctest.c 34 | 35 | OBJS := ${SRCS:.c=.o} 36 | 37 | all: ${TARGET} 38 | 39 | ${TARGET}: ${OBJS} 40 | ${CC} -o $@ ${OBJS} 41 | 42 | .c.o: 43 | ${CC} -c ${CFLAGS} $*.c -o $@ 44 | 45 | depend: 46 | rm -f .depend 47 | ${CC} -MM ${CFLAGS} *.c >> .depend 48 | 49 | clean: 50 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 51 | 52 | run: 53 | ./${TARGET} 54 | 55 | include: .depend 56 | 57 | .PHONY: all run clean 58 | -------------------------------------------------------------------------------- /test/vmac.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_VMAC 6 | 7 | CFLAGS = -Wall -Wmissing-prototypes $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/keylist.c \ 10 | $(SRC_DIR)/vmac.c \ 11 | ctest.c 12 | 13 | TARGET = vmac 14 | 15 | all: ${TARGET} 16 | 17 | OBJS = ${SRCS:.c=.o} 18 | 19 | ${TARGET}: ${OBJS} 20 | ${CC} -o $@ ${OBJS} 21 | 22 | .c.o: 23 | ${CC} -c ${CFLAGS} $*.c -o $@ 24 | 25 | depend: 26 | rm -f .depend 27 | ${CC} -MM ${CFLAGS} *.c >> .depend 28 | 29 | clean: 30 | rm -rf ${TARGET} $(OBJS) 31 | 32 | include: .depend 33 | -------------------------------------------------------------------------------- /test/whohas.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_WHOHAS 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/whohas.c \ 14 | ctest.c 15 | 16 | TARGET = whohas 17 | 18 | all: ${TARGET} 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/whois.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DTEST_WHOIS 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/whois.c \ 14 | ctest.c 15 | 16 | TARGET = whois 17 | 18 | all: ${TARGET} 19 | 20 | OBJS = ${SRCS:.c=.o} 21 | 22 | ${TARGET}: ${OBJS} 23 | ${CC} -o $@ ${OBJS} 24 | 25 | .c.o: 26 | ${CC} -c ${CFLAGS} $*.c -o $@ 27 | 28 | depend: 29 | rm -f .depend 30 | ${CC} -MM ${CFLAGS} *.c >> .depend 31 | 32 | clean: 33 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 34 | 35 | include: .depend 36 | -------------------------------------------------------------------------------- /test/wp.mak: -------------------------------------------------------------------------------- 1 | #Makefile to build test case 2 | CC = gcc 3 | SRC_DIR = ../src 4 | INCLUDES = -I../include -I. 5 | DEFINES = -DBIG_ENDIAN=0 -DTEST -DBACAPP_ALL -DTEST_WRITE_PROPERTY 6 | 7 | CFLAGS = -Wall $(INCLUDES) $(DEFINES) -g 8 | 9 | SRCS = $(SRC_DIR)/bacdcode.c \ 10 | $(SRC_DIR)/bacint.c \ 11 | $(SRC_DIR)/bacstr.c \ 12 | $(SRC_DIR)/bacreal.c \ 13 | $(SRC_DIR)/datetime.c \ 14 | $(SRC_DIR)/lighting.c \ 15 | $(SRC_DIR)/bacapp.c \ 16 | $(SRC_DIR)/bacdevobjpropref.c \ 17 | $(SRC_DIR)/bactext.c \ 18 | $(SRC_DIR)/indtext.c \ 19 | $(SRC_DIR)/wp.c \ 20 | ctest.c 21 | 22 | TARGET = wp 23 | 24 | all: ${TARGET} 25 | 26 | OBJS = ${SRCS:.c=.o} 27 | 28 | ${TARGET}: ${OBJS} 29 | ${CC} -o $@ ${OBJS} 30 | 31 | .c.o: 32 | ${CC} -c ${CFLAGS} $*.c -o $@ 33 | 34 | depend: 35 | rm -f .depend 36 | ${CC} -MM ${CFLAGS} *.c >> .depend 37 | 38 | clean: 39 | rm -rf core ${TARGET} $(OBJS) *.bak *.1 *.ini 40 | 41 | include: .depend 42 | -------------------------------------------------------------------------------- /unittest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo Build with MinGW and MSYS: mingw.sourceforge.net 3 | rem set PATH=C:\MinGW\msys\1.0\bin;C:\MinGW\bin 4 | rem assumes rm, cp, size are already in path 5 | set CC=gcc 6 | set AR=ar 7 | set MAKE=make 8 | rem make BACNET_PORT=win32 BUILD=release -f test.mak clean all 9 | make -s -f test.mak clean all 10 | 11 | -------------------------------------------------------------------------------- /unittest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Unit tests builder / runner for this project 3 | 4 | make -s -f test.mak clean 5 | make -f test.mak 6 | cat test.log | grep Failed 7 | --------------------------------------------------------------------------------