@litmusio/miravo-cli-linux-arm64 0.0.0-stage → 0.15.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +199 -0
- package/NOTICE +9 -0
- package/README.md +6 -2
- package/THIRD_PARTY_LICENSES.txt +15289 -0
- package/THIRD_PARTY_NOTICES.md +995 -0
- package/console-dist/assets/AnimatePresence-DWGUB15i.js +9 -0
- package/console-dist/assets/activity-DruTYzT1.js +1 -0
- package/console-dist/assets/api-13R-Szmo.js +57 -0
- package/console-dist/assets/arrow-up-right-DOENs04V.js +1 -0
- package/console-dist/assets/asset-detail-D142l0Fv.js +1 -0
- package/console-dist/assets/asset-detail-actions-Cf9kIXus.js +1 -0
- package/console-dist/assets/backup-power-B2I59W_p.js +1 -0
- package/console-dist/assets/badge-CdRB4Nd_.js +1 -0
- package/console-dist/assets/boiler-s_q0j7rz.js +1 -0
- package/console-dist/assets/by-path-BVKB6Tic.js +1 -0
- package/console-dist/assets/check-BTUv4z-H.js +1 -0
- package/console-dist/assets/chevron-down-CqA_2_CH.js +1 -0
- package/console-dist/assets/chevron-right-CVrgKBLR.js +1 -0
- package/console-dist/assets/chiller-r7DzAhJq.js +1 -0
- package/console-dist/assets/chunk-6KYCQHYJ-ga3Yekab.js +3 -0
- package/console-dist/assets/circle-x-BRkh0A1P.js +1 -0
- package/console-dist/assets/commercial-building-YWHjdNWm.js +1 -0
- package/console-dist/assets/compressor-ChZLMC94.js +1 -0
- package/console-dist/assets/console-panel-CnTkf-Zr.js +1 -0
- package/console-dist/assets/dialog-BYkdndf9.js +1 -0
- package/console-dist/assets/district-heating-DaU-3LzU.js +1 -0
- package/console-dist/assets/dom-BxZbg3NX.js +1 -0
- package/console-dist/assets/download-CvjDP5mu.js +1 -0
- package/console-dist/assets/fira-code-cyrillic-ext-wght-normal-DhYMMuQd.woff2 +0 -0
- package/console-dist/assets/fira-code-cyrillic-wght-normal-Y3u8pIsh.woff2 +0 -0
- package/console-dist/assets/fira-code-greek-ext-wght-normal-wWus70Ix.woff2 +0 -0
- package/console-dist/assets/fira-code-greek-wght-normal-B2SviObF.woff2 +0 -0
- package/console-dist/assets/fira-code-latin-ext-wght-normal-Dvfvaomy.woff2 +0 -0
- package/console-dist/assets/fira-code-latin-wght-normal-CHoedHDv.woff2 +0 -0
- package/console-dist/assets/fira-code-symbols2-wght-normal-CE6EOz_n.woff2 +0 -0
- package/console-dist/assets/floor-page-CiAcIxAW.js +1 -0
- package/console-dist/assets/floor-page-E-0txA4z.css +1 -0
- package/console-dist/assets/format-YLUJ7AXt.js +1 -0
- package/console-dist/assets/genset-C6_EUoFo.js +1 -0
- package/console-dist/assets/index-Cf8qRbyA.js +15 -0
- package/console-dist/assets/index-eZjXAdLh.css +2 -0
- package/console-dist/assets/loader-circle-w3T2fxvn.js +1 -0
- package/console-dist/assets/login-DP7gR4IQ.js +136 -0
- package/console-dist/assets/not-found-DeZnLH0i.js +1 -0
- package/console-dist/assets/pharma-cleanroom-DvWD_xsO.js +1 -0
- package/console-dist/assets/preload-helper-7y9sWmk5.js +1 -0
- package/console-dist/assets/react-DRt7cCXI.js +1 -0
- package/console-dist/assets/rolldown-runtime-BWaJ3C7D.js +1 -0
- package/console-dist/assets/rtu-ByogcRPI.js +1 -0
- package/console-dist/assets/runtime-link-D88Db2wY.js +1 -0
- package/console-dist/assets/schibsted-grotesk-latin-ext-wght-normal-hsMS0n0O.woff2 +0 -0
- package/console-dist/assets/schibsted-grotesk-latin-wght-normal-Bb8VGrTG.woff2 +0 -0
- package/console-dist/assets/server-B0q1NVkV.js +1 -0
- package/console-dist/assets/shallow-mIK1Qu8X.js +1 -0
- package/console-dist/assets/smart-factory-gfMWfMWM.js +1 -0
- package/console-dist/assets/source-host-miravo-BW-SKMTe.js +1 -0
- package/console-dist/assets/stages-EYRT12Yp.js +1 -0
- package/console-dist/assets/status-DQYLUbXs.js +1 -0
- package/console-dist/assets/tank-Btg5piqB.js +1 -0
- package/console-dist/assets/tooltip-Dfmuq2yz.js +1 -0
- package/console-dist/assets/trash-2-BAh5-hxl.js +1 -0
- package/console-dist/assets/triangle-alert-3Ab-dBrN.js +1 -0
- package/console-dist/assets/use-engine-command-mutation-BXSIzBAw.js +1 -0
- package/console-dist/assets/use-transition-navigate-COPPNZaw.js +2 -0
- package/console-dist/assets/useQuery-BbehJ-ez.js +1 -0
- package/console-dist/assets/utils-D6wrZy-b.js +1 -0
- package/console-dist/assets/validation-6JNiaZvb.js +1 -0
- package/console-dist/assets/vendor-charts-Bquh2dWE.js +56 -0
- package/console-dist/assets/vendor-table-5YnGQUhO.js +4 -0
- package/console-dist/assets/vendor-ui-BGeFlRLR.js +1 -0
- package/console-dist/assets/water-treatment-BkzNjsHx.js +1 -0
- package/console-dist/icon.png +0 -0
- package/console-dist/index.html +53 -0
- package/console-dist/miravo-logo.webp +0 -0
- package/licenses/EPL-2.0.txt +80 -0
- package/licenses/GCC-exception-3.1.txt +33 -0
- package/licenses/GPL-2.0-only.txt +117 -0
- package/licenses/GPL-3.0-only.txt +232 -0
- package/licenses/LGPL-2.1-only.txt +176 -0
- package/licenses/MPL-2.0.txt +373 -0
- package/licenses/OFL-1.1.txt +93 -0
- package/licenses/overrides/@headlessui+vue@1.7.23.txt +24 -0
- package/licenses/overrides/@next+env@16.4.6.txt +24 -0
- package/licenses/overrides/@radix-ui+react-compose-refs@1.1.2.txt +24 -0
- package/licenses/overrides/@radix-ui+react-context@1.1.2.txt +24 -0
- package/licenses/overrides/@radix-ui+react-direction@1.1.1.txt +24 -0
- package/licenses/overrides/@radix-ui+react-id@1.1.1.txt +24 -0
- package/licenses/overrides/@radix-ui+react-use-callback-ref@1.1.1.txt +24 -0
- package/licenses/overrides/@radix-ui+react-use-escape-keydown@1.1.1.txt +24 -0
- package/licenses/overrides/@radix-ui+react-use-layout-effect@1.1.1.txt +24 -0
- package/licenses/overrides/@radix-ui+react-use-rect@1.1.1.txt +24 -0
- package/licenses/overrides/@radix-ui+react-use-size@1.1.1.txt +24 -0
- package/licenses/overrides/@radix-ui+rect@1.1.1.txt +24 -0
- package/licenses/overrides/@replit+codemirror-css-color-picker@6.3.0.txt +6 -0
- package/licenses/overrides/@scalar+openapi-types@0.8.0.txt +24 -0
- package/licenses/overrides/@scalar+openapi-types@0.9.10.txt +24 -0
- package/licenses/overrides/@scalar+openapi-types@0.9.7.txt +24 -0
- package/licenses/overrides/@scalar+openapi-types@0.9.9.txt +24 -0
- package/licenses/overrides/@scalar+postman-to-openapi@0.7.1.txt +24 -0
- package/licenses/overrides/@scalar+schemas@0.19.0.txt +24 -0
- package/licenses/overrides/@scalar+workspace-store@0.46.3.txt +24 -0
- package/licenses/overrides/@scalar+workspace-store@0.75.0.txt +24 -0
- package/licenses/overrides/assert-plus@1.0.0.txt +24 -0
- package/licenses/overrides/client-only@0.0.1.txt +24 -0
- package/licenses/overrides/embla-carousel-react@8.6.0.txt +24 -0
- package/licenses/overrides/embla-carousel-reactive-utils@8.6.0.txt +24 -0
- package/licenses/overrides/embla-carousel@8.6.0.txt +24 -0
- package/licenses/overrides/fastdom@1.0.12.txt +12 -0
- package/licenses/overrides/precond@0.2.3.txt +22 -0
- package/licenses/overrides/react-remove-scroll-bar@2.3.8.txt +24 -0
- package/licenses/overrides/strictdom@1.0.1.txt +12 -0
- package/licenses/overrides/victory-vendor@36.9.2.txt +33 -0
- package/licenses/runtime/Bun-1.4.3-LICENSE.md +85 -0
- package/licenses/runtime/ICU-78.1-LICENSE.txt +568 -0
- package/licenses/runtime/bun-components/boringssl.txt +238 -0
- package/licenses/runtime/bun-components/brotli.txt +19 -0
- package/licenses/runtime/bun-components/c-ares.txt +24 -0
- package/licenses/runtime/bun-components/highway.txt +371 -0
- package/licenses/runtime/bun-components/libarchive.txt +65 -0
- package/licenses/runtime/bun-components/libbase64.txt +28 -0
- package/licenses/runtime/bun-components/libdeflate.txt +22 -0
- package/licenses/runtime/bun-components/libjpeg-turbo.txt +147 -0
- package/licenses/runtime/bun-components/libspng.txt +25 -0
- package/licenses/runtime/bun-components/libuv.txt +19 -0
- package/licenses/runtime/bun-components/libwebp.txt +30 -0
- package/licenses/runtime/bun-components/llvm.txt +311 -0
- package/licenses/runtime/bun-components/lol-html.txt +27 -0
- package/licenses/runtime/bun-components/ls-hpack.txt +21 -0
- package/licenses/runtime/bun-components/ls-qpack.txt +21 -0
- package/licenses/runtime/bun-components/lsquic-chrome.txt +32 -0
- package/licenses/runtime/bun-components/lsquic.txt +21 -0
- package/licenses/runtime/bun-components/mimalloc.txt +21 -0
- package/licenses/runtime/bun-components/picohttpparser.txt +24 -0
- package/licenses/runtime/bun-components/simdutf-apache.txt +201 -0
- package/licenses/runtime/bun-components/simdutf-mit.txt +18 -0
- package/licenses/runtime/bun-components/tigerbeetle.txt +177 -0
- package/licenses/runtime/bun-components/tinycc.txt +504 -0
- package/licenses/runtime/bun-components/typescript-go.txt +55 -0
- package/licenses/runtime/bun-components/usockets.txt +201 -0
- package/licenses/runtime/bun-components/uucode.txt +30 -0
- package/licenses/runtime/bun-components/uwebsockets.txt +201 -0
- package/licenses/runtime/bun-components/xxhash.txt +31 -0
- package/licenses/runtime/bun-components/zlib-ng.txt +19 -0
- package/licenses/runtime/bun-components/zstd-copying.txt +339 -0
- package/licenses/runtime/bun-components/zstd.txt +30 -0
- package/licenses/runtime/musl-1.2.6-COPYRIGHT.txt +193 -0
- package/miravo +4 -0
- package/native/S7-NOTICES.txt +11 -0
- package/native/miravo-s7.node +0 -0
- package/native/s7-source/CMakeLists.txt +23 -0
- package/native/s7-source/NODE-SNAP7-LICENSE +24 -0
- package/native/s7-source/addon.cpp +124 -0
- package/native/s7-source/bridge.cpp +150 -0
- package/native/s7-source/node-api-headers/LICENSE +21 -0
- package/native/s7-source/node-api-headers/include/js_native_api.h +591 -0
- package/native/s7-source/node-api-headers/include/js_native_api_types.h +213 -0
- package/native/s7-source/node-api-headers/include/node_api.h +265 -0
- package/native/s7-source/node-api-headers/include/node_api_types.h +58 -0
- package/native/s7-source/node-api-windows.h +78 -0
- package/native/s7-source/snap7/HISTORY.txt +277 -0
- package/native/s7-source/snap7/gpl.txt +674 -0
- package/native/s7-source/snap7/lgpl-3.0.txt +165 -0
- package/native/s7-source/snap7/src/core/miravo_request_validation.h +72 -0
- package/native/s7-source/snap7/src/core/s7_client.cpp +503 -0
- package/native/s7-source/snap7/src/core/s7_client.h +104 -0
- package/native/s7-source/snap7/src/core/s7_firmware.h +1256 -0
- package/native/s7-source/snap7/src/core/s7_isotcp.cpp +541 -0
- package/native/s7-source/snap7/src/core/s7_isotcp.h +271 -0
- package/native/s7-source/snap7/src/core/s7_micro_client.cpp +3328 -0
- package/native/s7-source/snap7/src/core/s7_micro_client.h +364 -0
- package/native/s7-source/snap7/src/core/s7_partner.cpp +1178 -0
- package/native/s7-source/snap7/src/core/s7_partner.h +284 -0
- package/native/s7-source/snap7/src/core/s7_peer.cpp +121 -0
- package/native/s7-source/snap7/src/core/s7_peer.h +58 -0
- package/native/s7-source/snap7/src/core/s7_server.cpp +2161 -0
- package/native/s7-source/snap7/src/core/s7_server.h +261 -0
- package/native/s7-source/snap7/src/core/s7_text.cpp +788 -0
- package/native/s7-source/snap7/src/core/s7_text.h +49 -0
- package/native/s7-source/snap7/src/core/s7_types.h +1066 -0
- package/native/s7-source/snap7/src/lib/snap7.def +129 -0
- package/native/s7-source/snap7/src/lib/snap7_libmain.cpp +1196 -0
- package/native/s7-source/snap7/src/lib/snap7_libmain.h +201 -0
- package/native/s7-source/snap7/src/sys/snap_msgsock.cpp +958 -0
- package/native/s7-source/snap7/src/sys/snap_msgsock.h +339 -0
- package/native/s7-source/snap7/src/sys/snap_platform.h +152 -0
- package/native/s7-source/snap7/src/sys/snap_sysutils.cpp +73 -0
- package/native/s7-source/snap7/src/sys/snap_sysutils.h +39 -0
- package/native/s7-source/snap7/src/sys/snap_tcpsrvr.cpp +487 -0
- package/native/s7-source/snap7/src/sys/snap_tcpsrvr.h +247 -0
- package/native/s7-source/snap7/src/sys/snap_threads.cpp +162 -0
- package/native/s7-source/snap7/src/sys/snap_threads.h +45 -0
- package/native/s7-source/snap7/src/sys/sol_threads.h +208 -0
- package/native/s7-source/snap7/src/sys/unix_threads.h +228 -0
- package/native/s7-source/snap7/src/sys/win_threads.h +159 -0
- package/nodesets/.ignore +1 -0
- package/nodesets/1.02/FTNIR.NodeSet2.xml +819 -0
- package/nodesets/1.02/Opc.Ua.Adi.NodeSet2.xml +8301 -0
- package/nodesets/1.02/Opc.Ua.Di.NodeSet2.xml +1785 -0
- package/nodesets/Opc.ISA95.NodeSet2.xml +3589 -0
- package/nodesets/Opc.Ua.AMB.NodeSet2.xml +1395 -0
- package/nodesets/Opc.Ua.Adi.NodeSet2.xml +8301 -0
- package/nodesets/Opc.Ua.Adi.Types.xsd +104 -0
- package/nodesets/Opc.Ua.AutoID.NodeSet2.xml +6062 -0
- package/nodesets/Opc.Ua.CNC.NodeSet.xml +15875 -0
- package/nodesets/Opc.Ua.CommercialKitchenEquipment.NodeSet2.xml +12096 -0
- package/nodesets/Opc.Ua.Di.NodeSet2.xml +6042 -0
- package/nodesets/Opc.Ua.Di.Types.xsd +161 -0
- package/nodesets/Opc.Ua.Eumabois.Nodeset2.xml +2483 -0
- package/nodesets/Opc.Ua.Gds.NodeSet2.xml +8282 -0
- package/nodesets/Opc.Ua.Glass.NodeSet2.xml +5100 -0
- package/nodesets/Opc.Ua.IA.NodeSet2.xml +1782 -0
- package/nodesets/Opc.Ua.IOLink.NodeSet2.xml +4374 -0
- package/nodesets/Opc.Ua.IOLinkIODD.NodeSet2.xml +139 -0
- package/nodesets/Opc.Ua.IRDI.NodeSet2.xml +2243 -0
- package/nodesets/Opc.Ua.Ijt.Base.NodeSet2.xml +19459 -0
- package/nodesets/Opc.Ua.Ijt.Tightening.NodeSet2.xml +883 -0
- package/nodesets/Opc.Ua.LADS.NodeSet2.xml +7086 -0
- package/nodesets/Opc.Ua.MachineTool.NodeSet2.xml +7884 -0
- package/nodesets/Opc.Ua.MachineVision.NodeSet2.xml +17324 -0
- package/nodesets/Opc.Ua.Machinery.Jobs.Nodeset2.xml +1249 -0
- package/nodesets/Opc.Ua.Machinery.NodeSet2.xml +2099 -0
- package/nodesets/Opc.Ua.Machinery.ProcessValues.NodeSet2.xml +1858 -0
- package/nodesets/Opc.Ua.Machinery_Result.NodeSet2.xml +2640 -0
- package/nodesets/Opc.Ua.MetalForming.NodeSet2.xml +1577 -0
- package/nodesets/Opc.Ua.NodeSet2.xml +81975 -0
- package/nodesets/Opc.Ua.PADIM.NodeSet2.xml +14131 -0
- package/nodesets/Opc.Ua.PackML.NodeSet2.xml +3030 -0
- package/nodesets/Opc.Ua.Robotics.NodeSet2.xml +7409 -0
- package/nodesets/Opc.Ua.Scales.NodeSet2.xml +15817 -0
- package/nodesets/Opc.Ua.Types.bsd +3499 -0
- package/nodesets/Opc.Ua.Weihenstephan.NodeSet2.xml +821 -0
- package/nodesets/Opc.Ua.Woodworking.NodeSet2.xml +17831 -0
- package/nodesets/UANodeSet.xsd +497 -0
- package/nodesets/opc.ua.isa95-jobcontrol.nodeset2.xml +4594 -0
- package/package.json +37 -4
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
/*=============================================================================|
|
|
2
|
+
| PROJECT SNAP7 1.3.0 |
|
|
3
|
+
|==============================================================================|
|
|
4
|
+
| Copyright (C) 2013, 2015 Davide Nardella |
|
|
5
|
+
| All rights reserved. |
|
|
6
|
+
|==============================================================================|
|
|
7
|
+
| SNAP7 is free software: you can redistribute it and/or modify |
|
|
8
|
+
| it under the terms of the Lesser GNU General Public License as published by |
|
|
9
|
+
| the Free Software Foundation, either version 3 of the License, or |
|
|
10
|
+
| (at your option) any later version. |
|
|
11
|
+
| |
|
|
12
|
+
| It means that you can distribute your commercial software linked with |
|
|
13
|
+
| SNAP7 without the requirement to distribute the source code of your |
|
|
14
|
+
| application and without the requirement that your application be itself |
|
|
15
|
+
| distributed under LGPL. |
|
|
16
|
+
| |
|
|
17
|
+
| SNAP7 is distributed in the hope that it will be useful, |
|
|
18
|
+
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
19
|
+
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
20
|
+
| Lesser GNU General Public License for more details. |
|
|
21
|
+
| |
|
|
22
|
+
| You should have received a copy of the GNU General Public License and a |
|
|
23
|
+
| copy of Lesser GNU General Public License along with Snap7. |
|
|
24
|
+
| If not, see http://www.gnu.org/licenses/ |
|
|
25
|
+
|=============================================================================*/
|
|
26
|
+
#ifndef s7_server_h
|
|
27
|
+
#define s7_server_h
|
|
28
|
+
//---------------------------------------------------------------------------
|
|
29
|
+
#include "snap_tcpsrvr.h"
|
|
30
|
+
#include "s7_types.h"
|
|
31
|
+
#include "s7_isotcp.h"
|
|
32
|
+
//---------------------------------------------------------------------------
|
|
33
|
+
|
|
34
|
+
// Maximum number of DB, change it to increase/decrease the limit.
|
|
35
|
+
// The DB table size is 12*MaxDB bytes
|
|
36
|
+
|
|
37
|
+
#define MaxDB 2048 // Like a S7 318
|
|
38
|
+
#define MinPduSize 240
|
|
39
|
+
#define CPU315PduSize 240
|
|
40
|
+
//---------------------------------------------------------------------------
|
|
41
|
+
// Server Interface errors
|
|
42
|
+
const longword errSrvDBNullPointer = 0x00200000; // Pssed null as PData
|
|
43
|
+
const longword errSrvAreaAlreadyExists = 0x00300000; // Area Re-registration
|
|
44
|
+
const longword errSrvUnknownArea = 0x00400000; // Unknown area
|
|
45
|
+
const longword errSrvInvalidParams = 0x00500000; // Invalid param(s) supplied
|
|
46
|
+
const longword errSrvTooManyDB = 0x00600000; // Cannot register DB
|
|
47
|
+
const longword errSrvInvalidParamNumber = 0x00700000; // Invalid param (srv_get/set_param)
|
|
48
|
+
const longword errSrvCannotChangeParam = 0x00800000; // Cannot change because running
|
|
49
|
+
|
|
50
|
+
// Server Area ID (use with Register/unregister - Lock/unlock Area)
|
|
51
|
+
const int srvAreaPE = 0;
|
|
52
|
+
const int srvAreaPA = 1;
|
|
53
|
+
const int srvAreaMK = 2;
|
|
54
|
+
const int srvAreaCT = 3;
|
|
55
|
+
const int srvAreaTM = 4;
|
|
56
|
+
const int srvAreaDB = 5;
|
|
57
|
+
|
|
58
|
+
typedef struct{
|
|
59
|
+
word Number; // Number (only for DB)
|
|
60
|
+
word Size; // Area size (in bytes)
|
|
61
|
+
pbyte PData; // Pointer to area
|
|
62
|
+
PSnapCriticalSection cs;
|
|
63
|
+
}TS7Area, *PS7Area;
|
|
64
|
+
|
|
65
|
+
//------------------------------------------------------------------------------
|
|
66
|
+
// ISOTCP WORKER CLASS
|
|
67
|
+
//------------------------------------------------------------------------------
|
|
68
|
+
class TIsoTcpWorker : public TIsoTcpSocket
|
|
69
|
+
{
|
|
70
|
+
protected:
|
|
71
|
+
virtual bool IsoPerformCommand(int &Size);
|
|
72
|
+
virtual bool ExecuteSend();
|
|
73
|
+
virtual bool ExecuteRecv();
|
|
74
|
+
public:
|
|
75
|
+
TIsoTcpWorker(){};
|
|
76
|
+
~TIsoTcpWorker(){};
|
|
77
|
+
// Worker execution
|
|
78
|
+
bool Execute();
|
|
79
|
+
};
|
|
80
|
+
//------------------------------------------------------------------------------
|
|
81
|
+
// S7 WORKER CLASS
|
|
82
|
+
//------------------------------------------------------------------------------
|
|
83
|
+
|
|
84
|
+
// SZL frame
|
|
85
|
+
typedef struct{
|
|
86
|
+
TS7Answer17 Answer;
|
|
87
|
+
PReqFunReadSZLFirst ReqParams;
|
|
88
|
+
PS7ReqSZLData ReqData;
|
|
89
|
+
PS7ResParams7 ResParams;
|
|
90
|
+
pbyte ResData;
|
|
91
|
+
int ID;
|
|
92
|
+
int Index;
|
|
93
|
+
bool SZLDone;
|
|
94
|
+
}TSZL;
|
|
95
|
+
|
|
96
|
+
// Current Event Info
|
|
97
|
+
typedef struct{
|
|
98
|
+
word EvRetCode;
|
|
99
|
+
word EvArea;
|
|
100
|
+
word EvIndex;
|
|
101
|
+
word EvStart;
|
|
102
|
+
word EvSize;
|
|
103
|
+
}TEv;
|
|
104
|
+
|
|
105
|
+
// Current Block info
|
|
106
|
+
typedef struct{
|
|
107
|
+
PReqFunGetBlockInfo ReqParams;
|
|
108
|
+
PResFunGetBlockInfo ResParams;
|
|
109
|
+
TS7Answer17 Answer;
|
|
110
|
+
word evError;
|
|
111
|
+
word DataLength;
|
|
112
|
+
}TCB;
|
|
113
|
+
|
|
114
|
+
class TSnap7Server; // forward declaration
|
|
115
|
+
|
|
116
|
+
class TS7Worker : public TIsoTcpWorker
|
|
117
|
+
{
|
|
118
|
+
private:
|
|
119
|
+
PS7ReqHeader PDUH_in;
|
|
120
|
+
int DBCnt;
|
|
121
|
+
byte LastBlk;
|
|
122
|
+
TSZL SZL;
|
|
123
|
+
byte BCD(word Value);
|
|
124
|
+
// Checks the consistence of the incoming PDU
|
|
125
|
+
bool CheckPDU_in(int PayloadSize);
|
|
126
|
+
void FillTime(PS7Time PTime);
|
|
127
|
+
protected:
|
|
128
|
+
int DataSizeByte(int WordLength);
|
|
129
|
+
bool ExecuteRecv();
|
|
130
|
+
void DoEvent(longword Code, word RetCode, word Param1, word Param2,
|
|
131
|
+
word Param3, word Param4);
|
|
132
|
+
void DoReadEvent(longword Code, word RetCode, word Param1, word Param2,
|
|
133
|
+
word Param3, word Param4);
|
|
134
|
+
void FragmentSkipped(int Size);
|
|
135
|
+
// Entry parse
|
|
136
|
+
bool IsoPerformCommand(int &Size);
|
|
137
|
+
// First stage parse
|
|
138
|
+
bool PerformPDUAck(int &Size);
|
|
139
|
+
bool PerformPDURequest(int &Size);
|
|
140
|
+
bool PerformPDUUsrData(int &Size);
|
|
141
|
+
// Second stage parse : PDU Request
|
|
142
|
+
PS7Area GetArea(byte S7Code, word index);
|
|
143
|
+
// Group Read Area
|
|
144
|
+
bool PerformFunctionRead();
|
|
145
|
+
// Subfunctions Read Data
|
|
146
|
+
word ReadArea(PResFunReadItem ResItemData, PReqFunReadItem ReqItemPar,
|
|
147
|
+
int &PDURemainder,TEv &EV);
|
|
148
|
+
word RA_NotFound(PResFunReadItem ResItem, TEv &EV);
|
|
149
|
+
word RA_OutOfRange(PResFunReadItem ResItem, TEv &EV);
|
|
150
|
+
word RA_SizeOverPDU(PResFunReadItem ResItem, TEv &EV);
|
|
151
|
+
// Group Write Area
|
|
152
|
+
bool PerformFunctionWrite();
|
|
153
|
+
// Subfunctions Write Data
|
|
154
|
+
byte WriteArea(PReqFunWriteDataItem ReqItemData, PReqFunWriteItem ReqItemPar,
|
|
155
|
+
TEv &EV);
|
|
156
|
+
byte WA_NotFound(TEv &EV);
|
|
157
|
+
byte WA_InvalidTransportSize(TEv &EV);
|
|
158
|
+
byte WA_OutOfRange(TEv &EV);
|
|
159
|
+
byte WA_DataSizeMismatch(TEv &EV);
|
|
160
|
+
// Negotiate PDU Length
|
|
161
|
+
bool PerformFunctionNegotiate();
|
|
162
|
+
// Control
|
|
163
|
+
bool PerformFunctionControl(byte PduFun);
|
|
164
|
+
// Up/Download
|
|
165
|
+
bool PerformFunctionUpload();
|
|
166
|
+
bool PerformFunctionDownload();
|
|
167
|
+
// Second stage parse : PDU User data
|
|
168
|
+
bool PerformGroupProgrammer();
|
|
169
|
+
bool PerformGroupCyclicData();
|
|
170
|
+
bool PerformGroupSecurity();
|
|
171
|
+
// Group Block(s) Info
|
|
172
|
+
bool PerformGroupBlockInfo();
|
|
173
|
+
// Subfunctions Block info
|
|
174
|
+
void BLK_ListAll(TCB &CB);
|
|
175
|
+
void BLK_ListBoT(byte BlockType, bool Start, TCB &CB);
|
|
176
|
+
void BLK_NoResource_ListBoT(PDataFunGetBot Data, TCB &CB);
|
|
177
|
+
void BLK_GetBlkInfo(TCB &CB);
|
|
178
|
+
void BLK_NoResource_GetBlkInfo(PResDataBlockInfo Data, TCB &CB);
|
|
179
|
+
void BLK_GetBlockNum_GetBlkInfo(int &BlkNum, PReqDataBlockInfo ReqData);
|
|
180
|
+
void BLK_DoBlockInfo_GetBlkInfo(PS7Area DB, PResDataBlockInfo Data, TCB &CB);
|
|
181
|
+
// Clock Group
|
|
182
|
+
bool PerformGetClock();
|
|
183
|
+
bool PerformSetClock();
|
|
184
|
+
// SZL Group
|
|
185
|
+
bool PerformGroupSZL();
|
|
186
|
+
// Subfunctions (called by PerformGroupSZL)
|
|
187
|
+
void SZLNotAvailable();
|
|
188
|
+
void SZLSystemState();
|
|
189
|
+
void SZLData(void *P, int len);
|
|
190
|
+
void SZL_ID424();
|
|
191
|
+
void SZL_ID131_IDX003();
|
|
192
|
+
public:
|
|
193
|
+
TSnap7Server *FServer;
|
|
194
|
+
int FPDULength;
|
|
195
|
+
TS7Worker();
|
|
196
|
+
~TS7Worker(){};
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
typedef TS7Worker *PS7Worker;
|
|
200
|
+
//------------------------------------------------------------------------------
|
|
201
|
+
// S7 SERVER CLASS
|
|
202
|
+
//------------------------------------------------------------------------------
|
|
203
|
+
extern "C"
|
|
204
|
+
{
|
|
205
|
+
typedef int (S7API *pfn_RWAreaCallBack)(void *usrPtr, int Sender, int Operation, PS7Tag PTag, void *pUsrData);
|
|
206
|
+
}
|
|
207
|
+
const int OperationRead = 0;
|
|
208
|
+
const int OperationWrite = 1;
|
|
209
|
+
|
|
210
|
+
class TSnap7Server : public TCustomMsgServer
|
|
211
|
+
{
|
|
212
|
+
private:
|
|
213
|
+
// Read Callback related
|
|
214
|
+
pfn_SrvCallBack OnReadEvent;
|
|
215
|
+
pfn_RWAreaCallBack OnRWArea;
|
|
216
|
+
// Critical section to lock Read/Write Hook Area
|
|
217
|
+
PSnapCriticalSection CSRWHook;
|
|
218
|
+
void *FReadUsrPtr;
|
|
219
|
+
void *FRWAreaUsrPtr;
|
|
220
|
+
void DisposeAll();
|
|
221
|
+
int FindFirstFreeDB();
|
|
222
|
+
int IndexOfDB(word DBNumber);
|
|
223
|
+
protected:
|
|
224
|
+
int DBCount;
|
|
225
|
+
int DBLimit;
|
|
226
|
+
PS7Area DB[MaxDB]; // DB
|
|
227
|
+
PS7Area HA[5]; // MK,PE,PA,TM,CT
|
|
228
|
+
PS7Area FindDB(word DBNumber);
|
|
229
|
+
PWorkerSocket CreateWorkerSocket(socket_t Sock);
|
|
230
|
+
bool ResourceLess;
|
|
231
|
+
word ForcePDU;
|
|
232
|
+
int RegisterDB(word Number, void *pUsrData, word Size);
|
|
233
|
+
int RegisterSys(int AreaCode, void *pUsrData, word Size);
|
|
234
|
+
int UnregisterDB(word DBNumber);
|
|
235
|
+
int UnregisterSys(int AreaCode);
|
|
236
|
+
// The Read event
|
|
237
|
+
void DoReadEvent(int Sender, longword Code, word RetCode, word Param1,
|
|
238
|
+
word Param2, word Param3, word Param4);
|
|
239
|
+
bool DoReadArea(int Sender, int Area, int DBNumber, int Start, int Size, int WordLen, void *pUsrData);
|
|
240
|
+
bool DoWriteArea(int Sender, int Area, int DBNumber, int Start, int Size, int WordLen, void *pUsrData);
|
|
241
|
+
public:
|
|
242
|
+
int WorkInterval;
|
|
243
|
+
byte CpuStatus;
|
|
244
|
+
TSnap7Server();
|
|
245
|
+
~TSnap7Server();
|
|
246
|
+
int StartTo(const char *Address);
|
|
247
|
+
int GetParam(int ParamNumber, void *pValue);
|
|
248
|
+
int SetParam(int ParamNumber, void *pValue);
|
|
249
|
+
int RegisterArea(int AreaCode, word Index, void *pUsrData, word Size);
|
|
250
|
+
int UnregisterArea(int AreaCode, word Index);
|
|
251
|
+
int LockArea(int AreaCode, word DBNumber);
|
|
252
|
+
int UnlockArea(int AreaCode, word DBNumber);
|
|
253
|
+
// Sets Event callback
|
|
254
|
+
int SetReadEventsCallBack(pfn_SrvCallBack PCallBack, void *UsrPtr);
|
|
255
|
+
int SetRWAreaCallBack(pfn_RWAreaCallBack PCallBack, void *UsrPtr);
|
|
256
|
+
friend class TS7Worker;
|
|
257
|
+
};
|
|
258
|
+
typedef TSnap7Server *PSnap7Server;
|
|
259
|
+
|
|
260
|
+
#endif // s7_server_h
|
|
261
|
+
|