提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.netsdk.demo.frame.scada; |
H |
2 |
|
|
3 |
import com.iailab.netsdk.demo.module.LoginModule; |
|
4 |
import com.iailab.netsdk.lib.NetSDKLib; |
|
5 |
|
|
6 |
import static com.iailab.netsdk.demo.module.LoginModule.m_hLoginHandle; |
|
7 |
|
|
8 |
/** |
|
9 |
* className:SCADAAttachModule |
|
10 |
* description: |
|
11 |
* author:251589 |
|
12 |
* createTime:2021/5/7 20:16 |
|
13 |
* |
|
14 |
* @version v1.0 |
|
15 |
*/ |
|
16 |
|
|
17 |
public class SCADAAttachModule { |
|
18 |
// 订阅实时信息句柄 |
|
19 |
public static NetSDKLib.LLong attachInfoHandle = new NetSDKLib.LLong(0); |
|
20 |
|
|
21 |
// 订阅报警句柄 |
|
22 |
public static NetSDKLib.LLong alarmAttachInfoHandle = new NetSDKLib.LLong(0); |
|
23 |
|
|
24 |
public static boolean attachInfo(NetSDKLib.fSCADAAttachInfoCallBack callBack){ |
|
25 |
// 入参 |
|
26 |
NetSDKLib.NET_IN_SCADA_ATTACH_INFO stIn = new NetSDKLib.NET_IN_SCADA_ATTACH_INFO(); |
|
27 |
stIn.cbCallBack = callBack; |
|
28 |
// 出参 |
|
29 |
NetSDKLib.NET_OUT_SCADA_ATTACH_INFO stOut = new NetSDKLib.NET_OUT_SCADA_ATTACH_INFO(); |
|
30 |
attachInfoHandle = LoginModule.netsdk.CLIENT_SCADAAttachInfo(m_hLoginHandle, stIn, stOut, 3000); |
|
31 |
if (attachInfoHandle.longValue() != 0){ |
|
32 |
System.out.println("AttachInfo succeed!"); |
|
33 |
} else { |
|
34 |
System.err.println("AttachInfo failed!"); |
|
35 |
return false; |
|
36 |
} |
|
37 |
return true; |
|
38 |
} |
|
39 |
|
|
40 |
|
|
41 |
} |