ua_client_highlevel_async.h 29 KB

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