Skip to content

Commit

Permalink
feat: IEC 61850 protocol module
Browse files Browse the repository at this point in the history
  • Loading branch information
activeshadow committed Apr 10, 2024
1 parent 014bab7 commit 1529c82
Show file tree
Hide file tree
Showing 7 changed files with 531 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@
[submodule "src/c++/deps/opendnp3"]
path = src/c++/deps/opendnp3
url = https://github.com/dnp3/opendnp3.git
[submodule "src/c/deps/json-c"]
path = src/c/deps/json-c
url = https://github.com/json-c/json-c.git
[submodule "src/c/deps/libiec61850"]
path = src/c/deps/libiec61850
url = https://github.com/mz-automation/libiec61850.git
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ ADD CMakeLists.txt /usr/local/src/ot-sim/CMakeLists.txt
ADD src/c /usr/local/src/ot-sim/src/c
ADD src/c++ /usr/local/src/ot-sim/src/c++
RUN cmake -S /usr/local/src/ot-sim -B /usr/local/src/ot-sim/build \
&& cmake -S /usr/local/src/ot-sim/src/c/deps/json-c -B /usr/local/src/ot-sim/src/c/deps/json-c/build \
&& cmake --build /usr/local/src/ot-sim/src/c/deps/json-c/build -j $(nproc) --target install
&& cmake -S /usr/local/src/ot-sim/src/c/deps/libiec61850 -B /usr/local/src/ot-sim/src/c/deps/libiec61850/build \
&& cmake --build /usr/local/src/ot-sim/src/c/deps/libiec61850/build -j $(nproc) --target install
&& cmake --build /usr/local/src/ot-sim/build -j $(nproc) --target install

FROM debian:bookworm AS prod
Expand Down
7 changes: 7 additions & 0 deletions src/c/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
set(JSON_INCLUDE_DIRS
${CMAKE_SOURCE_DIR}/deps
)

add_subdirectory(deps/json-c)

add_subdirectory(cmd/ot-sim-61850-module)
add_subdirectory(cmd/ot-sim-message-bus)
22 changes: 22 additions & 0 deletions src/c/cmd/ot-sim-61850-module/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
find_package(LibXml2 REQUIRED)

include_directories(
${JSON_INCLUDE_DIRS}
${LIBXML2_INCLUDE_DIR}
)

add_executable(ot-sim-61850-module
main.c
)

target_link_libraries(ot-sim-61850-module
czmq
${LIBXML2_LIBRARIES}
json-c
pthread
zmq
)

install(TARGETS ot-sim-61850-module
RUNTIME DESTINATION bin
)
Loading

0 comments on commit 1529c82

Please sign in to comment.