ua_client_highlevel_async.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  4. *
  5. * Copyright 2018 (c) Thomas Stalder, Blue Time Concept SA
  6. * Copyright 2018 (c) Fraunhofer IOSB (Author: Julius Pfrommer)
  7. */
  8. #ifndef UA_CLIENT_HIGHLEVEL_ASYNC_H_
  9. #define UA_CLIENT_HIGHLEVEL_ASYNC_H_
  10. #include "ua_client.h"
  11. _UA_BEGIN_DECLS
  12. /**
  13. * Raw Services
  14. * ^^^^^^^^^^^^ */
  15. typedef void (*UA_ClientAsyncReadCallback)(UA_Client *client, void *userdata,
  16. UA_UInt32 requestId, UA_ReadResponse *rr);
  17. static UA_INLINE UA_StatusCode UA_Client_sendAsyncReadRequest(UA_Client *client,
  18. UA_ReadRequest *request, UA_ClientAsyncReadCallback readCallback,
  19. void *userdata, UA_UInt32 *reqId) {
  20. return UA_Client_sendAsyncRequest(client, request,
  21. &UA_TYPES[UA_TYPES_READREQUEST],
  22. (UA_ClientAsyncServiceCallback) readCallback,
  23. &UA_TYPES[UA_TYPES_READRESPONSE], userdata, reqId);
  24. }
  25. typedef void (*UA_ClientAsyncWriteCallback)(UA_Client *client, void *userdata,
  26. UA_UInt32 requestId, UA_WriteResponse *wr);
  27. static UA_INLINE UA_StatusCode UA_Client_sendAsyncWriteRequest(
  28. UA_Client *client, UA_WriteRequest *request,
  29. UA_ClientAsyncWriteCallback writeCallback, void *userdata,
  30. UA_UInt32 *reqId) {
  31. return UA_Client_sendAsyncRequest(client, request,
  32. &UA_TYPES[UA_TYPES_WRITEREQUEST],
  33. (UA_ClientAsyncServiceCallback) writeCallback,
  34. &UA_TYPES[UA_TYPES_WRITERESPONSE], userdata, reqId);
  35. }
  36. typedef void (*UA_ClientAsyncBrowseCallback)(UA_Client *client, void *userdata,
  37. UA_UInt32 requestId, UA_BrowseResponse *wr);
  38. static UA_INLINE UA_StatusCode UA_Client_sendAsyncBrowseRequest(
  39. UA_Client *client, UA_BrowseRequest *request,
  40. UA_ClientAsyncBrowseCallback browseCallback, void *userdata,
  41. UA_UInt32 *reqId) {
  42. return UA_Client_sendAsyncRequest(client, request,
  43. &UA_TYPES[UA_TYPES_BROWSEREQUEST],
  44. (UA_ClientAsyncServiceCallback) browseCallback,
  45. &UA_TYPES[UA_TYPES_BROWSERESPONSE], userdata, reqId);
  46. }
  47. /**
  48. * Read Attribute
  49. * ^^^^^^^^^^^^^^ */
  50. UA_StatusCode UA_EXPORT
  51. __UA_Client_readAttribute_async(UA_Client *client, const UA_NodeId *nodeId,
  52. UA_AttributeId attributeId, const UA_DataType *outDataType,
  53. UA_ClientAsyncServiceCallback callback, void *userdata,
  54. UA_UInt32 *reqId);
  55. typedef void (*UA_ClientAsyncReadDataTypeAttributeCallback)(UA_Client *client,
  56. void *userdata, UA_UInt32 requestId, UA_NodeId *var);
  57. static UA_INLINE UA_StatusCode UA_Client_readDataTypeAttribute_async(
  58. UA_Client *client, const UA_NodeId nodeId,
  59. UA_ClientAsyncReadDataTypeAttributeCallback callback, void *userdata,
  60. UA_UInt32 *reqId) {
  61. return __UA_Client_readAttribute_async(client, &nodeId,
  62. UA_ATTRIBUTEID_DATATYPE, &UA_TYPES[UA_TYPES_NODEID],
  63. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  64. }
  65. typedef void (*UA_ClientAsyncReadValueAttributeCallback)(UA_Client *client,
  66. void *userdata, UA_UInt32 requestId, UA_Variant *var);
  67. static UA_INLINE UA_StatusCode UA_Client_readValueAttribute_async(
  68. UA_Client *client, const UA_NodeId nodeId,
  69. UA_ClientAsyncReadValueAttributeCallback callback, void *userdata,
  70. UA_UInt32 *reqId) {
  71. return __UA_Client_readAttribute_async(client, &nodeId,
  72. UA_ATTRIBUTEID_VALUE, &UA_TYPES[UA_TYPES_VARIANT],
  73. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  74. }
  75. typedef void (*UA_ClientAsyncReadNodeIdAttributeCallback)(UA_Client *client,
  76. void *userdata, UA_UInt32 requestId, UA_NodeId *out);
  77. static UA_INLINE UA_StatusCode UA_Client_readNodeIdAttribute_async(
  78. UA_Client *client, const UA_NodeId nodeId,
  79. UA_ClientAsyncReadNodeIdAttributeCallback callback, void *userdata,
  80. UA_UInt32 *reqId) {
  81. return __UA_Client_readAttribute_async(client, &nodeId,
  82. UA_ATTRIBUTEID_NODEID, &UA_TYPES[UA_TYPES_NODEID],
  83. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  84. }
  85. typedef void (*UA_ClientAsyncReadNodeClassAttributeCallback)(UA_Client *client,
  86. void *userdata, UA_UInt32 requestId, UA_NodeClass *out);
  87. static UA_INLINE UA_StatusCode UA_Client_readNodeClassAttribute_async(
  88. UA_Client *client, const UA_NodeId nodeId,
  89. UA_ClientAsyncReadNodeClassAttributeCallback callback, void *userdata,
  90. UA_UInt32 *reqId) {
  91. return __UA_Client_readAttribute_async(client, &nodeId,
  92. UA_ATTRIBUTEID_NODECLASS, &UA_TYPES[UA_TYPES_NODECLASS],
  93. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  94. }
  95. typedef void (*UA_ClientAsyncReadBrowseNameAttributeCallback)(UA_Client *client,
  96. void *userdata, UA_UInt32 requestId, UA_QualifiedName *out);
  97. static UA_INLINE UA_StatusCode UA_Client_readBrowseNameAttribute_async(
  98. UA_Client *client, const UA_NodeId nodeId,
  99. UA_ClientAsyncReadBrowseNameAttributeCallback callback, void *userdata,
  100. UA_UInt32 *reqId) {
  101. return __UA_Client_readAttribute_async(client, &nodeId,
  102. UA_ATTRIBUTEID_BROWSENAME, &UA_TYPES[UA_TYPES_QUALIFIEDNAME],
  103. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  104. }
  105. typedef void (*UA_ClientAsyncReadDisplayNameAttributeCallback)(
  106. UA_Client *client, void *userdata, UA_UInt32 requestId,
  107. UA_LocalizedText *out);
  108. static UA_INLINE UA_StatusCode UA_Client_readDisplayNameAttribute_async(
  109. UA_Client *client, const UA_NodeId nodeId,
  110. UA_ClientAsyncReadDisplayNameAttributeCallback callback, void *userdata,
  111. UA_UInt32 *reqId) {
  112. return __UA_Client_readAttribute_async(client, &nodeId,
  113. UA_ATTRIBUTEID_DISPLAYNAME, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT],
  114. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  115. }
  116. typedef void (*UA_ClientAsyncReadDescriptionAttributeCallback)(
  117. UA_Client *client, void *userdata, UA_UInt32 requestId,
  118. UA_LocalizedText *out);
  119. static UA_INLINE UA_StatusCode UA_Client_readDescriptionAttribute_async(
  120. UA_Client *client, const UA_NodeId nodeId,
  121. UA_ClientAsyncReadDescriptionAttributeCallback callback, void *userdata,
  122. UA_UInt32 *reqId) {
  123. return __UA_Client_readAttribute_async(client, &nodeId,
  124. UA_ATTRIBUTEID_DESCRIPTION, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT],
  125. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  126. }
  127. typedef void (*UA_ClientAsyncReadWriteMaskAttributeCallback)(UA_Client *client,
  128. void *userdata, UA_UInt32 requestId, UA_UInt32 *out);
  129. static UA_INLINE UA_StatusCode UA_Client_readWriteMaskAttribute_async(
  130. UA_Client *client, const UA_NodeId nodeId,
  131. UA_ClientAsyncReadWriteMaskAttributeCallback callback, void *userdata,
  132. UA_UInt32 *reqId) {
  133. return __UA_Client_readAttribute_async(client, &nodeId,
  134. UA_ATTRIBUTEID_WRITEMASK, &UA_TYPES[UA_TYPES_UINT32],
  135. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  136. }
  137. typedef void (*UA_ClientAsyncReadUserWriteMaskAttributeCallback)(
  138. UA_Client *client, void *userdata, UA_UInt32 requestId, UA_UInt32 *out);
  139. static UA_INLINE UA_StatusCode UA_Client_readUserWriteMaskAttribute_async(
  140. UA_Client *client, const UA_NodeId nodeId,
  141. UA_ClientAsyncReadUserWriteMaskAttributeCallback callback,
  142. void *userdata, UA_UInt32 *reqId) {
  143. return __UA_Client_readAttribute_async(client, &nodeId,
  144. UA_ATTRIBUTEID_USERWRITEMASK, &UA_TYPES[UA_TYPES_UINT32],
  145. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  146. }
  147. typedef void (*UA_ClientAsyncReadIsAbstractAttributeCallback)(UA_Client *client,
  148. void *userdata, UA_UInt32 requestId, UA_Boolean *out);
  149. static UA_INLINE UA_StatusCode UA_Client_readIsAbstractAttribute_async(
  150. UA_Client *client, const UA_NodeId nodeId,
  151. UA_ClientAsyncReadIsAbstractAttributeCallback callback, void *userdata,
  152. UA_UInt32 *reqId) {
  153. return __UA_Client_readAttribute_async(client, &nodeId,
  154. UA_ATTRIBUTEID_ISABSTRACT, &UA_TYPES[UA_TYPES_BOOLEAN],
  155. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  156. }
  157. typedef void (*UA_ClientAsyncReadSymmetricAttributeCallback)(UA_Client *client,
  158. void *userdata, UA_UInt32 requestId, UA_Boolean *out);
  159. static UA_INLINE UA_StatusCode UA_Client_readSymmetricAttribute_async(
  160. UA_Client *client, const UA_NodeId nodeId,
  161. UA_ClientAsyncReadSymmetricAttributeCallback callback, void *userdata,
  162. UA_UInt32 *reqId) {
  163. return __UA_Client_readAttribute_async(client, &nodeId,
  164. UA_ATTRIBUTEID_SYMMETRIC, &UA_TYPES[UA_TYPES_BOOLEAN],
  165. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  166. }
  167. typedef void (*UA_ClientAsyncReadInverseNameAttributeCallback)(
  168. UA_Client *client, void *userdata, UA_UInt32 requestId,
  169. UA_LocalizedText *out);
  170. static UA_INLINE UA_StatusCode UA_Client_readInverseNameAttribute_async(
  171. UA_Client *client, const UA_NodeId nodeId,
  172. UA_ClientAsyncReadInverseNameAttributeCallback callback, void *userdata,
  173. UA_UInt32 *reqId) {
  174. return __UA_Client_readAttribute_async(client, &nodeId,
  175. UA_ATTRIBUTEID_INVERSENAME, &UA_TYPES[UA_TYPES_LOCALIZEDTEXT],
  176. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  177. }
  178. typedef void (*UA_ClientAsyncReadContainsNoLoopsAttributeCallback)(
  179. UA_Client *client, void *userdata, UA_UInt32 requestId,
  180. UA_Boolean *out);
  181. static UA_INLINE UA_StatusCode UA_Client_readContainsNoLoopsAttribute_async(
  182. UA_Client *client, const UA_NodeId nodeId,
  183. UA_ClientAsyncReadContainsNoLoopsAttributeCallback callback,
  184. void *userdata, UA_UInt32 *reqId) {
  185. return __UA_Client_readAttribute_async(client, &nodeId,
  186. UA_ATTRIBUTEID_CONTAINSNOLOOPS, &UA_TYPES[UA_TYPES_BOOLEAN],
  187. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  188. }
  189. typedef void (*UA_ClientAsyncReadEventNotifierAttributeCallback)(
  190. UA_Client *client, void *userdata, UA_UInt32 requestId, UA_Byte *out);
  191. static UA_INLINE UA_StatusCode UA_Client_readEventNotifierAttribute_async(
  192. UA_Client *client, const UA_NodeId nodeId,
  193. UA_ClientAsyncReadEventNotifierAttributeCallback callback,
  194. void *userdata, UA_UInt32 *reqId) {
  195. return __UA_Client_readAttribute_async(client, &nodeId,
  196. UA_ATTRIBUTEID_EVENTNOTIFIER, &UA_TYPES[UA_TYPES_BYTE],
  197. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  198. }
  199. typedef void (*UA_ClientAsyncReadValueRankAttributeCallback)(UA_Client *client,
  200. void *userdata, UA_UInt32 requestId, UA_Int32 *out);
  201. static UA_INLINE UA_StatusCode UA_Client_readValueRankAttribute_async(
  202. UA_Client *client, const UA_NodeId nodeId,
  203. UA_ClientAsyncReadValueRankAttributeCallback callback, void *userdata,
  204. UA_UInt32 *reqId) {
  205. return __UA_Client_readAttribute_async(client, &nodeId,
  206. UA_ATTRIBUTEID_VALUERANK, &UA_TYPES[UA_TYPES_INT32],
  207. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  208. }
  209. typedef void (*UA_ClientAsyncReadAccessLevelAttributeCallback)(
  210. UA_Client *client, void *userdata, UA_UInt32 requestId, UA_Byte *out);
  211. static UA_INLINE UA_StatusCode UA_Client_readAccessLevelAttribute_async(
  212. UA_Client *client, const UA_NodeId nodeId,
  213. UA_ClientAsyncReadAccessLevelAttributeCallback callback, void *userdata,
  214. UA_UInt32 *reqId) {
  215. return __UA_Client_readAttribute_async(client, &nodeId,
  216. UA_ATTRIBUTEID_ACCESSLEVEL, &UA_TYPES[UA_TYPES_BYTE],
  217. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  218. }
  219. typedef void (*UA_ClientAsyncReadUserAccessLevelAttributeCallback)(
  220. UA_Client *client, void *userdata, UA_UInt32 requestId, UA_Byte *out);
  221. static UA_INLINE UA_StatusCode UA_Client_readUserAccessLevelAttribute_async(
  222. UA_Client *client, const UA_NodeId nodeId,
  223. UA_ClientAsyncReadUserAccessLevelAttributeCallback callback,
  224. void *userdata, UA_UInt32 *reqId) {
  225. return __UA_Client_readAttribute_async(client, &nodeId,
  226. UA_ATTRIBUTEID_USERACCESSLEVEL, &UA_TYPES[UA_TYPES_BYTE],
  227. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  228. }
  229. typedef void (*UA_ClientAsyncReadMinimumSamplingIntervalAttributeCallback)(
  230. UA_Client *client, void *userdata, UA_UInt32 requestId, UA_Double *out);
  231. static UA_INLINE UA_StatusCode UA_Client_readMinimumSamplingIntervalAttribute_async(
  232. UA_Client *client, const UA_NodeId nodeId,
  233. UA_ClientAsyncReadMinimumSamplingIntervalAttributeCallback callback,
  234. void *userdata, UA_UInt32 *reqId) {
  235. return __UA_Client_readAttribute_async(client, &nodeId,
  236. UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL, &UA_TYPES[UA_TYPES_DOUBLE],
  237. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  238. }
  239. typedef void (*UA_ClientAsyncReadHistorizingAttributeCallback)(
  240. UA_Client *client, void *userdata, UA_UInt32 requestId,
  241. UA_Boolean *out);
  242. static UA_INLINE UA_StatusCode UA_Client_readHistorizingAttribute_async(
  243. UA_Client *client, const UA_NodeId nodeId,
  244. UA_ClientAsyncReadHistorizingAttributeCallback callback, void *userdata,
  245. UA_UInt32 *reqId) {
  246. return __UA_Client_readAttribute_async(client, &nodeId,
  247. UA_ATTRIBUTEID_HISTORIZING, &UA_TYPES[UA_TYPES_BOOLEAN],
  248. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  249. }
  250. typedef void (*UA_ClientAsyncReadExecutableAttributeCallback)(UA_Client *client,
  251. void *userdata, UA_UInt32 requestId, UA_Boolean *out);
  252. static UA_INLINE UA_StatusCode UA_Client_readExecutableAttribute_async(
  253. UA_Client *client, const UA_NodeId nodeId,
  254. UA_ClientAsyncReadExecutableAttributeCallback callback, void *userdata,
  255. UA_UInt32 *reqId) {
  256. return __UA_Client_readAttribute_async(client, &nodeId,
  257. UA_ATTRIBUTEID_EXECUTABLE, &UA_TYPES[UA_TYPES_BOOLEAN],
  258. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  259. }
  260. typedef void (*UA_ClientAsyncReadUserExecutableAttributeCallback)(
  261. UA_Client *client, void *userdata, UA_UInt32 requestId,
  262. UA_Boolean *out);
  263. static UA_INLINE UA_StatusCode UA_Client_readUserExecutableAttribute_async(
  264. UA_Client *client, const UA_NodeId nodeId,
  265. UA_ClientAsyncReadUserExecutableAttributeCallback callback,
  266. void *userdata, UA_UInt32 *reqId) {
  267. return __UA_Client_readAttribute_async(client, &nodeId,
  268. UA_ATTRIBUTEID_USEREXECUTABLE, &UA_TYPES[UA_TYPES_BOOLEAN],
  269. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  270. }
  271. /**
  272. * Write Attribute
  273. * ^^^^^^^^^^^^^^ */
  274. UA_StatusCode UA_EXPORT
  275. __UA_Client_writeAttribute_async(UA_Client *client, const UA_NodeId *nodeId,
  276. UA_AttributeId attributeId, const void *in,
  277. const UA_DataType *inDataType, UA_ClientAsyncServiceCallback callback,
  278. void *userdata, UA_UInt32 *reqId);
  279. static UA_INLINE UA_StatusCode UA_Client_writeValueAttribute_async(
  280. UA_Client *client, const UA_NodeId nodeId, const UA_Variant *newValue,
  281. UA_ClientAsyncWriteCallback callback, void *userdata,
  282. UA_UInt32 *reqId) {
  283. return __UA_Client_writeAttribute_async(client, &nodeId,
  284. UA_ATTRIBUTEID_VALUE, newValue, &UA_TYPES[UA_TYPES_VARIANT],
  285. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  286. }
  287. static UA_INLINE UA_StatusCode UA_Client_writeNodeIdAttribute_async(
  288. UA_Client *client, const UA_NodeId nodeId, const UA_NodeId *outNodeId,
  289. UA_ClientAsyncServiceCallback callback, void *userdata,
  290. UA_UInt32 *reqId) {
  291. return __UA_Client_writeAttribute_async(client, &nodeId,
  292. UA_ATTRIBUTEID_NODEID, outNodeId, &UA_TYPES[UA_TYPES_NODEID],
  293. callback, userdata, reqId);
  294. }
  295. static UA_INLINE UA_StatusCode UA_Client_writeNodeClassAttribute_async(
  296. UA_Client *client, const UA_NodeId nodeId,
  297. const UA_NodeClass *outNodeClass,
  298. UA_ClientAsyncServiceCallback callback, void *userdata,
  299. UA_UInt32 *reqId) {
  300. return __UA_Client_writeAttribute_async(client, &nodeId,
  301. UA_ATTRIBUTEID_NODECLASS, outNodeClass,
  302. &UA_TYPES[UA_TYPES_NODECLASS], callback, userdata, reqId);
  303. }
  304. static UA_INLINE UA_StatusCode UA_Client_writeBrowseNameAttribute_async(
  305. UA_Client *client, const UA_NodeId nodeId,
  306. const UA_QualifiedName *outBrowseName,
  307. UA_ClientAsyncServiceCallback callback, void *userdata,
  308. UA_UInt32 *reqId) {
  309. return __UA_Client_writeAttribute_async(client, &nodeId,
  310. UA_ATTRIBUTEID_BROWSENAME, outBrowseName,
  311. &UA_TYPES[UA_TYPES_QUALIFIEDNAME], callback, userdata, reqId);
  312. }
  313. static UA_INLINE UA_StatusCode UA_Client_writeDisplayNameAttribute_async(
  314. UA_Client *client, const UA_NodeId nodeId,
  315. const UA_LocalizedText *outDisplayName,
  316. UA_ClientAsyncServiceCallback callback, void *userdata,
  317. UA_UInt32 *reqId) {
  318. return __UA_Client_writeAttribute_async(client, &nodeId,
  319. UA_ATTRIBUTEID_DISPLAYNAME, outDisplayName,
  320. &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], callback, userdata, reqId);
  321. }
  322. static UA_INLINE UA_StatusCode UA_Client_writeDescriptionAttribute_async(
  323. UA_Client *client, const UA_NodeId nodeId,
  324. const UA_LocalizedText *outDescription,
  325. UA_ClientAsyncServiceCallback callback, void *userdata,
  326. UA_UInt32 *reqId) {
  327. return __UA_Client_writeAttribute_async(client, &nodeId,
  328. UA_ATTRIBUTEID_DESCRIPTION, outDescription,
  329. &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], callback, userdata, reqId);
  330. }
  331. static UA_INLINE UA_StatusCode UA_Client_writeWriteMaskAttribute_async(
  332. UA_Client *client, const UA_NodeId nodeId,
  333. const UA_UInt32 *outWriteMask, UA_ClientAsyncServiceCallback callback,
  334. void *userdata, UA_UInt32 *reqId) {
  335. return __UA_Client_writeAttribute_async(client, &nodeId,
  336. UA_ATTRIBUTEID_WRITEMASK, outWriteMask, &UA_TYPES[UA_TYPES_UINT32],
  337. callback, userdata, reqId);
  338. }
  339. static UA_INLINE UA_StatusCode UA_Client_writeUserWriteMaskAttribute_async(
  340. UA_Client *client, const UA_NodeId nodeId,
  341. const UA_UInt32 *outUserWriteMask,
  342. UA_ClientAsyncServiceCallback callback, void *userdata,
  343. UA_UInt32 *reqId) {
  344. return __UA_Client_writeAttribute_async(client, &nodeId,
  345. UA_ATTRIBUTEID_USERWRITEMASK, outUserWriteMask,
  346. &UA_TYPES[UA_TYPES_UINT32], callback, userdata, reqId);
  347. }
  348. static UA_INLINE UA_StatusCode UA_Client_writeIsAbstractAttribute_async(
  349. UA_Client *client, const UA_NodeId nodeId,
  350. const UA_Boolean *outIsAbstract, UA_ClientAsyncServiceCallback callback,
  351. void *userdata, UA_UInt32 *reqId) {
  352. return __UA_Client_writeAttribute_async(client, &nodeId,
  353. UA_ATTRIBUTEID_ISABSTRACT, outIsAbstract,
  354. &UA_TYPES[UA_TYPES_BOOLEAN], callback, userdata, reqId);
  355. }
  356. static UA_INLINE UA_StatusCode UA_Client_writeSymmetricAttribute_async(
  357. UA_Client *client, const UA_NodeId nodeId,
  358. const UA_Boolean *outSymmetric, UA_ClientAsyncServiceCallback callback,
  359. void *userdata, UA_UInt32 *reqId) {
  360. return __UA_Client_writeAttribute_async(client, &nodeId,
  361. UA_ATTRIBUTEID_SYMMETRIC, outSymmetric, &UA_TYPES[UA_TYPES_BOOLEAN],
  362. callback, userdata, reqId);
  363. }
  364. static UA_INLINE UA_StatusCode UA_Client_writeInverseNameAttribute_async(
  365. UA_Client *client, const UA_NodeId nodeId,
  366. const UA_LocalizedText *outInverseName,
  367. UA_ClientAsyncServiceCallback callback, void *userdata,
  368. UA_UInt32 *reqId) {
  369. return __UA_Client_writeAttribute_async(client, &nodeId,
  370. UA_ATTRIBUTEID_INVERSENAME, outInverseName,
  371. &UA_TYPES[UA_TYPES_LOCALIZEDTEXT], callback, userdata, reqId);
  372. }
  373. static UA_INLINE UA_StatusCode UA_Client_writeContainsNoLoopsAttribute_async(
  374. UA_Client *client, const UA_NodeId nodeId,
  375. const UA_Boolean *outContainsNoLoops,
  376. UA_ClientAsyncServiceCallback callback, void *userdata,
  377. UA_UInt32 *reqId) {
  378. return __UA_Client_writeAttribute_async(client, &nodeId,
  379. UA_ATTRIBUTEID_CONTAINSNOLOOPS, outContainsNoLoops,
  380. &UA_TYPES[UA_TYPES_BOOLEAN], callback, userdata, reqId);
  381. }
  382. static UA_INLINE UA_StatusCode UA_Client_writeEventNotifierAttribute_async(
  383. UA_Client *client, const UA_NodeId nodeId,
  384. const UA_Byte *outEventNotifier, UA_ClientAsyncServiceCallback callback,
  385. void *userdata, UA_UInt32 *reqId) {
  386. return __UA_Client_writeAttribute_async(client, &nodeId,
  387. UA_ATTRIBUTEID_EVENTNOTIFIER, outEventNotifier,
  388. &UA_TYPES[UA_TYPES_BYTE], callback, userdata, reqId);
  389. }
  390. static UA_INLINE UA_StatusCode UA_Client_writeDataTypeAttribute_async(
  391. UA_Client *client, const UA_NodeId nodeId, const UA_NodeId *outDataType,
  392. UA_ClientAsyncServiceCallback callback, void *userdata,
  393. UA_UInt32 *reqId) {
  394. return __UA_Client_writeAttribute_async(client, &nodeId,
  395. UA_ATTRIBUTEID_DATATYPE, outDataType, &UA_TYPES[UA_TYPES_NODEID],
  396. callback, userdata, reqId);
  397. }
  398. static UA_INLINE UA_StatusCode UA_Client_writeValueRankAttribute_async(
  399. UA_Client *client, const UA_NodeId nodeId, const UA_Int32 *outValueRank,
  400. UA_ClientAsyncServiceCallback callback, void *userdata,
  401. UA_UInt32 *reqId) {
  402. return __UA_Client_writeAttribute_async(client, &nodeId,
  403. UA_ATTRIBUTEID_VALUERANK, outValueRank, &UA_TYPES[UA_TYPES_INT32],
  404. callback, userdata, reqId);
  405. }
  406. static UA_INLINE UA_StatusCode UA_Client_writeAccessLevelAttribute_async(
  407. UA_Client *client, const UA_NodeId nodeId,
  408. const UA_Byte *outAccessLevel, UA_ClientAsyncServiceCallback callback,
  409. void *userdata, UA_UInt32 *reqId) {
  410. return __UA_Client_writeAttribute_async(client, &nodeId,
  411. UA_ATTRIBUTEID_ACCESSLEVEL, outAccessLevel,
  412. &UA_TYPES[UA_TYPES_BYTE], callback, userdata, reqId);
  413. }
  414. static UA_INLINE UA_StatusCode UA_Client_writeUserAccessLevelAttribute_async(
  415. UA_Client *client, const UA_NodeId nodeId,
  416. const UA_Byte *outUserAccessLevel,
  417. UA_ClientAsyncServiceCallback callback, void *userdata,
  418. UA_UInt32 *reqId) {
  419. return __UA_Client_writeAttribute_async(client, &nodeId,
  420. UA_ATTRIBUTEID_USERACCESSLEVEL, outUserAccessLevel,
  421. &UA_TYPES[UA_TYPES_BYTE], callback, userdata, reqId);
  422. }
  423. static UA_INLINE UA_StatusCode UA_Client_writeMinimumSamplingIntervalAttribute_async(
  424. UA_Client *client, const UA_NodeId nodeId,
  425. const UA_Double *outMinimumSamplingInterval,
  426. UA_ClientAsyncServiceCallback callback, void *userdata,
  427. UA_UInt32 *reqId) {
  428. return __UA_Client_writeAttribute_async(client, &nodeId,
  429. UA_ATTRIBUTEID_MINIMUMSAMPLINGINTERVAL, outMinimumSamplingInterval,
  430. &UA_TYPES[UA_TYPES_DOUBLE], callback, userdata, reqId);
  431. }
  432. static UA_INLINE UA_StatusCode UA_Client_writeHistorizingAttribute_async(
  433. UA_Client *client, const UA_NodeId nodeId,
  434. const UA_Boolean *outHistorizing,
  435. UA_ClientAsyncServiceCallback callback, void *userdata,
  436. UA_UInt32 *reqId) {
  437. return __UA_Client_writeAttribute_async(client, &nodeId,
  438. UA_ATTRIBUTEID_HISTORIZING, outHistorizing,
  439. &UA_TYPES[UA_TYPES_BOOLEAN], callback, userdata, reqId);
  440. }
  441. static UA_INLINE UA_StatusCode UA_Client_writeExecutableAttribute_async(
  442. UA_Client *client, const UA_NodeId nodeId,
  443. const UA_Boolean *outExecutable, UA_ClientAsyncServiceCallback callback,
  444. void *userdata, UA_UInt32 *reqId) {
  445. return __UA_Client_writeAttribute_async(client, &nodeId,
  446. UA_ATTRIBUTEID_EXECUTABLE, outExecutable,
  447. &UA_TYPES[UA_TYPES_BOOLEAN], callback, userdata, reqId);
  448. }
  449. static UA_INLINE UA_StatusCode UA_Client_writeUserExecutableAttribute_async(
  450. UA_Client *client, const UA_NodeId nodeId,
  451. const UA_Boolean *outUserExecutable,
  452. UA_ClientAsyncServiceCallback callback, void *userdata,
  453. UA_UInt32 *reqId) {
  454. return __UA_Client_writeAttribute_async(client, &nodeId,
  455. UA_ATTRIBUTEID_USEREXECUTABLE, outUserExecutable,
  456. &UA_TYPES[UA_TYPES_BOOLEAN], callback, userdata, reqId);
  457. }
  458. /**
  459. * Method Calling
  460. * ^^^^^^^^^^^^^^ */
  461. #ifdef UA_ENABLE_METHODCALLS
  462. UA_StatusCode UA_EXPORT __UA_Client_call_async(UA_Client *client,
  463. const UA_NodeId objectId, const UA_NodeId methodId, size_t inputSize,
  464. const UA_Variant *input, UA_ClientAsyncServiceCallback callback,
  465. void *userdata, UA_UInt32 *reqId);
  466. typedef void (*UA_ClientAsyncCallCallback)(UA_Client *client, void *userdata,
  467. UA_UInt32 requestId, UA_CallResponse *cr);
  468. static UA_INLINE UA_StatusCode UA_Client_call_async(UA_Client *client,
  469. const UA_NodeId objectId, const UA_NodeId methodId, size_t inputSize,
  470. const UA_Variant *input, UA_ClientAsyncCallCallback callback,
  471. void *userdata, UA_UInt32 *reqId) {
  472. return __UA_Client_call_async(client, objectId, methodId, inputSize, input,
  473. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  474. }
  475. #endif
  476. /**
  477. * Node Management
  478. * ^^^^^^^^^^^^^^^ */
  479. typedef void (*UA_ClientAsyncAddNodesCallback)(UA_Client *client,
  480. void *userdata, UA_UInt32 requestId, UA_AddNodesResponse *ar);
  481. UA_StatusCode UA_EXPORT
  482. __UA_Client_addNode_async(UA_Client *client, const UA_NodeClass nodeClass,
  483. const UA_NodeId requestedNewNodeId, const UA_NodeId parentNodeId,
  484. const UA_NodeId referenceTypeId, const UA_QualifiedName browseName,
  485. const UA_NodeId typeDefinition, const UA_NodeAttributes *attr,
  486. const UA_DataType *attributeType, UA_NodeId *outNewNodeId,
  487. UA_ClientAsyncServiceCallback callback, void *userdata,
  488. UA_UInt32 *reqId);
  489. static UA_INLINE UA_StatusCode UA_Client_addVariableNode_async(
  490. UA_Client *client, const UA_NodeId requestedNewNodeId,
  491. const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId,
  492. const UA_QualifiedName browseName, const UA_NodeId typeDefinition,
  493. const UA_VariableAttributes attr, UA_NodeId *outNewNodeId,
  494. UA_ClientAsyncAddNodesCallback callback, void *userdata,
  495. UA_UInt32 *reqId) {
  496. return __UA_Client_addNode_async(client, UA_NODECLASS_VARIABLE,
  497. requestedNewNodeId, parentNodeId, referenceTypeId, browseName,
  498. typeDefinition, (const UA_NodeAttributes*) &attr,
  499. &UA_TYPES[UA_TYPES_VARIABLEATTRIBUTES], outNewNodeId,
  500. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  501. }
  502. static UA_INLINE UA_StatusCode UA_Client_addVariableTypeNode_async(
  503. UA_Client *client, const UA_NodeId requestedNewNodeId,
  504. const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId,
  505. const UA_QualifiedName browseName, const UA_VariableTypeAttributes attr,
  506. UA_NodeId *outNewNodeId, UA_ClientAsyncAddNodesCallback callback,
  507. void *userdata, UA_UInt32 *reqId) {
  508. return __UA_Client_addNode_async(client, UA_NODECLASS_VARIABLETYPE,
  509. requestedNewNodeId, parentNodeId, referenceTypeId, browseName,
  510. UA_NODEID_NULL, (const UA_NodeAttributes*) &attr,
  511. &UA_TYPES[UA_TYPES_VARIABLETYPEATTRIBUTES], outNewNodeId,
  512. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  513. }
  514. static UA_INLINE UA_StatusCode UA_Client_addObjectNode_async(UA_Client *client,
  515. const UA_NodeId requestedNewNodeId, const UA_NodeId parentNodeId,
  516. const UA_NodeId referenceTypeId, const UA_QualifiedName browseName,
  517. const UA_NodeId typeDefinition, const UA_ObjectAttributes attr,
  518. UA_NodeId *outNewNodeId, UA_ClientAsyncAddNodesCallback callback,
  519. void *userdata, UA_UInt32 *reqId) {
  520. return __UA_Client_addNode_async(client, UA_NODECLASS_OBJECT,
  521. requestedNewNodeId, parentNodeId, referenceTypeId, browseName,
  522. typeDefinition, (const UA_NodeAttributes*) &attr,
  523. &UA_TYPES[UA_TYPES_OBJECTATTRIBUTES], outNewNodeId,
  524. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  525. }
  526. static UA_INLINE UA_StatusCode UA_Client_addObjectTypeNode_async(
  527. UA_Client *client, const UA_NodeId requestedNewNodeId,
  528. const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId,
  529. const UA_QualifiedName browseName, const UA_ObjectTypeAttributes attr,
  530. UA_NodeId *outNewNodeId, UA_ClientAsyncAddNodesCallback callback,
  531. void *userdata, UA_UInt32 *reqId) {
  532. return __UA_Client_addNode_async(client, UA_NODECLASS_OBJECTTYPE,
  533. requestedNewNodeId, parentNodeId, referenceTypeId, browseName,
  534. UA_NODEID_NULL, (const UA_NodeAttributes*) &attr,
  535. &UA_TYPES[UA_TYPES_OBJECTTYPEATTRIBUTES], outNewNodeId,
  536. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  537. }
  538. static UA_INLINE UA_StatusCode UA_Client_addViewNode_async(UA_Client *client,
  539. const UA_NodeId requestedNewNodeId, const UA_NodeId parentNodeId,
  540. const UA_NodeId referenceTypeId, const UA_QualifiedName browseName,
  541. const UA_ViewAttributes attr, UA_NodeId *outNewNodeId,
  542. UA_ClientAsyncAddNodesCallback callback, void *userdata,
  543. UA_UInt32 *reqId) {
  544. return __UA_Client_addNode_async(client, UA_NODECLASS_VIEW,
  545. requestedNewNodeId, parentNodeId, referenceTypeId, browseName,
  546. UA_NODEID_NULL, (const UA_NodeAttributes*) &attr,
  547. &UA_TYPES[UA_TYPES_VIEWATTRIBUTES], outNewNodeId,
  548. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  549. }
  550. static UA_INLINE UA_StatusCode UA_Client_addReferenceTypeNode_async(
  551. UA_Client *client, const UA_NodeId requestedNewNodeId,
  552. const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId,
  553. const UA_QualifiedName browseName,
  554. const UA_ReferenceTypeAttributes attr, UA_NodeId *outNewNodeId,
  555. UA_ClientAsyncAddNodesCallback callback, void *userdata,
  556. UA_UInt32 *reqId) {
  557. return __UA_Client_addNode_async(client, UA_NODECLASS_REFERENCETYPE,
  558. requestedNewNodeId, parentNodeId, referenceTypeId, browseName,
  559. UA_NODEID_NULL, (const UA_NodeAttributes*) &attr,
  560. &UA_TYPES[UA_TYPES_REFERENCETYPEATTRIBUTES], outNewNodeId,
  561. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  562. }
  563. static UA_INLINE UA_StatusCode UA_Client_addDataTypeNode_async(
  564. UA_Client *client, const UA_NodeId requestedNewNodeId,
  565. const UA_NodeId parentNodeId, const UA_NodeId referenceTypeId,
  566. const UA_QualifiedName browseName, const UA_DataTypeAttributes attr,
  567. UA_NodeId *outNewNodeId, UA_ClientAsyncAddNodesCallback callback,
  568. void *userdata, UA_UInt32 *reqId) {
  569. return __UA_Client_addNode_async(client, UA_NODECLASS_DATATYPE,
  570. requestedNewNodeId, parentNodeId, referenceTypeId, browseName,
  571. UA_NODEID_NULL, (const UA_NodeAttributes*) &attr,
  572. &UA_TYPES[UA_TYPES_DATATYPEATTRIBUTES], outNewNodeId,
  573. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  574. }
  575. static UA_INLINE UA_StatusCode UA_Client_addMethodNode_async(UA_Client *client,
  576. const UA_NodeId requestedNewNodeId, const UA_NodeId parentNodeId,
  577. const UA_NodeId referenceTypeId, const UA_QualifiedName browseName,
  578. const UA_MethodAttributes attr, UA_NodeId *outNewNodeId,
  579. UA_ClientAsyncAddNodesCallback callback, void *userdata,
  580. UA_UInt32 *reqId) {
  581. return __UA_Client_addNode_async(client, UA_NODECLASS_METHOD,
  582. requestedNewNodeId, parentNodeId, referenceTypeId, browseName,
  583. UA_NODEID_NULL, (const UA_NodeAttributes*) &attr,
  584. &UA_TYPES[UA_TYPES_METHODATTRIBUTES], outNewNodeId,
  585. (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  586. }
  587. /**
  588. * Misc Functionalities
  589. * ^^^^^^^^^^^^^^^^^^^^ */
  590. UA_StatusCode UA_EXPORT
  591. __UA_Client_translateBrowsePathsToNodeIds_async(
  592. UA_Client *client, char *paths[], UA_UInt32 ids[], size_t pathSize,
  593. UA_ClientAsyncServiceCallback callback, void *userdata,
  594. UA_UInt32 *reqId);
  595. typedef void (*UA_ClientAsyncTranslateCallback)(UA_Client *client,
  596. void *userdata, UA_UInt32 requestId,
  597. UA_TranslateBrowsePathsToNodeIdsResponse *tr);
  598. static UA_INLINE UA_StatusCode UA_Cient_translateBrowsePathsToNodeIds_async(
  599. UA_Client *client, char **paths, UA_UInt32 *ids, size_t pathSize,
  600. UA_ClientAsyncTranslateCallback callback, void *userdata,
  601. UA_UInt32 *reqId) {
  602. return __UA_Client_translateBrowsePathsToNodeIds_async(client, paths, ids,
  603. pathSize, (UA_ClientAsyncServiceCallback) callback, userdata, reqId);
  604. }
  605. _UA_END_DECLS
  606. #endif /* UA_CLIENT_HIGHLEVEL_ASYNC_H_ */