This is an automated email from the ASF dual-hosted git repository.
justinchen pushed a commit to branch new_opc_server
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/new_opc_server by this push:
new 8e8f718a2d8 mh
8e8f718a2d8 is described below
commit 8e8f718a2d86df0b3bab1811ed48faab23012097
Author: Caideyipi <[email protected]>
AuthorDate: Thu Dec 4 16:12:09 2025 +0800
mh
---
.../java/org/apache/iotdb/opcua/ClientTest.java | 24 ++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git
a/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua/ClientTest.java
b/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua/ClientTest.java
index d38a07c61cd..19700796106 100644
---
a/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua/ClientTest.java
+++
b/example/pipe-opc-ua-sink/src/main/java/org/apache/iotdb/opcua/ClientTest.java
@@ -81,6 +81,15 @@ public class ClientTest implements ClientExample {
client
.addNodes(
Arrays.asList(
+ new AddNodesItem(
+ new NodeId(2, "root").expanded(),
+ Identifiers.Organizes,
+ new NodeId(2, "root/db").expanded(),
+ new QualifiedName(2, "db"),
+ NodeClass.Object,
+ ExtensionObject.encode(
+ client.getStaticSerializationContext(),
createFolder1Attributes()),
+ Identifiers.FolderType.expanded()),
new AddNodesItem(
new NodeId(2, "root/sg").expanded(),
Identifiers.Organizes,
@@ -88,7 +97,7 @@ public class ClientTest implements ClientExample {
new QualifiedName(2, "d2"),
NodeClass.Object,
ExtensionObject.encode(
- client.getStaticSerializationContext(),
createFolderAttributes()),
+ client.getStaticSerializationContext(),
createFolder2Attributes()),
Identifiers.FolderType.expanded()),
new AddNodesItem(
new NodeId(2, "root/sg/d1").expanded(),
@@ -123,7 +132,18 @@ public class ClientTest implements ClientExample {
);
}
- public static ObjectAttributes createFolderAttributes() {
+ public static ObjectAttributes createFolder1Attributes() {
+ return new ObjectAttributes(
+ Unsigned.uint(0xFFFF), // specifiedAttributes
+ LocalizedText.english("db"),
+ LocalizedText.english("反应釜压力传感器"),
+ Unsigned.uint(0), // writeMask
+ Unsigned.uint(0), // userWriteMask
+ null // 启用历史记录
+ );
+ }
+
+ public static ObjectAttributes createFolder2Attributes() {
return new ObjectAttributes(
Unsigned.uint(0xFFFF), // specifiedAttributes
LocalizedText.english("d2"),