瀏覽代碼

replacing UA_ReadValueId_new() by UA_Array_new(&UA_TYPES[UA_TYPES_READVALUEID], 1); to increase the readabliliy

Stasik0 9 年之前
父節點
當前提交
f9e8a6cfcc
共有 3 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      README.md
  2. 1 1
      doc/tutorial_client_firstSteps.rst
  3. 1 1
      examples/client.c

+ 1 - 1
README.md

@@ -104,7 +104,7 @@ int main(int argc, char *argv[])
     /* create a readrequest with one entry */
     UA_ReadRequest req;
     UA_ReadRequest_init(&req);
-    req.nodesToRead = UA_ReadValueId_new();
+    req.nodesToRead = UA_Array_new(&UA_TYPES[UA_TYPES_READVALUEID], 1);
     req.nodesToReadSize = 1;
     
     /* define the node and attribute to be read */

+ 1 - 1
doc/tutorial_client_firstSteps.rst

@@ -144,7 +144,7 @@ Let us extend the client with with an action reading node's value:
 
       UA_ReadRequest rReq;
       UA_ReadRequest_init(&rReq);
-      rReq.nodesToRead = UA_ReadValueId_new();
+      rReq.nodesToRead = UA_Array_new(&UA_TYPES[UA_TYPES_READVALUEID], 1);
       rReq.nodesToReadSize = 1;
       rReq.nodesToRead[0].nodeId = UA_NODEID_NUMERIC(0, 2258);
       rReq.nodesToRead[0].attributeId = UA_ATTRIBUTEID_VALUE;

+ 1 - 1
examples/client.c

@@ -88,7 +88,7 @@ int main(int argc, char *argv[]) {
     printf("\nReading the value of node (1, \"the.answer\"):\n");
     UA_ReadRequest rReq;
     UA_ReadRequest_init(&rReq);
-    rReq.nodesToRead = UA_ReadValueId_new();
+    rReq.nodesToRead =  UA_Array_new(&UA_TYPES[UA_TYPES_READVALUEID], 1);
     rReq.nodesToReadSize = 1;
     rReq.nodesToRead[0].nodeId = UA_NODEID_STRING_ALLOC(1, "the.answer"); /* assume this node exists */
     rReq.nodesToRead[0].attributeId = UA_ATTRIBUTEID_VALUE;