提交 | 用户 | 时间
|
487b2f
|
1 |
package cn.stylefeng.guns.opcua.cert; |
YY |
2 |
|
47eb81
|
3 |
import cn.stylefeng.guns.opcua.client.ClientHandler; |
YY |
4 |
import cn.stylefeng.guns.opcua.entity.NodeEntity; |
487b2f
|
5 |
import lombok.extern.slf4j.Slf4j; |
YY |
6 |
|
|
7 |
@Slf4j |
|
8 |
public class MethodName { |
|
9 |
public void a(String name){ |
69fbaa
|
10 |
log.info("str={},响应方法:{}", name,"A"); |
487b2f
|
11 |
} |
69fbaa
|
12 |
public void b(String name){ |
47eb81
|
13 |
try { |
YY |
14 |
NodeEntity node = NodeEntity.builder().index(2).identifier("my.device.x2") |
|
15 |
.value("99").type("int").build(); |
|
16 |
ClientHandler clientHandler=new ClientHandler(); |
|
17 |
String out=clientHandler.write(node); |
|
18 |
log.info(out); |
|
19 |
} catch (Exception e) { |
|
20 |
e.printStackTrace(); |
|
21 |
} |
487b2f
|
22 |
} |
69fbaa
|
23 |
public void c(String name){ |
YY |
24 |
log.info("str={},响应方法:{}", name,"C"); |
|
25 |
} |
487b2f
|
26 |
} |