├── .gitattributes ├── .gitignore ├── .gitmodules ├── .travis.yml ├── CMakeLists.txt ├── LICENSE ├── README.md ├── __init__.py ├── examples ├── master.py ├── master_cmd.py ├── outstation.py ├── outstation_cmd.py └── visitors.py ├── imasteroperations.patch ├── requirements.txt ├── reset_dnp3_submodule.sh ├── reset_pybind11_submodule.sh ├── settings.cmake ├── setup.py ├── src ├── asiodnp3 │ ├── AllHeaders.h │ ├── ConsoleLogger.h │ ├── DNP3Manager.h │ ├── DatabaseConfig.h │ ├── DefaultListenCallbacks.h │ ├── DefaultMasterApplication.h │ ├── ErrorCodes.h │ ├── IChannel.h │ ├── IChannelListener.h │ ├── IListenCallbacks.h │ ├── IMaster.h │ ├── IMasterOperations.h │ ├── IMasterScan.h │ ├── IMasterSession.h │ ├── IOutstation.h │ ├── ISessionAcceptor.h │ ├── IStack.h │ ├── MasterStackConfig.h │ ├── MasterTCPServer.h │ ├── OutstationStackConfig.h │ ├── PrintingChannelListener.h │ ├── PrintingCommandCallback.h │ ├── PrintingSOEHandler.h │ ├── UpdateBuilder.h │ ├── Updates.h │ └── X509Info.h ├── asiopal │ ├── ASIOSerialHelpers.h │ ├── AllHeaders.h │ ├── ChannelRetry.h │ ├── Executor.h │ ├── IAsyncChannel.h │ ├── IChannelCallbacks.h │ ├── IListener.h │ ├── IO.h │ ├── IOpenDelayStrategy.h │ ├── IPEndpoint.h │ ├── IResourceManager.h │ ├── LoggingConnectionCondition.h │ ├── ResourceManager.h │ ├── SerialChannel.h │ ├── SerialTypes.h │ ├── SocketChannel.h │ ├── SocketHelpers.h │ ├── SteadyClock.h │ ├── Synchronized.h │ ├── TCPClient.h │ ├── TCPServer.h │ ├── TLSConfig.h │ ├── ThreadPool.h │ ├── TimeConversions.h │ ├── Timer.h │ └── UTCTimeSource.h ├── opendnp3 │ ├── AllHeaders.h │ ├── LogLevels.h │ ├── StackStatistics.h │ ├── app │ │ ├── AnalogCommandEvent.h │ │ ├── AnalogOutput.h │ │ ├── AppConstants.h │ │ ├── BaseMeasurementTypes.h │ │ ├── BinaryCommandEvent.h │ │ ├── ClassField.h │ │ ├── ControlRelayOutputBlock.h │ │ ├── DNPTime.h │ │ ├── EventCells.h │ │ ├── EventTriggers.h │ │ ├── EventType.h │ │ ├── Flags.h │ │ ├── GroupVariationID.h │ │ ├── IINField.h │ │ ├── ITransactable.h │ │ ├── Indexed.h │ │ ├── MeasurementInfo.h │ │ ├── MeasurementTypeSpecs.h │ │ ├── MeasurementTypes.h │ │ ├── OctetData.h │ │ ├── OctetString.h │ │ ├── QualityMasks.h │ │ ├── SecurityStat.h │ │ └── parsing │ │ │ └── ICollection.h │ ├── gen │ │ ├── AnalogOutputStatusQuality.h │ │ ├── AnalogQuality.h │ │ ├── AssignClassType.h │ │ ├── Attributes.h │ │ ├── AuthErrorCode.h │ │ ├── BinaryOutputStatusQuality.h │ │ ├── BinaryQuality.h │ │ ├── CertificateType.h │ │ ├── ChallengeReason.h │ │ ├── ChannelState.h │ │ ├── CommandPointState.h │ │ ├── CommandStatus.h │ │ ├── ConfigAuthMode.h │ │ ├── ControlCode.h │ │ ├── CounterQuality.h │ │ ├── DoubleBit.h │ │ ├── DoubleBitBinaryQuality.h │ │ ├── EventAnalogOutputStatusVariation.h │ │ ├── EventAnalogVariation.h │ │ ├── EventBinaryOutputStatusVariation.h │ │ ├── EventBinaryVariation.h │ │ ├── EventCounterVariation.h │ │ ├── EventDoubleBinaryVariation.h │ │ ├── EventFrozenCounterVariation.h │ │ ├── EventMode.h │ │ ├── EventSecurityStatVariation.h │ │ ├── FlagsType.h │ │ ├── FlowControl.h │ │ ├── FrozenCounterQuality.h │ │ ├── FunctionCode.h │ │ ├── GroupVariation.h │ │ ├── HMACType.h │ │ ├── IndexMode.h │ │ ├── IntervalUnits.h │ │ ├── KeyChangeMethod.h │ │ ├── KeyStatus.h │ │ ├── KeyWrapAlgorithm.h │ │ ├── LinkFunction.h │ │ ├── LinkStatus.h │ │ ├── MasterTaskType.h │ │ ├── OperateType.h │ │ ├── Parity.h │ │ ├── PointClass.h │ │ ├── QualifierCode.h │ │ ├── RestartMode.h │ │ ├── RestartType.h │ │ ├── SecurityStatIndex.h │ │ ├── StaticAnalogOutputStatusVariation.h │ │ ├── StaticAnalogVariation.h │ │ ├── StaticBinaryOutputStatusVariation.h │ │ ├── StaticBinaryVariation.h │ │ ├── StaticCounterVariation.h │ │ ├── StaticDoubleBinaryVariation.h │ │ ├── StaticFrozenCounterVariation.h │ │ ├── StaticSecurityStatVariation.h │ │ ├── StaticTimeAndIntervalVariation.h │ │ ├── StaticTypeBitmask.h │ │ ├── StopBits.h │ │ ├── TaskCompletion.h │ │ ├── TimeSyncMode.h │ │ ├── TimestampMode.h │ │ ├── UserOperation.h │ │ └── UserRole.h │ ├── link │ │ ├── ILinkListener.h │ │ ├── LinkConfig.h │ │ ├── LinkHeaderFields.h │ │ └── LinkStatistics.h │ ├── master │ │ ├── CommandCallbackT.h │ │ ├── CommandPointResult.h │ │ ├── CommandSet.h │ │ ├── HeaderInfo.h │ │ ├── HeaderTypes.h │ │ ├── ICommandCollection.h │ │ ├── ICommandProcessor.h │ │ ├── ICommandTaskResult.h │ │ ├── IMasterApplication.h │ │ ├── ISOEHandler.h │ │ ├── ITaskCallback.h │ │ ├── MasterParams.h │ │ ├── RestartOperationResult.h │ │ ├── TaskConfig.h │ │ ├── TaskId.h │ │ └── TaskInfo.h │ └── outstation │ │ ├── ApplicationIIN.h │ │ ├── Cell.h │ │ ├── DatabaseSizes.h │ │ ├── EventBufferConfig.h │ │ ├── ICommandHandler.h │ │ ├── IOutstationApplication.h │ │ ├── IUpdateHandler.h │ │ ├── MeasurementConfig.h │ │ ├── OutstationConfig.h │ │ ├── OutstationParams.h │ │ ├── SimpleCommandHandler.h │ │ └── StaticTypeBitfield.h ├── openpal │ ├── AllHeaders.h │ ├── Configure.h │ ├── channel │ │ ├── IPhysicalLayer.h │ │ └── IPhysicalLayerCallbacks.h │ ├── container │ │ ├── Array.h │ │ ├── ArrayView.h │ │ ├── Buffer.h │ │ ├── HasSize.h │ │ ├── LinkedList.h │ │ ├── Pair.h │ │ ├── Queue.h │ │ ├── RSlice.h │ │ ├── RingBuffer.h │ │ ├── SecureBuffer.h │ │ ├── Settable.h │ │ ├── StaticBuffer.h │ │ └── WSlice.h │ ├── executor │ │ ├── IExecutor.h │ │ ├── IMonotonicTimeSource.h │ │ ├── ITimer.h │ │ ├── IUTCTimeSource.h │ │ ├── MonotonicTimestamp.h │ │ ├── TimeDuration.h │ │ ├── TimerRef.h │ │ └── UTCTimestamp.h │ ├── logging │ │ ├── ILogHandler.h │ │ ├── LogEntry.h │ │ ├── LogFilters.h │ │ ├── LogLevels.h │ │ ├── Logger.h │ │ └── StringFormatting.h │ ├── serialization │ │ ├── DoubleFloat.h │ │ ├── FloatByteOrder.h │ │ ├── Format.h │ │ ├── Parse.h │ │ ├── Serialization.h │ │ ├── SerializationTemplatesLE.h │ │ ├── Serializer.h │ │ └── SingleFloat.h │ └── util │ │ ├── Comparisons.h │ │ ├── Finally.h │ │ ├── Limits.h │ │ ├── SequenceNum.h │ │ ├── ToHex.h │ │ └── Uncopyable.h ├── pydnp3.cpp ├── pydnp3asiodnp3.cpp ├── pydnp3asiopal.cpp ├── pydnp3opendnp3.cpp └── pydnp3openpal.cpp ├── tests ├── test_constants.py ├── test_constructors.py ├── test_enum_classes.py ├── test_hang.py ├── test_interface_classes.py ├── test_master.py ├── test_operators.py ├── test_outstation.py └── test_template.py └── wheel ├── pydnp3-0.1.0-cp27-cp27m-macosx_10_12_x86_64.whl ├── pydnp3-0.1.0-cp35-cp35m-macosx_10_12_x86_64.whl └── pydnp3-0.1.0-cp36-cp36m-macosx_10_12_x86_64.whl /.gitattributes: -------------------------------------------------------------------------------- 1 | *.patch text eol=lf 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | pydnp3/dnp3/ 20 | lib64/ 21 | parts/ 22 | sdist/ 23 | var/ 24 | wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .coverage 43 | .coverage.* 44 | .cache 45 | nosetests.xml 46 | coverage.xml 47 | *.cover 48 | .hypothesis/ 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | local_settings.py 57 | 58 | # Flask stuff: 59 | instance/ 60 | .webassets-cache 61 | 62 | # Scrapy stuff: 63 | .scrapy 64 | 65 | # Sphinx documentation 66 | docs/_build/ 67 | 68 | # PyBuilder 69 | target/ 70 | 71 | # Jupyter Notebook 72 | .ipynb_checkpoints 73 | 74 | # pyenv 75 | .python-version 76 | 77 | # celery beat schedule file 78 | celerybeat-schedule 79 | 80 | # SageMath parsed files 81 | *.sage.py 82 | 83 | # dotenv 84 | .env 85 | 86 | # virtualenv 87 | .venv 88 | venv/ 89 | ENV/ 90 | 91 | # Spyder project settings 92 | .spyderproject 93 | .spyproject 94 | 95 | # Rope project settings 96 | .ropeproject 97 | 98 | # mkdocs documentation 99 | /site 100 | 101 | # mypy 102 | .mypy_cache/ 103 | *.pytest_cache/ 104 | 105 | # VisualStudio and VisualStudio Code project settings 106 | .vscode/ 107 | .vs/ 108 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "deps/pybind11"] 2 | path = deps/pybind11 3 | url = https://github.com/Kisensum/pybind11.git 4 | [submodule "deps/dnp3"] 5 | path = deps/dnp3 6 | url = https://github.com/automatak/dnp3.git 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: python 2 | 3 | matrix: 4 | include: 5 | - os: linux 6 | addons: 7 | apt: 8 | sources: 9 | - ubuntu-toolchain-r-test 10 | packages: 11 | - g++-5 12 | - cmake 13 | env: 14 | - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" 15 | - PYTHON=2.7 16 | sudo: required 17 | - os: linux 18 | addons: 19 | apt: 20 | sources: 21 | - ubuntu-toolchain-r-test 22 | packages: 23 | - g++-5 24 | - cmake 25 | env: 26 | - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" 27 | - PYTHON=3.6 28 | sudo: required 29 | 30 | before_install: 31 | - eval "${MATRIX_EVAL}" 32 | - sudo apt-get update -qq 33 | - sudo apt-get install -y build-essential python-dev openssl libssl-dev libevent-dev 34 | - sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5 35 | - pip install -U pip 36 | - python setup.py install 37 | 38 | script: 39 | - pytest tests/ -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.8) 2 | 3 | project (pydnp3) 4 | set(PYDNP3_MAJOR_VERSION 0) 5 | set(PYDNP3_MINOR_VERSION 1) 6 | set(PYDNP3_MICRO_VERSION 1) 7 | set(PYDNP3_VERSION ${PYDNP3_MAJOR_VERSION}.${PYDNP3_MINOR_VERSION}.${PYDNP3_MICRO_VERSION}) 8 | 9 | if(NOT CMAKE_BUILD_TYPE) 10 | set(CMAKE_BUILD_TYPE "Release" CACHE STRING 11 | "Choose the type of build, options are: Debug Release 12 | RelWithDebInfo MinSizeRel." 13 | FORCE) 14 | endif() 15 | 16 | message("CMake build is: ${CMAKE_BUILD_TYPE}") 17 | 18 | 19 | #include(${PROJECT_SOURCE_DIR}/settings.cmake) 20 | 21 | 22 | # other options off-by-default that you can enable 23 | option(WERROR "Set all warnings to errors" OFF) 24 | option(STATICLIBS "Builds static versions of all installed libraries" OFF) 25 | option(COVERAGE "Builds the libraries with coverage info for gcov (gcc only)" OFF) 26 | option(PROFILE "Builds the libraries with profiling support (gcc only)" OFF) 27 | 28 | set(CMAKE_REQUIRED_FLAGS ${CMAKE_CXX_FLAGS}) 29 | 30 | set(STATICLIBS ON) 31 | 32 | if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC") 33 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") 34 | endif() 35 | 36 | add_subdirectory(deps/pybind11) 37 | add_subdirectory(deps/dnp3) 38 | 39 | # include paths for all the local libraries 40 | include_directories(deps/dnp3/cpp/libs/include) 41 | include_directories(deps/dnp3/cpp/libs/src) 42 | 43 | # asio 44 | include_directories(deps/dnp3/deps/asio/asio/include) 45 | add_definitions(-DASIO_STANDALONE) 46 | 47 | pybind11_add_module(pydnp3 MODULE src/pydnp3.cpp src/pydnp3asiodnp3.cpp src/pydnp3asiopal.cpp src/pydnp3opendnp3.cpp src/pydnp3openpal.cpp) 48 | target_link_libraries(pydnp3 PRIVATE asiopal asiodnp3 openpal opendnp3) 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pydnp3 2 | Python bindings for the [opendnp3](https://github.com/automatak/dnp3) library, an open source 3 | implementation of the [DNP3](http://ww.dnp.org) protocol stack written in C++14. 4 | 5 | Note: This is a work in progress. See [Issues](http://github.com/Kisensum/pydnp3/issues) for things we know about and feel free to add your own. 6 | 7 | **Supported Platforms:** Linux, MacOS 8 | 9 | ## Dependencies 10 | To build the library from source, you must have: 11 | 12 | * A toolchain with a C++14 compiler 13 | * CMake >= 2.8.12 (https://cmake.org/download/) 14 | 15 | This repository includes two repositories as submodules (under `deps/`): 16 | 17 | * dnp3 (https://github.com/automatak/dnp3) 18 | * pybind11 (https://github.com/Kisensum/pybind11) - This is a fork containing a minor patch 19 | required to compile some of the pydnp3 wrapper code. It will be replaced with pybind11 proper 20 | when the issue is resolved. 21 | 22 | ## Build & Install 23 | At the moment, this library must be built from source: 24 | ``` 25 | $ clone --recursive http://github.com/Kisensum/pydnp3 26 | $ cd pydnp3 27 | $ python setup.py install 28 | ``` 29 | 30 | 31 | ## Documentation 32 | 33 | pydnp3 is a thin wrapper around most all of the opendnp3 classes. Documentation for the opendnp3 34 | classes is available at [automatak](https://www.automatak.com/opendnp3/#documentation). 35 | 36 | Use python's help to discover the available wrapper classes and functions. For example, 37 | 38 | ``` 39 | > import pydnp3 40 | > help (pydnp3.opendnp3) 41 | Help on module pydnp3.opendnp3 in pydnp3: 42 | 43 | NAME 44 | pydnp3.opendnp3 - Bindings for opendnp3 namespace 45 | 46 | FILE 47 | (built-in) 48 | 49 | CLASSES 50 | pybind11_builtins.pybind11_object(__builtin__.object) 51 | AnalogCommandEvent 52 | AnalogInfo 53 | AnalogSpec 54 | ... 55 | ``` 56 | 57 | -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChargePoint/pydnp3/3699581dc80409b82e0d64a71b26e0db1863525a/__init__.py -------------------------------------------------------------------------------- /imasteroperations.patch: -------------------------------------------------------------------------------- 1 | diff --git a/cpp/libs/include/asiodnp3/IMasterOperations.h b/cpp/libs/include/asiodnp3/IMasterOperations.h 2 | index f056323e4..75cad0273 100644 3 | --- a/cpp/libs/include/asiodnp3/IMasterOperations.h 4 | +++ b/cpp/libs/include/asiodnp3/IMasterOperations.h 5 | @@ -40,6 +40,7 @@ 6 | 7 | #include 8 | #include 9 | +#include 10 | 11 | namespace asiodnp3 12 | { 13 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | attrs==17.4.0 2 | cmake==0.9.0 3 | funcsigs==1.0.2 4 | pluggy==0.6.0 5 | py==1.5.2 6 | pytest==3.4.0 7 | six==1.11.0 -------------------------------------------------------------------------------- /reset_dnp3_submodule.sh: -------------------------------------------------------------------------------- 1 | git rm --cached deps/dnp3 2 | rm -rf .git/modules/deps/dnp3 3 | rm -rf deps/dnp3 4 | cd deps 5 | git submodule add https://github.com/automatak/dnp3.git 6 | git submodule update --init --recursive 7 | cd dnp3 8 | git checkout 71e767f4c4baae8e866406b964d9e8ffaafa02d8 9 | cd ../.. -------------------------------------------------------------------------------- /reset_pybind11_submodule.sh: -------------------------------------------------------------------------------- 1 | git rm --cached deps/pybind11 2 | rm -rf .git/modules/deps/pybind11 3 | rm -rf deps/pybind11 4 | cd deps 5 | git submodule add https://github.com/Kisensum/pybind11.git 6 | git submodule update --init --recursive 7 | cd .. -------------------------------------------------------------------------------- /settings.cmake: -------------------------------------------------------------------------------- 1 | get_filename_component(settings_cmake_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) 2 | 3 | if (UNIX) 4 | set(PTHREAD pthread) 5 | find_package(Threads) 6 | if(STATICLIBS) 7 | set(LIB_TYPE STATIC) 8 | else() 9 | set(LIB_TYPE SHARED) 10 | endif() 11 | 12 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-multichar -Wunused-variable -Wno-unused-parameter -Wunused-function -Wunused -Wno-system-headers -Wwrite-strings -save-temps") 13 | 14 | if (${CYGWIN}) 15 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") 16 | elseif(${MINGW}) 17 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") 18 | else() 19 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") 20 | endif() 21 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-parentheses -std=c++14") 22 | 23 | set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g") 24 | set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") 25 | set(CMAKE_CXX_FLAGS_RELEASE "-O4 -DNDEBUG") 26 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") 27 | 28 | # Compiler-specific C++14 activation. 29 | if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") 30 | if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9) 31 | message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.9 or greater") 32 | endif () 33 | elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") 34 | if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5) 35 | message(FATAL_ERROR "${PROJECT_NAME} requires clang 3.5 or greater") 36 | endif () 37 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") 38 | else () 39 | message(FATAL_ERROR "Your C++ compiler does not support C++14: ${CMAKE_CXX_COMPILER_ID} - ${CMAKE_CXX_COMPILER_VERSION}") 40 | endif () 41 | 42 | if(COVERAGE) 43 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") 44 | endif() 45 | 46 | if(PROFILE) 47 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") 48 | endif() 49 | 50 | if (WERROR) 51 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") 52 | 53 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-vaue") 54 | endif() 55 | 56 | endif() 57 | 58 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) 59 | -------------------------------------------------------------------------------- /src/asiodnp3/AllHeaders.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIODNP3_ALLHEADERS_H 32 | #define PYDNP3_ASIODNP3_ALLHEADERS_H 33 | 34 | // For this compilation unit, include the header file 35 | // related to asiodnp3 36 | #define PYDNP3_ASIODNP3 37 | 38 | // ---------- ASIODNP3 HEADERS ---------- 39 | #include "ConsoleLogger.h" 40 | #include "DatabaseConfig.h" 41 | #include "DefaultListenCallbacks.h" 42 | #include "DefaultMasterApplication.h" 43 | #include "DNP3Manager.h" 44 | #include "ErrorCodes.h" 45 | #include "IChannel.h" 46 | #include "IChannelListener.h" 47 | #include "IListenCallbacks.h" 48 | #include "IMaster.h" 49 | #include "IMasterOperations.h" 50 | #include "IMasterScan.h" 51 | #include "IMasterSession.h" 52 | #include "IOutstation.h" 53 | #include "ISessionAcceptor.h" 54 | #include "IStack.h" 55 | #include "MasterStackConfig.h" 56 | #include "MasterTCPServer.h" 57 | #include "OutstationStackConfig.h" 58 | #include "PrintingChannelListener.h" 59 | #include "PrintingCommandCallback.h" 60 | #include "PrintingSOEHandler.h" 61 | #include "UpdateBuilder.h" 62 | #include "Updates.h" 63 | #include "X509Info.h" 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/asiodnp3/ConsoleLogger.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIODNP3_CONSOLELOGGER_H 32 | #define PYDNP3_ASIODNP3_CONSOLELOGGER_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIODNP3 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_ConsoleLogger(py::module &m) 44 | { 45 | // ----- class: asiodnp3::ConsoleLogger ----- 46 | py::class_>(m, "ConsoleLogger", 49 | "LogHandler that prints all log messages to the console.") 50 | 51 | .def( 52 | py::init(), 53 | ":param printLocation: defaults to False", 54 | py::arg("printLocation") = false 55 | ) 56 | 57 | .def( 58 | "Log", 59 | &asiodnp3::ConsoleLogger::Log, 60 | " Callback method for log messages. \n" 61 | ":param entry: the log message to handle", 62 | py::arg("entry") 63 | ) 64 | 65 | .def_static( 66 | "Create", 67 | &asiodnp3::ConsoleLogger::Create, 68 | ":param printLocation: defaults to False \n" 69 | ":return: shared_ptr to openpal.ILogHandler", 70 | py::arg("printLocation") = false 71 | ); 72 | } 73 | 74 | #endif // PYDNP3_ASIODNP3 75 | #endif 76 | -------------------------------------------------------------------------------- /src/asiodnp3/IMasterScan.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIODNP3_IMASTERSCAN_H 32 | #define PYDNP3_ASIODNP3_IMASTERSCAN_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIODNP3 40 | 41 | namespace py = pybind11; 42 | 43 | namespace asiodnp3 44 | { 45 | /** 46 | * Overriding virtual functions from interface class IMasterScan. 47 | */ 48 | class PyIMasterScan : public IMasterScan 49 | { 50 | /* Inherit the constructors */ 51 | using IMasterScan::IMasterScan; 52 | 53 | /* Trampoline for IMasterScan virtual functions */ 54 | void Demand() override { 55 | PYBIND11_OVERLOAD_PURE( 56 | void, 57 | IMasterScan, 58 | Demand, 59 | ); 60 | } 61 | }; 62 | } 63 | 64 | void bind_IMasterScan(py::module &m) 65 | { 66 | // ----- class: asiodnp3::IMasterScan ----- 67 | py::class_>(m, "IMasterScan", 68 | "Interface for interacting with a permanently bound scan.") 69 | 70 | .def(py::init<>()) 71 | 72 | .def( 73 | "Demand", 74 | &asiodnp3::IMasterScan::Demand, 75 | "Request that the scan be performed as soon as possible." 76 | ); 77 | } 78 | 79 | #endif // PYDNP3_ASIODNP3 80 | #endif 81 | -------------------------------------------------------------------------------- /src/asiodnp3/MasterStackConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIODNP3_MASTERSTACKCONFIG_H 32 | #define PYDNP3_ASIODNP3_MASTERSTACKCONFIG_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIODNP3 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_MasterStackConfig(py::module &m) 44 | { 45 | // ----- class: asiodnp3::MasterStackConfig ----- 46 | py::class_(m, "MasterStackConfig", 47 | "A composite configuration struct that contains all the config information for a dnp3 master stack.") 48 | 49 | .def(py::init<>()) 50 | 51 | .def_readwrite( 52 | "master", 53 | &asiodnp3::MasterStackConfig::master, 54 | "Master config." 55 | ) 56 | 57 | .def_readwrite( 58 | "link", 59 | &asiodnp3::MasterStackConfig::link, 60 | "Link layer config." 61 | ); 62 | } 63 | 64 | #endif // PYDNP3_ASIODNP3 65 | #endif 66 | -------------------------------------------------------------------------------- /src/asiodnp3/PrintingChannelListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIODNP3_PRINTINGCHANNELLISTENER_H 32 | #define PYDNP3_ASIODNP3_PRINTINGCHANNELLISTENER_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIODNP3 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_PrintingChannelListener(py::module &m) 44 | { 45 | // ----- class: asiodnp3::PrintingChannelListener ----- 46 | py::class_>(m, "PrintingChannelListener", 49 | "Callback interface for receiving information about a running channel.") 50 | 51 | .def(py::init<>()) 52 | 53 | // @todo Return value policy experimental 54 | .def_static( 55 | "Create", 56 | &asiodnp3::PrintingChannelListener::Create, 57 | ":return: shared_ptr to asiodnp3.IChannelListener", 58 | py::return_value_policy::reference 59 | ) 60 | 61 | .def( 62 | "OnStateChange", 63 | &asiodnp3::PrintingChannelListener::OnStateChange 64 | ); 65 | } 66 | 67 | #endif // PYDNP3_ASIODNP3 68 | #endif 69 | -------------------------------------------------------------------------------- /src/asiodnp3/PrintingCommandCallback.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIODNP3_PRINTINGCOMMANDCALLBACK_H 32 | #define PYDNP3_ASIODNP3_PRINTINGCOMMANDCALLBACK_H 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | 40 | #ifdef PYDNP3_ASIODNP3 41 | 42 | namespace py = pybind11; 43 | 44 | void bind_PrintingCommandCallback(py::module &m) 45 | { 46 | // ----- class: asiodnp3::PrintingCommandCallback ----- 47 | py::class_(m, "PrintingCommandCallback") 48 | 49 | .def_static( 50 | "Get", 51 | &asiodnp3::PrintingCommandCallback::Get 52 | ); 53 | } 54 | 55 | #endif // PYDNP3_ASIODNP3 56 | #endif 57 | -------------------------------------------------------------------------------- /src/asiodnp3/Updates.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIODNP3_UPDATES_H 32 | #define PYDNP3_ASIODNP3_UPDATES_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIODNP3 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_Updates(py::module &m) 44 | { 45 | // ----- class: asiodnp3::update_func_t ----- 46 | py::class_(m, "update_func_t"); 47 | 48 | // ----- class: asiodnp3::shared_updates_t ----- 49 | py::class_(m, "shared_updates_t"); 50 | 51 | // ----- class: asiodnp3::Updates ----- 52 | py::class_(m, "Updates") 53 | 54 | .def( 55 | "Apply", 56 | &asiodnp3::Updates::Apply, 57 | py::arg("handler") 58 | ) 59 | 60 | .def( 61 | "IsEmpty", 62 | &asiodnp3::Updates::IsEmpty 63 | ); 64 | } 65 | 66 | #endif // PYDNP3_ASIODNP3 67 | #endif 68 | -------------------------------------------------------------------------------- /src/asiodnp3/X509Info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIODNP3_X509INFO_H 32 | #define PYDNP3_ASIODNP3_X509INFO_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIODNP3 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_X509Info(py::module &m) 44 | { 45 | // ----- class: asiodnp3::X509Info ----- 46 | py::class_(m, "X509Info", 47 | "Select information from a preverified x509 certificate that user can can inspect an optionally reject.") 48 | 49 | .def( 50 | py::init(), 51 | py::arg("depth"), py::arg("sha1thumbprint"), py::arg("subjectName") 52 | ) 53 | 54 | .def_readwrite( 55 | "depth", 56 | &asiodnp3::X509Info::depth, 57 | "The depth of the certificate in the chain." 58 | ) 59 | 60 | .def_readwrite( 61 | "sha1thumbprint", 62 | &asiodnp3::X509Info::sha1thumbprint, 63 | "The sha1 thumbprint." 64 | ) 65 | 66 | .def_readwrite( 67 | "subjectName", 68 | &asiodnp3::X509Info::subjectName, 69 | "The extracted subject name." 70 | ); 71 | } 72 | 73 | #endif // PYDNP3_ASIODNP3 74 | #endif 75 | -------------------------------------------------------------------------------- /src/asiopal/ASIOSerialHelpers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIOPAL_ASIOSERIALHELPERS_H 32 | #define PYDNP3_ASIOPAL_ASIOSERIALHELPERS_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIOPAL 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_ASIOSerialHelpers(py::module &m) 45 | { 46 | // ----- func: asiopal::Configure ----- 47 | m.def( 48 | "Configure", 49 | &asiopal::Configure, 50 | "Serial port configuration functions free to keep the classes simple.", 51 | py::arg("settings"), py::arg("port"), py::arg("ec") 52 | ); 53 | } 54 | 55 | #endif // PYDNP3_ASIOPAL 56 | #endif 57 | -------------------------------------------------------------------------------- /src/asiopal/AllHeaders.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIOPAL_ALLHEADERS_H 32 | #define PYDNP3_ASIOPAL_ALLHEADERS_H 33 | 34 | // For this compilation unit, include the header file 35 | // related to asiopal 36 | #define PYDNP3_ASIOPAL 37 | 38 | // ---------- ASIOPAL HEADERS ---------- 39 | #include "ASIOSerialHelpers.h" 40 | #include "ChannelRetry.h" 41 | #include "Executor.h" 42 | #include "IAsyncChannel.h" 43 | #include "IChannelCallbacks.h" 44 | #include "IListener.h" 45 | #include "IO.h" 46 | #include "IOpenDelayStrategy.h" 47 | #include "IPEndpoint.h" 48 | #include "IResourceManager.h" 49 | #include "LoggingConnectionCondition.h" 50 | #include "ResourceManager.h" 51 | #include "SerialChannel.h" 52 | #include "SerialTypes.h" 53 | #include "SocketChannel.h" 54 | #include "SocketHelpers.h" 55 | #include "SteadyClock.h" 56 | #include "Synchronized.h" 57 | #include "TCPClient.h" 58 | #include "TCPServer.h" 59 | #include "ThreadPool.h" 60 | #include "TimeConversions.h" 61 | #include "Timer.h" 62 | #include "TLSConfig.h" 63 | #include "UTCTimeSource.h" 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/asiopal/IListener.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIOPAL_ILISTENER_H 32 | #define PYDNP3_ASIOPAL_ILISTENER_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIOPAL 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | namespace asiopal 45 | { 46 | /** 47 | * Overriding virtual functions from interface class IListener. 48 | */ 49 | class PyIListener : public IListener 50 | { 51 | public: 52 | /* Inherit the constructors */ 53 | using IListener::IListener; 54 | 55 | /* Trampoline for IResource virtual functions */ 56 | void Shutdown() override { 57 | PYBIND11_OVERLOAD_PURE( 58 | void, 59 | IResource, 60 | Shutdown, 61 | ); 62 | } 63 | }; 64 | } 65 | 66 | void bind_IListener(py::module &m) 67 | { 68 | // ----- class: asiopal::IListener ----- 69 | py::class_>(m, "IListener", 73 | "Represents a running TCP or TLS listener that can be shutdown so that no new connections are accepted.") 74 | 75 | .def(py::init<>()); 76 | } 77 | 78 | #endif // PYDNP3_ASIOPAL 79 | #endif 80 | -------------------------------------------------------------------------------- /src/asiopal/IO.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIOPAL_IO_H 32 | #define PYDNP3_ASIOPAL_IO_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIOPAL 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | namespace asiopal 45 | { 46 | /** 47 | * Overriding virtual functions from interface class IO. 48 | */ 49 | class PyIO : public IO 50 | { 51 | public: 52 | /* Inherit the constructors */ 53 | using IO::IO; 54 | }; 55 | } 56 | 57 | void bind_IO(py::module &m) 58 | { 59 | // ----- class: asiopal::IO ----- 60 | py::class_>(m, "IO", 61 | "Container class for an asio::io_service.") 62 | 63 | .def(py::init<>()) 64 | 65 | .def_readonly( 66 | "service", 67 | &asiopal::IO::service 68 | ); 69 | } 70 | 71 | #endif // PYDNP3_ASIOPAL 72 | #endif 73 | -------------------------------------------------------------------------------- /src/asiopal/IPEndpoint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIOPAL_IPENDPOINT_H 32 | #define PYDNP3_ASIOPAL_IPENDPOINT_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIOPAL 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_IPEndpoint(py::module &m) 45 | { 46 | // ----- class: asiopal::IPEndpoint ----- 47 | py::class_(m, "IPEndpoint") 48 | 49 | .def( 50 | py::init(), 51 | ":type port: unsigned short", 52 | py::arg("address"), py::arg("port") 53 | ) 54 | 55 | .def_static( 56 | "AllAdapters", 57 | &asiopal::IPEndpoint::AllAdapters, 58 | ":type port: unsigned short", 59 | py::arg("port") 60 | ) 61 | 62 | .def_static( 63 | "AllAdapters", 64 | &asiopal::IPEndpoint::Localhost, 65 | ":type port: unsigned short", 66 | py::arg("port") 67 | ) 68 | 69 | .def_readwrite( 70 | "address", 71 | &asiopal::IPEndpoint::address 72 | ) 73 | 74 | .def_readwrite( 75 | "port", 76 | &asiopal::IPEndpoint::port, 77 | ":type port: unsigned short" 78 | ); 79 | } 80 | 81 | #endif // PYDNP3_ASIOPAL 82 | #endif 83 | -------------------------------------------------------------------------------- /src/asiopal/LoggingConnectionCondition.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIOPAL_LOGGINGCONNECTIONCONDITION_H 32 | #define PYDNP3_ASIOPAL_LOGGINGCONNECTIONCONDITION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIOPAL 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_LoggingConnectionCondition(py::module &m) 45 | { 46 | // ----- class: asiopal::LoggingConnectionCondition ----- 47 | py::class_(m, "LoggingConnectionCondition") 48 | 49 | .def( 50 | py::init(), 51 | py::arg("logger") 52 | ); 53 | } 54 | 55 | #endif // PYDNP3_ASIOPAL 56 | #endif 57 | -------------------------------------------------------------------------------- /src/asiopal/SerialChannel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIOPAL_SERIALCHANNEL_H 32 | #define PYDNP3_ASIOPAL_SERIALCHANNEL_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIOPAL 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_SerialChannel(py::module &m) 45 | { 46 | // ----- class: asiopal::SerialChannel ----- 47 | py::class_>(m, "SerialChannel") 50 | 51 | .def( 52 | py::init>(), 53 | py::arg("executor") 54 | ) 55 | 56 | .def_static( 57 | "Create", 58 | &asiopal::SerialChannel::Create, 59 | py::arg("executor") 60 | ) 61 | 62 | .def( 63 | "Open", 64 | &asiopal::SerialChannel::Open, 65 | py::arg("settings"), py::arg("ec") 66 | ); 67 | } 68 | 69 | #endif // PYDNP3_ASIOPAL 70 | #endif 71 | -------------------------------------------------------------------------------- /src/asiopal/SocketChannel.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIOPAL_SOCKETCHANNEL_H 32 | #define PYDNP3_ASIOPAL_SOCKETCHANNEL_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIOPAL 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_SocketChannel(py::module &m) 45 | { 46 | // ----- class: asiopal::SocketChannel ----- 47 | py::class_>(m, "SocketChannel"); 50 | } 51 | 52 | #endif // PYDNP3_ASIOPAL 53 | #endif 54 | -------------------------------------------------------------------------------- /src/asiopal/SocketHelpers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIOPAL_SOCKETHELPERS_H 32 | #define PYDNP3_ASIOPAL_SOCKETHELPERS_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIOPAL 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_SocketHelpers(py::module &m) 45 | { 46 | // ----- class: asiopal::SocketHelpers ----- 47 | py::class_(m, "SocketHelpers", 48 | "Bind a socket object to a local endpoint given an address. If the address is empty, 0.0.0.0 is used.") 49 | 50 | .def_static( 51 | "BindToLocalAddress", 52 | &asiopal::SocketHelpers::BindToLocalAddress 53 | ); 54 | } 55 | 56 | #endif // PYDNP3_ASIOPAL 57 | #endif 58 | -------------------------------------------------------------------------------- /src/asiopal/SteadyClock.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIOPAL_STEADYCLOCK_H 32 | #define PYDNP3_ASIOPAL_STEADYCLOCK_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIOPAL 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_SteadyClock(py::module &m) 45 | { 46 | // ----- struct: asiopal::steady_clock_t ----- 47 | py::class_(m, "steady_clock_t", 48 | "Custom steady clock implementation to handle the situation where the Windows steady clock implementation " 49 | "is not monotonic. \n" 50 | "Normal steady clock implementation is used on other platforms.") 51 | 52 | .def(py::init<>()) 53 | 54 | .def_static( 55 | "now", 56 | &asiopal::steady_clock_t::now 57 | ); 58 | } 59 | 60 | #endif // PYDNP3_ASIOPAL 61 | #endif 62 | -------------------------------------------------------------------------------- /src/asiopal/Synchronized.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIOPAL_SYNCHRONIZED_H 32 | #define PYDNP3_ASIOPAL_SYNCHRONIZED_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIOPAL 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | template 45 | void declareSynchronized(py::module &m, string const & type) 46 | { 47 | // ----- class: asiopal::Synchronized ----- 48 | py::class_>(m, ("Synchronized" + type).c_str(), 49 | "Provides thread-safe access to a value that can be set once.") 50 | 51 | .def(py::init<>()) 52 | 53 | .def( 54 | "WaitForValue", 55 | &asiopal::Synchronized::WaitForValue 56 | ) 57 | 58 | .def( 59 | "SetValue", 60 | &asiopal::Synchronized::SetValue, 61 | py::arg("value") 62 | ); 63 | } 64 | 65 | void bind_Synchronized(py::module &m) 66 | { 67 | } 68 | 69 | #endif // PYDNP3_ASIOPAL 70 | #endif 71 | -------------------------------------------------------------------------------- /src/asiopal/TCPClient.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIOPAL_TCPCLIENT_H 32 | #define PYDNP3_ASIOPAL_TCPCLIENT_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIOPAL 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_TCPClient(py::module &m) 45 | { 46 | // ----- class: asiopal::TCPClient ----- 47 | py::class_>(m, "TCPClient") 48 | 49 | .def( 50 | py::init&, asiopal::IPEndpoint&, std::string&>(), 51 | py::arg("logger"), py::arg("executor"), py::arg("remote"), py::arg("adapter") 52 | ) 53 | 54 | .def_static( 55 | "Create", 56 | &asiopal::TCPClient::Create 57 | ) 58 | 59 | .def( 60 | "Cancel", 61 | &asiopal::TCPClient::Cancel 62 | ) 63 | 64 | .def( 65 | "BeginConnect", 66 | &asiopal::TCPClient::BeginConnect 67 | ); 68 | } 69 | 70 | #endif // PYDNP3_ASIOPAL 71 | #endif 72 | -------------------------------------------------------------------------------- /src/asiopal/TimeConversions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIOPAL_TIMECONVERSIONS_H 32 | #define PYDNP3_ASIOPAL_TIMECONVERSIONS_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIOPAL 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_TimeConversions(py::module &m) 45 | { 46 | // ----- class: asiopal::TimeConversions ----- 47 | py::class_(m, "TimeConversions") 48 | 49 | .def_static( 50 | "Convert", 51 | [](const openpal::MonotonicTimestamp& timestamp){ 52 | return asiopal::TimeConversions::Convert(timestamp); 53 | } 54 | ) 55 | 56 | .def_static( 57 | "Convert", 58 | [](const asiopal::steady_clock_t::time_point& timestamp){ 59 | return asiopal::TimeConversions::Convert(timestamp); 60 | } 61 | ); 62 | } 63 | 64 | #endif // PYDNP3_ASIOPAL 65 | #endif 66 | -------------------------------------------------------------------------------- /src/asiopal/Timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIOPAL_TIMER_H 32 | #define PYDNP3_ASIOPAL_TIMER_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIOPAL 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_Timer(py::module &m) 45 | { 46 | // ----- class: asiopal::Timer ----- 47 | py::class_(m, "Timer", 48 | "Implementation of openpal::ITimer backed by asio::basic_waitable_timer.") 49 | 50 | .def( 51 | py::init(), 52 | py::arg("service") 53 | ) 54 | 55 | .def( 56 | "Cancel", 57 | &asiopal::Timer::Cancel 58 | ) 59 | 60 | .def( 61 | "ExpireAt", 62 | &asiopal::Timer::ExpiresAt 63 | ); 64 | } 65 | 66 | #endif // PYDNP3_ASIOPAL 67 | #endif 68 | -------------------------------------------------------------------------------- /src/asiopal/UTCTimeSource.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_ASIOPAL_UTCTIMESOURCE_H 32 | #define PYDNP3_ASIOPAL_UTCTIMESOURCE_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_ASIOPAL 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_UTCTimeSource(py::module &m) 45 | { 46 | // ----- class: asiopal::UTCTimeSource ----- 47 | py::class_>(m, "UTCTimeSource", 50 | "Interface that defines a method to get UTC timestamps") 51 | 52 | .def_static( 53 | "Instance", 54 | &asiopal::UTCTimeSource::Instance 55 | ) 56 | 57 | .def( 58 | "Now", 59 | &asiopal::UTCTimeSource::Now 60 | ); 61 | } 62 | 63 | #endif // PYDNP3_ASIOPAL 64 | #endif 65 | -------------------------------------------------------------------------------- /src/opendnp3/app/AppConstants.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_APP_APPCONSTANTS_H 32 | #define PYDNP3_OPENDNP3_APP_APPCONSTANTS_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_AppConstants(py::module &m) 45 | { 46 | // ----- const: opendnp3::DEFAULT_MAX_APDU_SIZE ----- 47 | // The default size for an APDU 48 | m.attr("DEFAULT_MAX_APDU_SIZE") = &opendnp3::DEFAULT_MAX_APDU_SIZE; 49 | 50 | // ----- const: DEFAULT_APP_TIMEOUT ----- 51 | // Default timeout in milliseconds for the application layer 52 | m.attr("DEFAULT_APP_TIMEOUT") = &opendnp3::DEFAULT_APP_TIMEOUT; 53 | } 54 | 55 | #endif // PYDNP3_OPENDNP3 56 | #endif 57 | -------------------------------------------------------------------------------- /src/opendnp3/app/DNPTime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_APP_DNPTIME_H 32 | #define PYDNP3_OPENDNP3_APP_DNPTIME_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_DNPTime(py::module &m) { 45 | // ----- class: opendnp3::DNPTime ----- 46 | py::class_(m, "DNPTime") 47 | 48 | .def(py::init<>()) 49 | 50 | .def( 51 | py::init(), 52 | ":type value: long", 53 | py::arg("value") 54 | ) 55 | 56 | .def_readwrite( 57 | "value", 58 | &opendnp3::DNPTime::value, 59 | ":type value: long" 60 | ); 61 | } 62 | 63 | #endif // PYDNP3_OPENDNP3 64 | #endif 65 | -------------------------------------------------------------------------------- /src/opendnp3/app/EventTriggers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_APP_EVENTTRIGGERS_H 32 | #define PYDNP3_OPENDNP3_APP_EVENTTRIGGERS_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_EventTriggers(py::module &m) 45 | { 46 | // ----- func: opendnp3::measurements::IsEvent ----- 47 | m.def_submodule("measurements").def( 48 | "IsEvent", 49 | &opendnp3::measurements::IsEvent 50 | ); 51 | 52 | m.def_submodule("measurements").def( 53 | "IsEvent", 54 | (bool (*)(const opendnp3::TypedMeasurement&, const opendnp3::TypedMeasurement&, double)) 55 | &opendnp3::measurements::IsEvent, 56 | py::arg("newMeas"), py::arg("oldMeas"), py::arg("deadband") 57 | ); 58 | } 59 | 60 | #endif // PYDNP3_OPENDNP3 61 | #endif 62 | -------------------------------------------------------------------------------- /src/opendnp3/app/GroupVariationID.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_APP_GROUPVARIATIONID_H 32 | #define PYDNP3_OPENDNP3_APP_GROUPVARIATIONID_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_GroupVariationID(py::module &m) 45 | { 46 | // ----- class: opendnp3::GroupVariationID ----- 47 | py::class_(m, "GroupVariationID", 48 | "Simple uint8_t/uint8_t tuple for group and variation.") 49 | 50 | .def( 51 | py::init(), 52 | ":param group: defaults to 0xFF \n" 53 | ":param variation: defaults to 0xFF \n" 54 | ":type group: unsigned char \n" 55 | ":type varitaion: unsigned char", 56 | py::arg("group") = 0xFF, py::arg("variation") = 0xFF 57 | ) 58 | 59 | .def_readwrite( 60 | "group", 61 | &opendnp3::GroupVariationID::group, 62 | ":type group: unsigned char" 63 | ) 64 | 65 | .def_readwrite( 66 | "variation", 67 | &opendnp3::GroupVariationID::variation, 68 | ":type varitaion: unsigned char" 69 | ); 70 | } 71 | 72 | #endif // PYDNP3_OPENDNP3 73 | #endif 74 | -------------------------------------------------------------------------------- /src/opendnp3/app/OctetData.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_APP_OCTETDATA_H 32 | #define PYDNP3_OPENDNP3_APP_OCTETDATA_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_OctetData(py::module &m) 45 | { 46 | // ----- class: opendnp3::OctetData ----- 47 | py::class_>(m, "OctetData", 48 | "A base-class for bitstrings containing up to 255 bytes") 49 | 50 | .def(py::init<>()) 51 | 52 | .def( 53 | py::init(), 54 | py::arg("input") 55 | ) 56 | 57 | .def( 58 | "ToRSlice", 59 | &opendnp3::OctetData::ToRSlice 60 | ) 61 | 62 | .def_property_readonly_static( 63 | "MAX_SIZE", 64 | [](py::object) { return opendnp3::OctetData::MAX_SIZE; } 65 | ); 66 | } 67 | 68 | #endif // PYDNP3_OPENDNP3 69 | #endif 70 | -------------------------------------------------------------------------------- /src/opendnp3/app/OctetString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_APP_OCTETSTRING_H 32 | #define PYDNP3_OPENDNP3_APP_OCTETSTRING_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_OctetString(py::module &m) 45 | { 46 | // ----- class: opendnp3::OctetString ----- 47 | py::class_>(m, "OctetString", 48 | "Respresents group 110/111 objects.") 49 | 50 | .def(py::init<>()) 51 | 52 | .def( 53 | py::init(), 54 | py::arg("data") 55 | ) 56 | 57 | .def( 58 | py::init(), 59 | py::arg("buffer") 60 | ); 61 | } 62 | 63 | #endif // PYDNP3_OPENDNP3 64 | #endif 65 | -------------------------------------------------------------------------------- /src/opendnp3/app/QualityMasks.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_APP_QUALITYMASKS_H 32 | #define PYDNP3_OPENDNP3_APP_QUALITYMASKS_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | 43 | template 44 | void declareToUnderlying(py::module &m) 45 | { 46 | // ----- func: opendnp3::ToUnderlying ----- 47 | m.def( 48 | "ToUnderlying", 49 | &opendnp3::ToUnderlying, 50 | py::arg("flag") 51 | ); 52 | } 53 | 54 | void bind_QualityMasks(py::module &m) 55 | { 56 | declareToUnderlying(m); 57 | declareToUnderlying(m); 58 | declareToUnderlying(m); 59 | declareToUnderlying(m); 60 | declareToUnderlying(m); 61 | declareToUnderlying(m); 62 | declareToUnderlying(m); 63 | } 64 | 65 | #endif // PYDNP3_OPENDNP3 66 | #endif 67 | -------------------------------------------------------------------------------- /src/opendnp3/gen/AssignClassType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_ASSIGNCLASSTYPE_H 32 | #define PYDNP3_OPENDNP3_GEN_ASSIGNCLASSTYPE_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_AssignClassType(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::AssignClassType ----- 47 | py::enum_(m, "AssignClassType", 48 | "Groups that can be used inconjunction with the ASSIGN_CLASS function code.") 49 | 50 | .value("BinaryInput", opendnp3::AssignClassType::BinaryInput) 51 | .value("DoubleBinaryInput", opendnp3::AssignClassType::DoubleBinaryInput) 52 | .value("Counter", opendnp3::AssignClassType::Counter) 53 | .value("FrozenCounter", opendnp3::AssignClassType::FrozenCounter) 54 | .value("AnalogInput", opendnp3::AssignClassType::AnalogInput) 55 | .value("BinaryOutputStatus", opendnp3::AssignClassType::BinaryOutputStatus) 56 | .value("AnalogOutputStatus", opendnp3::AssignClassType::AnalogOutputStatus); 57 | } 58 | 59 | #endif // PYDNP3_OPENDNP3 60 | #endif 61 | -------------------------------------------------------------------------------- /src/opendnp3/gen/Attributes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_ATTRIBUTES_H 32 | #define PYDNP3_OPENDNP3_GEN_ATTRIBUTES_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_Attributes(py::module &m) 45 | { 46 | // ----- func: opendnp3::HasAbsoluteTime ----- 47 | m.def( 48 | "HasAbsoluteTime", 49 | &opendnp3::HasAbsoluteTime, 50 | py::arg("gv") 51 | ); 52 | 53 | // ----- func: opendnp3::HasRelativeTime ----- 54 | m.def( 55 | "HasRelativeTime", 56 | &opendnp3::HasRelativeTime, 57 | py::arg("gv") 58 | ); 59 | 60 | // ----- func: opendnp3::HasFlags ----- 61 | m.def( 62 | "HasFlags", 63 | &opendnp3::HasFlags, 64 | py::arg("gv") 65 | ); 66 | 67 | // ----- func: opendnp3::IsEvent ----- 68 | m.def( 69 | "IsEvent", 70 | (bool (*)(opendnp3::GroupVariation)) 71 | &opendnp3::IsEvent, 72 | py::arg("gv") 73 | ); 74 | } 75 | 76 | #endif // PYDNP3_OPENDNP3 77 | #endif 78 | -------------------------------------------------------------------------------- /src/opendnp3/gen/ConfigAuthMode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_CONFIGAUTHMODE_H 32 | #define PYDNP3_OPENDNP3_GEN_CONFIGAUTHMODE_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_ConfigAuthMode(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::ConfigAuthMode ----- 47 | py::enum_(m, "ConfigAuthMode", 48 | "Configuration enum for the authentication mode.") 49 | 50 | .value( 51 | "NONE", 52 | opendnp3::ConfigAuthMode::NONE, 53 | "No authentication." 54 | ) 55 | 56 | .value( 57 | "SAV5", 58 | opendnp3::ConfigAuthMode::SAV5, 59 | "Secure authentication version 5." 60 | ); 61 | } 62 | 63 | #endif // PYDNP3_OPENDNP3 64 | #endif 65 | -------------------------------------------------------------------------------- /src/opendnp3/gen/EventAnalogOutputStatusVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_EVENTANALOGOUTPUTSTATUSVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_EVENTANALOGOUTPUTSTATUSVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_EventAnalogOutputStatusVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::EventAnalogOutputStatusVariation 47 | py::enum_(m, "EventAnalogOutputStatusVariation") 48 | .value("Group42Var1", opendnp3::EventAnalogOutputStatusVariation::Group42Var1) 49 | .value("Group42Var2", opendnp3::EventAnalogOutputStatusVariation::Group42Var2) 50 | .value("Group42Var3", opendnp3::EventAnalogOutputStatusVariation::Group42Var3) 51 | .value("Group42Var4", opendnp3::EventAnalogOutputStatusVariation::Group42Var4) 52 | .value("Group42Var5", opendnp3::EventAnalogOutputStatusVariation::Group42Var5) 53 | .value("Group42Var6", opendnp3::EventAnalogOutputStatusVariation::Group42Var6) 54 | .value("Group42Var7", opendnp3::EventAnalogOutputStatusVariation::Group42Var7) 55 | .value("Group42Var8", opendnp3::EventAnalogOutputStatusVariation::Group42Var8); 56 | } 57 | 58 | #endif // PYDNP3_OPENDNP3 59 | #endif 60 | -------------------------------------------------------------------------------- /src/opendnp3/gen/EventAnalogVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_EVENTANALOGVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_EVENTANALOGVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_EventAnalogVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::EventAnalogVariation ----- 47 | py::enum_(m, "EventAnalogVariation") 48 | .value("Group32Var1", opendnp3::EventAnalogVariation::Group32Var1) 49 | .value("Group32Var2", opendnp3::EventAnalogVariation::Group32Var2) 50 | .value("Group32Var3", opendnp3::EventAnalogVariation::Group32Var3) 51 | .value("Group32Var4", opendnp3::EventAnalogVariation::Group32Var4) 52 | .value("Group32Var5", opendnp3::EventAnalogVariation::Group32Var5) 53 | .value("Group32Var6", opendnp3::EventAnalogVariation::Group32Var6) 54 | .value("Group32Var7", opendnp3::EventAnalogVariation::Group32Var7) 55 | .value("Group32Var8", opendnp3::EventAnalogVariation::Group32Var8); 56 | } 57 | 58 | #endif // PYDNP3_OPENDNP3 59 | #endif 60 | -------------------------------------------------------------------------------- /src/opendnp3/gen/EventBinaryOutputStatusVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_EVENTBINARYOUTPUTSTATUSVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_EVENTBINARYOUTPUTSTATUSVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_EventBinaryOutputStatusVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::EventBinaryOutputStatusVariation 47 | py::enum_(m, "EventBinaryOutputStatusVariation") 48 | .value("Group11Var1", opendnp3::EventBinaryOutputStatusVariation::Group11Var1) 49 | .value("Group11Var2", opendnp3::EventBinaryOutputStatusVariation::Group11Var2); 50 | } 51 | 52 | #endif // PYDNP3_OPENDNP3 53 | #endif 54 | -------------------------------------------------------------------------------- /src/opendnp3/gen/EventBinaryVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_EVENTBINARYVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_EVENTBINARYVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_EventBinaryVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::EventBinaryVariation ----- 47 | py::enum_(m, "EventBinaryVariation") 48 | .value("Group2Var1", opendnp3::EventBinaryVariation::Group2Var1) 49 | .value("Group2Var2", opendnp3::EventBinaryVariation::Group2Var2) 50 | .value("Group2Var3", opendnp3::EventBinaryVariation::Group2Var3); 51 | } 52 | 53 | #endif // PYDNP3_OPENDNP3 54 | #endif 55 | -------------------------------------------------------------------------------- /src/opendnp3/gen/EventCounterVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_EVENTCOUNTERVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_EVENTCOUNTERVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_EventCounterVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::EventCounterVariation 47 | py::enum_(m, "EventCounterVariation") 48 | .value("Group22Var1", opendnp3::EventCounterVariation::Group22Var1) 49 | .value("Group22Var2", opendnp3::EventCounterVariation::Group22Var2) 50 | .value("Group22Var5", opendnp3::EventCounterVariation::Group22Var5) 51 | .value("Group22Var6", opendnp3::EventCounterVariation::Group22Var6); 52 | } 53 | 54 | #endif // PYDNP3_OPENDNP3 55 | #endif 56 | -------------------------------------------------------------------------------- /src/opendnp3/gen/EventDoubleBinaryVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_EVENTDOUBLEBINARYVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_EVENTDOUBLEBINARYVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_EventDoubleBinaryVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::EventDoubleBinaryVariation 47 | py::enum_(m, "EventDoubleBinaryVariation") 48 | .value("Group4Var1", opendnp3::EventDoubleBinaryVariation::Group4Var1) 49 | .value("Group4Var2", opendnp3::EventDoubleBinaryVariation::Group4Var2) 50 | .value("Group4Var3", opendnp3::EventDoubleBinaryVariation::Group4Var3); 51 | } 52 | 53 | #endif // PYDNP3_OPENDNP3 54 | #endif 55 | -------------------------------------------------------------------------------- /src/opendnp3/gen/EventFrozenCounterVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_EVENTFROZENCOUNTERVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_EVENTFROZENCOUNTERVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_EventFrozenCounterVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::EventFrozenCounterVariation 47 | py::enum_(m, "EventFrozenCounterVariation") 48 | .value("Group23Var1", opendnp3::EventFrozenCounterVariation::Group23Var1) 49 | .value("Group23Var2", opendnp3::EventFrozenCounterVariation::Group23Var2) 50 | .value("Group23Var5", opendnp3::EventFrozenCounterVariation::Group23Var5) 51 | .value("Group23Var6", opendnp3::EventFrozenCounterVariation::Group23Var6); 52 | } 53 | 54 | #endif // PYDNP3_OPENDNP3 55 | #endif 56 | -------------------------------------------------------------------------------- /src/opendnp3/gen/EventMode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_EVENTMODE_H 32 | #define PYDNP3_OPENDNP3_GEN_EVENTMODE_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_EventMode(py::module &m) { 45 | // ----- enum class: opendnp3::EventMode 46 | py::enum_(m, "EventMode", 47 | "Describes how a transaction behaves with respect to event generation.") 48 | 49 | .value( 50 | "Detect", 51 | opendnp3::EventMode::Detect, 52 | "Detect events using the specific mechanism for that type." 53 | ) 54 | 55 | .value( 56 | "Force", 57 | opendnp3::EventMode::Force, 58 | "Force the creation of an event bypassing detection mechanism." 59 | ) 60 | 61 | .value( 62 | "Suppress", 63 | opendnp3::EventMode::Suppress, 64 | "Never produce an event regardless of changes." 65 | ); 66 | } 67 | 68 | #endif // PYDNP3_OPENDNP3 69 | #endif 70 | -------------------------------------------------------------------------------- /src/opendnp3/gen/EventSecurityStatVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_EVENTSECURITYSTATVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_EVENTSECURITYSTATVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_EventSecurityStatVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::EventSecurityStatVariation 47 | py::enum_(m, "EventSecurityStatVariation") 48 | .value("Group122Var1", opendnp3::EventSecurityStatVariation::Group122Var1) 49 | .value("Group122Var2", opendnp3::EventSecurityStatVariation::Group122Var2); 50 | } 51 | 52 | #endif // PYDNP3_OPENDNP3 53 | #endif 54 | -------------------------------------------------------------------------------- /src/opendnp3/gen/IndexMode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_INDEXMODE_H 32 | #define PYDNP3_OPENDNP3_GEN_INDEXMODE_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_IndexMode(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::IndexMode ----- 47 | py::enum_(m, "IndexMode", 48 | "Select contiguous or dis-contiguous index mode.") 49 | 50 | .value( 51 | "Contiguous", 52 | opendnp3::IndexMode::Contiguous, 53 | "Indices are contiguous. Most efficient as direct indexing is used." 54 | ) 55 | 56 | .value( 57 | "Discontiguous", 58 | opendnp3::IndexMode::Discontiguous, 59 | "Indices are dis-contiguous. Resorts to binary search to find raw index." 60 | ); 61 | } 62 | 63 | #endif // PYDNP3_OPENDNP3 64 | #endif 65 | -------------------------------------------------------------------------------- /src/opendnp3/gen/LinkStatus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_LINKSTATUS_H 32 | #define PYDNP3_OPENDNP3_GEN_LINKSTATUS_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_LinkStatus(py::module &m) 44 | { 45 | // ----- enum class: opendnp3::LinkStatus ----- 46 | py::enum_(m, "LinkStatus", 47 | "Enumeration for reset/unreset states of a link layer") 48 | 49 | .value( 50 | "UNRESET", 51 | opendnp3::LinkStatus::UNRESET, 52 | "DOWN." 53 | ) 54 | 55 | .value( 56 | "RESET", 57 | opendnp3::LinkStatus::RESET, 58 | "UP." 59 | ); 60 | 61 | // ----- func: opendnp3::LinkStatusToString ----- 62 | m.def( 63 | "LinkStatusToString", 64 | &opendnp3::LinkStatusToString, 65 | py::arg("linkStatus") 66 | ); 67 | } 68 | 69 | #endif // PYDNP3_OPENDNP3 70 | #endif 71 | -------------------------------------------------------------------------------- /src/opendnp3/gen/MasterTaskType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_MASTERTASKTYPE_H 32 | #define PYDNP3_OPENDNP3_GEN_MASTERTASKTYPE_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_MasterTaskType(py::module &m) 44 | { 45 | // ----- enum class: opendnp3::MasterTaskType ----- 46 | py::enum_(m, "MasterTaskType", 47 | "Enumeration of internal tasks.") 48 | 49 | .value("CLEAR_RESTART", opendnp3::MasterTaskType::CLEAR_RESTART) 50 | .value("DISABLE_UNSOLICITED", opendnp3::MasterTaskType::DISABLE_UNSOLICITED) 51 | .value("ASSIGN_CLASS", opendnp3::MasterTaskType::ASSIGN_CLASS) 52 | .value("STARTUP_INTEGRITY_POLL", opendnp3::MasterTaskType::STARTUP_INTEGRITY_POLL) 53 | .value("NON_LAN_TIME_SYNC", opendnp3::MasterTaskType::NON_LAN_TIME_SYNC) 54 | .value("LAN_TIME_SYNC", opendnp3::MasterTaskType::LAN_TIME_SYNC) 55 | .value("ENABLE_UNSOLICITED", opendnp3::MasterTaskType::ENABLE_UNSOLICITED) 56 | .value("AUTO_EVENT_SCAN", opendnp3::MasterTaskType::AUTO_EVENT_SCAN) 57 | .value("USER_TASK", opendnp3::MasterTaskType::USER_TASK); 58 | 59 | // ----- func: opendnp3::MasterTaskTypeToString ----- 60 | m.def( 61 | "MasterTaskTypeToString", 62 | &opendnp3::MasterTaskTypeToString 63 | ); 64 | } 65 | 66 | #endif // PYDNP3_OPENDNP3 67 | #endif 68 | -------------------------------------------------------------------------------- /src/opendnp3/gen/OperateType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_OPERATETYPE_H 32 | #define PYDNP3_OPENDNP3_GEN_OPERATETYPE_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_OperateType(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::OperateType ----- 47 | py::enum_(m, "OperateType", 48 | "Various ways that an outstation can receive a request to operate a BO or AO point.") 49 | 50 | .value( 51 | "SELECT_BEFORE_OPERATE", 52 | opendnp3::OperateType::SelectBeforeOperate, 53 | "The outstation received a valid prior SELECT followed by OPERATE." 54 | ) 55 | 56 | .value( 57 | "DIRECT_OPERATE", 58 | opendnp3::OperateType::DirectOperate, 59 | "The outstation received a direct operate request." 60 | ) 61 | 62 | .value( 63 | "DIRECT_OPERATE_NO_ACK", 64 | opendnp3::OperateType::DirectOperateNoAck, 65 | "The outstation received a direct operate no ack request." 66 | ); 67 | } 68 | 69 | #endif // PYDNP3_OPENDNP3 70 | #endif 71 | -------------------------------------------------------------------------------- /src/opendnp3/gen/Parity.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_PARITY_H 32 | #define PYDNP3_OPENDNP3_GEN_PARITY_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_Parity(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::Parity ----- 47 | py::enum_(m, "Parity", 48 | "Enumeration for setting serial port parity.") 49 | 50 | .value("Even", opendnp3::Parity::Even) 51 | .value("Odd", opendnp3::Parity::Odd) 52 | .value("None", opendnp3::Parity::None); 53 | 54 | // ----- func: opendnp3::ParityToType ----- 55 | m.def( 56 | "ParityToType", 57 | &opendnp3::ParityToType, 58 | py::arg("parity") 59 | ); 60 | 61 | // ----- func: opendnp3::ParityFromType ----- 62 | m.def( 63 | "ParityFromType", 64 | &opendnp3::ParityFromType, 65 | ":type rawType: unsigned char", 66 | py::arg("rawType") 67 | ); 68 | 69 | // ----- func: opendnp3::ParityToString ----- 70 | m.def( 71 | "ParityToString", 72 | &opendnp3::ParityToString, 73 | py::arg("parity") 74 | ); 75 | } 76 | 77 | #endif // PYDNP3_OPENDNP3 78 | #endif 79 | -------------------------------------------------------------------------------- /src/opendnp3/gen/PointClass.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_POINTCLASS_H 32 | #define PYDNP3_OPENDNP3_GEN_POINTCLASS_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_PointClass(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::PointClass ----- 47 | py::enum_(m, "PointClass", 48 | "Class assignment for a measurement point.") 49 | 50 | .value( 51 | "Class0", 52 | opendnp3::PointClass::Class0, 53 | "No event class assignment." 54 | ) 55 | 56 | .value( 57 | "Class1", 58 | opendnp3::PointClass::Class1, 59 | "Assigned to event class 1." 60 | ) 61 | 62 | .value( 63 | "Class2", 64 | opendnp3::PointClass::Class2, 65 | "Assigned to event class 2." 66 | ) 67 | 68 | .value( 69 | "Class3", 70 | opendnp3::PointClass::Class3, 71 | "Assigned to event class 3." 72 | ); 73 | } 74 | 75 | #endif // PYDNP3_OPENDNP3 76 | #endif 77 | -------------------------------------------------------------------------------- /src/opendnp3/gen/RestartMode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_RESTARTMODE_H 32 | #define PYDNP3_OPENDNP3_GEN_RESTARTMODE_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_RestartMode(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::RestartMode ----- 47 | py::enum_(m, "RestartMode", 48 | "Enumeration describing restart mode support of an outstation.") 49 | 50 | .value( 51 | "UNSUPPORTED", 52 | opendnp3::RestartMode::UNSUPPORTED, 53 | "Device does not support restart." 54 | ) 55 | 56 | .value( 57 | "SUPPORTED_DELAY_FINE", 58 | opendnp3::RestartMode::SUPPORTED_DELAY_FINE, 59 | "Supports restart, and time returned is a fine time delay." 60 | ) 61 | 62 | .value( 63 | "SUPPORTED_DELAY_COARSE", 64 | opendnp3::RestartMode::SUPPORTED_DELAY_COARSE, 65 | "Supports restart, and time returned is a coarse time delay." 66 | ); 67 | } 68 | 69 | #endif // PYDNP3_OPENDNP3 70 | #endif 71 | -------------------------------------------------------------------------------- /src/opendnp3/gen/RestartType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_RESTARTTYPE_H 32 | #define PYDNP3_OPENDNP3_GEN_RESTARTTYPE_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_RestartType(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::RestartType ----- 47 | py::enum_(m, "RestartType", 48 | "Enumeration describing restart operation to perform on an outstation.") 49 | 50 | .value( 51 | "COLD", 52 | opendnp3::RestartType::COLD, 53 | "Full reboot." 54 | ) 55 | 56 | .value( 57 | "WARM", 58 | opendnp3::RestartType::WARM, 59 | "Warm reboot of process only." 60 | ); 61 | } 62 | 63 | #endif // PYDNP3_OPENDNP3 64 | #endif 65 | -------------------------------------------------------------------------------- /src/opendnp3/gen/StaticAnalogOutputStatusVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_STATICANALOGOUTPUTSTATUSVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_STATICANALOGOUTPUTSTATUSVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_StaticAnalogOutputStatusVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::StaticAnalogOutputStatusVariation ----- 47 | py::enum_(m, "StaticAnalogOutputStatusVariation") 48 | .value("Group40Var1", opendnp3::StaticAnalogOutputStatusVariation::Group40Var1) 49 | .value("Group40Var2", opendnp3::StaticAnalogOutputStatusVariation::Group40Var2) 50 | .value("Group40Var3", opendnp3::StaticAnalogOutputStatusVariation::Group40Var3) 51 | .value("Group40Var4", opendnp3::StaticAnalogOutputStatusVariation::Group40Var4); 52 | } 53 | 54 | #endif // PYDNP3_OPENDNP3 55 | #endif 56 | -------------------------------------------------------------------------------- /src/opendnp3/gen/StaticAnalogVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_STATICANALOGVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_STATICANALOGVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_StaticAnalogVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::StaticAnalogVariation ----- 47 | py::enum_(m, "StaticAnalogVariation") 48 | .value("Group30Var1", opendnp3::StaticAnalogVariation::Group30Var1) 49 | .value("Group30Var2", opendnp3::StaticAnalogVariation::Group30Var2) 50 | .value("Group30Var3", opendnp3::StaticAnalogVariation::Group30Var3) 51 | .value("Group30Var4", opendnp3::StaticAnalogVariation::Group30Var4) 52 | .value("Group30Var5", opendnp3::StaticAnalogVariation::Group30Var5) 53 | .value("Group30Var6", opendnp3::StaticAnalogVariation::Group30Var6); 54 | } 55 | 56 | #endif // PYDNP3_OPENDNP3 57 | #endif 58 | -------------------------------------------------------------------------------- /src/opendnp3/gen/StaticBinaryOutputStatusVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_STATICBINARYOUTPUTSTATUSVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_STATICBINARYOUTPUTSTATUSVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_StaticBinaryOutputStatusVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::StaticBinaryOutputStatusVariation ----- 47 | py::enum_(m, "StaticBinaryOutputStatusVariation") 48 | .value("Group10Var2", opendnp3::StaticBinaryOutputStatusVariation::Group10Var2); 49 | } 50 | 51 | #endif // PYDNP3_OPENDNP3 52 | #endif 53 | -------------------------------------------------------------------------------- /src/opendnp3/gen/StaticBinaryVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_STATICBINARYVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_STATICBINARYVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_StaticBinaryVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::StaticBinaryVariation ----- 47 | py::enum_(m, "StaticBinaryVariation") 48 | .value("Group1Var1", opendnp3::StaticBinaryVariation::Group1Var1) 49 | .value("Group1Var2", opendnp3::StaticBinaryVariation::Group1Var2); 50 | } 51 | 52 | #endif // PYDNP3_OPENDNP3 53 | #endif 54 | -------------------------------------------------------------------------------- /src/opendnp3/gen/StaticCounterVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_STATICCOUNTERVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_STATICCOUNTERVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_StaticCounterVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::StaticCounterVariation ----- 47 | py::enum_(m, "StaticCounterVariation") 48 | .value("Group20Var1", opendnp3::StaticCounterVariation::Group20Var1) 49 | .value("Group20Var2", opendnp3::StaticCounterVariation::Group20Var2) 50 | .value("Group20Var5", opendnp3::StaticCounterVariation::Group20Var5) 51 | .value("Group20Var6", opendnp3::StaticCounterVariation::Group20Var6); 52 | } 53 | 54 | #endif // PYDNP3_OPENDNP3 55 | #endif 56 | -------------------------------------------------------------------------------- /src/opendnp3/gen/StaticDoubleBinaryVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_STATICDOUBLEBINARYVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_STATICDOUBLEBINARYVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_StaticDoubleBinaryVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::StaticDoubleBinaryVariation 47 | py::enum_(m, "StaticDoubleBinaryVariation") 48 | .value("Group3Var2", opendnp3::StaticDoubleBinaryVariation::Group3Var2); 49 | } 50 | 51 | #endif // PYDNP3_OPENDNP3 52 | #endif 53 | -------------------------------------------------------------------------------- /src/opendnp3/gen/StaticFrozenCounterVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_STATICFROZENCOUNTERVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_STATICFROZENCOUNTERVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_StaticFrozenCounterVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::StaticFrozenCounterVariation 47 | py::enum_(m, "StaticFrozenCounterVariation") 48 | .value("Group21Var1", opendnp3::StaticFrozenCounterVariation::Group21Var1) 49 | .value("Group21Var2", opendnp3::StaticFrozenCounterVariation::Group21Var2) 50 | .value("Group21Var5", opendnp3::StaticFrozenCounterVariation::Group21Var5) 51 | .value("Group21Var6", opendnp3::StaticFrozenCounterVariation::Group21Var6) 52 | .value("Group21Var9", opendnp3::StaticFrozenCounterVariation::Group21Var9) 53 | .value("Group21Var10", opendnp3::StaticFrozenCounterVariation::Group21Var10); 54 | } 55 | 56 | #endif // PYDNP3_OPENDNP3 57 | #endif 58 | -------------------------------------------------------------------------------- /src/opendnp3/gen/StaticSecurityStatVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_STATICSECURITYSTATVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_STATICSECURITYSTATVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_StaticSecurityStatVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::StaticSecurityStatVariation 47 | py::enum_(m, "StaticSecurityStatVariation") 48 | .value("Group121Var1", opendnp3::StaticSecurityStatVariation::Group121Var1); 49 | } 50 | 51 | #endif // PYDNP3_OPENDNP3 52 | #endif 53 | -------------------------------------------------------------------------------- /src/opendnp3/gen/StaticTimeAndIntervalVariation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_STATICTIMEANDINTERVALVARIATION_H 32 | #define PYDNP3_OPENDNP3_GEN_STATICTIMEANDINTERVALVARIATION_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_StaticTimeAndIntervalVariation(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::StaticTimeAndIntervalVariation 47 | py::enum_(m, "StaticTimeAndIntervalVariation") 48 | .value("Group50Var4", opendnp3::StaticTimeAndIntervalVariation::Group50Var4); 49 | } 50 | 51 | #endif // PYDNP3_OPENDNP3 52 | #endif 53 | -------------------------------------------------------------------------------- /src/opendnp3/gen/StaticTypeBitmask.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_STATICTYPEBITMASK_H 32 | #define PYDNP3_OPENDNP3_GEN_STATICTYPEBITMASK_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_StaticTypeBitmask(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::StaticTypeBitmask 47 | py::enum_(m, "StaticTypeBitmask") 48 | .value("BinaryInput", opendnp3::StaticTypeBitmask::BinaryInput) 49 | .value("DoubleBinaryInput", opendnp3::StaticTypeBitmask::DoubleBinaryInput) 50 | .value("Counter", opendnp3::StaticTypeBitmask::Counter) 51 | .value("FrozenCounter", opendnp3::StaticTypeBitmask::FrozenCounter) 52 | .value("AnalogInput", opendnp3::StaticTypeBitmask::AnalogInput) 53 | .value("BinaryOutputStatus", opendnp3::StaticTypeBitmask::BinaryOutputStatus) 54 | .value("AnalogOutputStatus", opendnp3::StaticTypeBitmask::AnalogOutputStatus) 55 | .value("TimeAndInterval", opendnp3::StaticTypeBitmask::TimeAndInterval); 56 | } 57 | 58 | #endif // PYDNP3_OPENDNP3 59 | #endif 60 | -------------------------------------------------------------------------------- /src/opendnp3/gen/StopBits.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_STOPBITS_H 32 | #define PYDNP3_OPENDNP3_GEN_STOPBITS_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_StopBits(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::StopBits 47 | py::enum_(m, "StopBits", 48 | "Enumeration for setting serial port stop bits.") 49 | 50 | .value("One", opendnp3::StopBits::One) 51 | .value("OnePointFive", opendnp3::StopBits::OnePointFive) 52 | .value("Two", opendnp3::StopBits::Two) 53 | .value("None", opendnp3::StopBits::None); 54 | 55 | // ----- func: opendnp3::StopBitsToType ----- 56 | m.def( 57 | "StopBitsToType", 58 | &opendnp3::StopBitsToType, 59 | py::arg("stopBits") 60 | ); 61 | 62 | // ----- func: opendnp3::StopBitsFromType ----- 63 | m.def( 64 | "StopBitsFromType", 65 | &opendnp3::StopBitsFromType, 66 | ":type rawType: unsigned char", 67 | py::arg("rawType") 68 | ); 69 | 70 | // ----- func: opendnp3::StopBitsToString ----- 71 | m.def( 72 | "StopBitsToString", 73 | &opendnp3::StopBitsToString, 74 | py::arg("stopBits") 75 | ); 76 | } 77 | 78 | #endif // PYDNP3_OPENDNP3 79 | #endif 80 | -------------------------------------------------------------------------------- /src/opendnp3/gen/TimeSyncMode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_TIMESYNCMODE_H 32 | #define PYDNP3_OPENDNP3_GEN_TIMESYNCMODE_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_TimeSyncMode(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::TimeSyncMode ----- 47 | py::enum_(m, "TimeSyncMode", 48 | "Indicates the validity of timestamp values for an entire object header.") 49 | 50 | .value( 51 | "NonLAN", 52 | opendnp3::TimeSyncMode::NonLAN, 53 | "Synchronize the outstation's time using the non-LAN time sync procedure." 54 | ) 55 | 56 | .value( 57 | "LAN", 58 | opendnp3::TimeSyncMode::LAN, 59 | "Synchronize the outstation's time using the LAN time sync procedure." 60 | ) 61 | 62 | .value( 63 | "None", 64 | opendnp3::TimeSyncMode::None, 65 | "Don't perform a time-sync." 66 | ); 67 | } 68 | 69 | #endif // PYDNP3_OPENDNP3 70 | #endif 71 | -------------------------------------------------------------------------------- /src/opendnp3/gen/TimestampMode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_GEN_TIMESTAMPMODE_H 32 | #define PYDNP3_OPENDNP3_GEN_TIMESTAMPMODE_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_TimestampMode(py::module &m) 45 | { 46 | // ----- enum class: opendnp3::TimestampMode ----- 47 | py::enum_(m, "TimestampMode", 48 | "Determines what the master station does when it sees the NEED_TIME iin bit.") 49 | 50 | .value( 51 | "SYNCHRONIZED", 52 | opendnp3::TimestampMode::SYNCHRONIZED, 53 | "The timestamp is UTC synchronized at the remote device." 54 | ) 55 | 56 | .value( 57 | "UNSYNCHRONIZED", 58 | opendnp3::TimestampMode::UNSYNCHRONIZED, 59 | "The device indicate the timestamp may be unsynchronized." 60 | ) 61 | 62 | .value( 63 | "INVALID", 64 | opendnp3::TimestampMode::INVALID, 65 | "Timestamp is not valid, ignore the value and use a local timestamp." 66 | ); 67 | } 68 | 69 | #endif // PYDNP3_OPENDNP3 70 | #endif 71 | -------------------------------------------------------------------------------- /src/opendnp3/master/CommandCallbackT.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_MASTER_COMMANDCALLBACKT_H 32 | #define PYDNP3_OPENDNP3_MASTER_COMMANDCALLBACKT_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_CommandCallbackT(py::module &m) 45 | { 46 | // ----- class: opendnp3::CommandCallbackT ----- 47 | py::class_(m, "CommandCallbackT"); 48 | } 49 | 50 | #endif // PYDNP3_OPENDNP3 51 | #endif 52 | -------------------------------------------------------------------------------- /src/opendnp3/master/RestartOperationResult.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_MASTER_RESTARTOPERATIONRESULT_H 32 | #define PYDNP3_OPENDNP3_MASTER_RESTARTOPERATIONRESULT_H 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #include 39 | 40 | #ifdef PYDNP3_OPENDNP3 41 | 42 | namespace py = pybind11; 43 | using namespace std; 44 | 45 | void bind_RestartOperationResult(py::module &m) 46 | { 47 | // ----- class: opendnp3::RestartOperationResult ----- 48 | py::class_(m, "RestartOperationResult") 49 | 50 | .def(py::init<>()) 51 | 52 | .def( 53 | py::init(), 54 | py::arg("summary"), py::arg("restartTime") 55 | ) 56 | 57 | .def_readwrite( 58 | "summary", 59 | &opendnp3::RestartOperationResult::summary, 60 | "The result of the task as a whole." 61 | ) 62 | 63 | .def_readwrite( 64 | "restartTime", 65 | &opendnp3::RestartOperationResult::restartTime, 66 | "Time delay until restart." 67 | ); 68 | 69 | // ----- class: opendnp3::RestartOperationCallbackT ----- 70 | py::class_(m, "RestartOperationCallbackT"); 71 | } 72 | 73 | #endif // PYDNP3_OPENDNP3 74 | #endif 75 | -------------------------------------------------------------------------------- /src/opendnp3/master/TaskId.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_MASTER_TASKID_H 32 | #define PYDNP3_OPENDNP3_MASTER_TASKID_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_TaskId(py::module &m) 44 | { 45 | // ----- class: opendnp3::TaskId ----- 46 | py::class_>(m, "TaskId", 47 | "Interface that represents a running master.") 48 | 49 | .def_static( 50 | "Defined", 51 | &opendnp3::TaskId::Defined, 52 | py::arg("id") 53 | ) 54 | 55 | .def_static( 56 | "Undefined", 57 | &opendnp3::TaskId::Undefined 58 | ) 59 | 60 | .def( 61 | "GetId", 62 | &opendnp3::TaskId::GetId 63 | ) 64 | 65 | .def( 66 | "IsDefined", 67 | &opendnp3::TaskId::IsDefined 68 | ); 69 | } 70 | 71 | #endif // PYDNP3_OPENDNP3 72 | #endif 73 | -------------------------------------------------------------------------------- /src/opendnp3/master/TaskInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_MASTER_TASKINFO_H 32 | #define PYDNP3_OPENDNP3_MASTER_TASKINFO_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_TaskInfo(py::module &m) 44 | { 45 | // ----- class: opendnp3::TaskInfo ----- 46 | py::class_>(m, "TaskInfo", 47 | "Struct that provides information about a completed or failed task.") 48 | 49 | .def( 50 | py::init(), 51 | py::arg("type"), py::arg("result"), py::arg("id") 52 | ) 53 | 54 | .def_readwrite( 55 | "type", 56 | &opendnp3::TaskInfo::type 57 | ) 58 | 59 | .def_readwrite( 60 | "result", 61 | &opendnp3::TaskInfo::result 62 | ) 63 | 64 | .def_readwrite( 65 | "id", 66 | &opendnp3::TaskInfo::id 67 | ); 68 | } 69 | 70 | #endif // PYDNP3_OPENDNP3 71 | #endif 72 | -------------------------------------------------------------------------------- /src/opendnp3/outstation/StaticTypeBitfield.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENDNP3_OUTSTATION_STATICTYPEBITFIELD_H 32 | #define PYDNP3_OPENDNP3_OUTSTATION_STATICTYPEBITFIELD_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENDNP3 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_StaticTypeBitfield(py::module &m) 45 | { 46 | // ----- struct: opendnp3::StaticTypeBitField ----- 47 | py::class_(m, "StaticTypeBitField", 48 | "A bitfield that describes a subset of all static types. \n" 49 | "E.g. {Binary, Analog} or {Analog, Counter, FrozenCounter}") 50 | 51 | .def(py::init<>()) 52 | 53 | .def( 54 | py::init(), 55 | "type mask: unsigned short", 56 | py::arg("mask") 57 | ) 58 | 59 | .def_static( 60 | "AllTypes", 61 | &opendnp3::StaticTypeBitField::AllTypes 62 | ) 63 | 64 | .def( 65 | "IsSet", 66 | &opendnp3::StaticTypeBitField::IsSet, 67 | py::arg("type") 68 | ) 69 | 70 | .def( 71 | "Except", 72 | &opendnp3::StaticTypeBitField::Except, 73 | py::arg("type") 74 | ); 75 | } 76 | 77 | #endif // PYDNP3_OPENDNP3 78 | #endif 79 | -------------------------------------------------------------------------------- /src/openpal/Configure.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENPAL_CONFIGURE_H 32 | #define PYDNP3_OPENPAL_CONFIGURE_H 33 | 34 | #if defined(_MSC_VER) && (_MSC_VER >= 1200) 35 | #pragma once 36 | #endif 37 | 38 | #include 39 | #include 40 | 41 | #include 42 | 43 | #ifdef PYDNP3_OPENPAL 44 | 45 | namespace py = pybind11; 46 | 47 | void bind_Configure(py::module &m) 48 | { 49 | // ----- const: openpal::sizes::MAX_ERASURE_SIZE ----- 50 | m.def_submodule("sizes").attr("MAX_ERASURE_SIZE") = &openpal::sizes::MAX_ERASURE_SIZE; 51 | } 52 | 53 | #endif // PYDNP3_OPENPAL 54 | #endif 55 | -------------------------------------------------------------------------------- /src/openpal/container/Pair.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENPAL_CONTAINER_PAIR_H 32 | #define PYDNP3_OPENPAL_CONTAINER_PAIR_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENPAL 40 | 41 | template 42 | void declarePair(py::module &m, std::string const &type) 43 | { 44 | // ----- class: openpal::Pair ----- 45 | py::class_>(m, ("Pair" + type).c_str()) 46 | 47 | .def( 48 | py::init(), 49 | py::arg("first"), py::arg("second") 50 | ) 51 | 52 | .def_readwrite( 53 | "first", 54 | &openpal::Pair::first 55 | ) 56 | 57 | .def_readwrite( 58 | "second", 59 | &openpal::Pair::second 60 | ); 61 | } 62 | 63 | void bind_Pair(py::module &m) 64 | { 65 | // Example 66 | declarePair(m, "Int"); 67 | declarePair(m, "String"); 68 | } 69 | 70 | #endif // PYDNP3_OPENPAL 71 | #endif 72 | -------------------------------------------------------------------------------- /src/openpal/container/SecureBuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENPAL_CONTAINER_SECUREBUFFER_H 32 | #define PYDNP3_OPENPAL_CONTAINER_SECUREBUFFER_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENPAL 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_SecureBuffer(py::module &m) 44 | { 45 | // ----- class: openpal::SecureBuffer ----- 46 | py::class_(m, "SecureBuffer") 47 | 48 | .def(py::init<>()) 49 | 50 | .def( 51 | py::init(), 52 | ":type size: unsigned int", 53 | py::arg("size") 54 | ) 55 | 56 | .def( 57 | py::init(), 58 | "Initialize with the exact size and contents of the view.", 59 | py::arg("input") 60 | ); 61 | } 62 | 63 | #endif // PYDNP3_OPENPAL 64 | #endif 65 | -------------------------------------------------------------------------------- /src/openpal/executor/UTCTimestamp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENPAL_EXECUTOR_UTCTIMESTAMP_H 32 | #define PYDNP3_OPENPAL_EXECUTOR_UTCTIMESTAMP_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENPAL 40 | 41 | namespace py = pybind11; 42 | using namespace std; 43 | 44 | void bind_UTCTimestamp(py::module &m) { 45 | // ----- class: openpal::UTCTimestamp ----- 46 | py::class_(m, "UTCTimestamp", 47 | "Strong typing for UTCTimestamps") 48 | 49 | .def(py::init<>()) 50 | 51 | .def( 52 | py::init(), 53 | ":type msSinceEpoch: unsigned long", 54 | py::arg("msSinceEpoch") 55 | ) 56 | 57 | .def_readwrite( 58 | "msSinceEpoch", 59 | &openpal::UTCTimestamp::msSinceEpoch, 60 | ":type msSinceEpoch: unsigned long" 61 | ); 62 | } 63 | 64 | #endif // PYDNP3_OPENPAL 65 | #endif 66 | -------------------------------------------------------------------------------- /src/openpal/logging/LogEntry.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENPAL_LOGGING_LOGENTRY_H 32 | #define PYDNP3_OPENPAL_LOGGING_LOGENTRY_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENPAL 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_LogEntry(py::module &m) 44 | { 45 | // ----- class: openpal::LogEntry ----- 46 | py::class_>(m, "LogEntry", 47 | "An event recorded by the logging framework.") 48 | 49 | .def( 50 | py::init(), 51 | py::arg("loggerid"), py::arg("filters"), py::arg("location"), py::arg("message"), 52 | py::return_value_policy::reference 53 | ) 54 | 55 | .def_readwrite( 56 | "loggerid", 57 | &openpal::LogEntry::loggerid 58 | ) 59 | 60 | .def_readwrite( 61 | "filters", 62 | &openpal::LogEntry::filters 63 | ) 64 | 65 | .def_readwrite( 66 | "location", 67 | &openpal::LogEntry::location 68 | ) 69 | 70 | .def_readwrite( 71 | "message", 72 | &openpal::LogEntry::message 73 | ); 74 | } 75 | 76 | #endif // PYDNP3_OPENPAL 77 | #endif 78 | -------------------------------------------------------------------------------- /src/openpal/logging/LogFilters.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENPAL_LOGGING_LOGFILTERS_H 32 | #define PYDNP3_OPENPAL_LOGGING_LOGFILTERS_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENPAL 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_LogFilters(py::module &m) 44 | { 45 | // ----- class: openpal::LogFilters ----- 46 | py::class_>(m, "LogFilters", 47 | "Strongly typed wrapper for flags bitfield.") 48 | 49 | .def(py::init<>()) 50 | 51 | .def( 52 | py::init(), 53 | py::arg("filters") 54 | ) 55 | 56 | .def( 57 | "IsSet", 58 | &openpal::LogFilters::IsSet, 59 | py::arg("levels") 60 | ) 61 | 62 | .def( 63 | "GetBitfield", 64 | &openpal::LogFilters::GetBitfield 65 | ); 66 | } 67 | 68 | #endif // PYDNP3_OPENPAL 69 | #endif 70 | -------------------------------------------------------------------------------- /src/openpal/logging/LogLevels.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENPAL_LOGGING_LOGLEVELS_H 32 | #define PYDNP3_OPENPAL_LOGGING_LOGLEVELS_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENPAL 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_OpenpalLogLevels(py::module &m) 44 | { 45 | // ----- constants openpal::logflags ----- 46 | m.def_submodule("logflags").attr("EVENT") = &openpal::logflags::EVENT; 47 | m.def_submodule("logflags").attr("ERR") = &openpal::logflags::ERR; 48 | m.def_submodule("logflags").attr("WARN") = &openpal::logflags::WARN; 49 | m.def_submodule("logflags").attr("INFO") = &openpal::logflags::INFO; 50 | m.def_submodule("logflags").attr("DBG") = &openpal::logflags::DBG; 51 | } 52 | 53 | #endif // PYDNP3_OPENPAL 54 | #endif 55 | -------------------------------------------------------------------------------- /src/openpal/logging/StringFormatting.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENPAL_LOGGING_STRINGFORMATTING_H 32 | #define PYDNP3_OPENPAL_LOGGING_STRINGFORMATTING_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENPAL 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_StringFormatting(py::module &m) 44 | { 45 | // ----- const: openpal::MAX_LOG_ENTRY_SIZE ----- 46 | m.attr("MAX_LOG_ENTRY_SIZE") = &openpal::MAX_LOG_ENTRY_SIZE; 47 | 48 | // ----- const: openpal::MAX_HEX_PER_LINE ----- 49 | m.attr("MAX_HEX_PER_LINE") = &openpal::MAX_HEX_PER_LINE; 50 | 51 | // ----- func: openpal::LogHex ----- 52 | m.def( 53 | "LogHex", 54 | &openpal::LogHex, 55 | ":type firstRowSize: unsigned int \n" 56 | ":type otherRowSize: unsigned int", 57 | py::arg("logger"), py::arg("filters"), py::arg("source"), py::arg("firstRowSize"), py::arg("otherRowSize") 58 | ); 59 | 60 | // ----- func: openpal::AllocateCopy ----- 61 | m.def( 62 | "AllocateCopy", 63 | &openpal::AllocateCopy, 64 | "Portable allocation of a copy of a cstring.", 65 | py::arg("alias") 66 | ); 67 | } 68 | 69 | #endif // PYDNP3_OPENPAL 70 | #endif 71 | -------------------------------------------------------------------------------- /src/openpal/serialization/FloatByteOrder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENPAL_SERIALIZATION_FLOATBYTEORDER_H 32 | #define PYDNP3_OPENPAL_SERIALIZATION_FLOATBYTEORDER_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENPAL 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_FloatByteOrder(py::module &m) 44 | { 45 | // ----- enum class: openpal::FloatByteOrder::Value ----- 46 | py::enum_(m, "FloatByteOrderValue") 47 | .value("NORMAL", openpal::FloatByteOrder::Value::NORMAL) 48 | .value("REVERSE", openpal::FloatByteOrder::Value::REVERSE) 49 | .value("UNSUPPORTED", openpal::FloatByteOrder::Value::UNSUPPORTED); 50 | 51 | // ----- class: openpal::FloatByteOrder ----- 52 | py::class_(m, "FloatByteOrder") 53 | 54 | .def_property_readonly_static( 55 | "ORDER", 56 | [](py::object) { return openpal::FloatByteOrder::ORDER; } 57 | ); 58 | } 59 | 60 | #endif // PYDNP3_OPENPAL 61 | #endif 62 | -------------------------------------------------------------------------------- /src/openpal/util/Comparisons.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENPAL_UTIL_COMPARISONS_H 32 | #define PYDNP3_OPENPAL_UTIL_COMPARISONS_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENPAL 40 | 41 | namespace py = pybind11; 42 | 43 | template 44 | void declareComparisions(py::module &m) 45 | { 46 | // ----- function: openpal::Min ----- 47 | m.def( 48 | "Min", 49 | &openpal::Min 50 | ); 51 | 52 | // ----- function: openpal::Max ----- 53 | m.def( 54 | "Max", 55 | &openpal::Max 56 | ); 57 | 58 | // ----- function: openpal::Bounded ----- 59 | m.def( 60 | "Bounded", 61 | &openpal::Bounded, 62 | py::arg("value"), py::arg("min"), py::arg("max") 63 | ); 64 | 65 | // ----- function: openpal::WithinLimits ----- 66 | m.def( 67 | "WithinLimits", 68 | &openpal::WithinLimits, 69 | py::arg("value"), py::arg("min"), py::arg("max") 70 | ); 71 | 72 | // ----- function: openpal::FloatEqual ----- 73 | m.def( 74 | "FloatEqual", 75 | &openpal::FloatEqual 76 | ); 77 | } 78 | 79 | void bind_Comparisons(py::module &m) 80 | { 81 | declareComparisions(m); 82 | declareComparisions(m); 83 | } 84 | 85 | #endif // PYDNP3_OPENPAL 86 | #endif 87 | -------------------------------------------------------------------------------- /src/openpal/util/Finally.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENPAL_UTIL_FINALLY_H 32 | #define PYDNP3_OPENPAL_UTIL_FINALLY_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENPAL 40 | 41 | template 42 | void declareFinally(py::module &m, string const &type) 43 | { 44 | // ----- class: openpal::RAII ----- 45 | py::class_>(m, ("RAII" + type).c_str(), 46 | "Finally is an RAII helper that takes a functor to run when it destructs."); 47 | 48 | // ----- func: openpal::Finally ----- 49 | m.def( 50 | "Finally", 51 | &openpal::Finally 52 | ); 53 | } 54 | 55 | void bind_Finally(py::module &m) 56 | { 57 | } 58 | 59 | #endif // PYDNP3_OPENPAL 60 | #endif 61 | -------------------------------------------------------------------------------- /src/openpal/util/Limits.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENPAL_UTIL_LIMITS_H 32 | #define PYDNP3_OPENPAL_UTIL_LIMITS_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENPAL 40 | 41 | namespace py = pybind11; 42 | 43 | template 44 | void declareLimits(py::module &m) 45 | { 46 | // ----- function: openpal::MinValue ----- 47 | m.def( 48 | "MinValue", 49 | &openpal::MinValue 50 | ); 51 | 52 | // ----- function: openpal::MaxValue ----- 53 | m.def( 54 | "MaxValue", 55 | &openpal::MaxValue 56 | ); 57 | } 58 | 59 | void bind_Limits(py::module &m) 60 | { 61 | declareLimits(m); 62 | declareLimits(m); 63 | declareLimits(m); 64 | declareLimits(m); 65 | declareLimits(m); 66 | declareLimits(m); 67 | declareLimits(m); 68 | declareLimits(m); 69 | } 70 | 71 | #endif // PYDNP3_OPENPAL 72 | #endif 73 | -------------------------------------------------------------------------------- /src/openpal/util/ToHex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENPAL_UTIL_TOHEX_H 32 | #define PYDNP3_OPENPAL_UTIL_TOHEX_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENPAL 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_ToHex(py::module &m) 44 | { 45 | // ----- function: openpal::ToHexChar ----- 46 | m.def( 47 | "ToHexChar", 48 | &openpal::ToHexChar, 49 | py::arg("char") 50 | ); 51 | } 52 | 53 | #endif // PYDNP3_OPENPAL 54 | #endif 55 | -------------------------------------------------------------------------------- /src/openpal/util/Uncopyable.h: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #ifndef PYDNP3_OPENPAL_UTIL_UNCOPYABLE_H 32 | #define PYDNP3_OPENPAL_UTIL_UNCOPYABLE_H 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | #ifdef PYDNP3_OPENPAL 40 | 41 | namespace py = pybind11; 42 | 43 | void bind_Uncopyable(py::module &m) 44 | { 45 | // ----- class: openpal::Uncopyable ----- 46 | py::class_>(m, "Uncopyable", 47 | "Inherited classes will not have default copy/assignment."); 48 | 49 | // ----- class: openpal::StaticOnly ----- 50 | py::class_(m, "StaticOnly"); 51 | } 52 | 53 | #endif // PYDNP3_OPENPAL 54 | #endif 55 | -------------------------------------------------------------------------------- /src/pydnp3asiopal.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * -*- coding: utf-8 -*- {{{ 3 | * vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 4 | * 5 | * Copyright 2018, Kisensum. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * 19 | * Neither Kisensum, nor any of its employees, nor any jurisdiction or 20 | * organization that has cooperated in the development of these materials, 21 | * makes any warranty, express or implied, or assumes any legal liability 22 | * or responsibility for the accuracy, completeness, or usefulness or any 23 | * information, apparatus, product, software, or process disclosed, or 24 | * represents that its use would not infringe privately owned rights. 25 | * Reference herein to any specific commercial product, process, or service 26 | * by trade name, trademark, manufacturer, or otherwise does not necessarily 27 | * constitute or imply its endorsement, recommendation, or favoring by Kisensum. 28 | * }}} 29 | */ 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #include 37 | 38 | #include "asiopal/AllHeaders.h" 39 | 40 | namespace py = pybind11; 41 | 42 | void init_asiopal(py::module &asiopal) 43 | { 44 | // -------------------- PYDNP3.ASIOPAL -------------------- 45 | bind_SerialTypes(asiopal); 46 | bind_ASIOSerialHelpers(asiopal); 47 | bind_IOpenDelayStrategy(asiopal); 48 | bind_ChannelRetry(asiopal); 49 | bind_IO(asiopal); 50 | bind_SteadyClock(asiopal); 51 | bind_Executor(asiopal); 52 | bind_IChannelCallbacks(asiopal); 53 | bind_IAsyncChannel(asiopal); 54 | bind_IResourceManager(asiopal); // GIL release: Shutdown 55 | bind_IListener(asiopal); 56 | bind_IPEndpoint(asiopal); 57 | bind_LoggingConnectionCondition(asiopal); 58 | bind_ResourceManager(asiopal); 59 | bind_SerialChannel(asiopal); 60 | bind_SocketChannel(asiopal); //@todo: init, Create (error: call to implicitly-deleted copy constructor) 61 | bind_SocketHelpers(asiopal); 62 | bind_Synchronized(asiopal); 63 | bind_TCPClient(asiopal); 64 | bind_TCPServer(asiopal); 65 | bind_TLSConfig(asiopal); 66 | bind_ThreadPool(asiopal); 67 | bind_TimeConversions(asiopal); 68 | bind_Timer(asiopal); 69 | bind_UTCTimeSource(asiopal); 70 | } -------------------------------------------------------------------------------- /tests/test_constants.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- {{{ 2 | # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: 3 | # 4 | # Copyright 2018, Kisensum. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | # Neither Kisensum, nor any of its employees, nor any jurisdiction or 19 | # organization that has cooperated in the development of these materials, 20 | # makes any warranty, express or implied, or assumes any legal liability 21 | # or responsibility for the accuracy, completeness, or usefulness or any 22 | # information, apparatus, product, software, or process disclosed, or 23 | # represents that its use would not infringe privately owned rights. 24 | # Reference herein to any specific commercial product, process, or service 25 | # by trade name, trademark, manufacturer, or otherwise does not necessarily 26 | # constitute or imply its endorsement, recommendation, or favoring by Kisensum. 27 | # }}} 28 | 29 | from pydnp3 import opendnp3 as opendnp3 30 | from pydnp3 import openpal as openpal 31 | 32 | 33 | class TestConstants(): 34 | """ 35 | Test some constants from pydnp3 and confirm their values. 36 | """ 37 | 38 | def test_const(self): 39 | assert opendnp3.DEFAULT_MAX_APDU_SIZE == 2048 40 | assert opendnp3.DEFAULT_APP_TIMEOUT is not None 41 | assert opendnp3.NUM_OUTSTATION_EVENT_TYPES == 8 42 | assert openpal.MAX_LOG_ENTRY_SIZE == 120 43 | assert openpal.MAX_HEX_PER_LINE == 20 -------------------------------------------------------------------------------- /tests/test_hang.py: -------------------------------------------------------------------------------- 1 | # MAKE SURE TO RUN OUTSTATION FOR TESTING 2 | 3 | from pydnp3 import asiodnp3, asiopal, opendnp3, openpal 4 | 5 | import time 6 | 7 | FILTERS = opendnp3.levels.NORMAL | opendnp3.levels.ALL_COMMS 8 | HOST = "127.0.0.1" 9 | LOCAL = "0.0.0.0" 10 | PORT = 20000 11 | 12 | 13 | 14 | def run_master(hang=False): 15 | """Demonstrate hanging when channel and master are not deleted prior to manager.Shutdown() 16 | """ 17 | logger = asiodnp3.ConsoleLogger().Create() 18 | manager = asiodnp3.DNP3Manager(1, asiodnp3.ConsoleLogger().Create()) 19 | #printing_channel_listener = asiodnp3.PrintingChannelListener().Create() 20 | channel = manager.AddTCPClient("tcpclient", 21 | FILTERS, 22 | asiopal.ChannelRetry(), 23 | HOST, 24 | LOCAL, 25 | PORT, 26 | asiodnp3.PrintingChannelListener().Create()) 27 | stack_config = asiodnp3.MasterStackConfig() 28 | stack_config.master.responseTimeout = openpal.TimeDuration().Seconds(2) 29 | stack_config.link.RemoteAddr = 10 30 | soe_handler = asiodnp3.PrintingSOEHandler().Create() 31 | default_master_app = asiodnp3.DefaultMasterApplication().Create() 32 | master = channel.AddMaster("master", 33 | soe_handler, 34 | default_master_app, 35 | stack_config) 36 | master.Enable() 37 | time.sleep(2) 38 | if not hang: 39 | #del logger 40 | #del printing_channel_listener 41 | del channel 42 | #del stack_config 43 | #del soe_handler 44 | #del default_master_app 45 | del master 46 | print("Shutdown, Hang = {}".format(hang)) 47 | manager.Shutdown() 48 | 49 | # run_master(hang=False) 50 | # run_master(hang=False) 51 | # #run_master(hang=True) 52 | 53 | -------------------------------------------------------------------------------- /wheel/pydnp3-0.1.0-cp27-cp27m-macosx_10_12_x86_64.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChargePoint/pydnp3/3699581dc80409b82e0d64a71b26e0db1863525a/wheel/pydnp3-0.1.0-cp27-cp27m-macosx_10_12_x86_64.whl -------------------------------------------------------------------------------- /wheel/pydnp3-0.1.0-cp35-cp35m-macosx_10_12_x86_64.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChargePoint/pydnp3/3699581dc80409b82e0d64a71b26e0db1863525a/wheel/pydnp3-0.1.0-cp35-cp35m-macosx_10_12_x86_64.whl -------------------------------------------------------------------------------- /wheel/pydnp3-0.1.0-cp36-cp36m-macosx_10_12_x86_64.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ChargePoint/pydnp3/3699581dc80409b82e0d64a71b26e0db1863525a/wheel/pydnp3-0.1.0-cp36-cp36m-macosx_10_12_x86_64.whl --------------------------------------------------------------------------------