├── .gitignore ├── CMakeLists.txt ├── README.md ├── build ├── linux │ └── .gitignore └── windows │ └── .gitignore ├── common ├── cmake │ ├── configure-linux.cmake │ ├── configure-windows.cmake │ ├── findoplklib.cmake │ ├── linkoplklib.cmake │ └── options.cmake ├── objdicts │ └── CiA401_CN │ │ ├── 00000000_POWERLINK_CiA401_CN.xdd │ │ ├── icon_generic_cn.ico │ │ └── image_generic_cn.png ├── proj │ └── linux │ │ ├── liboplkcn │ │ ├── CMakeLists.txt │ │ └── oplkcfg.h │ │ ├── liboplkcnapp-kernelintf │ │ ├── CMakeLists.txt │ │ └── oplkcfg.h │ │ ├── liboplkcnapp-kernelpcp │ │ ├── CMakeLists.txt │ │ └── oplkcfg.h │ │ ├── liboplkcnapp-userintf │ │ ├── CMakeLists.txt │ │ └── oplkcfg.h │ │ └── liboplkcndrv-pcap │ │ ├── CMakeLists.txt │ │ └── oplkcfg.h └── src │ ├── arp │ ├── arp-target.h │ ├── arp.c │ └── arp.h │ ├── eventlog │ ├── eventlog.c │ ├── eventlog.h │ ├── eventlogstring.c │ └── eventlogstring.h │ ├── firmwaremanager │ ├── firmwarecheck.c │ ├── firmwarecheck.h │ ├── firmwareinfo.c │ ├── firmwareinfo.h │ ├── firmwareinfodecode-ascii.c │ ├── firmwareinfodecode.h │ ├── firmwaremanager.c │ ├── firmwaremanager.h │ ├── firmwarestore-file.c │ ├── firmwarestore.h │ ├── firmwaretrace.h │ ├── firmwareupdate.c │ └── firmwareupdate.h │ ├── netselect │ ├── netselect.c │ └── netselect.h │ ├── obdcreate │ ├── obdcreate.c │ ├── obdcreate.h │ └── obdmacro.h │ └── system │ ├── system-linux.c │ ├── system-windows.c │ └── system.h ├── drivers └── linux │ ├── drv_daemon_pcap │ ├── CMakeLists.txt │ ├── build │ │ └── .gitignore │ └── daemon.c │ └── drv_kernelmod_edrv │ ├── CMakeLists.txt │ ├── build │ └── .gitignore │ ├── main.c │ └── proj │ └── cn │ └── oplkcfg.h ├── include ├── app │ ├── app.h │ └── event.h ├── common │ ├── ami.h │ ├── bufalloc.h │ ├── circbuffer.h │ ├── ctrl.h │ ├── ctrlcal-mem.h │ ├── ctrlcal.h │ ├── debug.h │ ├── defaultcfg.h │ ├── dllcal.h │ ├── driver-linux.h │ ├── driver-linuxdpshm.h │ ├── driver-windows.h │ ├── driver.h │ ├── errhnd.h │ ├── ftracedebug.h │ ├── led.h │ ├── memmap.h │ ├── nmt.h │ ├── oplkinc.h │ ├── pdo.h │ ├── section.h │ ├── target.h │ ├── timer.h │ └── timesync.h ├── contrib │ ├── bootloader │ │ ├── altera-nios2 │ │ │ └── epcsboot │ │ │ │ ├── build │ │ │ │ ├── .gitignore │ │ │ │ └── Makefile │ │ │ │ └── src │ │ │ │ ├── boot_loader.S │ │ │ │ ├── boot_loader.h │ │ │ │ ├── boot_loader_epcs_bits.S │ │ │ │ └── boot_loader_epcs_bits_sii_siii_ciii.S │ │ └── xilinx-microblaze │ │ │ └── simpleboot │ │ │ ├── CMakeLists.txt │ │ │ ├── build │ │ │ └── .gitignore │ │ │ ├── configure-microblazeise.cmake │ │ │ ├── scripts │ │ │ ├── pcublaze.pl │ │ │ └── program-prom-avnet-s6plkeb.cmd │ │ │ └── src │ │ │ ├── crt3.s │ │ │ ├── crtinit.s │ │ │ ├── global.h │ │ │ ├── init.s │ │ │ ├── main.c │ │ │ ├── spi.c │ │ │ ├── spi.h │ │ │ ├── util.c │ │ │ └── util.h │ ├── console │ │ ├── console-linux.c │ │ ├── console-nios2.c │ │ ├── console-windows.c │ │ ├── console.h │ │ └── printlog.c │ ├── dualprocshm │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── cmake │ │ │ ├── configure-c5socarm.cmake │ │ │ └── configure-microblaze.cmake │ │ ├── include │ │ │ ├── dualprocshm-c5soc.h │ │ │ ├── dualprocshm-c5socarm.h │ │ │ ├── dualprocshm-linuxkernel.h │ │ │ ├── dualprocshm-microblaze.h │ │ │ ├── dualprocshm-nios2.h │ │ │ ├── dualprocshm-pcie.h │ │ │ ├── dualprocshm-target.h │ │ │ ├── dualprocshm-winkernel.h │ │ │ ├── dualprocshm-zynq.h │ │ │ └── dualprocshm.h │ │ └── src │ │ │ ├── dualprocshm-c5soc.c │ │ │ ├── dualprocshm-intr.c │ │ │ ├── dualprocshm-linuxpcie.c │ │ │ ├── dualprocshm-linuxzynq.c │ │ │ ├── dualprocshm-lock.c │ │ │ ├── dualprocshm-noos.c │ │ │ ├── dualprocshm-pcp.c │ │ │ ├── dualprocshm-winpcie.c │ │ │ └── dualprocshm-zynq.c │ ├── getopt │ │ ├── getopt.c │ │ └── getopt.h │ ├── ndislib │ │ ├── ndisintermediate │ │ │ ├── ndis-im.c │ │ │ ├── ndis-im.h │ │ │ ├── ndis-imInternal.h │ │ │ ├── ndis-imMiniport.c │ │ │ └── ndis-imProtocol.c │ │ └── ndispcie │ │ │ ├── ndis-intf.h │ │ │ ├── ndis-pcie.c │ │ │ ├── ndis-pcieMiniport.c │ │ │ └── ndisDriver.h │ ├── pcap │ │ ├── wince │ │ │ └── PacketCE │ │ │ │ ├── Packet32.c │ │ │ │ ├── Support.h │ │ │ │ ├── packet32.h │ │ │ │ └── readme.txt │ │ └── windows │ │ │ ├── .gitignore │ │ │ └── WpdPack │ │ │ ├── .gitignore │ │ │ ├── Include │ │ │ ├── Packet32.h │ │ │ ├── Win32-Extensions.h │ │ │ ├── bittypes.h │ │ │ ├── ip6_misc.h │ │ │ ├── pcap-bpf.h │ │ │ ├── pcap-namedb.h │ │ │ ├── pcap-stdinc.h │ │ │ ├── pcap.h │ │ │ ├── pcap │ │ │ │ ├── bluetooth.h │ │ │ │ ├── bpf.h │ │ │ │ ├── namedb.h │ │ │ │ ├── pcap.h │ │ │ │ ├── sll.h │ │ │ │ ├── usb.h │ │ │ │ └── vlan.h │ │ │ └── remote-ext.h │ │ │ └── Lib │ │ │ ├── Packet.lib │ │ │ ├── libpacket.a │ │ │ ├── libwpcap.a │ │ │ ├── wpcap.lib │ │ │ └── x64 │ │ │ ├── Packet.lib │ │ │ └── wpcap.lib │ ├── socketwrapper │ │ ├── readme.md │ │ └── socketwrapper.h │ ├── timer │ │ └── vxworks-hrtimer │ │ │ ├── hpetTimer.c │ │ │ ├── hpetTimer.h │ │ │ ├── hrtimer.c │ │ │ ├── hrtimer.h │ │ │ ├── hrtimerLib.c │ │ │ └── hrtimerLib.h │ └── trace │ │ ├── trace-c5socarm.c │ │ ├── trace-printf.c │ │ ├── trace-printk.c │ │ ├── trace-sim.c │ │ ├── trace-windows.c │ │ └── trace.h ├── kernel │ ├── ctrlk.h │ ├── ctrlkcal.h │ ├── dllk.h │ ├── dllkcal.h │ ├── dllkfilter.h │ ├── dllktgt.h │ ├── edrv.h │ ├── edrvcyclic.h │ ├── errhndk.h │ ├── eventk.h │ ├── eventkcal.h │ ├── eventkcalintf.h │ ├── hrestimer.h │ ├── ledk.h │ ├── nmtk.h │ ├── pdok.h │ ├── pdokcal.h │ ├── pdoklut.h │ ├── synctimer.h │ ├── timestamp.h │ ├── timesynck.h │ ├── timesynckcal.h │ └── veth.h ├── opcua │ ├── open62541.c │ └── open62541.h ├── oplk │ ├── basictypes.h │ ├── benchmark.h │ ├── cfm.h │ ├── debugstr.h │ ├── dll.h │ ├── errordefs.h │ ├── event.h │ ├── frame.h │ ├── nmt.h │ ├── obd.h │ ├── obdal.h │ ├── obdcdc.h │ ├── oplk.h │ ├── oplkcfg.h │ ├── oplkdefs.h │ ├── oplkinc.h │ ├── sdo.h │ ├── sdoabortcodes.h │ ├── targetdefs │ │ ├── linux.h │ │ ├── windows-mingw.h │ │ ├── windows.h │ │ └── winkernel.h │ ├── targetsystem.h │ └── version.h ├── target │ ├── openmac-microblaze.h │ ├── openmac-nios2.h │ └── openmac.h └── user │ ├── cfmu.h │ ├── ctrlu.h │ ├── ctrlucal.h │ ├── dllucal.h │ ├── errhndu.h │ ├── eventu.h │ ├── eventucal.h │ ├── eventucalintf.h │ ├── identu.h │ ├── nmtcnu.h │ ├── nmtmnu.h │ ├── nmtu.h │ ├── obdal.h │ ├── obdconf.h │ ├── obdu.h │ ├── pdou.h │ ├── pdoucal.h │ ├── sdoal.h │ ├── sdoasnd.h │ ├── sdocom.h │ ├── sdocomclt.h │ ├── sdocomint.h │ ├── sdocomsrv.h │ ├── sdoseq.h │ ├── sdotest.h │ ├── sdoudp.h │ ├── statusu.h │ ├── syncu.h │ ├── timeru.h │ ├── timesyncu.h │ └── timesyncucal.h ├── lib ├── linux │ ├── liboplkcn.a │ ├── liboplkcn_d.a │ ├── liboplkcnapp-kernelintf.a │ ├── liboplkcnapp-kernelintf_d.a │ ├── liboplkcnapp-kernelpcp.a │ ├── liboplkcnapp-kernelpcp_d.a │ ├── liboplkcnapp-userintf.a │ ├── liboplkcnapp-userintf_d.a │ ├── liboplkcndrv-pcap.a │ └── liboplkcndrv-pcap_d.a └── windows │ ├── oplkcn.dll │ ├── oplkcn.lib │ ├── oplkcn_d.dll │ └── oplkcn_d.lib ├── linux.cmake ├── src ├── opcua2powerlink │ ├── event.c │ └── main.c └── oplk │ ├── arch │ ├── linux │ │ ├── ftracedebug.c │ │ ├── lock-linuxdualproc.c │ │ ├── netif-linux.c │ │ ├── target-linux.c │ │ └── target-mutex.c │ └── linuxkernel │ │ ├── target-linuxkernel.c │ │ └── target-mutex.c │ ├── common │ ├── ami │ │ ├── ami.c │ │ └── amix86.c │ ├── bufalloc │ │ └── bufalloc.c │ ├── circbuf │ │ ├── circbuf-arch.h │ │ ├── circbuf-linuxkernel.c │ │ ├── circbuf-noos.c │ │ ├── circbuf-noosdual.c │ │ ├── circbuf-nooshostif.c │ │ ├── circbuf-posixshm.c │ │ ├── circbuf-win32.c │ │ ├── circbuf-winkernel.c │ │ └── circbuffer.c │ ├── ctrl │ │ └── ctrlcal-posixshm.c │ ├── debugstr.c │ ├── dll │ │ └── dllcal-direct.c │ └── memmap │ │ ├── memmap-linuxdpshm.c │ │ ├── memmap-noosdual.c │ │ ├── memmap-nooshostif.c │ │ ├── memmap-nooslocal.c │ │ ├── memmap-null.c │ │ └── memmap-winioctl.c │ ├── kernel │ ├── ctrl │ │ ├── ctrlk.c │ │ ├── ctrlkcal-direct.c │ │ ├── ctrlkcal-hostif.c │ │ ├── ctrlkcal-mem.c │ │ └── ctrlkcal-noosdual.c │ ├── dll │ │ ├── dllk-internal.h │ │ ├── dllk.c │ │ ├── dllkcal-circbuf.c │ │ ├── dllkcal.c │ │ ├── dllkevent.c │ │ ├── dllkfilter.c │ │ ├── dllkframe.c │ │ ├── dllkframe.h │ │ ├── dllknode.c │ │ ├── dllknode.h │ │ ├── dllkstatemachine.c │ │ └── dllkstatemachine.h │ ├── edrv │ │ ├── .gitignore │ │ ├── edrv-8111.c │ │ ├── edrv-8139.c │ │ ├── edrv-8255x.c │ │ ├── edrv-82573.c │ │ ├── edrv-emacps.c │ │ ├── edrv-i210.c │ │ ├── edrv-mux_vxworks.c │ │ ├── edrv-ndisintermediate.c │ │ ├── edrv-openmac.c │ │ ├── edrv-pcap_linux.c │ │ ├── edrv-pcap_win.c │ │ ├── edrv-rawsock_linux.c │ │ ├── edrv-sim.c │ │ ├── edrvcyclic-openmac.c │ │ └── edrvcyclic.c │ ├── errhnd │ │ ├── errhndk.c │ │ ├── errhndkcal-hostif.c │ │ ├── errhndkcal-local.c │ │ ├── errhndkcal-noosdual.c │ │ ├── errhndkcal-posixshm.c │ │ ├── errhndkcal.c │ │ └── errhndkcal.h │ ├── event │ │ ├── eventk.c │ │ ├── eventkcal-direct.c │ │ ├── eventkcal-linux.c │ │ ├── eventkcal-linuxkernel.c │ │ ├── eventkcal-nooscircbuf.c │ │ ├── eventkcal-noosdual.c │ │ ├── eventkcal-nooshostif.c │ │ ├── eventkcal-win32.c │ │ ├── eventkcal-winkernel.c │ │ └── eventkcalintf-circbuf.c │ ├── led │ │ ├── ledk.c │ │ └── ledktimer.c │ ├── nmt │ │ └── nmtk.c │ ├── pdo │ │ ├── pdok.c │ │ ├── pdokcal-triplebufshm.c │ │ ├── pdokcal.c │ │ ├── pdokcalmem-hostif.c │ │ ├── pdokcalmem-linuxkernel.c │ │ ├── pdokcalmem-local.c │ │ ├── pdokcalmem-noosdual.c │ │ ├── pdokcalmem-posixshm.c │ │ ├── pdokcalmem-winkernel.c │ │ └── pdoklut.c │ ├── timer │ │ ├── hrestimer-i210.c │ │ ├── hrestimer-linuxkernel.c │ │ ├── hrestimer-ndistimer.c │ │ ├── hrestimer-openmac.c │ │ ├── hrestimer-posix.c │ │ ├── hrestimer-posix_clocknanosleep.c │ │ ├── hrestimer-sim.c │ │ ├── hrestimer-vxworks.c │ │ ├── hrestimer-windows.c │ │ ├── hrestimer-zynqttc.c │ │ ├── synctimer-openmac.c │ │ └── timestamp-openmac.c │ ├── timesync │ │ ├── timesynck.c │ │ ├── timesynckcal-bsdsem.c │ │ ├── timesynckcal-hostif.c │ │ ├── timesynckcal-linuxdpshm.c │ │ ├── timesynckcal-linuxkernel.c │ │ ├── timesynckcal-local.c │ │ ├── timesynckcal-noosdual.c │ │ └── timesynckcal-winkernel.c │ └── veth │ │ ├── veth-generic.c │ │ ├── veth-linuxdpshm.c │ │ ├── veth-linuxkernel.c │ │ ├── veth-linuxuser.c │ │ └── veth-ndisintemediate.c │ └── user │ ├── api │ ├── generic.c │ ├── processimage.c │ ├── sdotest.c │ └── service.c │ ├── cfmu.c │ ├── ctrl │ ├── ctrlu.c │ ├── ctrlucal-direct.c │ ├── ctrlucal-hostif.c │ ├── ctrlucal-ioctl.c │ ├── ctrlucal-linuxdpshm.c │ ├── ctrlucal-mem.c │ ├── ctrlucal-noosdual.c │ └── ctrlucal-winioctl.c │ ├── dll │ ├── dllucal-circbuf.c │ ├── dllucal-ioctl.c │ ├── dllucal-winioctl.c │ └── dllucal.c │ ├── errhnd │ ├── errhndu.c │ ├── errhnducal-hostif.c │ ├── errhnducal-ioctl.c │ ├── errhnducal-local.c │ ├── errhnducal-noosdual.c │ ├── errhnducal-posixshm.c │ ├── errhnducal-winioctl.c │ └── errhnducal.h │ ├── event │ ├── eventu.c │ ├── eventucal-linux.c │ ├── eventucal-linuxdpshm.c │ ├── eventucal-linuxioctl.c │ ├── eventucal-nooscircbuf.c │ ├── eventucal-noosdual.c │ ├── eventucal-nooshostif.c │ ├── eventucal-win32.c │ ├── eventucal-winioctl.c │ ├── eventucal-winpcie.c │ └── eventucalintf-circbuf.c │ ├── nmt │ ├── identu.c │ ├── nmtcnu.c │ ├── nmtmnu.c │ ├── nmtu.c │ ├── statusu.c │ └── syncu.c │ ├── obd │ ├── obdal.c │ ├── obdcdc.c │ ├── obdconf-fileio.c │ ├── obdconfcrc-generic.c │ └── obdu.c │ ├── pdo │ ├── pdou.c │ ├── pdoucal-triplebufshm.c │ ├── pdoucal.c │ ├── pdoucalmem-hostif.c │ ├── pdoucalmem-linuxdpshm.c │ ├── pdoucalmem-linuxmmap.c │ ├── pdoucalmem-local.c │ ├── pdoucalmem-noosdual.c │ ├── pdoucalmem-posixshm.c │ └── pdoucalmem-winioctl.c │ ├── sdo │ ├── sdoasnd.c │ ├── sdocom-dummy.c │ ├── sdocom-std.c │ ├── sdocom.c │ ├── sdocomclt.c │ ├── sdocomsrv.c │ ├── sdoseq.c │ ├── sdotest-com.c │ ├── sdotest-seq.c │ ├── sdoudp-linux.c │ ├── sdoudp-socketwrapper.c │ ├── sdoudp-windows.c │ └── sdoudp.c │ ├── timer │ ├── timer-generic.c │ ├── timer-linuxuser.c │ ├── timer-sim.c │ └── timer-vxworks.c │ └── timesync │ ├── timesyncu.c │ ├── timesyncucal-bsdsem.c │ ├── timesyncucal-hostif.c │ ├── timesyncucal-ioctl.c │ ├── timesyncucal-linuxdpshm.c │ ├── timesyncucal-local.c │ ├── timesyncucal-noosdual.c │ └── timesyncucal-winioctl.c ├── tools ├── linux │ ├── 50-openPOWERLINK.rules │ ├── Kbuild.in │ ├── devices.txt │ ├── plkload │ ├── plkunload │ └── set_prio ├── nodeset │ └── .gitignore ├── nodeset_compiler │ ├── NodeID_AssumeExternal.txt │ ├── NodeID_Blacklist.txt │ ├── NodeID_NS0_Base.txt │ ├── README.md │ ├── __init__.py │ ├── __pycache__ │ │ ├── backend_open62541.cpython-36.pyc │ │ ├── backend_open62541_datatypes.cpython-36.pyc │ │ ├── backend_open62541_nodes.cpython-36.pyc │ │ ├── constants.cpython-36.pyc │ │ ├── datatypes.cpython-36.pyc │ │ ├── nodes.cpython-36.pyc │ │ ├── nodeset.cpython-36.pyc │ │ └── opaque_type_mapping.cpython-36.pyc │ ├── backend_graphviz.py │ ├── backend_open62541.py │ ├── backend_open62541.pyc │ ├── backend_open62541_datatypes.py │ ├── backend_open62541_datatypes.pyc │ ├── backend_open62541_nodes.py │ ├── backend_open62541_nodes.pyc │ ├── constants.py │ ├── constants.pyc │ ├── datatypes.py │ ├── datatypes.pyc │ ├── nodes.py │ ├── nodes.pyc │ ├── nodeset.py │ ├── nodeset.pyc │ ├── nodeset_compiler.py │ ├── nodeset_testing.py │ ├── opaque_type_mapping.py │ └── opaque_type_mapping.pyc ├── pictures │ └── UaExpert.png ├── schema │ ├── Custom.Opc.Ua.Transport.bsd │ ├── NodeIds.csv │ ├── Opc.Ua.NodeSet2.Minimal.xml │ ├── Opc.Ua.StatusCodes.csv │ ├── Opc.Ua.Types.bsd │ ├── datatypes_minimal.txt │ ├── datatypes_transport.txt │ └── objdict.h └── xdd_compiler │ ├── ConvertXDD.py │ ├── app_error.txt │ ├── app_init.txt │ ├── app_top.txt │ ├── exchange.c │ ├── exchange.h │ ├── nodeset.xml │ └── server_nodeset.xml └── windows.cmake /.gitignore: -------------------------------------------------------------------------------- 1 | **/src/opcua2powerlink/app.c 2 | **/CiA401_CN/objdict.h 3 | **/opcua/nodeset 4 | **/nodeset/nodeset.xml 5 | -------------------------------------------------------------------------------- /build/linux/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | .* 3 | !.gitignore -------------------------------------------------------------------------------- /build/windows/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | .* 3 | !.gitignore -------------------------------------------------------------------------------- /common/cmake/configure-windows.cmake: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # Windows configuration options for openPOWERLINK stack 4 | # 5 | # Copyright (c) 2015, Kalycito Infotech Private Limited 6 | # Copyright (c) 2014, B&R Industrial Automation GmbH 7 | # All rights reserved. 8 | # 9 | # Redistribution and use in source and binary forms, with or without 10 | # modification, are permitted provided that the following conditions are met: 11 | # * Redistributions of source code must retain the above copyright 12 | # notice, this list of conditions and the following disclaimer. 13 | # * Redistributions in binary form must reproduce the above copyright 14 | # notice, this list of conditions and the following disclaimer in the 15 | # documentation and/or other materials provided with the distribution. 16 | # * Neither the name of the copyright holders nor the 17 | # names of its contributors may be used to endorse or promote products 18 | # derived from this software without specific prior written permission. 19 | # 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 21 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 22 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | # DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 24 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 25 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 26 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 27 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 29 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | ################################################################################ 31 | 32 | SET (CFG_BUILD_KERNEL_STACK "Link to Application" 33 | CACHE STRING "Configure how to build the kernel stack") 34 | 35 | IF (CFG_BUILD_KERNEL_STACK STREQUAL "Link to Application") 36 | 37 | SET (CFG_KERNEL_STACK_DIRECTLINK ON CACHE INTERNAL 38 | "Link kernel stack directly into application (Single process solution)") 39 | UNSET (CFG_KERNEL_STACK_USERSPACE_DAEMON CACHE) 40 | UNSET (CFG_KERNEL_STACK_PCIE CACHE) 41 | UNSET (CFG_KERNEL_STACK_KERNEL_MODULE CACHE) 42 | 43 | ENDIF () 44 | 45 | -------------------------------------------------------------------------------- /common/cmake/linkoplklib.cmake: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # CMake script for linking with the openPOWERLINK library 4 | # 5 | # Copyright (c) 2015, B&R Industrial Automation GmbH 6 | # All rights reserved. 7 | # 8 | # Redistribution and use in source and binary forms, with or without 9 | # modification, are permitted provided that the following conditions are met: 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above copyright 13 | # notice, this list of conditions and the following disclaimer in the 14 | # documentation and/or other materials provided with the distribution. 15 | # * Neither the name of the copyright holders nor the 16 | # names of its contributors may be used to endorse or promote products 17 | # derived from this software without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | # DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | ################################################################################ 30 | 31 | MACRO(OPLK_LINK_LIBRARIES EXECUTABLE_NAME) 32 | IF(CMAKE_GENERATOR MATCHES "Visual Studio") 33 | TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} optimized ${OPLKLIB} debug ${OPLKLIB_DEBUG}) 34 | ELSE() 35 | IF(${CMAKE_BUILD_TYPE} STREQUAL "Debug") 36 | TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} debug ${OPLKLIB_DEBUG}) 37 | ELSE () 38 | TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} optimized ${OPLKLIB}) 39 | ENDIF() 40 | ENDIF() 41 | ENDMACRO(OPLK_LINK_LIBRARIES) 42 | -------------------------------------------------------------------------------- /common/objdicts/CiA401_CN/icon_generic_cn.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/common/objdicts/CiA401_CN/icon_generic_cn.ico -------------------------------------------------------------------------------- /common/objdicts/CiA401_CN/image_generic_cn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/common/objdicts/CiA401_CN/image_generic_cn.png -------------------------------------------------------------------------------- /common/proj/linux/liboplkcndrv-pcap/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # CMake file for openPOWERLINK Linux userspace CN driver library 4 | # 5 | # Copyright (c) 2016, B&R Industrial Automation GmbH 6 | # All rights reserved. 7 | # 8 | # Redistribution and use in source and binary forms, with or without 9 | # modification, are permitted provided that the following conditions are met: 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above copyright 13 | # notice, this list of conditions and the following disclaimer in the 14 | # documentation and/or other materials provided with the distribution. 15 | # * Neither the name of the copyright holders nor the 16 | # names of its contributors may be used to endorse or promote products 17 | # derived from this software without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | # DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | ################################################################################ 30 | 31 | # Set library name 32 | SET(LIB_NAME "oplkcndrv-pcap") 33 | MESSAGE(STATUS "Configuring ${LIB_NAME}") 34 | 35 | # Set type of library 36 | IF(CFG_COMPILE_SHARED_LIBRARY) 37 | SET(LIB_TYPE "SHARED") 38 | ELSE() 39 | SET(LIB_TYPE "STATIC") 40 | ENDIF() 41 | 42 | # set general sources of POWERLINK library 43 | SET (LIB_SOURCES 44 | ${KERNEL_SOURCES} 45 | ${CTRL_KCAL_POSIXMEM_SOURCES} 46 | ${DLL_KCAL_CIRCBUF_SOURCES} 47 | ${ERRHND_KCAL_POSIXMEM_SOURCES} 48 | ${EVENT_KCAL_LINUXUSER_SOURCES} 49 | ${PDO_KCAL_POSIXMEM_SOURCES} 50 | ${HARDWARE_DRIVER_LINUXUSER_SOURCES} 51 | ${COMMON_SOURCES} 52 | ${COMMON_LINUXUSER_SOURCES} 53 | ${TARGET_LINUX_SOURCES} 54 | ${CIRCBUF_POSIX_SOURCES} 55 | ) 56 | 57 | IF(CMAKE_SYSTEM_PROCESSOR MATCHES "^(i.86|x86(_64)?)$") 58 | SET(LIB_SOURCES ${LIB_SOURCES} ${ARCH_X86_SOURCES}) 59 | ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES arm*) 60 | SET(LIB_SOURCES ${LIB_SOURCES} ${ARCH_LE_SOURCES}) 61 | ELSE() 62 | MESSAGE(FATAL_ERROR "Unsupported CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}") 63 | ENDIF() 64 | 65 | # Configure compile definitions 66 | ADD_DEFINITIONS(-DCONFIG_MN -D_GNU_SOURCE -D_POSIX_C_SOURCE=200112L) 67 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -std=c99 -pthread -fno-strict-aliasing") 68 | 69 | # Additional include directories 70 | INCLUDE_DIRECTORIES( 71 | . 72 | ) 73 | 74 | # Define library and installation rules 75 | ADD_LIBRARY(${LIB_NAME} ${LIB_TYPE} ${LIB_SOURCES}) 76 | TARGET_LINK_LIBRARIES(${LIB_NAME} ${ARCH_LIBRARIES}) 77 | SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY COMPILE_DEFINITIONS_DEBUG DEBUG;DEF_DEBUG_LVL=${CFG_DEBUG_LVL}) 78 | SET_PROPERTY(TARGET ${LIB_NAME} PROPERTY DEBUG_POSTFIX "_d") 79 | INSTALL(TARGETS ${LIB_NAME} ARCHIVE DESTINATION . LIBRARY DESTINATION .) 80 | -------------------------------------------------------------------------------- /common/src/arp/arp.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file arp.h 4 | 5 | \brief ARP demo implementation 6 | 7 | This file contains the definitions for the ARP demo. 8 | 9 | *******************************************************************************/ 10 | 11 | /*------------------------------------------------------------------------------ 12 | Copyright (c) 2016, B&R Industrial Automation GmbH 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | * Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | * Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 27 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | ------------------------------------------------------------------------------*/ 37 | #ifndef _INC_arp_H_ 38 | #define _INC_arp_H_ 39 | 40 | //------------------------------------------------------------------------------ 41 | // includes 42 | //------------------------------------------------------------------------------ 43 | #include 44 | 45 | //------------------------------------------------------------------------------ 46 | // const defines 47 | //------------------------------------------------------------------------------ 48 | 49 | //------------------------------------------------------------------------------ 50 | // typedef 51 | //------------------------------------------------------------------------------ 52 | 53 | //------------------------------------------------------------------------------ 54 | // function prototypes 55 | //------------------------------------------------------------------------------ 56 | #ifdef __cplusplus 57 | extern "C" 58 | { 59 | #endif 60 | 61 | void arp_init(UINT8 nodeId_p); 62 | void arp_exit(void); 63 | void arp_setMacAddr(const UINT8* pMacAddr_p); 64 | void arp_setIpAddr(UINT32 ipAddr_p); 65 | void arp_setDefGateway(UINT32 defGateway_p); 66 | 67 | int arp_sendRequest(UINT32 ipAddr_p); 68 | int arp_processReceive(const tPlkFrame* pFrame_p, 69 | UINT size_p); 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif /* _INC_arp_H_ */ 76 | -------------------------------------------------------------------------------- /common/src/firmwaremanager/firmwaretrace.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file firmwaretrace.h 4 | 5 | \brief Header file for trace macros used within firmware manager modules 6 | 7 | *******************************************************************************/ 8 | 9 | /*------------------------------------------------------------------------------ 10 | Copyright (c) 2017, B&R Industrial Automation GmbH 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | * Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | * Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 25 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | ------------------------------------------------------------------------------*/ 35 | #ifndef _INC_firmwaretrace_H_ 36 | #define _INC_firmwaretrace_H_ 37 | 38 | //------------------------------------------------------------------------------ 39 | // includes 40 | //------------------------------------------------------------------------------ 41 | 42 | #include 43 | 44 | //------------------------------------------------------------------------------ 45 | // const defines 46 | //------------------------------------------------------------------------------ 47 | 48 | #define FWM_TRACE_ENABLE 49 | 50 | #if !defined(FWM_TRACE_PREFIX) 51 | #define FWM_TRACE_PREFIX "FWM: " 52 | #endif 53 | 54 | #if !defined(FWM_ERROR_PREFIX) 55 | #define FWM_ERROR_PREFIX "FWM-ERROR: " 56 | #endif 57 | 58 | #if defined(FWM_TRACE_ENABLE) 59 | #define FWM_TRACE(...) printf(FWM_TRACE_PREFIX __VA_ARGS__) 60 | #else 61 | #define FWM_TRACE(...) 62 | #endif 63 | 64 | #if defined(FWM_TRACE_ENABLE) 65 | #define FWM_ERROR(...) fprintf(stderr, FWM_ERROR_PREFIX __VA_ARGS__) 66 | #else 67 | #define FWM_ERROR(...) 68 | #endif 69 | 70 | //------------------------------------------------------------------------------ 71 | // typedef 72 | //------------------------------------------------------------------------------ 73 | 74 | //------------------------------------------------------------------------------ 75 | // function prototypes 76 | //------------------------------------------------------------------------------ 77 | 78 | #ifdef __cplusplus 79 | extern "C" 80 | { 81 | #endif 82 | 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | 87 | #endif /* _INC_firmwaretrace_H_ */ 88 | -------------------------------------------------------------------------------- /common/src/netselect/netselect.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file netselect.h 4 | 5 | \brief Definitions for network interface selection functions. 6 | 7 | This header file provides the definitions for the network interface selection 8 | functions used by the openPOWERLINK examples. 9 | *******************************************************************************/ 10 | 11 | /*------------------------------------------------------------------------------ 12 | Copyright (c) 2017, B&R Industrial Automation GmbH 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | * Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | * Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 27 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | ------------------------------------------------------------------------------*/ 37 | #ifndef _INC_netselect_H_ 38 | #define _INC_netselect_H_ 39 | 40 | //------------------------------------------------------------------------------ 41 | // includes 42 | //------------------------------------------------------------------------------ 43 | 44 | //------------------------------------------------------------------------------ 45 | // const defines 46 | //------------------------------------------------------------------------------ 47 | 48 | //------------------------------------------------------------------------------ 49 | // typedef 50 | //------------------------------------------------------------------------------ 51 | 52 | //------------------------------------------------------------------------------ 53 | // function prototypes 54 | //------------------------------------------------------------------------------ 55 | #ifdef __cplusplus 56 | extern "C" 57 | { 58 | #endif 59 | 60 | int netselect_selectNetworkInterface(char* pDevName_p, size_t maxLen_p); 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif /* _INC_netselect_H_ */ 67 | -------------------------------------------------------------------------------- /common/src/obdcreate/obdcreate.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file obdcreate/obdcreate.h 4 | 5 | \brief Object dictionary creation 6 | 7 | This file contains the definitions for the creation of a static object 8 | dictionary. 9 | *******************************************************************************/ 10 | 11 | /*------------------------------------------------------------------------------ 12 | Copyright (c) 2016, B&R Industrial Automation GmbH 13 | Copyright (c) 2013, SYSTEC electronic GmbH 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | * Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | * Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ------------------------------------------------------------------------------*/ 38 | #ifndef _INC_obdcreate_obdcreate_H_ 39 | #define _INC_obdcreate_obdcreate_H_ 40 | 41 | //------------------------------------------------------------------------------ 42 | // includes 43 | //------------------------------------------------------------------------------ 44 | #include 45 | 46 | //------------------------------------------------------------------------------ 47 | // const defines 48 | //------------------------------------------------------------------------------ 49 | 50 | //------------------------------------------------------------------------------ 51 | // typedef 52 | //------------------------------------------------------------------------------ 53 | 54 | //------------------------------------------------------------------------------ 55 | // function prototypes 56 | //------------------------------------------------------------------------------ 57 | #ifdef __cplusplus 58 | extern "C" 59 | { 60 | #endif 61 | 62 | tOplkError obdcreate_initObd(tObdInitParam* pInitParam_p); 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif /* _INC_obdcreate_obdcreate_H_ */ 69 | -------------------------------------------------------------------------------- /drivers/linux/drv_daemon_pcap/build/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | .* 3 | !.gitignore 4 | 5 | -------------------------------------------------------------------------------- /drivers/linux/drv_kernelmod_edrv/build/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | .* 3 | !.gitignore 4 | 5 | -------------------------------------------------------------------------------- /include/app/app.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file app.h 4 | 5 | \brief Definitions for CN application 6 | 7 | The file contains the definitions for the CN digital I/O application. 8 | *******************************************************************************/ 9 | 10 | /*------------------------------------------------------------------------------ 11 | Copyright (c) 2016, B&R Industrial Automation GmbH 12 | Copyright (c) 2013, SYSTEC electronic GmbH 13 | Copyright (c) 2013, Kalycito Infotech Private Ltd.All rights reserved. 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | * Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | * Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ------------------------------------------------------------------------------*/ 38 | #ifndef _INC_demo_app_H_ 39 | #define _INC_demo_app_H_ 40 | 41 | //------------------------------------------------------------------------------ 42 | // includes 43 | //------------------------------------------------------------------------------ 44 | #include 45 | 46 | //------------------------------------------------------------------------------ 47 | // const defines 48 | //------------------------------------------------------------------------------ 49 | 50 | //------------------------------------------------------------------------------ 51 | // typedef 52 | //------------------------------------------------------------------------------ 53 | 54 | //------------------------------------------------------------------------------ 55 | // function prototypes 56 | //------------------------------------------------------------------------------ 57 | #ifdef __cplusplus 58 | extern "C" 59 | { 60 | #endif 61 | 62 | tOplkError initApp(void); 63 | void shutdownApp(void); 64 | tOplkError processSync(void); 65 | void printOutputs(void); 66 | void printInputs(void); 67 | void setupInputs(void); 68 | void callbackOPCUA(UA_Server* server); 69 | void setStatus_OPCUA(const char* status); 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif /* _INC_demo_app_H_ */ 76 | -------------------------------------------------------------------------------- /include/app/event.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file event.h 4 | 5 | \brief Definitions of the CN demo event handler 6 | 7 | The file contains the definitions for the CN demo event handler. 8 | *******************************************************************************/ 9 | 10 | /*------------------------------------------------------------------------------ 11 | Copyright (c) 2016, B&R Industrial Automation GmbH 12 | Copyright (c) 2013, SYSTEC electronic GmbH 13 | Copyright (c) 2013, Kalycito Infotech Private Ltd.All rights reserved. 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | * Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | * Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ------------------------------------------------------------------------------*/ 38 | #ifndef _INC_demo_event_H_ 39 | #define _INC_demo_event_H_ 40 | 41 | //------------------------------------------------------------------------------ 42 | // includes 43 | //------------------------------------------------------------------------------ 44 | #include 45 | 46 | //------------------------------------------------------------------------------ 47 | // const defines 48 | //------------------------------------------------------------------------------ 49 | 50 | //------------------------------------------------------------------------------ 51 | // typedef 52 | //------------------------------------------------------------------------------ 53 | 54 | //------------------------------------------------------------------------------ 55 | // function prototypes 56 | //------------------------------------------------------------------------------ 57 | 58 | #ifdef __cplusplus 59 | extern "C" 60 | { 61 | #endif 62 | 63 | void initEvents(BOOL* pfGsOff_p); 64 | tOplkError processEvents(tOplkApiEventType eventType_p, 65 | const tOplkApiEventArg* pEventArg_p, 66 | void* pUserArg_p); 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif /* _INC_demo_event_H_ */ 73 | -------------------------------------------------------------------------------- /include/common/ctrlcal.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file common/ctrlcal.h 4 | 5 | \brief Definitions for ctrl CAL module 6 | 7 | This file contains the definitions for the ctrl CAL module. 8 | 9 | *******************************************************************************/ 10 | 11 | /*------------------------------------------------------------------------------ 12 | Copyright (c) 2017, B&R Industrial Automation GmbH 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | * Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | * Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 27 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | ------------------------------------------------------------------------------*/ 37 | #ifndef _INC_common_ctrlcal_H_ 38 | #define _INC_common_ctrlcal_H_ 39 | 40 | //------------------------------------------------------------------------------ 41 | // includes 42 | //------------------------------------------------------------------------------ 43 | #include 44 | 45 | //------------------------------------------------------------------------------ 46 | // const defines 47 | //------------------------------------------------------------------------------ 48 | 49 | //------------------------------------------------------------------------------ 50 | // typedef 51 | //------------------------------------------------------------------------------ 52 | 53 | //------------------------------------------------------------------------------ 54 | // function prototypes 55 | //------------------------------------------------------------------------------ 56 | #ifdef __cplusplus 57 | extern "C" 58 | { 59 | #endif 60 | 61 | tOplkError ctrlcal_init(size_t size_p); 62 | tOplkError ctrlcal_exit(void); 63 | void ctrlcal_writeData(size_t offset_p, 64 | const void* pSrc_p, 65 | size_t length_p); 66 | tOplkError ctrlcal_readData(void* pDest_p, 67 | size_t offset_p, 68 | size_t length_p); 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif /* _INC_common_ctrlcal_H_ */ 75 | -------------------------------------------------------------------------------- /include/contrib/bootloader/altera-nios2/epcsboot/build/.gitignore: -------------------------------------------------------------------------------- 1 | *.elf 2 | *.srec 3 | *.hex 4 | *.dump 5 | -------------------------------------------------------------------------------- /include/contrib/bootloader/altera-nios2/epcsboot/src/boot_loader.h: -------------------------------------------------------------------------------- 1 | // file: boot_loader.h 2 | // asmsyntax=nios2 3 | // 4 | // Copyright 2003-2004 Altera Corporation, San Jose, California, USA. 5 | // All rights reserved. 6 | // 7 | // Register definitions for the boot loader code 8 | 9 | // Symbolic definitions for how registers are used in this program 10 | // program 11 | #define r_zero r0 12 | #define r_asm_tmp r1 13 | 14 | #define r_flash_ptr r2 15 | #define r_data_size r3 16 | #define r_dest r4 17 | 18 | #define r_halt_record r5 19 | 20 | #define r_read_int_return_value r6 21 | #define r_riff_count r7 22 | #define r_riff_return_address r8 23 | #define rf_temp r9 24 | 25 | #define r_read_byte_return_value r10 26 | 27 | #define r_epcs_tx_value r11 28 | 29 | #define r_eopen_eclose_tmp r12 30 | 31 | #define r_findp_return_address r13 32 | #define r_findp_temp r14 33 | #define r_findp_pattern r15 34 | #define r_findp_count r16 35 | 36 | #define r_revbyte_mask r17 37 | 38 | #define r_epcs_base_address r18 39 | 40 | #define r_flush_counter r19 41 | #define r_my_temp r19 // Used to calc the right EPCS image offset 42 | 43 | #define r_trie_count r20 44 | 45 | #define r_epcs_4_bytes_mode r21 46 | 47 | #define r_open_close_return_address r22 48 | 49 | #define return_address_less_4 r23 50 | 51 | // EPCS control/status register offsets 52 | #define EPCS_RXDATA_OFFSET 0x00 53 | #define EPCS_TXDATA_OFFSET 0x04 54 | #define EPCS_STATUS_OFFSET 0x08 55 | #define EPCS_CONTROL_OFFSET 0x0C 56 | 57 | // EPCS Bit Masks 58 | #define EPCS_STATUS_TMT_MASK 0x20 59 | #define EPCS_STATUS_TRDY_MASK 0x40 60 | #define EPCS_STATUS_RRDY_MASK 0x80 61 | 62 | #define EPCS_CONTROL_SSO_MASK 0x400 63 | 64 | // EPCS commands 65 | #define EPCS_COMMAND_READ 0x03 66 | #define EPCS_COMMAND_RDID 0x9F 67 | #define EPCS_COMMAND_EN4B 0xB7 68 | #define EPCS_COMMAND_EX4B 0xE9 69 | #define EPCS_COMMAND_WREN 0x06 70 | 71 | // Density ID 72 | #define EPCS_256 0x19 73 | 74 | // end of file 75 | -------------------------------------------------------------------------------- /include/contrib/bootloader/xilinx-microblaze/simpleboot/build/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | .* 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /include/contrib/bootloader/xilinx-microblaze/simpleboot/scripts/program-prom-avnet-s6plkeb.cmd: -------------------------------------------------------------------------------- 1 | setMode -bscan 2 | setCable -p auto 3 | Identify -inferir 4 | identifyMPM 5 | attachflash -position 1 -spi "S25FL064P" 6 | assignfiletoattachedflash -position 1 -file flash_image.mcs 7 | Program -p 1 -dataWidth 1 -spionly -e -v -loadfpga 8 | quit 9 | -------------------------------------------------------------------------------- /include/contrib/bootloader/xilinx-microblaze/simpleboot/src/crt3.s: -------------------------------------------------------------------------------- 1 | ###################################-*-asm*- 2 | # 3 | # Copyright (c) 2001 Xilinx, Inc. All rights reserved. 4 | # 5 | # Xilinx, Inc. 6 | # 7 | # XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A 8 | # COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS 9 | # ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR 10 | # STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION 11 | # IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE 12 | # FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION. 13 | # XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO 14 | # THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO 15 | # ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE 16 | # FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY 17 | # AND FITNESS FOR A PARTICULAR PURPOSE. 18 | # 19 | # crt4.s 20 | # 21 | # C run-time for MicroBlaze applications that do not want vectors (compiled 22 | # with -xl-mode-novectors) 23 | # $Id: crt3.s,v 1.1.2.1 2009/06/16 21:29:06 vasanth Exp $ 24 | # 25 | ####################################### 26 | 27 | /* 28 | MicroBlaze Vector Map for vector-less ELF images 29 | 30 | Address Vector type Label 31 | ------- ----------- ------ 32 | 33 | # 0x00 # (-- IMM --) 34 | # 0x04 # Reset (-- Don't Care --) 35 | 36 | # 0x08 # (-- IMM --) 37 | # 0x0c # Software Exception (-- Don't Care --) 38 | 39 | # 0x10 # (-- IMM --) 40 | # 0x14 # Hardware Interrupt (-- Don't Care --) 41 | 42 | # 0x18 # (-- IMM --) 43 | # 0x1C # Breakpoint Exception (-- Don't Care --) 44 | 45 | # 0x20 # (-- IMM --) 46 | # 0x24 # Hardware Exception (-- Don't Care --) 47 | */ 48 | 49 | 50 | .section .text 51 | .globl _start 52 | .align 2 53 | .ent _start 54 | .type _start, @function 55 | _start: 56 | la r13, r0, _SDA_BASE_ /* Set the Small Data Anchors and the stack pointer */ 57 | la r2, r0, _SDA2_BASE_ 58 | la r1, r0, _stack-16 /* 16 bytes (4 words are needed by crtinit for args and link reg */ 59 | 60 | brlid r15, _crtinit /* Initialize BSS and run program */ 61 | nop 62 | 63 | brlid r15, exit /* Call exit with the return value of main */ 64 | addik r5, r3, 0 65 | 66 | /* Control does not reach here */ 67 | .end _start 68 | 69 | 70 | /* 71 | _exit 72 | Our simple _exit 73 | */ 74 | .globl _exit 75 | .align 2 76 | .ent _exit 77 | .type _exit, @function 78 | _exit: 79 | bri 0 80 | .end _exit 81 | -------------------------------------------------------------------------------- /include/contrib/bootloader/xilinx-microblaze/simpleboot/src/crtinit.s: -------------------------------------------------------------------------------- 1 | ###################################-*-asm*- 2 | # 3 | # Copyright (c) 2001 Xilinx, Inc. All rights reserved. 4 | # 5 | # Xilinx, Inc. 6 | # 7 | # XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A 8 | # COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS 9 | # ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR 10 | # STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION 11 | # IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE 12 | # FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION. 13 | # XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO 14 | # THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO 15 | # ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE 16 | # FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY 17 | # AND FITNESS FOR A PARTICULAR PURPOSE. 18 | # 19 | # crtinit.s 20 | # 21 | # Default second stage of C run-time initialization 22 | # 23 | # $Id: crtinit.s,v 1.1.2.1 2009/06/16 21:29:06 vasanth Exp $ 24 | # 25 | ####################################### 26 | 27 | .globl _crtinit 28 | .align 2 29 | .ent _crtinit 30 | .type _crtinit, @function 31 | _crtinit: 32 | addi r1, r1, -20 /* Save Link register */ 33 | swi r15, r1, 0 34 | 35 | addi r6, r0, __sbss_start /* clear SBSS */ 36 | addi r7, r0, __sbss_end 37 | rsub r18, r6, r7 38 | blei r18, .Lendsbss 39 | 40 | .Lloopsbss: 41 | swi r0, r6, 0 42 | addi r6, r6, 4 43 | rsub r18, r6, r7 44 | bgti r18, .Lloopsbss 45 | .Lendsbss: 46 | 47 | addi r6, r0, __bss_start /* clear BSS */ 48 | addi r7, r0, __bss_end 49 | rsub r18, r6, r7 50 | blei r18, .Lendbss 51 | .Lloopbss: 52 | swi r0, r6, 0 53 | addi r6, r6, 4 54 | rsub r18, r6, r7 55 | bgti r18, .Lloopbss 56 | .Lendbss: 57 | 58 | brlid r15, _program_init /* Initialize the program */ 59 | nop 60 | 61 | brlid r15, __init /* Invoke language initialization functions */ 62 | nop 63 | 64 | addi r6, r0, 0 /* Initialize argc = 1 and argv = NULL and envp = NULL */ 65 | addi r7, r0, 0 66 | brlid r15, main /* Execute the program */ 67 | addi r5, r0, 0 68 | 69 | addik r19, r3, 0 /* Save return value */ 70 | 71 | # brlid r15, __fini /* Invoke language cleanup functions */ 72 | nop 73 | 74 | brlid r15, _program_clean /* Cleanup the program */ 75 | nop 76 | 77 | lw r15, r1, r0 /* Return back to CRT */ 78 | 79 | addik r3, r19, 0 /* Restore return value */ 80 | rtsd r15, 8 81 | addi r1, r1, 20 82 | .end _crtinit 83 | 84 | -------------------------------------------------------------------------------- /include/contrib/bootloader/xilinx-microblaze/simpleboot/src/global.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 Avnet. All rights reserved. 3 | * 4 | * Avnet (HK) 5 | * AVNET IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A 6 | * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS 7 | * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR 8 | * STANDARD, AVNET IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION 9 | * IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE 10 | * FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION 11 | * AVNET EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO 12 | * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO 13 | * ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE 14 | * FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY 15 | * AND FITNESS FOR A PARTICULAR PURPOSE. 16 | */ 17 | 18 | #ifndef __GLOBAL_H__ 19 | #define __GLOBAL_H__ 20 | 21 | #include "xparameters.h" 22 | 23 | /* debug settings */ 24 | #define DEBUG 0 // 1 - general debug message 25 | #define DEBUG_SPI 0 // 1 - debug spi driver 26 | #define DEBUG_PRINT_FLASH_DATA 0 // 1 - debug readback spi flash data 27 | 28 | /**************************************************/ 29 | /* Automatic settings */ 30 | /**************************************************/ 31 | 32 | /* bootloader mode */ 33 | #ifdef XPAR_SPI_FLASH_BASEADDR 34 | #define SPI_FLASH 1 // 1 - SPI flash; 0 - parallel flash 35 | #else 36 | #define SPI_FLASH 0 // 1 - SPI flash; 0 - parallel flash 37 | #endif //XPAR_SPI_FLASH_BASEADDR 38 | 39 | /* Enable/Disable byte swapping */ 40 | #if XPAR_MICROBLAZE_ENDIANNESS == 0 /* MICROBLAZE is big endian */ 41 | #define SWAP_HILO_BYTE 0 // 1 - for 16bit access, this can swap hi-lo bytes 42 | #elif XPAR_MICROBLAZE_ENDIANNESS == 1 /* MICROBLAZE is little endian */ 43 | #define SWAP_HILO_BYTE 1 // 1 - for 16bit access, this can swap hi-lo bytes 44 | #else 45 | #error "Microblaze endianess information is not available!" 46 | #endif // XPAR_MICROBLAZE_ENDIANNESS == 0 47 | 48 | #if SPI_FLASH == 1 49 | #define BIT_SWAP_ON 0 // 1 - swap bit order 50 | #elif SPI_FLASH == 0 51 | #define BIT_SWAP_ON 0 // 1 - swap bit order 52 | #else 53 | #error "Wrong Flash mode provided! Only 1 (SPI Flash) and 0 (Parallel Flash) is possible!" 54 | #endif // SPI_FLASH == 1 55 | 56 | 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /include/contrib/bootloader/xilinx-microblaze/simpleboot/src/init.s: -------------------------------------------------------------------------------- 1 | ###################################-*-asm*- 2 | # 3 | # Copyright (c) 2004 Xilinx, Inc. All rights reserved. 4 | # 5 | # Xilinx, Inc. CONFIDENTIAL 6 | # 7 | # XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A 8 | # COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS 9 | # ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR 10 | # STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION 11 | # IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE 12 | # FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION. 13 | # XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO 14 | # THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO 15 | # ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE 16 | # FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY 17 | # AND FITNESS FOR A PARTICULAR PURPOSE. 18 | # 19 | # init.s 20 | # 21 | # $Id$ 22 | # 23 | ####################################### 24 | 25 | .globl __init 26 | .ent __init 27 | .section .init 28 | __init: 29 | la r1, r0, _stack 30 | brlid r15,main 31 | .end __init 32 | 33 | -------------------------------------------------------------------------------- /include/contrib/bootloader/xilinx-microblaze/simpleboot/src/util.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 Avnet. All rights reserved. 3 | * 4 | * Avnet (HK) 5 | * AVNET IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A 6 | * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS 7 | * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR 8 | * STANDARD, AVNET IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION 9 | * IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE 10 | * FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION 11 | * AVNET EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO 12 | * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO 13 | * ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE 14 | * FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY 15 | * AND FITNESS FOR A PARTICULAR PURPOSE. 16 | */ 17 | 18 | #include "xbasic_types.h" 19 | #include "xstatus.h" 20 | #include "global.h" 21 | 22 | #if BIT_SWAP_ON == 1 23 | u8 BitReOrder8(u8 data) 24 | { 25 | u8 dswap = data; 26 | 27 | dswap = ((dswap&0x1)<<7) | ((dswap&0x2)<<5) | ((dswap&0x4)<<3) | ((dswap&0x8)<<1) | \ 28 | ((dswap&0x10)>>1) | ((dswap&0x20)>>3) | ((dswap&0x40)>>5) | ((dswap&0x80)>>7); 29 | 30 | return dswap; 31 | } 32 | #endif 33 | 34 | u16 BitReOrder16(Xuint16 data) 35 | { 36 | Xuint8 dhi, dlo; 37 | 38 | #if SWAP_HILO_BYTE == 1 39 | /* swap hi-lo byte */ 40 | dlo = (Xuint8)(data >> 8); 41 | dhi = (Xuint8)data; 42 | #else 43 | /* no need to swap hi-lo byte */ 44 | dlo = (Xuint8)data; 45 | dhi = (Xuint8)(data >> 8); 46 | #endif 47 | 48 | #if BIT_SWAP_ON == 1 49 | /* swap bits by software */ 50 | dlo = BitReOrder8(dlo); 51 | dhi = BitReOrder8(dhi); 52 | #endif 53 | 54 | return (dhi << 8) | dlo; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /include/contrib/bootloader/xilinx-microblaze/simpleboot/src/util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 Avnet. All rights reserved. 3 | * 4 | * Avnet (HK) 5 | * AVNET IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A 6 | * COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS 7 | * ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR 8 | * STANDARD, AVNET IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION 9 | * IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE 10 | * FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION 11 | * AVNET EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO 12 | * THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO 13 | * ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE 14 | * FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY 15 | * AND FITNESS FOR A PARTICULAR PURPOSE. 16 | */ 17 | #ifndef __UTIL_H__ 18 | #define __UTIL_H__ 19 | 20 | #include "xbasic_types.h" 21 | 22 | /***************************** Include Files *********************************/ 23 | 24 | 25 | /************************** Constant Definitions *****************************/ 26 | 27 | 28 | /**************************** Type Definitions *******************************/ 29 | 30 | 31 | /************************** Constant Definitions *****************************/ 32 | 33 | 34 | 35 | 36 | u8 BitReOrder8(u8 data); 37 | u16 BitReOrder16(u16 data); 38 | 39 | 40 | #endif 41 | 42 | 43 | -------------------------------------------------------------------------------- /include/contrib/console/console-nios2.c: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file console-nios2.c 4 | 5 | \brief Console input/output implementation for Altera NiosII 6 | 7 | This file contains the console input/output implementation for Altera NiosII. 8 | 9 | \ingroup module_console 10 | *******************************************************************************/ 11 | 12 | /*------------------------------------------------------------------------------ 13 | Copyright (c) 2016, B&R Industrial Automation GmbH 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | * Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | * Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ------------------------------------------------------------------------------*/ 38 | 39 | //------------------------------------------------------------------------------ 40 | // includes 41 | //------------------------------------------------------------------------------ 42 | 43 | //============================================================================// 44 | // P U B L I C F U N C T I O N S // 45 | //============================================================================// 46 | 47 | //------------------------------------------------------------------------------ 48 | /** 49 | \brief Get character from console 50 | 51 | This function reads a character from the console input. 52 | 53 | \note This function needs to be implemented for Nios II if required. 54 | 55 | \return The function returns the read character. 56 | 57 | \ingroup module_console 58 | */ 59 | //------------------------------------------------------------------------------ 60 | int console_getch(void) 61 | { 62 | //TODO 63 | return 0; 64 | } 65 | 66 | //------------------------------------------------------------------------------ 67 | /** 68 | \brief Detecting a keystroke 69 | 70 | The function checks the console for a keystroke. 71 | 72 | \note This function needs to be implemented for Nios II if required. 73 | 74 | \return The function returns 0 if no key has been pressed or 1 if a key has 75 | been pressed. 76 | 77 | \ingroup module_console 78 | */ 79 | //------------------------------------------------------------------------------ 80 | int console_kbhit(void) 81 | { 82 | //TODO 83 | return 0; 84 | } 85 | -------------------------------------------------------------------------------- /include/contrib/console/console-windows.c: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file console-windows.c 4 | 5 | \brief Console input/output implementation for Windows 6 | 7 | This file contains the console input/output implementation for Windows. 8 | 9 | \ingroup module_console 10 | *******************************************************************************/ 11 | 12 | /*------------------------------------------------------------------------------ 13 | Copyright (c) 2016, B&R Industrial Automation GmbH 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | * Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | * Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ------------------------------------------------------------------------------*/ 38 | 39 | //------------------------------------------------------------------------------ 40 | // includes 41 | //------------------------------------------------------------------------------ 42 | #include 43 | 44 | //============================================================================// 45 | // P U B L I C F U N C T I O N S // 46 | //============================================================================// 47 | 48 | //------------------------------------------------------------------------------ 49 | /** 50 | \brief Get character from console 51 | 52 | This function reads a character from the console input. It uses Microsoft's 53 | _getch() (ISO C++) provided in conio.h. 54 | 55 | \return The function returns the read character. 56 | 57 | \ingroup module_console 58 | */ 59 | //------------------------------------------------------------------------------ 60 | int console_getch(void) 61 | { 62 | return _getch(); 63 | } 64 | 65 | //------------------------------------------------------------------------------ 66 | /** 67 | \brief Detecting a keystroke 68 | 69 | The function checks the console for a keystroke. It uses Microsoft's 70 | _kbhit() (ISO C++) provided in conio.h. 71 | 72 | \return The function returns 0 if no key has been pressed or 1 if a key has 73 | been pressed. 74 | 75 | \ingroup module_console 76 | */ 77 | //------------------------------------------------------------------------------ 78 | int console_kbhit(void) 79 | { 80 | return _kbhit(); 81 | } 82 | -------------------------------------------------------------------------------- /include/contrib/console/console.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file console.h 4 | 5 | \brief Console Input/Output header file 6 | 7 | This file contains definitions for the console input/output module. 8 | *******************************************************************************/ 9 | 10 | /*------------------------------------------------------------------------------ 11 | Copyright (c) 2016, B&R Industrial Automation GmbH 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without 15 | modification, are permitted provided that the following conditions are met: 16 | * Redistributions of source code must retain the above copyright 17 | notice, this list of conditions and the following disclaimer. 18 | * Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | * Neither the name of the copyright holders nor the 22 | names of its contributors may be used to endorse or promote products 23 | derived from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 26 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 29 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 30 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 32 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 34 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ------------------------------------------------------------------------------*/ 36 | #ifndef _INC_console_H_ 37 | #define _INC_console_H_ 38 | 39 | //------------------------------------------------------------------------------ 40 | // includes 41 | //------------------------------------------------------------------------------ 42 | 43 | //------------------------------------------------------------------------------ 44 | // const defines 45 | //------------------------------------------------------------------------------ 46 | 47 | //------------------------------------------------------------------------------ 48 | // typedef 49 | //------------------------------------------------------------------------------ 50 | 51 | //------------------------------------------------------------------------------ 52 | // function prototypes 53 | //------------------------------------------------------------------------------ 54 | #ifdef __cplusplus 55 | extern "C" { 56 | #endif 57 | 58 | int console_getch(void); 59 | int console_kbhit(void); 60 | void console_printlog(const char* fmt, ...); 61 | void console_printlogadd(const char* fmt, ...); 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif /* _INC_console_H_ */ 68 | -------------------------------------------------------------------------------- /include/contrib/dualprocshm/.gitignore: -------------------------------------------------------------------------------- 1 | .metadata/ 2 | .settings 3 | .project 4 | .cproject 5 | *~ 6 | *.orig 7 | *.bak 8 | *.o 9 | *.d 10 | -------------------------------------------------------------------------------- /include/contrib/dualprocshm/cmake/configure-microblaze.cmake: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # CMake file for dual processor library where target is Microblaze 4 | # 5 | # Copyright (c) 2014, Kalycito Infotech Private Limited. 6 | # All rights reserved. 7 | # 8 | # Redistribution and use in source and binary forms, with or without 9 | # modification, are permitted provided that the following conditions are met: 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above copyright 13 | # notice, this list of conditions and the following disclaimer in the 14 | # documentation and/or other materials provided with the distribution. 15 | # * Neither the name of the copyright holders nor the 16 | # names of its contributors may be used to endorse or promote products 17 | # derived from this software without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | # DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | ################################################################################ 30 | 31 | ################################################################################ 32 | # Set architecture specific sources and include directories 33 | 34 | SET(LIB_ARCH_SRCS "") 35 | 36 | SET(LIB_ARCH_INCS 37 | ${EXAMPLE_BINARY_DIR}/bsp${CFG_${PROC_INST_NAME}_NAME}/${CFG_${PROC_INST_NAME}_NAME}/include 38 | ${BOARD_EXAMPLE_DIR}/include 39 | ) 40 | 41 | ################################################################################ 42 | # Set architecture specific definitions 43 | SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${XIL_${PROC_INST_NAME}_CFLAGS} -fmessage-length=0 -mcpu=${CFG_${PROC_INST_NAME}_CPU_VERSION} -ffunction-sections -fdata-sections -fno-inline") 44 | 45 | IF(DEFINED CFG_DEMO_BOARD_ZYNQ AND CFG_DEMO_BOARD_ZYNQ) 46 | ADD_DEFINITIONS(-D__ZYNQ__) 47 | ENDIF() 48 | ################################################################################ 49 | # Set architecture specific installation files 50 | 51 | ######################################################################## 52 | # Eclipse project files 53 | SET(CFG_CPU_NAME ${CFG_${PROC_INST_NAME}_NAME}) 54 | 55 | GEN_ECLIPSE_FILE_LIST("${DUALPROCSHM_LIB_SRCS}" "" PART_ECLIPSE_FILE_LIST) 56 | SET(ECLIPSE_FILE_LIST "${ECLIPSE_FILE_LIST} ${PART_ECLIPSE_FILE_LIST}") 57 | 58 | GEN_ECLIPSE_FILE_LIST("${LIB_ARCH_SRCS}" "arch" PART_ECLIPSE_FILE_LIST) 59 | SET(ECLIPSE_FILE_LIST "${ECLIPSE_FILE_LIST} ${PART_ECLIPSE_FILE_LIST}") 60 | 61 | SET(LIBRARY_INCLUDES ${DUALPROCSHM_LIB_INCS} ${LIB_ARCH_INCS}) 62 | GEN_ECLIPSE_INCLUDE_LIST("${LIBRARY_INCLUDES}" ECLIPSE_INCLUDE_LIST ) 63 | 64 | CONFIGURE_FILE(${ARCH_TOOLS_DIR}/eclipse/libproject.in ${PROJECT_BINARY_DIR}/.project @ONLY) 65 | CONFIGURE_FILE(${ARCH_TOOLS_DIR}/eclipse/libcproject.in ${PROJECT_BINARY_DIR}/.cproject @ONLY) 66 | -------------------------------------------------------------------------------- /include/contrib/getopt/getopt.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file getopt.h 4 | 5 | \brief Definitions for getopt command option parser 6 | 7 | This file contains definitions for the getopt command option parser. 8 | *******************************************************************************/ 9 | 10 | /*------------------------------------------------------------------------------ 11 | Copyright (c) 2016, B&R Industrial Automation GmbH 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without 15 | modification, are permitted provided that the following conditions are met: 16 | * Redistributions of source code must retain the above copyright 17 | notice, this list of conditions and the following disclaimer. 18 | * Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | * Neither the name of the copyright holders nor the 22 | names of its contributors may be used to endorse or promote products 23 | derived from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 26 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 29 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 30 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 32 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 34 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ------------------------------------------------------------------------------*/ 36 | #ifndef _INC_getopt_H_ 37 | #define _INC_getopt_H_ 38 | 39 | //------------------------------------------------------------------------------ 40 | // global variable declarations 41 | //------------------------------------------------------------------------------ 42 | extern char* optarg; /* getopt(3) external variables */ 43 | extern int optind; 44 | extern int opterr; 45 | extern int optopt; 46 | 47 | //------------------------------------------------------------------------------ 48 | // function prototypes 49 | //------------------------------------------------------------------------------ 50 | #ifdef __cplusplus 51 | extern "C" { 52 | #endif 53 | 54 | int getopt(int, char* const [], const char*); 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* _INC_getopt_H_ */ 61 | -------------------------------------------------------------------------------- /include/contrib/pcap/wince/PacketCE/Support.h: -------------------------------------------------------------------------------- 1 | #ifndef __SUPPORT_H__ 2 | #define __SUPPORT_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | // Common file required by the driver as well as dll files 9 | #define ETHERNET_HEADER_LENGTH 14 10 | 11 | #define PIOC_OPEN_ADAPTER 7419 12 | #define PIOC_CLOSE_ADAPTER 7420 13 | #define PIOC_SET_BUFFER_SIZE 9592 14 | #define PIOC_SETF 9030 15 | #define PIOC_SRTIMEOUT 7416 16 | 17 | #define PIOC_SMINTOCOPY 7414 18 | #define PIOC_SETOID 9100 19 | #define PIOC_QUERYOID 9101 20 | #define PIOC_EVNAME 7415 21 | 22 | #define PIOC_RELEASEREQUESTS 7412 23 | #define PIOC_READ_PACKET 9032 24 | #define PIOC_WRITE_PACKET 9033 25 | #define PIOC_GET_MACNAME 9034 26 | #define PIOC_RESET 9038 27 | 28 | #define DRIVER_NAME L"PKT" 29 | #define DRIVER_DLL L"pktdrv.dll" 30 | #define DRIVER_INSTANCE 0x4545 31 | 32 | //#define NDIS_PACKET_TYPE_DIRECTED 0x0001 33 | //#define NDIS_PACKET_TYPE_MULTICAST 0x0002 34 | //#define NDIS_PACKET_TYPE_ALL_MULTICAST 0x0004 35 | //#define NDIS_PACKET_TYPE_BROADCAST 0x0008 36 | //#define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x0010 37 | //#define NDIS_PACKET_TYPE_PROMISCUOUS 0x0020 38 | //#define NDIS_PACKET_TYPE_SMT 0x0040 39 | //#define NDIS_PACKET_TYPE_ALL_LOCAL 0x0080 40 | //#define NDIS_PACKET_TYPE_MAC_FRAME 0x8000 41 | //#define NDIS_PACKET_TYPE_FUNCTIONAL 0x4000 42 | //#define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x2000 43 | //#define NDIS_PACKET_TYPE_GROUP 0x1000 44 | 45 | ///////////////////////////////////////////////////////////////////////////////////// 46 | // Declaration related to BPF 47 | struct time_val { 48 | long tv_sec; /* seconds */ 49 | long tv_usec; /* and microseconds */ 50 | }; 51 | 52 | struct bpf_program { 53 | UINT bf_len; // length of the program 54 | struct bpf_insn *bf_insns; // pointer to the 55 | }; 56 | 57 | struct bpf_insn { // define the instruction structure 58 | USHORT code; // the instruction code 59 | UCHAR jt; // first operand 60 | UCHAR jf; // second operand 61 | int k; 62 | }; 63 | 64 | 65 | struct bpf_hdr { // bpf header for every packet 66 | struct time_val bh_tstamp; // time stamp 67 | UINT bh_caplen; // length of captured portion 68 | UINT bh_datalen; // original length of packet 69 | USHORT bh_hdrlen; // length of bpf header (this struct plus alignment padding) 70 | }; 71 | 72 | typedef struct _PACKET_OID_DATA { 73 | ULONG Oid; 74 | ULONG Length; 75 | UCHAR Data[1]; 76 | }PACKET_OID_DATA, *PPACKET_OID_DATA; 77 | 78 | // PACKET_WORDALIGN rounds up to the next even multiple of Packet_ALIGNMENT. 79 | #define PACKET_ALIGNMENT sizeof(int) 80 | #define PACKET_WORDALIGN(x) (((x) + (PACKET_ALIGNMENT - 1)) & ~(PACKET_ALIGNMENT - 1)) 81 | 82 | #ifdef __cplusplus 83 | } 84 | #endif 85 | 86 | #endif // __SUPPORT_H__ -------------------------------------------------------------------------------- /include/contrib/pcap/wince/PacketCE/packet32.h: -------------------------------------------------------------------------------- 1 | #ifndef __PACKET32_H__ 2 | #define __PACKET32_H__ 3 | #include "support.h" 4 | 5 | #define DRIVER_OPEN_STRING L"PKT1:" 6 | // Globals for retrieving Adapter names 7 | #define RX_BUFFER_SIZE 1024 8 | #define NO_OF_ADAPTERS 5 9 | #define ADAPTER_NAME_SIZE 50 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef struct _PACKET { 16 | PVOID Buffer; 17 | UINT Length; 18 | UINT ulBytesReceived; 19 | BOOL bIoComplete; 20 | } PACKET, *LPPACKET; 21 | 22 | 23 | typedef struct _ADAPTER { 24 | UINT nWrites; 25 | HANDLE hFile; 26 | HANDLE ReadEvent; 27 | } ADAPTER, *LPADAPTER; 28 | 29 | typedef struct NetType 30 | { 31 | UINT LinkType; 32 | UINT LinkSpeed; 33 | } NetType; 34 | 35 | //--------------------------------------------------------------------------- 36 | // Function prototypes 37 | 38 | BOOLEAN PacketSetMinToCopy(LPADAPTER AdapterObject,int nbytes); 39 | BOOLEAN PacketSetNumWrites(LPADAPTER AdapterObject,int nwrites); 40 | BOOLEAN PacketSetMode(LPADAPTER AdapterObject,int mode); 41 | BOOLEAN PacketSetMaxLookaheadsize (LPADAPTER AdapterObject); 42 | BOOLEAN PacketSetReadTimeout(LPADAPTER AdapterObject,int timeout); 43 | BOOLEAN PacketSetBpf(LPADAPTER AdapterObject,struct bpf_program *fp); 44 | BOOLEAN PacketGetStats(LPADAPTER AdapterObject,struct bpf_stat *s); 45 | BOOLEAN PacketSetBuff(LPADAPTER AdapterObject,int dim); 46 | BOOLEAN PacketGetNetType (LPADAPTER AdapterObject,NetType *type); 47 | LPADAPTER PacketOpenAdapter(LPTSTR AdapterName); 48 | BOOLEAN PacketSendPacket(LPADAPTER AdapterObject,LPPACKET pPacket,BOOLEAN Sync); 49 | LPPACKET PacketAllocatePacket(void); 50 | LPPACKET PacketAllocateNPacket(UINT n); 51 | VOID PacketInitPacket(LPPACKET lpPacket,PVOID Buffer,UINT Length); 52 | VOID PacketFreePacket(LPPACKET lpPacket); 53 | BOOLEAN PacketResetAdapter(LPADAPTER AdapterObject); 54 | BOOLEAN PacketWaitPacket(LPADAPTER AdapterObject,LPPACKET lpPacket); 55 | BOOLEAN PacketReceiveNPacket(LPADAPTER AdapterObject,LPPACKET headLPacket,UINT n,UINT length,BYTE* buffer,BOOLEAN Sync); 56 | BOOLEAN PacketReceivePacket(LPADAPTER AdapterObject,LPPACKET lpPacket,BOOLEAN Sync); 57 | VOID PacketCloseAdapter(LPADAPTER lpAdapter); 58 | BOOLEAN PacketSetHwFilter(LPADAPTER AdapterObject,ULONG Filter); 59 | BOOLEAN PacketGetAdapterNames(PTSTR pStr,PULONG BufferSize); 60 | BOOLEAN PacketGetNetInfo(LPTSTR AdapterName, PULONG netp, PULONG maskp); 61 | BOOLEAN PacketRequest(LPADAPTER AdapterObject,BOOLEAN Set,PPACKET_OID_DATA OidData); 62 | VOID PacketSetNextPacket(LPPACKET lpPacket, LPPACKET next); 63 | VOID PacketSetLengthBuffer(LPPACKET lpPacket, UINT dim); 64 | VOID PacketSetLengthPacket(LPPACKET lpPacket, UINT numBytes); 65 | LPPACKET PacketGetNextPacket(LPPACKET lpPacket); 66 | BOOLEAN PacketLoadDriver(VOID); 67 | BOOL PacketUnloadDriver (VOID); 68 | BOOL PacketSetMaxLookahead (LPADAPTER lpAdapter); 69 | DWORD PacketSetLastError (DWORD nNewError); 70 | DWORD PacketGetLastError (VOID); 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | 76 | #endif //__PACKET32_H__ -------------------------------------------------------------------------------- /include/contrib/pcap/wince/PacketCE/readme.txt: -------------------------------------------------------------------------------- 1 | Original version from http://www.winpcap.org/install/bin/PacketCE.zip 2 | -------------------------------------------------------------------------------- /include/contrib/pcap/windows/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/include/contrib/pcap/windows/.gitignore -------------------------------------------------------------------------------- /include/contrib/pcap/windows/WpdPack/.gitignore: -------------------------------------------------------------------------------- 1 | docs 2 | Examples-pcap 3 | Examples-remote 4 | -------------------------------------------------------------------------------- /include/contrib/pcap/windows/WpdPack/Include/pcap-bpf.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * This code is derived from the Stanford/CMU enet packet filter, 6 | * (net/enet.c) distributed as part of 4.3BSD, and code contributed 7 | * to Berkeley by Steven McCanne and Van Jacobson both of Lawrence 8 | * Berkeley Laboratory. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 1. Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright 16 | * notice, this list of conditions and the following disclaimer in the 17 | * documentation and/or other materials provided with the distribution. 18 | * 3. All advertising materials mentioning features or use of this software 19 | * must display the following acknowledgement: 20 | * This product includes software developed by the University of 21 | * California, Berkeley and its contributors. 22 | * 4. Neither the name of the University nor the names of its contributors 23 | * may be used to endorse or promote products derived from this software 24 | * without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 27 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 29 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 30 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 | * SUCH DAMAGE. 37 | * 38 | * @(#) $Header: /tcpdump/master/libpcap/pcap-bpf.h,v 1.50 2007/04/01 21:43:55 guy Exp $ (LBL) 39 | */ 40 | 41 | /* 42 | * For backwards compatibility. 43 | * 44 | * Note to OS vendors: do NOT get rid of this file! Some applications 45 | * might expect to be able to include . 46 | */ 47 | #include 48 | -------------------------------------------------------------------------------- /include/contrib/pcap/windows/WpdPack/Include/pcap-namedb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1994, 1996 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by the Computer Systems 16 | * Engineering Group at Lawrence Berkeley Laboratory. 17 | * 4. Neither the name of the University nor of the Laboratory may be used 18 | * to endorse or promote products derived from this software without 19 | * specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | * 33 | * @(#) $Header: /tcpdump/master/libpcap/pcap-namedb.h,v 1.13 2006/10/04 18:13:32 guy Exp $ (LBL) 34 | */ 35 | 36 | /* 37 | * For backwards compatibility. 38 | * 39 | * Note to OS vendors: do NOT get rid of this file! Some applications 40 | * might expect to be able to include . 41 | */ 42 | #include 43 | -------------------------------------------------------------------------------- /include/contrib/pcap/windows/WpdPack/Include/pcap-stdinc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2002 - 2005 NetGroup, Politecnico di Torino (Italy) 3 | * Copyright (c) 2005 - 2009 CACE Technologies, Inc. Davis (California) 4 | * All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions 8 | * are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Politecnico di Torino nor the names of its 16 | * contributors may be used to endorse or promote products derived from 17 | * this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | * @(#) $Header: /tcpdump/master/libpcap/pcap-stdinc.h,v 1.10.2.1 2008-10-06 15:38:39 gianluca Exp $ (LBL) 32 | */ 33 | 34 | #define SIZEOF_CHAR 1 35 | #define SIZEOF_SHORT 2 36 | #define SIZEOF_INT 4 37 | #ifndef _MSC_EXTENSIONS 38 | #define SIZEOF_LONG_LONG 8 39 | #endif 40 | 41 | /* 42 | * Avoids a compiler warning in case this was already defined 43 | * (someone defined _WINSOCKAPI_ when including 'windows.h', in order 44 | * to prevent it from including 'winsock.h') 45 | */ 46 | #ifdef _WINSOCKAPI_ 47 | #undef _WINSOCKAPI_ 48 | #endif 49 | #include 50 | 51 | #include 52 | 53 | #include "bittypes.h" 54 | #include 55 | #include 56 | 57 | #ifndef __MINGW32__ 58 | #include "IP6_misc.h" 59 | #endif 60 | 61 | #define caddr_t char* 62 | 63 | #if _MSC_VER < 1500 64 | #define snprintf _snprintf 65 | #define vsnprintf _vsnprintf 66 | #define strdup _strdup 67 | #endif 68 | 69 | #define inline __inline 70 | 71 | #ifdef __MINGW32__ 72 | #include 73 | #else /*__MINGW32__*/ 74 | /* MSVC compiler */ 75 | #ifndef _UINTPTR_T_DEFINED 76 | #ifdef _WIN64 77 | typedef unsigned __int64 uintptr_t; 78 | #else 79 | typedef _W64 unsigned int uintptr_t; 80 | #endif 81 | #define _UINTPTR_T_DEFINED 82 | #endif 83 | 84 | #ifndef _INTPTR_T_DEFINED 85 | #ifdef _WIN64 86 | typedef __int64 intptr_t; 87 | #else 88 | typedef _W64 int intptr_t; 89 | #endif 90 | #define _INTPTR_T_DEFINED 91 | #endif 92 | 93 | #endif /*__MINGW32__*/ 94 | -------------------------------------------------------------------------------- /include/contrib/pcap/windows/WpdPack/Include/pcap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1993, 1994, 1995, 1996, 1997 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by the Computer Systems 16 | * Engineering Group at Lawrence Berkeley Laboratory. 17 | * 4. Neither the name of the University nor of the Laboratory may be used 18 | * to endorse or promote products derived from this software without 19 | * specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | * 33 | * @(#) $Header: /tcpdump/master/libpcap/pcap.h,v 1.59 2006/10/04 18:09:22 guy Exp $ (LBL) 34 | */ 35 | 36 | /* 37 | * For backwards compatibility. 38 | * 39 | * Note to OS vendors: do NOT get rid of this file! Many applications 40 | * expect to be able to include , and at least some of them 41 | * go through contortions in their configure scripts to try to detect 42 | * OSes that have "helpfully" moved pcap.h to without 43 | * leaving behind a file. 44 | */ 45 | #include 46 | -------------------------------------------------------------------------------- /include/contrib/pcap/windows/WpdPack/Include/pcap/bluetooth.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 Paolo Abeni (Italy) 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote 15 | * products derived from this software without specific prior written 16 | * permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | * 30 | * bluetooth data struct 31 | * By Paolo Abeni 32 | * 33 | * @(#) $Header: /tcpdump/master/libpcap/pcap/bluetooth.h,v 1.1 2007/09/22 02:10:17 guy Exp $ 34 | */ 35 | 36 | #ifndef _PCAP_BLUETOOTH_STRUCTS_H__ 37 | #define _PCAP_BLUETOOTH_STRUCTS_H__ 38 | 39 | /* 40 | * Header prepended libpcap to each bluetooth h:4 frame. 41 | * fields are in network byte order 42 | */ 43 | typedef struct _pcap_bluetooth_h4_header { 44 | u_int32_t direction; /* if first bit is set direction is incoming */ 45 | } pcap_bluetooth_h4_header; 46 | 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /include/contrib/pcap/windows/WpdPack/Include/pcap/namedb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1994, 1996 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by the Computer Systems 16 | * Engineering Group at Lawrence Berkeley Laboratory. 17 | * 4. Neither the name of the University nor of the Laboratory may be used 18 | * to endorse or promote products derived from this software without 19 | * specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | * 33 | * @(#) $Header: /tcpdump/master/libpcap/pcap/namedb.h,v 1.1 2006/10/04 18:09:22 guy Exp $ (LBL) 34 | */ 35 | 36 | #ifndef lib_pcap_namedb_h 37 | #define lib_pcap_namedb_h 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | /* 44 | * As returned by the pcap_next_etherent() 45 | * XXX this stuff doesn't belong in this interface, but this 46 | * library already must do name to address translation, so 47 | * on systems that don't have support for /etc/ethers, we 48 | * export these hooks since they'll 49 | */ 50 | struct pcap_etherent { 51 | u_char addr[6]; 52 | char name[122]; 53 | }; 54 | #ifndef PCAP_ETHERS_FILE 55 | #define PCAP_ETHERS_FILE "/etc/ethers" 56 | #endif 57 | struct pcap_etherent *pcap_next_etherent(FILE *); 58 | u_char *pcap_ether_hostton(const char*); 59 | u_char *pcap_ether_aton(const char *); 60 | 61 | bpf_u_int32 **pcap_nametoaddr(const char *); 62 | #ifdef INET6 63 | struct addrinfo *pcap_nametoaddrinfo(const char *); 64 | #endif 65 | bpf_u_int32 pcap_nametonetaddr(const char *); 66 | 67 | int pcap_nametoport(const char *, int *, int *); 68 | int pcap_nametoportrange(const char *, int *, int *, int *); 69 | int pcap_nametoproto(const char *); 70 | int pcap_nametoeproto(const char *); 71 | int pcap_nametollc(const char *); 72 | /* 73 | * If a protocol is unknown, PROTO_UNDEF is returned. 74 | * Also, pcap_nametoport() returns the protocol along with the port number. 75 | * If there are ambiguous entried in /etc/services (i.e. domain 76 | * can be either tcp or udp) PROTO_UNDEF is returned. 77 | */ 78 | #define PROTO_UNDEF -1 79 | 80 | /* XXX move these to pcap-int.h? */ 81 | int __pcap_atodn(const char *, bpf_u_int32 *); 82 | int __pcap_atoin(const char *, bpf_u_int32 *); 83 | u_short __pcap_nametodnaddr(const char *); 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /include/contrib/pcap/windows/WpdPack/Include/pcap/usb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2006 Paolo Abeni (Italy) 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 3. The name of the author may not be used to endorse or promote 15 | * products derived from this software without specific prior written 16 | * permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | * 30 | * Basic USB data struct 31 | * By Paolo Abeni 32 | * 33 | * @(#) $Header: /tcpdump/master/libpcap/pcap/usb.h,v 1.6 2007/09/22 02:06:08 guy Exp $ 34 | */ 35 | 36 | #ifndef _PCAP_USB_STRUCTS_H__ 37 | #define _PCAP_USB_STRUCTS_H__ 38 | 39 | /* 40 | * possible transfer mode 41 | */ 42 | #define URB_TRANSFER_IN 0x80 43 | #define URB_ISOCHRONOUS 0x0 44 | #define URB_INTERRUPT 0x1 45 | #define URB_CONTROL 0x2 46 | #define URB_BULK 0x3 47 | 48 | /* 49 | * possible event type 50 | */ 51 | #define URB_SUBMIT 'S' 52 | #define URB_COMPLETE 'C' 53 | #define URB_ERROR 'E' 54 | 55 | /* 56 | * USB setup header as defined in USB specification. 57 | * Appears at the front of each packet in DLT_USB captures. 58 | */ 59 | typedef struct _usb_setup { 60 | u_int8_t bmRequestType; 61 | u_int8_t bRequest; 62 | u_int16_t wValue; 63 | u_int16_t wIndex; 64 | u_int16_t wLength; 65 | } pcap_usb_setup; 66 | 67 | 68 | /* 69 | * Header prepended by linux kernel to each event. 70 | * Appears at the front of each packet in DLT_USB_LINUX captures. 71 | */ 72 | typedef struct _usb_header { 73 | u_int64_t id; 74 | u_int8_t event_type; 75 | u_int8_t transfer_type; 76 | u_int8_t endpoint_number; 77 | u_int8_t device_address; 78 | u_int16_t bus_id; 79 | char setup_flag;/*if !=0 the urb setup header is not present*/ 80 | char data_flag; /*if !=0 no urb data is present*/ 81 | int64_t ts_sec; 82 | int32_t ts_usec; 83 | int32_t status; 84 | u_int32_t urb_len; 85 | u_int32_t data_len; /* amount of urb data really present in this event*/ 86 | pcap_usb_setup setup; 87 | } pcap_usb_header; 88 | 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /include/contrib/pcap/windows/WpdPack/Include/pcap/vlan.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. All advertising materials mentioning features or use of this software 14 | * must display the following acknowledgement: 15 | * This product includes software developed by the University of 16 | * California, Berkeley and its contributors. 17 | * 4. Neither the name of the University nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | * 33 | * @(#) $Header: /tcpdump/master/libpcap/pcap/vlan.h,v 1.1.2.2 2008-08-06 07:45:59 guy Exp $ 34 | */ 35 | 36 | #ifndef lib_pcap_vlan_h 37 | #define lib_pcap_vlan_h 38 | 39 | struct vlan_tag { 40 | u_int16_t vlan_tpid; /* ETH_P_8021Q */ 41 | u_int16_t vlan_tci; /* VLAN TCI */ 42 | }; 43 | 44 | #define VLAN_TAG_LEN 4 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /include/contrib/pcap/windows/WpdPack/Lib/Packet.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/include/contrib/pcap/windows/WpdPack/Lib/Packet.lib -------------------------------------------------------------------------------- /include/contrib/pcap/windows/WpdPack/Lib/libpacket.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/include/contrib/pcap/windows/WpdPack/Lib/libpacket.a -------------------------------------------------------------------------------- /include/contrib/pcap/windows/WpdPack/Lib/libwpcap.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/include/contrib/pcap/windows/WpdPack/Lib/libwpcap.a -------------------------------------------------------------------------------- /include/contrib/pcap/windows/WpdPack/Lib/wpcap.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/include/contrib/pcap/windows/WpdPack/Lib/wpcap.lib -------------------------------------------------------------------------------- /include/contrib/pcap/windows/WpdPack/Lib/x64/Packet.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/include/contrib/pcap/windows/WpdPack/Lib/x64/Packet.lib -------------------------------------------------------------------------------- /include/contrib/pcap/windows/WpdPack/Lib/x64/wpcap.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/include/contrib/pcap/windows/WpdPack/Lib/x64/wpcap.lib -------------------------------------------------------------------------------- /include/contrib/socketwrapper/readme.md: -------------------------------------------------------------------------------- 1 | Socket wrapper for SDO/UDP 2 | ========================== 3 | 4 | ## Introduction 5 | 6 | The SDO over UDP capability requires IP/UDP supported by the target platform. 7 | On OS platforms (e.g. Linux) a socket is created for the POWERLINK node's UDP 8 | connection. Other platforms, which have no socket interface support, the socket 9 | wrapper is used for interfacing to customized IP or similar protocol stacks. 10 | 11 | ## Requirements 12 | 13 | If there is no SDO/UDP target-specific implementation available for your target 14 | platform, it is recommended to use the socket wrapper interface. 15 | 16 | In the following sections the functions to be implemented for the target platform 17 | are discussed. 18 | 19 | ### Create 20 | 21 | The `socketwrapper_create` function is called by the SDO/UDP module to create 22 | the socket wrapper instance. The caller provides the socket receive callback 23 | function pointer, which is called if a frame is received from the socket. 24 | The function must return a pointer to the successfully created socket wrapper 25 | instance, otherwise `SOCKETWRAPPER_INVALID` has to be returned. 26 | 27 | ### Bind 28 | 29 | The `socketwrapper_bind` function configures the created socket wrapper by setting 30 | the local IP address and port. 31 | If the function fails, it shall return `kErrorSdoUdpNoSocket`. 32 | 33 | ### Close 34 | 35 | The `socketwrapper_close` function is called to close the connection. Any frame 36 | that is still received after closing shall be dropped, also frame transmissions 37 | with `socketwrapper_send` shall be rejected. 38 | If the function fails, it shall return `kErrorSdoUdpSocketError`. 39 | 40 | ### Send 41 | 42 | The `socketwrapper_send` function is used to transmit a packet to the UDP connection. 43 | The caller must specify the remote IP address and port with using `pRemote_p`. 44 | The arguments `pData_p` and `dataSize_p` reflect the UDP payload only. 45 | If the function fails, it shall return `kErrorSdoUdpSendError`. 46 | 47 | ### Critical section 48 | 49 | The `sdoudp_criticalSection` function is required to be implemented if the 50 | receive callback is called from a different thread context. Otherwise, the 51 | function can be left empty. 52 | 53 | ### ARP query 54 | 55 | The `socketwrapper_arpQuery` function is called when a new SDO connection is 56 | initialized. The SDO UDP module provides the remote IP address (`remoteIpAddress_p`) 57 | for the SDO connection. This enables triggering ARP to obtain the remote node's 58 | Ethernet address. The function shall return `kErrorSdoUdpArpInProgress` to 59 | signalize the pending ARP progress. If the remote node's Ethernet address is 60 | already known, the function shall return with `kErrorOk`. 61 | 62 | ### Receive callback 63 | 64 | The socket receive callback `receiveFromSocket` (`sdoudp-socketwrapper.c`) shall 65 | be called when a frame is received from the network that matches the binding 66 | configurations (IP address and port). The arguments `pData_p` and `dataSize_p` 67 | reflect the UDP payload of the received frame. The `pRemote_p` argument gives the 68 | remote IP address and port. 69 | -------------------------------------------------------------------------------- /include/contrib/trace/trace-c5socarm.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * 3 | * Copyright 2014 Altera Corporation. All Rights Reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, 12 | * this list of conditions and the following disclaimer in the documentation 13 | * and/or other materials provided with the distribution. 14 | * 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY EXPRESS OR 19 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO 21 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | ******************************************************************************/ 30 | 31 | /* 32 | * This file contains minimal IO support to make printf work over UART 33 | * The code relies on the Preloader to set the UART module including baud rate 34 | */ 35 | 36 | #include 37 | #include 38 | 39 | #include "socal/alt_uart.h" 40 | #include "socal/hps.h" 41 | #include "socal/socal.h" 42 | 43 | #ifndef NDEBUG 44 | #define STDOUT_FILENO 1 45 | #define STDERR_FILENO 2 46 | 47 | int _close(int file) 48 | { 49 | /* Succeeds only for STDOUT */ 50 | return ((file == STDOUT_FILENO) || (file == STDERR_FILENO)) ? 0 : -1; 51 | } 52 | 53 | int _fstat(int file, void *st) 54 | { 55 | /* Succeeds only for STDOUT */ 56 | return ((file == STDOUT_FILENO) || (file == STDERR_FILENO)) ? 0 : -1; 57 | } 58 | 59 | int _isatty(int file) 60 | { 61 | /* Succeeds only for STDOUT */ 62 | return ((file == STDOUT_FILENO) || (file == STDERR_FILENO)) ? 1 : -1; 63 | } 64 | 65 | off_t _lseek(int file, off_t ptr, int dir) 66 | { 67 | /* Succeeds only for STDOUT */ 68 | return ((file == STDOUT_FILENO) || (file == STDERR_FILENO)) ? 0 : -1; 69 | } 70 | 71 | int _read(int file, void* ptr, size_t len) 72 | { 73 | /* Always fails */ 74 | return -1; 75 | } 76 | 77 | int _write(int file, char* ptr, unsigned len, int flag) 78 | { 79 | /* Fails if not STDOUT */ 80 | if ((file != STDOUT_FILENO) && (file != STDERR_FILENO)) 81 | { 82 | return -1; 83 | } 84 | 85 | /* Print each character to UART */ 86 | for (int i = 0; i < len; i++) 87 | { 88 | /* Wait until THR is empty*/ 89 | while (1 != ALT_UART_LSR_THRE_GET(alt_read_word(ALT_UART0_LSR_ADDR))); 90 | 91 | /* Write character to THR */ 92 | alt_write_word(ALT_UART0_RBR_THR_DLL_ADDR, ptr[i]); 93 | } 94 | 95 | /* All printed fine */ 96 | return len; 97 | } 98 | 99 | #endif 100 | -------------------------------------------------------------------------------- /include/contrib/trace/trace-printf.c: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file trace-printf.c 4 | 5 | \brief Trace function using fprintf to stderr 6 | 7 | *******************************************************************************/ 8 | 9 | /*------------------------------------------------------------------------------ 10 | Copyright (c) 2017, B&R Industrial Automation GmbH 11 | Copyright (c) 2013, SYSTEC electronik GmbH 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without 15 | modification, are permitted provided that the following conditions are met: 16 | * Redistributions of source code must retain the above copyright 17 | notice, this list of conditions and the following disclaimer. 18 | * Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | * Neither the name of the copyright holders nor the 22 | names of its contributors may be used to endorse or promote products 23 | derived from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 26 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 29 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 30 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 32 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 34 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ------------------------------------------------------------------------------*/ 36 | 37 | //------------------------------------------------------------------------------ 38 | // includes 39 | //------------------------------------------------------------------------------ 40 | #include 41 | #include 42 | #include 43 | 44 | //============================================================================// 45 | // P U B L I C F U N C T I O N S // 46 | //============================================================================// 47 | 48 | #ifndef NDEBUG 49 | //------------------------------------------------------------------------------ 50 | /** 51 | \brief Print debug trace message 52 | 53 | The function prints a debug trace message using standard printf 54 | 55 | \param[in] fmt Format string 56 | \param[in] ... Arguments to print 57 | */ 58 | //------------------------------------------------------------------------------ 59 | void trace(const char* fmt, ...) 60 | { 61 | va_list argptr; 62 | 63 | va_start(argptr, fmt); 64 | vfprintf(stderr, fmt, argptr); 65 | va_end(argptr); 66 | } 67 | #endif 68 | -------------------------------------------------------------------------------- /include/contrib/trace/trace-printk.c: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file trace-printk.c 4 | 5 | \brief Trace function using Linux kernel printk 6 | 7 | *******************************************************************************/ 8 | 9 | /*------------------------------------------------------------------------------ 10 | Copyright (c) 2017, B&R Industrial Automation GmbH 11 | Copyright (c) 2013, SYSTEC electronik GmbH 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without 15 | modification, are permitted provided that the following conditions are met: 16 | * Redistributions of source code must retain the above copyright 17 | notice, this list of conditions and the following disclaimer. 18 | * Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | * Neither the name of the copyright holders nor the 22 | names of its contributors may be used to endorse or promote products 23 | derived from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 26 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 29 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 30 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 32 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 34 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ------------------------------------------------------------------------------*/ 36 | 37 | //------------------------------------------------------------------------------ 38 | // includes 39 | //------------------------------------------------------------------------------ 40 | #include 41 | #include 42 | 43 | #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,36)) 44 | #include 45 | #endif 46 | 47 | #include 48 | 49 | //============================================================================// 50 | // P U B L I C F U N C T I O N S // 51 | //============================================================================// 52 | 53 | #ifndef NDEBUG 54 | //------------------------------------------------------------------------------ 55 | /** 56 | \brief Print debug trace message 57 | 58 | The function prints a debug trace message using standard printk 59 | 60 | \param[in] fmt Format string 61 | \param[in] ... Arguments to print 62 | */ 63 | //------------------------------------------------------------------------------ 64 | void trace(const char* fmt, ...) 65 | { 66 | va_list argptr; 67 | 68 | va_start(argptr, fmt); 69 | vprintk(fmt, argptr); 70 | va_end(argptr); 71 | } 72 | #endif -------------------------------------------------------------------------------- /include/contrib/trace/trace.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file trace.h 4 | 5 | \brief Definitions for trace 6 | 7 | This file contains definitions for the trace function. 8 | *******************************************************************************/ 9 | 10 | /*------------------------------------------------------------------------------ 11 | Copyright (c) 2016, B&R Industrial Automation GmbH 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without 15 | modification, are permitted provided that the following conditions are met: 16 | * Redistributions of source code must retain the above copyright 17 | notice, this list of conditions and the following disclaimer. 18 | * Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | * Neither the name of the copyright holders nor the 22 | names of its contributors may be used to endorse or promote products 23 | derived from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 26 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 29 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 30 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 32 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 34 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ------------------------------------------------------------------------------*/ 36 | #ifndef _INC_trace_H_ 37 | #define _INC_trace_H_ 38 | 39 | #ifndef NDEBUG 40 | #define TRACE(...) trace(__VA_ARGS__) 41 | #else 42 | #define TRACE(...) 43 | #endif 44 | 45 | //------------------------------------------------------------------------------ 46 | // function prototypes 47 | //------------------------------------------------------------------------------ 48 | #ifdef __cplusplus 49 | extern "C" { 50 | #endif 51 | 52 | #ifndef NDEBUG 53 | void trace(const char* fmt, ...); 54 | #endif 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* _INC_trace_H_ */ 61 | -------------------------------------------------------------------------------- /include/kernel/eventk.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file kernel/eventk.h 4 | 5 | \brief Definitions of the kernel event CAL module 6 | 7 | This file contains definitions for the kernel CAL module. 8 | 9 | *******************************************************************************/ 10 | 11 | /*------------------------------------------------------------------------------ 12 | Copyright (c) 2012, SYSTEC electronic GmbH 13 | Copyright (c) 2016, B&R Industrial Automation GmbH 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | * Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | * Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ------------------------------------------------------------------------------*/ 38 | #ifndef _INC_kernel_eventk_H_ 39 | #define _INC_kernel_eventk_H_ 40 | 41 | //------------------------------------------------------------------------------ 42 | // includes 43 | //------------------------------------------------------------------------------ 44 | #include 45 | #include 46 | 47 | //------------------------------------------------------------------------------ 48 | // const defines 49 | //------------------------------------------------------------------------------ 50 | 51 | //------------------------------------------------------------------------------ 52 | // typedef 53 | //------------------------------------------------------------------------------ 54 | 55 | //------------------------------------------------------------------------------ 56 | // function prototypes 57 | //------------------------------------------------------------------------------ 58 | #ifdef __cplusplus 59 | extern "C" 60 | { 61 | #endif 62 | 63 | tOplkError eventk_init(void); 64 | tOplkError eventk_exit(void); 65 | tOplkError eventk_process(const tEvent* pEvent_p) SECTION_EVENTK_PROCESS; 66 | tOplkError eventk_postEvent(const tEvent* pEvent_p) SECTION_EVENTK_POST; 67 | tOplkError eventk_postError(tEventSource eventSource_p, 68 | tOplkError oplkError_p, 69 | UINT argSize_p, 70 | const void* pArg_p); 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif /* _INC_kernel_eventk_H_ */ 77 | -------------------------------------------------------------------------------- /include/kernel/nmtk.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file kernel/nmtk.h 4 | 5 | \brief Definitions for NMT kernel module 6 | 7 | This file contains the definitions for the NMT kernel module. 8 | 9 | *******************************************************************************/ 10 | 11 | /*------------------------------------------------------------------------------ 12 | Copyright (c) 2013, SYSTEC electronic GmbH 13 | Copyright (c) 2016, B&R Industrial Automation GmbH 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | * Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | * Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ------------------------------------------------------------------------------*/ 38 | #ifndef _INC_kernel_nmtk_H_ 39 | #define _INC_kernel_nmtk_H_ 40 | 41 | //------------------------------------------------------------------------------ 42 | // includes 43 | //------------------------------------------------------------------------------ 44 | #include 45 | #include 46 | 47 | //------------------------------------------------------------------------------ 48 | // const defines 49 | //------------------------------------------------------------------------------ 50 | 51 | //------------------------------------------------------------------------------ 52 | // typedef 53 | //------------------------------------------------------------------------------ 54 | 55 | //------------------------------------------------------------------------------ 56 | // function prototypes 57 | //------------------------------------------------------------------------------ 58 | #ifdef __cplusplus 59 | extern "C" 60 | { 61 | #endif 62 | 63 | tOplkError nmtk_init(void); 64 | tOplkError nmtk_exit(void); 65 | tOplkError nmtk_process(const tEvent* pEvent_p); 66 | 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | 71 | #endif /* _INC_kernel_nmtk_H_ */ 72 | -------------------------------------------------------------------------------- /include/kernel/pdok.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file kernel/pdok.h 4 | 5 | \brief Include file for kernel PDO module 6 | 7 | *******************************************************************************/ 8 | 9 | /*------------------------------------------------------------------------------ 10 | Copyright (c) 2012, SYSTEC electronic GmbH 11 | Copyright (c) 2016, B&R Industrial Automation GmbH 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without 15 | modification, are permitted provided that the following conditions are met: 16 | * Redistributions of source code must retain the above copyright 17 | notice, this list of conditions and the following disclaimer. 18 | * Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | * Neither the name of the copyright holders nor the 22 | names of its contributors may be used to endorse or promote products 23 | derived from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 26 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 29 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 30 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 32 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 34 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ------------------------------------------------------------------------------*/ 36 | #ifndef _INC_kernel_pdok_H_ 37 | #define _INC_kernel_pdok_H_ 38 | 39 | //--------------------------------------------------------------------------- 40 | // includes 41 | //--------------------------------------------------------------------------- 42 | #include 43 | #include 44 | #include 45 | 46 | //--------------------------------------------------------------------------- 47 | // const defines 48 | //--------------------------------------------------------------------------- 49 | 50 | 51 | //--------------------------------------------------------------------------- 52 | // typedef 53 | //--------------------------------------------------------------------------- 54 | 55 | 56 | //--------------------------------------------------------------------------- 57 | // function prototypes 58 | //--------------------------------------------------------------------------- 59 | #ifdef __cplusplus 60 | extern "C" 61 | { 62 | #endif 63 | 64 | tOplkError pdok_processRxPdo(const tPlkFrame* pFrame_p, UINT frameSize_p) SECTION_PDOK_PROCESS_RPDO; 65 | tOplkError pdok_init(void); 66 | tOplkError pdok_exit(void); 67 | tOplkError pdok_deAllocChannelMem(void); 68 | tOplkError pdok_allocChannelMem(const tPdoAllocationParam* pAllocationParam_p); 69 | tOplkError pdok_configureChannel(const tPdoChannelConf* pChannelConf_p); 70 | tOplkError pdok_setupPdoBuffers(size_t rxPdoMemSize_p, size_t txPdoMemSize_p); 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif /* _INC_kernel_pdok_H_ */ 77 | -------------------------------------------------------------------------------- /include/kernel/timestamp.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file kernel/timestamp.h 4 | 5 | \brief Definitions for timestamp handling 6 | 7 | This file contains the definitions for timestamp handling. 8 | 9 | *******************************************************************************/ 10 | 11 | /*------------------------------------------------------------------------------ 12 | Copyright (c) 2013, SYSTEC electronic GmbH 13 | Copyright (c) 2016, B&R Industrial Automation GmbH 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | * Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | * Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ------------------------------------------------------------------------------*/ 38 | #ifndef _INC_kernel_timestamp_H_ 39 | #define _INC_kernel_timestamp_H_ 40 | 41 | //------------------------------------------------------------------------------ 42 | // includes 43 | //------------------------------------------------------------------------------ 44 | #include 45 | 46 | //------------------------------------------------------------------------------ 47 | // const defines 48 | //------------------------------------------------------------------------------ 49 | 50 | //------------------------------------------------------------------------------ 51 | // typedef 52 | //------------------------------------------------------------------------------ 53 | 54 | //------------------------------------------------------------------------------ 55 | // function prototypes 56 | //------------------------------------------------------------------------------ 57 | #ifdef __cplusplus 58 | extern "C" 59 | { 60 | #endif 61 | 62 | UINT32 timestamp_calcTimeDiff(const tTimestamp* pTimeStampPrevious_p, 63 | const tTimestamp* pTimeStampCurrent_p); 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* _INC_kernel_timestamp_H_ */ 70 | -------------------------------------------------------------------------------- /include/kernel/timesynckcal.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file kernel/timesynckcal.h 4 | 5 | \brief Include file for kernel timesync CAL module 6 | 7 | *******************************************************************************/ 8 | 9 | /*------------------------------------------------------------------------------ 10 | Copyright (c) 2016, B&R Industrial Automation GmbH 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | * Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | * Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 25 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | ------------------------------------------------------------------------------*/ 35 | #ifndef _INC_kernel_timesynckcal_H_ 36 | #define _INC_kernel_timesynckcal_H_ 37 | 38 | //------------------------------------------------------------------------------ 39 | // includes 40 | //------------------------------------------------------------------------------ 41 | #include 42 | #include 43 | 44 | //------------------------------------------------------------------------------ 45 | // const defines 46 | //------------------------------------------------------------------------------ 47 | 48 | //------------------------------------------------------------------------------ 49 | // typedef 50 | //------------------------------------------------------------------------------ 51 | 52 | //------------------------------------------------------------------------------ 53 | // function prototypes 54 | //------------------------------------------------------------------------------ 55 | #ifdef __cplusplus 56 | extern "C" 57 | { 58 | #endif 59 | 60 | tOplkError timesynckcal_init(void); 61 | void timesynckcal_exit(void); 62 | tOplkError timesynckcal_controlSync(BOOL fEnable_p); 63 | tOplkError timesynckcal_sendSyncEvent(void); 64 | 65 | #if (((TARGET_SYSTEM == _LINUX_) && defined(__KERNEL__)) || \ 66 | ((TARGET_SYSTEM == _WIN32_) && defined(_KERNEL_MODE))) 67 | tOplkError timesynckcal_waitSyncEvent(void); 68 | #endif 69 | 70 | #if defined(CONFIG_INCLUDE_SOC_TIME_FORWARD) 71 | tTimesyncSharedMemory* timesynckcal_getSharedMemory(void); 72 | #endif /* defined(CONFIG_INCLUDE_SOC_TIME_FORWARD) */ 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif /* _INC_kernel_timesynckcal_H_ */ 79 | -------------------------------------------------------------------------------- /include/kernel/veth.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file kernel/veth.h 4 | 5 | \brief Definitions for virtual Ethernet module 6 | 7 | This file contains the definitions for the virtual Ethernet module. 8 | 9 | *******************************************************************************/ 10 | 11 | /*------------------------------------------------------------------------------ 12 | Copyright (c) 2013, SYSTEC electronic GmbH 13 | Copyright (c) 2016, B&R Industrial Automation GmbH 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | * Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | * Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ------------------------------------------------------------------------------*/ 38 | #ifndef _INC_kernel_veth_H_ 39 | #define _INC_kernel_veth_H_ 40 | 41 | //------------------------------------------------------------------------------ 42 | // includes 43 | //------------------------------------------------------------------------------ 44 | #include 45 | 46 | //------------------------------------------------------------------------------ 47 | // const defines 48 | //------------------------------------------------------------------------------ 49 | 50 | //------------------------------------------------------------------------------ 51 | // typedef 52 | //------------------------------------------------------------------------------ 53 | 54 | //------------------------------------------------------------------------------ 55 | // function prototypes 56 | //------------------------------------------------------------------------------ 57 | #ifdef __cplusplus 58 | extern "C" 59 | { 60 | #endif 61 | 62 | tOplkError veth_init(const UINT8 aSrcMac_p[6]); 63 | tOplkError veth_exit(void); 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* _INC_kernel_veth_H_ */ 70 | -------------------------------------------------------------------------------- /include/oplk/cfm.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file oplk/cfm.h 4 | 5 | \brief General include file for configuration file manager (CFM) 6 | 7 | This file contains global definitions for the CFM module. 8 | *******************************************************************************/ 9 | 10 | /*------------------------------------------------------------------------------ 11 | Copyright (c) 2017, B&R Industrial Automation GmbH 12 | Copyright (c) 2013, SYSTEC electronic GmbH 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | * Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | * Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 27 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | ------------------------------------------------------------------------------*/ 37 | #ifndef _INC_oplk_cfm_H_ 38 | #define _INC_oplk_cfm_H_ 39 | 40 | //------------------------------------------------------------------------------ 41 | // includes 42 | //------------------------------------------------------------------------------ 43 | #include "oplkinc.h" 44 | 45 | //------------------------------------------------------------------------------ 46 | // const defines 47 | //------------------------------------------------------------------------------ 48 | 49 | //------------------------------------------------------------------------------ 50 | // typedef 51 | //------------------------------------------------------------------------------ 52 | 53 | /** 54 | * \brief Structure for CFM CN progress event 55 | * 56 | * This structure contains all information of the CFMs CN progress event. 57 | */ 58 | typedef struct 59 | { 60 | UINT nodeId; ///< Node ID of the CN 61 | UINT objectIndex; ///< Index of object to be written 62 | UINT objectSubIndex; ///< Subindex of object to be written 63 | UINT32 sdoAbortCode; ///< SDO abort code 64 | tOplkError error; ///< Error which occurred 65 | size_t totalNumberOfBytes; ///< Total number of bytes to transfer 66 | size_t bytesDownloaded; ///< Number of already downloaded bytes 67 | } tCfmEventCnProgress; 68 | 69 | #endif /* _INC_oplk_cfm_H_ */ 70 | -------------------------------------------------------------------------------- /include/oplk/obdcdc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file oplk/obdcdc.h 4 | 5 | \brief Definitions for OBD CDC module 6 | 7 | This file contains definitions for the OBD CDC module 8 | *******************************************************************************/ 9 | 10 | /*------------------------------------------------------------------------------ 11 | Copyright (c) 2016, B&R Industrial Automation GmbH 12 | Copyright (c) 2013, SYSTEC electronic GmbH 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | * Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | * Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 27 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | ------------------------------------------------------------------------------*/ 37 | #ifndef _INC_oplk_obdcdc_H_ 38 | #define _INC_oplk_obdcdc_H_ 39 | 40 | //------------------------------------------------------------------------------ 41 | // includes 42 | //------------------------------------------------------------------------------ 43 | #include 44 | 45 | //------------------------------------------------------------------------------ 46 | // const defines 47 | //------------------------------------------------------------------------------ 48 | 49 | //------------------------------------------------------------------------------ 50 | // typedef 51 | //------------------------------------------------------------------------------ 52 | 53 | //------------------------------------------------------------------------------ 54 | // function prototypes 55 | //------------------------------------------------------------------------------ 56 | #ifdef __cplusplus 57 | extern "C" 58 | { 59 | #endif 60 | 61 | tOplkError obdcdc_init(void); 62 | void obdcdc_exit(void); 63 | void obdcdc_setFilename(const char* pCdcFilename_p); 64 | void obdcdc_setBuffer(const void* pCdc_p, size_t cdcSize_p); 65 | tOplkError obdcdc_loadCdc(void); 66 | 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | 71 | #endif /* _INC_oplk_obdcdc_H_ */ 72 | -------------------------------------------------------------------------------- /include/oplk/version.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file oplk/version.h 4 | 5 | \brief openPOWERLINK version definitions 6 | 7 | The file contains definitions describing the openPOWERLINK version. 8 | *******************************************************************************/ 9 | 10 | /*------------------------------------------------------------------------------ 11 | Copyright (c) 2017, B&R Industrial Automation GmbH 12 | Copyright (c) 2013, SYSTEC electronic GmbH 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | * Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | * Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 27 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | ------------------------------------------------------------------------------*/ 37 | #ifndef _INC_oplk_version_H_ 38 | #define _INC_oplk_version_H_ 39 | 40 | //------------------------------------------------------------------------------ 41 | // includes 42 | //------------------------------------------------------------------------------ 43 | 44 | // NOTE: 45 | // All version macros should contain the same version number. But do not use 46 | // defines instead of the numbers. Because the macro PLK_STRING_VERSION() can not 47 | // convert a define to a string. In case of a release candidate (rc) version 48 | // the PLK_STRING_VERSION() must be replaced with PLK_STRING_VERSION_RC() in order 49 | // to add the "-rc" suffix. 50 | // 51 | // Format: maj.min.build-rc 52 | // maj = major version 53 | // min = minor version (will be set to 0 if major version will be incremented) 54 | // build = current build (will be set to 0 if minor version will be incremented) 55 | // rc = release candidate (will be set to 0 if final version created) 56 | // 57 | #define PLK_DEFINED_STACK_VERSION PLK_STACK_VERSION (2, 7, 1, 0) 58 | #define PLK_DEFINED_OBJ1018_VERSION PLK_OBJ1018_VERSION (2, 7, 1, 0) 59 | #define PLK_DEFINED_STRING_VERSION PLK_STRING_VERSION (2, 7, 1, 0) 60 | 61 | #endif /* _INC_oplk_version_H_ */ 62 | -------------------------------------------------------------------------------- /include/user/errhndu.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file user/errhndu.h 4 | 5 | \brief interface definitions for user error handler module 6 | 7 | This file provides the interface for the user error handler module. 8 | 9 | *******************************************************************************/ 10 | 11 | /*------------------------------------------------------------------------------ 12 | Copyright (c) 2016, B&R Industrial Automation GmbH 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | * Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | * Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 27 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | ------------------------------------------------------------------------------*/ 37 | #ifndef _INC_user_errhndu_H_ 38 | #define _INC_user_errhndu_H_ 39 | 40 | //------------------------------------------------------------------------------ 41 | // includes 42 | //------------------------------------------------------------------------------ 43 | #include 44 | #include 45 | #include 46 | 47 | //------------------------------------------------------------------------------ 48 | // const defines 49 | //------------------------------------------------------------------------------ 50 | 51 | //------------------------------------------------------------------------------ 52 | // typedef 53 | //------------------------------------------------------------------------------ 54 | 55 | //------------------------------------------------------------------------------ 56 | // function prototypes 57 | //------------------------------------------------------------------------------ 58 | #ifdef __cplusplus 59 | extern "C" 60 | { 61 | #endif 62 | 63 | // init function 64 | tOplkError errhndu_init(void); 65 | 66 | // delete instance 67 | tOplkError errhndu_exit(void); 68 | 69 | // object callback functions 70 | tOplkError errhndu_cbObdAccess(const tObdCbParam* pParam_p); 71 | tOplkError errhndu_mnCnLossPresCbObdAccess(const tObdCbParam* pParam_p); 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif /* _INC_user_errhndu_H_ */ 78 | -------------------------------------------------------------------------------- /include/user/eventucal.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file user/eventucal.h 4 | 5 | \brief Include file for user event CAL module 6 | 7 | This file contains definitions for the user event CAL module. The user event 8 | CAL builds the interface between the user event and the event queue 9 | implementations. 10 | 11 | *******************************************************************************/ 12 | 13 | /*------------------------------------------------------------------------------ 14 | Copyright (c) 2012, SYSTEC electronic GmbH 15 | Copyright (c) 2016, B&R Industrial Automation GmbH 16 | All rights reserved. 17 | 18 | Redistribution and use in source and binary forms, with or without 19 | modification, are permitted provided that the following conditions are met: 20 | * Redistributions of source code must retain the above copyright 21 | notice, this list of conditions and the following disclaimer. 22 | * Redistributions in binary form must reproduce the above copyright 23 | notice, this list of conditions and the following disclaimer in the 24 | documentation and/or other materials provided with the distribution. 25 | * Neither the name of the copyright holders nor the 26 | names of its contributors may be used to endorse or promote products 27 | derived from this software without specific prior written permission. 28 | 29 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 30 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 31 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 32 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 33 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 34 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 35 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 36 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | ------------------------------------------------------------------------------*/ 40 | #ifndef _INC_user_eventucal_H_ 41 | #define _INC_user_eventucal_H_ 42 | 43 | //------------------------------------------------------------------------------ 44 | // includes 45 | //------------------------------------------------------------------------------ 46 | #include 47 | #include 48 | 49 | //------------------------------------------------------------------------------ 50 | // const defines 51 | //------------------------------------------------------------------------------ 52 | 53 | //------------------------------------------------------------------------------ 54 | // typedef 55 | //------------------------------------------------------------------------------ 56 | 57 | //------------------------------------------------------------------------------ 58 | // function prototypes 59 | //------------------------------------------------------------------------------ 60 | #ifdef __cplusplus 61 | extern "C" 62 | { 63 | #endif 64 | 65 | tOplkError eventucal_init(void); 66 | tOplkError eventucal_exit(void); 67 | tOplkError eventucal_postKernelEvent(const tEvent* pEvent_p); 68 | tOplkError eventucal_postUserEvent(const tEvent* pEvent_p); 69 | void eventucal_process(void); 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif /* _INC_user_eventucal_H_ */ 76 | -------------------------------------------------------------------------------- /include/user/identu.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file user/identu.h 4 | 5 | \brief Definitions for identu module 6 | 7 | This file contains the definitions for the identu modules. 8 | 9 | *******************************************************************************/ 10 | 11 | /*------------------------------------------------------------------------------ 12 | Copyright (c) 2012, SYSTEC electronic GmbH 13 | Copyright (c) 2016, B&R Industrial Automation GmbH 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | * Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | * Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ------------------------------------------------------------------------------*/ 38 | #ifndef _INC_user_identu_H_ 39 | #define _INC_user_identu_H_ 40 | 41 | //------------------------------------------------------------------------------ 42 | // includes 43 | //------------------------------------------------------------------------------ 44 | #include 45 | #include 46 | 47 | //------------------------------------------------------------------------------ 48 | // const defines 49 | //------------------------------------------------------------------------------ 50 | 51 | //------------------------------------------------------------------------------ 52 | // typedef 53 | //------------------------------------------------------------------------------ 54 | typedef tOplkError (*tIdentuCbResponse)(UINT nodeId_p, 55 | const tIdentResponse* pIdentResponse_p); 56 | 57 | //------------------------------------------------------------------------------ 58 | // function prototypes 59 | //------------------------------------------------------------------------------ 60 | #ifdef __cplusplus 61 | extern "C" 62 | { 63 | #endif 64 | 65 | tOplkError identu_init(void); 66 | tOplkError identu_exit(void); 67 | tOplkError identu_reset(void); 68 | tOplkError identu_getIdentResponse(UINT nodeId_p, 69 | const tIdentResponse** ppIdentResponse_p); 70 | tOplkError identu_requestIdentResponse(UINT nodeId_p, 71 | tIdentuCbResponse pfnCbResponse_p); 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif /* _INC_user_identu_H_ */ 78 | -------------------------------------------------------------------------------- /include/user/nmtcnu.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file user/nmtcnu.h 4 | 5 | \brief Definitions for nmtcnu module 6 | 7 | This file contains the definitions for the nmtcnu module. 8 | 9 | *******************************************************************************/ 10 | 11 | /*------------------------------------------------------------------------------ 12 | Copyright (c) 2013, SYSTEC electronic GmbH 13 | Copyright (c) 2016, B&R Industrial Automation GmbH 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | * Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | * Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ------------------------------------------------------------------------------*/ 38 | #ifndef _INC_user_nmtcnu_H_ 39 | #define _INC_user_nmtcnu_H_ 40 | 41 | //------------------------------------------------------------------------------ 42 | // includes 43 | //------------------------------------------------------------------------------ 44 | #include 45 | #include 46 | #include 47 | 48 | //------------------------------------------------------------------------------ 49 | // const defines 50 | //------------------------------------------------------------------------------ 51 | 52 | //------------------------------------------------------------------------------ 53 | // typedef 54 | //------------------------------------------------------------------------------ 55 | 56 | //------------------------------------------------------------------------------ 57 | // function prototypes 58 | //------------------------------------------------------------------------------ 59 | #ifdef __cplusplus 60 | extern "C" 61 | { 62 | #endif 63 | 64 | tOplkError nmtcnu_init(UINT nodeId_p); 65 | tOplkError nmtcnu_exit(void); 66 | tOplkError nmtcnu_sendNmtRequest(UINT nodeId_p, 67 | tNmtCommand nmtCommand_p); 68 | tOplkError nmtcnu_sendNmtRequestEx(UINT nodeId_p, 69 | tNmtCommand nmtCommand_p, 70 | const void* pNmtCommandData_p, 71 | size_t dataSize_p); 72 | tOplkError nmtcnu_registerCheckEventCb(tNmtuCheckEventCallback pfnNmtCheckEventCb_p); 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif /* _INC_user_nmtcnu_H_ */ 79 | -------------------------------------------------------------------------------- /include/user/sdoal.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file user/sdoal.h 4 | 5 | \brief Definitions for SDO protocol abstraction layer modules 6 | 7 | This file contains common definitions for the SDO protocol abstraction layer 8 | modules. 9 | *******************************************************************************/ 10 | 11 | /*------------------------------------------------------------------------------ 12 | Copyright (c) 2017, B&R Industrial Automation GmbH 13 | Copyright (c) 2013, SYSTEC electronic GmbH 14 | All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | * Redistributions of source code must retain the above copyright 19 | notice, this list of conditions and the following disclaimer. 20 | * Redistributions in binary form must reproduce the above copyright 21 | notice, this list of conditions and the following disclaimer in the 22 | documentation and/or other materials provided with the distribution. 23 | * Neither the name of the copyright holders nor the 24 | names of its contributors may be used to endorse or promote products 25 | derived from this software without specific prior written permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 28 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 30 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 32 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 34 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 36 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | ------------------------------------------------------------------------------*/ 38 | #ifndef _INC_user_sdoal_H_ 39 | #define _INC_user_sdoal_H_ 40 | 41 | //------------------------------------------------------------------------------ 42 | // includes 43 | //------------------------------------------------------------------------------ 44 | #include 45 | #include 46 | 47 | //------------------------------------------------------------------------------ 48 | // const defines 49 | //------------------------------------------------------------------------------ 50 | 51 | // handle between protocol abstraction layer and asynchronous SDO Sequence Layer 52 | #define SDO_UDP_HANDLE 0x8000 53 | #define SDO_ASND_HANDLE 0x4000 54 | #define SDO_ASY_HANDLE_MASK 0xC000 55 | #define SDO_ASY_INVALID_HDL 0x3FFF 56 | 57 | #define ASND_HEADER_SIZE 4 58 | 59 | 60 | //------------------------------------------------------------------------------ 61 | // Type definitions 62 | //------------------------------------------------------------------------------ 63 | 64 | /// Data type for handle between protocol abstraction layer and asynchronous SDO Sequence Layer 65 | typedef UINT tSdoConHdl; 66 | 67 | /// Callback function pointer for the protocol abstraction layer to call the asynchronous SDO Sequence Layer 68 | typedef tOplkError (*tSequLayerReceiveCb)(tSdoConHdl conHdl_p, 69 | const tAsySdoSeq* pSdoSeqData_p, 70 | size_t dataSize_p); 71 | 72 | #endif /* _INC_user_sdoal_H_ */ 73 | -------------------------------------------------------------------------------- /include/user/sdoasnd.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file user/sdoasnd.h 4 | 5 | \brief Definitions for SDO over ASnd protocol abstraction layer 6 | 7 | The file contains definitions for the SDO over ASnd protocol abstraction layer. 8 | *******************************************************************************/ 9 | 10 | /*------------------------------------------------------------------------------ 11 | Copyright (c) 2017, B&R Industrial Automation GmbH 12 | Copyright (c) 2013, SYSTEC electronic GmbH 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | * Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | * Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 27 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | ------------------------------------------------------------------------------*/ 37 | #ifndef _INC_user_sdoasnd_H_ 38 | #define _INC_user_sdoasnd_H_ 39 | 40 | //------------------------------------------------------------------------------ 41 | // includes 42 | //------------------------------------------------------------------------------ 43 | #include 44 | #include 45 | #include 46 | 47 | //------------------------------------------------------------------------------ 48 | // const defines 49 | //------------------------------------------------------------------------------ 50 | 51 | //------------------------------------------------------------------------------ 52 | // typedef 53 | //------------------------------------------------------------------------------ 54 | 55 | //------------------------------------------------------------------------------ 56 | // function prototypes 57 | //------------------------------------------------------------------------------ 58 | #ifdef __cplusplus 59 | extern "C" 60 | { 61 | #endif 62 | 63 | #if defined(CONFIG_INCLUDE_SDO_ASND) 64 | tOplkError sdoasnd_init(tSequLayerReceiveCb pfnReceiveCb_p); 65 | tOplkError sdoasnd_exit(void); 66 | tOplkError sdoasnd_initCon(tSdoConHdl* pSdoConHandle_p, 67 | UINT targetNodeId_p); 68 | tOplkError sdoasnd_sendData(tSdoConHdl sdoConHandle_p, 69 | tPlkFrame* pSrcData_p, 70 | size_t dataSize_p); 71 | tOplkError sdoasnd_deleteCon(tSdoConHdl sdoConHandle_p); 72 | #endif /* defined(CONFIG_INCLUDE_SDO_ASND) */ 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif /* _INC_user_sdoasnd_H_ */ 79 | -------------------------------------------------------------------------------- /include/user/sdocomsrv.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file user/sdocomsrv.h 4 | 5 | \brief Definitions for SDO Command Layer server functions 6 | 7 | The file contains definitions for the SDO Command Layer server module. 8 | *******************************************************************************/ 9 | 10 | /*------------------------------------------------------------------------------ 11 | Copyright (c) 2017, B&R Industrial Automation GmbH 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without 15 | modification, are permitted provided that the following conditions are met: 16 | * Redistributions of source code must retain the above copyright 17 | notice, this list of conditions and the following disclaimer. 18 | * Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | * Neither the name of the copyright holders nor the 22 | names of its contributors may be used to endorse or promote products 23 | derived from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 26 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 29 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 30 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 32 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 34 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ------------------------------------------------------------------------------*/ 36 | 37 | #ifndef _INC_user_sdocomsrv_H_ 38 | #define _INC_user_sdocomsrv_H_ 39 | 40 | //------------------------------------------------------------------------------ 41 | // includes 42 | //------------------------------------------------------------------------------ 43 | #include 44 | 45 | //------------------------------------------------------------------------------ 46 | // const defines 47 | //------------------------------------------------------------------------------ 48 | 49 | //------------------------------------------------------------------------------ 50 | // typedef 51 | //------------------------------------------------------------------------------ 52 | 53 | //------------------------------------------------------------------------------ 54 | // function prototypes 55 | //------------------------------------------------------------------------------ 56 | tOplkError sdocomsrv_initCon(tSdoComCon* pSdoComCon_p, 57 | const tAsySdoCom* pRecvdCmdLayer_p); 58 | tOplkError sdocomsrv_processStateServerSegmTrans(tSdoComConHdl sdoComConHdl_p, 59 | tSdoComConEvent sdoComConEvent_p, 60 | const tAsySdoCom* pRecvdCmdLayer_p); 61 | 62 | #endif /* _INC_user_sdocomsrv_H_ */ 63 | -------------------------------------------------------------------------------- /include/user/statusu.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file user/statusu.h 4 | 5 | \brief Include file for statusu module 6 | 7 | This file contains the definitions for the statusu module. 8 | *******************************************************************************/ 9 | 10 | /*------------------------------------------------------------------------------ 11 | Copyright (c) 2013, SYSTEC electronic GmbH 12 | Copyright (c) 2016, B&R Industrial Automation GmbH 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | * Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | * Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 27 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | ------------------------------------------------------------------------------*/ 37 | #ifndef _INC_user_statusu_H_ 38 | #define _INC_user_statusu_H_ 39 | 40 | //------------------------------------------------------------------------------ 41 | // includes 42 | //------------------------------------------------------------------------------ 43 | #include 44 | #include 45 | 46 | //------------------------------------------------------------------------------ 47 | // const defines 48 | //------------------------------------------------------------------------------ 49 | 50 | //------------------------------------------------------------------------------ 51 | // typedef 52 | //------------------------------------------------------------------------------ 53 | typedef tOplkError (*tStatusuCbResponse)(UINT nodeId_p, 54 | const tStatusResponse* pStatusResponse_p); 55 | 56 | //------------------------------------------------------------------------------ 57 | // function prototypes 58 | //------------------------------------------------------------------------------ 59 | #ifdef __cplusplus 60 | extern "C" 61 | { 62 | #endif 63 | 64 | tOplkError statusu_init(void); 65 | tOplkError statusu_exit(void); 66 | tOplkError statusu_reset(void); 67 | tOplkError statusu_requestStatusResponse(UINT nodeId_p, 68 | tStatusuCbResponse pfnCbResponse_p); 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif /* _INC_user_statusu_H_ */ 75 | -------------------------------------------------------------------------------- /include/user/timesyncu.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file user/timesyncu.h 4 | 5 | \brief Include file for user timesync module 6 | 7 | *******************************************************************************/ 8 | 9 | /*------------------------------------------------------------------------------ 10 | Copyright (c) 2016, B&R Industrial Automation GmbH 11 | Copyright (c) 2017, Kalycito Infotech Private Limited 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without 15 | modification, are permitted provided that the following conditions are met: 16 | * Redistributions of source code must retain the above copyright 17 | notice, this list of conditions and the following disclaimer. 18 | * Redistributions in binary form must reproduce the above copyright 19 | notice, this list of conditions and the following disclaimer in the 20 | documentation and/or other materials provided with the distribution. 21 | * Neither the name of the copyright holders nor the 22 | names of its contributors may be used to endorse or promote products 23 | derived from this software without specific prior written permission. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 26 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 27 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 29 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 30 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 31 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 32 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 34 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | ------------------------------------------------------------------------------*/ 36 | #ifndef _INC_user_timesyncu_H_ 37 | #define _INC_user_timesyncu_H_ 38 | 39 | //------------------------------------------------------------------------------ 40 | // includes 41 | //------------------------------------------------------------------------------ 42 | #include 43 | #include 44 | 45 | //------------------------------------------------------------------------------ 46 | // const defines 47 | //------------------------------------------------------------------------------ 48 | 49 | //------------------------------------------------------------------------------ 50 | // typedef 51 | //------------------------------------------------------------------------------ 52 | 53 | //------------------------------------------------------------------------------ 54 | // function prototypes 55 | //------------------------------------------------------------------------------ 56 | #ifdef __cplusplus 57 | extern "C" 58 | { 59 | #endif 60 | 61 | tOplkError timesyncu_init(tSyncCb pfnSyncCb_p); 62 | void timesyncu_exit(void); 63 | tOplkError timesyncu_getSocTime(tOplkApiSocTimeInfo* pSocTime_p); 64 | tOplkError timesyncu_waitSyncEvent(ULONG timeout_p); 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif /* _INC_user_timesyncu_H_ */ 71 | -------------------------------------------------------------------------------- /include/user/timesyncucal.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file user/timesyncucal.h 4 | 5 | \brief Include file for user timesync CAL module 6 | 7 | *******************************************************************************/ 8 | 9 | /*------------------------------------------------------------------------------ 10 | Copyright (c) 2016, B&R Industrial Automation GmbH 11 | All rights reserved. 12 | 13 | Redistribution and use in source and binary forms, with or without 14 | modification, are permitted provided that the following conditions are met: 15 | * Redistributions of source code must retain the above copyright 16 | notice, this list of conditions and the following disclaimer. 17 | * Redistributions in binary form must reproduce the above copyright 18 | notice, this list of conditions and the following disclaimer in the 19 | documentation and/or other materials provided with the distribution. 20 | * Neither the name of the copyright holders nor the 21 | names of its contributors may be used to endorse or promote products 22 | derived from this software without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 25 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 29 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 32 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | ------------------------------------------------------------------------------*/ 35 | #ifndef _INC_user_timesyncucal_H_ 36 | #define _INC_user_timesyncucal_H_ 37 | 38 | //------------------------------------------------------------------------------ 39 | // includes 40 | //------------------------------------------------------------------------------ 41 | #include 42 | #include 43 | 44 | //------------------------------------------------------------------------------ 45 | // const defines 46 | //------------------------------------------------------------------------------ 47 | 48 | //------------------------------------------------------------------------------ 49 | // typedef 50 | //------------------------------------------------------------------------------ 51 | 52 | //------------------------------------------------------------------------------ 53 | // function prototypes 54 | //------------------------------------------------------------------------------ 55 | #ifdef __cplusplus 56 | extern "C" 57 | { 58 | #endif 59 | 60 | tOplkError timesyncucal_init(tSyncCb pfnSyncCb_p); 61 | void timesyncucal_exit(void); 62 | tOplkError timesyncucal_waitSyncEvent(ULONG timeout_p); 63 | tOplkError timesyncucal_callSyncCb(void); 64 | 65 | tTimesyncSharedMemory* timesyncucal_getSharedMemory(void); 66 | 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | 71 | #endif /* _INC_user_timesyncucal_H_ */ 72 | -------------------------------------------------------------------------------- /lib/linux/liboplkcn.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/lib/linux/liboplkcn.a -------------------------------------------------------------------------------- /lib/linux/liboplkcn_d.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/lib/linux/liboplkcn_d.a -------------------------------------------------------------------------------- /lib/linux/liboplkcnapp-kernelintf.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/lib/linux/liboplkcnapp-kernelintf.a -------------------------------------------------------------------------------- /lib/linux/liboplkcnapp-kernelintf_d.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/lib/linux/liboplkcnapp-kernelintf_d.a -------------------------------------------------------------------------------- /lib/linux/liboplkcnapp-kernelpcp.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/lib/linux/liboplkcnapp-kernelpcp.a -------------------------------------------------------------------------------- /lib/linux/liboplkcnapp-kernelpcp_d.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/lib/linux/liboplkcnapp-kernelpcp_d.a -------------------------------------------------------------------------------- /lib/linux/liboplkcnapp-userintf.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/lib/linux/liboplkcnapp-userintf.a -------------------------------------------------------------------------------- /lib/linux/liboplkcnapp-userintf_d.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/lib/linux/liboplkcnapp-userintf_d.a -------------------------------------------------------------------------------- /lib/linux/liboplkcndrv-pcap.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/lib/linux/liboplkcndrv-pcap.a -------------------------------------------------------------------------------- /lib/linux/liboplkcndrv-pcap_d.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/lib/linux/liboplkcndrv-pcap_d.a -------------------------------------------------------------------------------- /lib/windows/oplkcn.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/lib/windows/oplkcn.dll -------------------------------------------------------------------------------- /lib/windows/oplkcn.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/lib/windows/oplkcn.lib -------------------------------------------------------------------------------- /lib/windows/oplkcn_d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/lib/windows/oplkcn_d.dll -------------------------------------------------------------------------------- /lib/windows/oplkcn_d.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/lib/windows/oplkcn_d.lib -------------------------------------------------------------------------------- /src/oplk/kernel/dll/dllkstatemachine.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file dllkstatemachine.h 4 | 5 | \brief Definitions for the DLL state machine 6 | 7 | This file contains the definitions for the DLL state machine. It is part of 8 | the DLL kernel module. 9 | 10 | *******************************************************************************/ 11 | 12 | /*------------------------------------------------------------------------------ 13 | Copyright (c) 2013, SYSTEC electronic GmbH 14 | Copyright (c) 2016, B&R Industrial Automation GmbH 15 | All rights reserved. 16 | 17 | Redistribution and use in source and binary forms, with or without 18 | modification, are permitted provided that the following conditions are met: 19 | * Redistributions of source code must retain the above copyright 20 | notice, this list of conditions and the following disclaimer. 21 | * Redistributions in binary form must reproduce the above copyright 22 | notice, this list of conditions and the following disclaimer in the 23 | documentation and/or other materials provided with the distribution. 24 | * Neither the name of the copyright holders nor the 25 | names of its contributors may be used to endorse or promote products 26 | derived from this software without specific prior written permission. 27 | 28 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 29 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 32 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 33 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 35 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 37 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | ------------------------------------------------------------------------------*/ 39 | #ifndef _INC_dllkstatemachine_H_ 40 | #define _INC_dllkstatemachine_H_ 41 | 42 | //------------------------------------------------------------------------------ 43 | // includes 44 | //------------------------------------------------------------------------------ 45 | #include 46 | #include 47 | 48 | //------------------------------------------------------------------------------ 49 | // const defines 50 | //------------------------------------------------------------------------------ 51 | 52 | 53 | //------------------------------------------------------------------------------ 54 | // typedef 55 | //------------------------------------------------------------------------------ 56 | 57 | 58 | //------------------------------------------------------------------------------ 59 | // function prototypes 60 | //------------------------------------------------------------------------------ 61 | #ifdef __cplusplus 62 | extern "C" 63 | { 64 | #endif 65 | 66 | tOplkError dllkstatemachine_changeState(tNmtEvent nmtEvent_p, 67 | tNmtState nmtState_p) 68 | SECTION_DLLK_CHANGE_STATE; 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif /* _INC_dllkstatemachine_H_ */ 75 | -------------------------------------------------------------------------------- /src/oplk/kernel/edrv/.gitignore: -------------------------------------------------------------------------------- 1 | *.o.cmd 2 | -------------------------------------------------------------------------------- /src/oplk/user/errhnd/errhnducal.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************** 3 | \file errhnducal.h 4 | 5 | \brief Definitions for user CAL module of error handler 6 | 7 | This file provides the interface of the error handlers user CAL module. 8 | 9 | *******************************************************************************/ 10 | 11 | /*------------------------------------------------------------------------------ 12 | Copyright (c) 2016, B&R Industrial Automation GmbH 13 | All rights reserved. 14 | 15 | Redistribution and use in source and binary forms, with or without 16 | modification, are permitted provided that the following conditions are met: 17 | * Redistributions of source code must retain the above copyright 18 | notice, this list of conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | * Neither the name of the copyright holders nor the 23 | names of its contributors may be used to endorse or promote products 24 | derived from this software without specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 27 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 28 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 29 | DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 30 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 31 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 32 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 33 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 35 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | ------------------------------------------------------------------------------*/ 37 | #ifndef _INC_user_errhnducal_H_ 38 | #define _INC_user_errhnducal_H_ 39 | 40 | //------------------------------------------------------------------------------ 41 | // includes 42 | //------------------------------------------------------------------------------ 43 | #include 44 | #include 45 | 46 | //------------------------------------------------------------------------------ 47 | // const defines 48 | //------------------------------------------------------------------------------ 49 | 50 | //------------------------------------------------------------------------------ 51 | // typedef 52 | //------------------------------------------------------------------------------ 53 | 54 | //------------------------------------------------------------------------------ 55 | // function prototypes 56 | //------------------------------------------------------------------------------ 57 | #ifdef __cplusplus 58 | extern "C" 59 | { 60 | #endif 61 | 62 | tOplkError errhnducal_init(tErrHndObjects* pLocalObjects_p); 63 | void errhnducal_exit(void); 64 | tOplkError errhnducal_writeErrorObject(UINT index_p, 65 | UINT subIndex_p, 66 | const UINT32* pParam_p); 67 | tOplkError errhnducal_readErrorObject(UINT index_p, 68 | UINT subIndex_p, 69 | UINT32* pParam_p); 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif /* _INC_user_errhnducal_H_ */ 76 | -------------------------------------------------------------------------------- /tools/linux/50-openPOWERLINK.rules: -------------------------------------------------------------------------------- 1 | # for easy startup, we allow others to access the openPOWERLINK driver 2 | SUBSYSTEM=="plk", KERNEL=="plk", NAME="plk", OWNER="root", GROUP="root", MODE="0666" 3 | 4 | # for production, you should create a special group, where the user 5 | # which runs the application belongs to. 6 | #SUBSYSTEM=="plk", KERNEL=="plk", NAME="plk", OWNER="root", GROUP="plk", MODE="0660" 7 | 8 | # hack to adjust the priority of the IRQ thread after the openPOWERLINK stack has been initialized 9 | SUBSYSTEM=="net", KERNEL=="plk", ACTION=="add", RUN+="PLKLOAD_PATH/plkload -s" 10 | -------------------------------------------------------------------------------- /tools/linux/Kbuild.in: -------------------------------------------------------------------------------- 1 | # 2 | # Template for Kbuild script 3 | # 4 | 5 | EXTRA_CFLAGS := ${MODULE_INCLUDES} 6 | EXTRA_CFLAGS += ${MODULE_DEFS} 7 | 8 | # object files for kernel object with relative paths 9 | MODULEOBJS = ${MODULE_OBJS} 10 | 11 | # build rule for the openPOWERLINK kernel object 12 | obj-m := ${MODULE_NAME}.o 13 | 14 | ${MODULE_NAME}-y := $(MODULEOBJS) 15 | 16 | 17 | -------------------------------------------------------------------------------- /tools/linux/devices.txt: -------------------------------------------------------------------------------- 1 | 82573,Intel Corporation 82573L,e1000e 2 | 82573,Intel Corporation 82567V,e1000e 3 | 82573,Intel Corporation 82583V,e1000e 4 | 82573,Intel Corporation 82567LM,e1000e 5 | 82573,Intel Corporation 82574L,e1000e 6 | 82573,Intel Corporation 82540EM,e1000 7 | 8139,RTL-8139,8139too 8 | 8139,RTL-8100/8101L/8139,8139too 9 | 8255x,Intel Corporation 82557,e100 10 | 8255x,Intel Corporation 8255xER,e100 11 | 8255x,Intel Corporation PRO/100,e100 12 | i210,Intel Corporation I210,igb 13 | 8111,RTL8111/8168,r8169 14 | -------------------------------------------------------------------------------- /tools/linux/set_prio: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Shell script to set priority of some important kernel threads 4 | # 5 | 6 | interface= 7 | 8 | usage() 9 | { 10 | echo >&2 \ 11 | "usage: set_prio \n" 12 | exit 1 13 | } 14 | 15 | if [ $USER != "root" ] ; then 16 | echo "Please run 'sudo $0'" 17 | exit 18 | fi 19 | 20 | if [ "$#" -ne "1" ] ; then 21 | usage 22 | else 23 | interface=$1 24 | fi 25 | 26 | ############################################################################### 27 | # Get Main kernel version 28 | KERNEL_MAIN=`uname -r | cut -f1 -d.` 29 | 30 | echo -n "Check if high resolution timer support is available..." 31 | 32 | cat /proc/timer_list | grep 'hres_active.*1' > /dev/null 33 | if [ "$?" -ne "0" ] ; then 34 | echo " Failed" 35 | echo 36 | echo " High resolution timer support is NOT active." 37 | echo " Maybe you need to add 'acpi=force' to kernel command line" 38 | echo " or try it on a more recent X86 processor." 39 | echo 40 | 41 | exit 42 | else 43 | echo " OK" 44 | fi 45 | 46 | echo -n "Check if interface $interface exists..." 47 | ps -e -o comm | grep -q ^irq/.*${interface}\$ 48 | if [ "$?" -ne "0" ] ; then 49 | echo " Failed" 50 | echo " Interrupt thread for interface $interface not found! Priority couldn't be set!" 51 | echo 52 | 53 | exit 54 | else 55 | echo " OK" 56 | fi 57 | 58 | echo "Setting thread priorities..." 59 | echo 60 | 61 | # Set real-time priority openPOWERLINK dependant threads 62 | if [ "$KERNEL_MAIN" = "2" ] ; then 63 | chrt -f -p 80 `ps -C sirq-hrtimer/1 -o pid --no-headers` 64 | chrt -f -p 70 `ps -C \`ps -e -o comm |grep ^irq/.*${interface}\$\` -o pid --no-headers` 65 | chrt -f -p 60 `ps -C sirq-net-rx/1 -o pid --no-headers` 66 | else 67 | chrt -f -p 96 `ps -C ksoftirqd/1 -o pid --no-headers` 68 | chrt -f -p 97 `ps -C \`ps -e -o comm |grep ^irq/.*${interface}\$\` -o pid --no-headers` 69 | taskset -p 2 `ps -C \`ps -e -o comm |grep ^irq/.*${interface}\$\` -o pid --no-headers` 70 | fi 71 | 72 | 73 | exit 0 74 | 75 | 76 | -------------------------------------------------------------------------------- /tools/nodeset/.gitignore: -------------------------------------------------------------------------------- 1 | !.gitignore -------------------------------------------------------------------------------- /tools/nodeset_compiler/NodeID_AssumeExternal.txt: -------------------------------------------------------------------------------- 1 | i=2253 2 | i=2254 3 | i=2255 4 | i=2256 5 | i=2257 6 | i=2258 7 | i=2259 8 | i=2260 9 | i=2261 10 | i=2262 11 | i=2263 12 | i=2264 13 | i=2265 14 | i=2266 15 | i=2267 16 | i=2271 17 | i=2274 18 | i=2294 19 | i=2735 20 | i=2992 21 | i=2993 22 | i=2994 23 | i=2268 24 | i=295 25 | i=296 26 | i=11715 27 | i=11492 28 | -------------------------------------------------------------------------------- /tools/nodeset_compiler/NodeID_Blacklist.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/NodeID_Blacklist.txt -------------------------------------------------------------------------------- /tools/nodeset_compiler/NodeID_NS0_Base.txt: -------------------------------------------------------------------------------- 1 | i=1 2 | i=2 3 | i=3 4 | i=4 5 | i=5 6 | i=6 7 | i=7 8 | i=8 9 | i=9 10 | i=10 11 | i=11 12 | i=12 13 | i=13 14 | i=14 15 | i=15 16 | i=16 17 | i=17 18 | i=18 19 | i=19 20 | i=20 21 | i=21 22 | i=22 23 | i=24 24 | i=26 25 | i=27 26 | i=28 27 | i=31 28 | i=32 29 | i=33 30 | i=34 31 | i=35 32 | i=36 33 | i=37 34 | i=38 35 | i=39 36 | i=40 37 | i=41 38 | i=44 39 | i=45 40 | i=45 41 | i=46 42 | i=47 43 | i=48 44 | i=49 45 | i=58 46 | i=61 47 | i=62 48 | i=63 49 | i=84 50 | i=85 51 | i=86 52 | i=87 53 | i=88 54 | i=89 55 | i=90 56 | i=91 57 | i=121 58 | i=290 59 | i=294 60 | i=295 61 | i=3048 -------------------------------------------------------------------------------- /tools/nodeset_compiler/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/__init__.py -------------------------------------------------------------------------------- /tools/nodeset_compiler/__pycache__/backend_open62541.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/__pycache__/backend_open62541.cpython-36.pyc -------------------------------------------------------------------------------- /tools/nodeset_compiler/__pycache__/backend_open62541_datatypes.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/__pycache__/backend_open62541_datatypes.cpython-36.pyc -------------------------------------------------------------------------------- /tools/nodeset_compiler/__pycache__/backend_open62541_nodes.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/__pycache__/backend_open62541_nodes.cpython-36.pyc -------------------------------------------------------------------------------- /tools/nodeset_compiler/__pycache__/constants.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/__pycache__/constants.cpython-36.pyc -------------------------------------------------------------------------------- /tools/nodeset_compiler/__pycache__/datatypes.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/__pycache__/datatypes.cpython-36.pyc -------------------------------------------------------------------------------- /tools/nodeset_compiler/__pycache__/nodes.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/__pycache__/nodes.cpython-36.pyc -------------------------------------------------------------------------------- /tools/nodeset_compiler/__pycache__/nodeset.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/__pycache__/nodeset.cpython-36.pyc -------------------------------------------------------------------------------- /tools/nodeset_compiler/__pycache__/opaque_type_mapping.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/__pycache__/opaque_type_mapping.cpython-36.pyc -------------------------------------------------------------------------------- /tools/nodeset_compiler/backend_open62541.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/backend_open62541.pyc -------------------------------------------------------------------------------- /tools/nodeset_compiler/backend_open62541_datatypes.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/backend_open62541_datatypes.pyc -------------------------------------------------------------------------------- /tools/nodeset_compiler/backend_open62541_nodes.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/backend_open62541_nodes.pyc -------------------------------------------------------------------------------- /tools/nodeset_compiler/constants.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | # This Source Code Form is subject to the terms of the Mozilla Public 5 | # License, v. 2.0. If a copy of the MPL was not distributed with this 6 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 | 8 | ### 9 | ### Author: Chris Iatrou (ichrispa@core-vector.net) 10 | ### Version: rev 13 11 | ### 12 | ### This program was created for educational purposes and has been 13 | ### contributed to the open62541 project by the author. All licensing 14 | ### terms for this source is inherited by the terms and conditions 15 | ### specified for by the open62541 project (see the projects readme 16 | ### file for more information on the MPLv2 terms and restrictions). 17 | ### 18 | ### This program is not meant to be used in a production environment. The 19 | ### author is not liable for any complications arising due to the use of 20 | ### this program. 21 | ### 22 | 23 | NODE_CLASS_GENERERIC = 0 24 | NODE_CLASS_OBJECT = 1 25 | NODE_CLASS_VARIABLE = 2 26 | NODE_CLASS_METHOD = 4 27 | NODE_CLASS_OBJECTTYPE = 8 28 | NODE_CLASS_VARIABLETYPE = 16 29 | NODE_CLASS_REFERENCETYPE = 32 30 | NODE_CLASS_DATATYPE = 64 31 | NODE_CLASS_VIEW = 128 32 | 33 | # Not in OPC-UA, but exists in XML 34 | NODE_CLASS_METHODTYPE = 256 35 | 36 | ## 37 | ## Numeric codes used to encode binary type fields: 38 | ## 39 | BUILTINTYPE_TYPEID_EXTENSIONOBJECT = 1 40 | BUILTINTYPE_TYPEID_LOCALIZEDTEXT = 2 41 | BUILTINTYPE_TYPEID_EXPANDEDNODEID = 3 42 | BUILTINTYPE_TYPEID_NODEID = 4 43 | BUILTINTYPE_TYPEID_DATETIME = 5 44 | BUILTINTYPE_TYPEID_QUALIFIEDNAME = 6 45 | BUILTINTYPE_TYPEID_STATUSCODE = 7 46 | BUILTINTYPE_TYPEID_GUID = 8 47 | BUILTINTYPE_TYPEID_BOOLEAN = 9 48 | BUILTINTYPE_TYPEID_BYTE = 10 49 | BUILTINTYPE_TYPEID_SBYTE = 11 50 | BUILTINTYPE_TYPEID_INT16 = 12 51 | BUILTINTYPE_TYPEID_UINT16 = 13 52 | BUILTINTYPE_TYPEID_INT32 = 14 53 | BUILTINTYPE_TYPEID_UINT32 = 15 54 | BUILTINTYPE_TYPEID_INT64 = 16 55 | BUILTINTYPE_TYPEID_UINT64 = 17 56 | BUILTINTYPE_TYPEID_FLOAT = 18 57 | BUILTINTYPE_TYPEID_DOUBLE = 19 58 | BUILTINTYPE_TYPEID_STRING = 20 59 | BUILTINTYPE_TYPEID_XMLELEMENT = 21 60 | BUILTINTYPE_TYPEID_BYTESTRING = 22 61 | BUILTINTYPE_TYPEID_DIAGNOSTICINFO = 23 62 | BUILTINTYPE_TYPEID_NUMBER = 24 63 | BUILTINTYPE_TYPEID_UINTEGER = 25 64 | BUILTINTYPE_TYPEID_INTEGER = 26 65 | -------------------------------------------------------------------------------- /tools/nodeset_compiler/constants.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/constants.pyc -------------------------------------------------------------------------------- /tools/nodeset_compiler/datatypes.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/datatypes.pyc -------------------------------------------------------------------------------- /tools/nodeset_compiler/nodes.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/nodes.pyc -------------------------------------------------------------------------------- /tools/nodeset_compiler/nodeset.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/nodeset.pyc -------------------------------------------------------------------------------- /tools/nodeset_compiler/nodeset_testing.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import codecs 4 | from nodeset import * 5 | 6 | class testing: 7 | def __init__(self): 8 | self.ns = NodeSet("testing") 9 | 10 | logger.debug("Phase 1: Reading XML file nodessets") 11 | self.ns.parseXML("Opc.Ua.NodeSet2.xml") 12 | # self.ns.parseXML("Opc.Ua.NodeSet2.Part4.xml") 13 | # self.ns.parseXML("Opc.Ua.NodeSet2.Part5.xml") 14 | # self.ns.parseXML("Opc.Ua.SimulationNodeSet2.xml") 15 | 16 | logger.debug("Phase 2: Linking address space references and datatypes") 17 | self.ns.linkOpenPointers() 18 | self.ns.sanitize() 19 | 20 | logger.debug("Phase 3: Comprehending DataType encoding rules") 21 | self.ns.buildEncodingRules() 22 | 23 | logger.debug("Phase 4: Allocating variable value data") 24 | self.ns.allocateVariables() 25 | 26 | bin = self.ns.buildBinary() 27 | f = codecs.open("binary.base64", "w+", encoding='utf-8') 28 | f.write(bin.encode("base64")) 29 | f.close() 30 | 31 | allnodes = self.ns.nodes 32 | ns = [self.ns.getRoot()] 33 | 34 | i = 0 35 | # print "Starting depth search on " + str(len(allnodes)) + " nodes starting 36 | # with from " + str(ns) 37 | while (len(ns) < len(allnodes)): 38 | i = i + 1 39 | tmp = [] 40 | print("Iteration: " + str(i)) 41 | for n in ns: 42 | tmp.append(n) 43 | for r in n.getReferences(): 44 | if (not r.target() in tmp): 45 | tmp.append(r.target()) 46 | print("...tmp, " + str(len(tmp)) + " nodes discovered") 47 | ns = [] 48 | for n in tmp: 49 | ns.append(n) 50 | print("...done, " + str(len(ns)) + " nodes discovered") 51 | 52 | class testing_open62541_header: 53 | def __init__(self): 54 | self.ns = opcua_ns("testing") 55 | 56 | logger.debug("Phase 1: Reading XML file nodessets") 57 | self.ns.parseXML("Opc.Ua.NodeSet2.xml") 58 | # self.ns.parseXML("Opc.Ua.NodeSet2.Part4.xml") 59 | # self.ns.parseXML("Opc.Ua.NodeSet2.Part5.xml") 60 | # self.ns.parseXML("Opc.Ua.SimulationNodeSet2.xml") 61 | 62 | logger.debug("Phase 2: Linking address space references and datatypes") 63 | self.ns.linkOpenPointers() 64 | self.ns.sanitize() 65 | 66 | logger.debug("Phase 3: Calling C Printers") 67 | code = self.ns.printOpen62541Header() 68 | 69 | codeout = codecs.open("./open62541_nodeset.c", "w+", encoding='utf-8') 70 | for line in code: 71 | codeout.write(line + "\n") 72 | codeout.close() 73 | return 74 | 75 | if __name__ == '__main__': 76 | tst = testing_open62541_header() 77 | -------------------------------------------------------------------------------- /tools/nodeset_compiler/opaque_type_mapping.py: -------------------------------------------------------------------------------- 1 | 2 | # Opaque types are in general defined as simple byte strings. For the base opaque types there is a corresponding node id definition 3 | # in the nodeset. E.g. Opc.Ua.Types.bsd contains the simple definition for OpaqueType LocaleId. In Opc.Ua.NodeSet2.xml the LocaleId 4 | # is defined as a Subtype of String(i=12) thus LocaleId is a String object. 5 | # TODO we can automate this mapping by loading the NodeSet2.xml and read those mappings automatically. For now we just use this map 6 | opaque_type_mapping = { 7 | 'Image': { 8 | 'ns': 0, 9 | 'id': 15, 10 | 'name': 'ByteString' 11 | }, 12 | 'Number': { 13 | 'ns': 0, 14 | 'id': 24, 15 | 'name': 'BaseDataType' 16 | }, 17 | 'UInteger': { 18 | 'ns': 0, 19 | 'id': 24, 20 | 'name': 'BaseDataType' 21 | }, 22 | 'ImageBMP': { 23 | 'ns': 0, 24 | 'id': 15, 25 | 'name': 'ByteString' 26 | }, 27 | 'ImageGIF': { 28 | 'ns': 0, 29 | 'id': 15, 30 | 'name': 'ByteString' 31 | }, 32 | 'ImageJPG': { 33 | 'ns': 0, 34 | 'id': 15, 35 | 'name': 'ByteString' 36 | }, 37 | 'ImagePNG': { 38 | 'ns': 0, 39 | 'id': 15, 40 | 'name': 'ByteString' 41 | }, 42 | 'BitFieldMaskDataType': { 43 | 'ns': 0, 44 | 'id': 9, 45 | 'name': 'UInt64' 46 | }, 47 | 'NormalizedString': { 48 | 'ns': 0, 49 | 'id': 12, 50 | 'name': 'String' 51 | }, 52 | 'DecimalString': { 53 | 'ns': 0, 54 | 'id': 12, 55 | 'name': 'String' 56 | }, 57 | 'DurationString': { 58 | 'ns': 0, 59 | 'id': 12, 60 | 'name': 'String' 61 | }, 62 | 'TimeString': { 63 | 'ns': 0, 64 | 'id': 12, 65 | 'name': 'String' 66 | }, 67 | 'DateString': { 68 | 'ns': 0, 69 | 'id': 12, 70 | 'name': 'String' 71 | }, 72 | 'Duration': { 73 | 'ns': 0, 74 | 'id': 11, 75 | 'name': 'Double' 76 | }, 77 | 'UtcTime': { 78 | 'ns': 0, 79 | 'id': 13, 80 | 'name': 'DateTime' 81 | }, 82 | 'LocaleId': { 83 | 'ns': 0, 84 | 'id': 12, 85 | 'name': 'String' 86 | }, 87 | 'IntegerId': { 88 | 'ns': 0, 89 | 'id': 7, 90 | 'name': 'UInt32' 91 | }, 92 | 'ApplicationInstanceCertificate': { 93 | 'ns': 0, 94 | 'id': 15, 95 | 'name': 'ByteString' 96 | }, 97 | 'SessionAuthenticationToken': { 98 | 'ns': 0, 99 | 'id': 17, 100 | 'name': 'NodeId' 101 | }, 102 | 'ContinuationPoint': { 103 | 'ns': 0, 104 | 'id': 15, 105 | 'name': 'ByteString' 106 | }, 107 | 'Counter': { 108 | 'ns': 0, 109 | 'id': 7, 110 | 'name': 'UInt32' 111 | }, 112 | 'NumericRange': { 113 | 'ns': 0, 114 | 'id': 12, 115 | 'name': 'String' 116 | }, 117 | 'Time': { 118 | 'ns': 0, 119 | 'id': 12, 120 | 'name': 'String' 121 | }, 122 | 'Date': { 123 | 'ns': 0, 124 | 'id': 13, 125 | 'name': 'DateTime' 126 | } 127 | } 128 | 129 | def get_base_type_for_opaque(opaqueTypeName): 130 | if opaqueTypeName in opaque_type_mapping: 131 | return opaque_type_mapping[opaqueTypeName] 132 | # Default if not in mapping is ByteString 133 | return { 134 | 'ns': 0, 135 | 'id': 15, 136 | 'name': 'ByteString' 137 | } 138 | -------------------------------------------------------------------------------- /tools/nodeset_compiler/opaque_type_mapping.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/nodeset_compiler/opaque_type_mapping.pyc -------------------------------------------------------------------------------- /tools/pictures/UaExpert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/emersbergerl/opcua2powerlink/5a9a9d347a0d1ad649eb058357b7c1e3726f655b/tools/pictures/UaExpert.png -------------------------------------------------------------------------------- /tools/schema/datatypes_transport.txt: -------------------------------------------------------------------------------- 1 | MessageType 2 | ChunkType 3 | TcpMessageHeader 4 | TcpHelloMessage 5 | TcpAcknowledgeMessage 6 | TcpErrorMessage 7 | SecureConversationMessageHeader 8 | AsymmetricAlgorithmSecurityHeader 9 | SymmetricAlgorithmSecurityHeader 10 | SequenceHeader 11 | SecureConversationMessageFooter 12 | SecureConversationMessageAbortBody 13 | -------------------------------------------------------------------------------- /tools/xdd_compiler/app_error.txt: -------------------------------------------------------------------------------- 1 | if (ret != kErrorOk) 2 | { 3 | fprintf(stderr, 4 | "Linking process vars failed with \"%s\" (0x%04x)\n", 5 | debugstr_getRetValStr(ret), 6 | ret); 7 | return ret; 8 | } 9 | -------------------------------------------------------------------------------- /tools/xdd_compiler/app_init.txt: -------------------------------------------------------------------------------- 1 | 2 | //============================================================================// 3 | // P R I V A T E F U N C T I O N S // 4 | //============================================================================// 5 | /// \name Private Functions 6 | /// \{ 7 | 8 | //------------------------------------------------------------------------------ 9 | /** 10 | \brief Initialize process image 11 | 12 | The function initializes the process image of the application. 13 | 14 | \return The function returns a tOplkError error code. 15 | */ 16 | //------------------------------------------------------------------------------ 17 | static tOplkError initProcessImage(void) 18 | { 19 | tOplkError ret = kErrorOk; 20 | UINT varEntries; 21 | tObdSize obdSize; 22 | 23 | /* Allocate process image */ 24 | printf("Initializing process image...\n"); 25 | printf("Size of process image: Input = %lu Output = %lu \n", 26 | (ULONG)sizeof(PI_IN), 27 | (ULONG)sizeof(PI_OUT)); 28 | eventlog_printMessage(kEventlogLevelInfo, 29 | kEventlogCategoryGeneric, 30 | "Allocating process image: Input:%lu Output:%lu", 31 | (ULONG)sizeof(PI_IN), 32 | (ULONG)sizeof(PI_OUT)); 33 | 34 | ret = oplk_allocProcessImage(sizeof(PI_IN), sizeof(PI_OUT)); 35 | if (ret != kErrorOk) 36 | return ret; 37 | 38 | pProcessImageIn_l = (PI_IN*)oplk_getProcessImageIn(); 39 | pProcessImageOut_l = (const PI_OUT*)oplk_getProcessImageOut(); 40 | 41 | /* link process variables used by CN to object dictionary */ 42 | fprintf(stderr, "Linking process image vars:\n"); 43 | -------------------------------------------------------------------------------- /tools/xdd_compiler/app_top.txt: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // local function prototypes 3 | //------------------------------------------------------------------------------ 4 | static tOplkError initProcessImage(void); 5 | 6 | //============================================================================// 7 | // P U B L I C F U N C T I O N S // 8 | //============================================================================// 9 | 10 | //------------------------------------------------------------------------------ 11 | /** 12 | \brief Initialize the synchronous data application 13 | 14 | The function initializes the synchronous data application 15 | 16 | \return The function returns a tOplkError error code. 17 | 18 | \ingroup module_demo_cn_console 19 | */ 20 | //------------------------------------------------------------------------------ 21 | tOplkError initApp(void) 22 | { 23 | tOplkError ret; 24 | 25 | ret = initProcessImage(); 26 | 27 | return ret; 28 | } 29 | 30 | //------------------------------------------------------------------------------ 31 | /** 32 | \brief Shutdown the synchronous data application 33 | 34 | The function shuts down the synchronous data application 35 | 36 | \return The function returns a tOplkError error code. 37 | 38 | \ingroup module_demo_cn_console 39 | */ 40 | //------------------------------------------------------------------------------ 41 | void shutdownApp(void) 42 | { 43 | oplk_freeProcessImage(); 44 | } 45 | 46 | //------------------------------------------------------------------------------ 47 | /** 48 | \brief Synchronous data handler 49 | 50 | The function implements the synchronous data handler. 51 | 52 | \return The function returns a tOplkError error code. 53 | 54 | \ingroup module_demo_cn_console 55 | */ 56 | //------------------------------------------------------------------------------ 57 | tOplkError processSync(void) 58 | { 59 | tOplkError ret = kErrorOk; 60 | 61 | if (oplk_waitSyncEvent(100000) != kErrorOk) 62 | return ret; 63 | 64 | ret = oplk_exchangeProcessImageOut(); 65 | if (ret != kErrorOk) 66 | return ret; 67 | 68 | // setup input image - digital outputs -------------------------------------------------------------------------------- /tools/xdd_compiler/exchange.h: -------------------------------------------------------------------------------- 1 | #ifndef EXCHANGE_H_ 2 | #define EXCHANGE_H_ 3 | 4 | #include 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | extern static void dataExchange(UA_Server *server); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | 15 | #endif /* OPCUAEXCHANGE_H_ */ -------------------------------------------------------------------------------- /tools/xdd_compiler/server_nodeset.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | http://yourorganisation.org/test/ 4 | 5 | 6 | i=11 7 | i=35 8 | i=37 9 | i=40 10 | i=45 11 | i=47 12 | 13 | 14 | 15 | testInstance 16 | 17 | ns=1;i=5002 18 | ns=1;i=1001 19 | ns=1;i=6002 20 | 21 | 22 | 23 | testFolder 24 | 25 | i=85 26 | i=61 27 | 28 | 29 | 30 | testType 31 | 32 | i=58 33 | ns=1;i=6001 34 | 35 | 36 | 37 | Var1 38 | 39 | i=63 40 | i=78 41 | ns=1;i=1001 42 | 43 | 44 | 42.0 45 | 46 | 47 | 48 | Var2 49 | 50 | i=63 51 | ns=1;i=5001 52 | 53 | 54 | 55 | 1 56 | 2 57 | 3 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /windows.cmake: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # CMake file of CiA 401 CN console demo application 4 | # 5 | # Copyright (c) 2017, B&R Industrial Automation GmbH 6 | # All rights reserved. 7 | # 8 | # Redistribution and use in source and binary forms, with or without 9 | # modification, are permitted provided that the following conditions are met: 10 | # * Redistributions of source code must retain the above copyright 11 | # notice, this list of conditions and the following disclaimer. 12 | # * Redistributions in binary form must reproduce the above copyright 13 | # notice, this list of conditions and the following disclaimer in the 14 | # documentation and/or other materials provided with the distribution. 15 | # * Neither the name of the copyright holders nor the 16 | # names of its contributors may be used to endorse or promote products 17 | # derived from this software without specific prior written permission. 18 | # 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 20 | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | # DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 28 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | ################################################################################ 30 | 31 | ################################################################################ 32 | # Set architecture specific definitions 33 | 34 | ADD_DEFINITIONS(-D_CONSOLE -DHAVE_REMOTE -D_CRT_SECURE_NO_WARNINGS) 35 | 36 | ################################################################################ 37 | # Set architecture specific sources and include directories 38 | 39 | SET(DEMO_ARCH_SOURCES 40 | ${DEMO_ARCHSOURCES} 41 | ${COMMON_SOURCE_DIR}/system/system-windows.c 42 | ${CONTRIB_SOURCE_DIR}/console/console-windows.c 43 | ${CONTRIB_SOURCE_DIR}/trace/trace-windows.c 44 | ${CONTRIB_SOURCE_DIR}/getopt/getopt.c 45 | ) 46 | 47 | ################################################################################ 48 | # Set architecture specific libraries 49 | 50 | IF(CMAKE_CL_64) 51 | LINK_DIRECTORIES(${CONTRIB_SOURCE_DIR}/pcap/windows/WpdPack/Lib/x64) 52 | ELSE() 53 | LINK_DIRECTORIES(${CONTRIB_SOURCE_DIR}/pcap/windows/WpdPack/Lib) 54 | ENDIF() 55 | 56 | SET(ARCH_LIBRARIES wpcap iphlpapi) 57 | 58 | ################################################################################ 59 | # Set architecture specific installation files 60 | IF (DEFINED OPLKDLL) 61 | IF(NOT (${OPLKDLL} STREQUAL "OPLKDLL-NOTFOUND")) 62 | INSTALL(FILES ${OPLKDLL} 63 | DESTINATION ${CMAKE_PROJECT_NAME} 64 | CONFIGURATIONS "Release" 65 | ) 66 | ENDIF() 67 | ENDIF() 68 | 69 | IF (DEFINED OPLKDLL_DEBUG) 70 | IF(NOT (${OPLKDLL_DEBUG} STREQUAL "OPLKDLL_DEBUG-NOTFOUND")) 71 | INSTALL(FILES ${OPLKDLL_DEBUG} 72 | DESTINATION ${CMAKE_PROJECT_NAME} 73 | CONFIGURATIONS "Debug" 74 | ) 75 | ENDIF() 76 | ENDIF() 77 | --------------------------------------------------------------------------------