You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ju...@apache.org on 2025/12/04 07:08:30 UTC
(iotdb) 01/02: bitmask
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
commit 99095dc255fb5b82a5ef9f225d4042e7bbbd3a76
Author: Caideyipi <87...@users.noreply.github.com>
AuthorDate: Thu Dec 4 15:06:22 2025 +0800
bitmask
---
.../src/main/java/org/apache/iotdb/opcua/ClientTest.java | 2 +-
.../apache/iotdb/db/pipe/sink/protocol/opcua/OpcUaNameSpace.java | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
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 eaf7c733275..560ebe609cb 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
@@ -58,7 +58,7 @@ public class ClientTest implements ClientExample {
System.out.println("✅ 连接成功");
// 读取标签值c
- NodeId nodeId = new NodeId(2, "root/sg/d1/s1");
+ NodeId nodeId = new NodeId(2, "root/sg/d1/s2");
// 1. 先读取当前值确认节点可访问
DataValue readValue = client.readValue(0, TimestampsToReturn.Both, nodeId).get();
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/opcua/OpcUaNameSpace.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/opcua/OpcUaNameSpace.java
index f242975263a..ba4e69f0154 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/opcua/OpcUaNameSpace.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/sink/protocol/opcua/OpcUaNameSpace.java
@@ -529,6 +529,9 @@ public class OpcUaNameSpace extends ManagedNamespaceWithLifecycle {
.setDisplayName(variableAttributes.getDisplayName())
.setDataType(variableAttributes.getDataType())
.setTypeDefinition(typeDefinition.get())
+ .setValueRank(variableAttributes.getValueRank())
+ .setWriteMask(variableAttributes.getWriteMask())
+ .setUserWriteMask(variableAttributes.getUserWriteMask())
.build();
getNodeManager().addNode(measurementNode);
parentNode.addReference(
@@ -537,6 +540,9 @@ public class OpcUaNameSpace extends ManagedNamespaceWithLifecycle {
item.getReferenceTypeId(),
measurementNode.getNodeId().expanded(),
true));
+ measurementNode.setValue(
+ new DataValue(
+ variableAttributes.getValue(), StatusCode.GOOD, new DateTime(), new DateTime()));
results.add(new AddNodesResult(StatusCode.GOOD, measurementNode.getNodeId()));
} else {
results.add(