ua_client_highlevel_async.h 29 KB

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