historical_read_test_data.h 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398
  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) basysKom GmbH <opensource@basyskom.com> (Author: Peter Rustler)
  6. */
  7. /* Data in this header is gathered from OPC Unified Architecture, Part 11, Release
  8. 1.03 Page 5-6 from OPC Foundation */
  9. #ifndef UA_HISTORICAL_READ_TEST_DATA_H_
  10. #define UA_HISTORICAL_READ_TEST_DATA_H_
  11. #include "ua_types.h"
  12. #include <limits.h>
  13. typedef struct {
  14. UA_DateTime start;
  15. UA_DateTime end;
  16. UA_UInt32 numValuesPerNode;
  17. UA_Boolean returnBounds;
  18. UA_DateTime result[8];
  19. UA_Boolean returnContinuationPoint;
  20. } testTuple;
  21. #define TIMESTAMP_UNSPECIFIED LLONG_MIN
  22. #define NODATA 0
  23. #define TIMESTAMP_FIRST 1
  24. #define TIMESTAMP_4_48 (448 * UA_DATETIME_SEC)
  25. #define TIMESTAMP_4_58 (458 * UA_DATETIME_SEC)
  26. #define TIMESTAMP_4_59 (459 * UA_DATETIME_SEC)
  27. #define TIMESTAMP_5_00 (500 * UA_DATETIME_SEC)
  28. #define TIMESTAMP_5_01 (501 * UA_DATETIME_SEC)
  29. #define TIMESTAMP_5_02 (502 * UA_DATETIME_SEC)
  30. #define TIMESTAMP_5_03 (503 * UA_DATETIME_SEC)
  31. #define TIMESTAMP_5_04 (504 * UA_DATETIME_SEC)
  32. #define TIMESTAMP_5_05 (505 * UA_DATETIME_SEC)
  33. #define TIMESTAMP_5_06 (506 * UA_DATETIME_SEC)
  34. #define TIMESTAMP_5_07 (507 * UA_DATETIME_SEC)
  35. #define TIMESTAMP_LAST (600 * UA_DATETIME_SEC)
  36. static UA_DateTime testData[] = {
  37. TIMESTAMP_5_03,
  38. TIMESTAMP_5_00,
  39. TIMESTAMP_5_02,
  40. TIMESTAMP_5_06,
  41. TIMESTAMP_5_05,
  42. 0 // last element
  43. };
  44. static testTuple testRequests[] =
  45. {
  46. { TIMESTAMP_5_00,
  47. TIMESTAMP_5_05,
  48. 0,
  49. true,
  50. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, 0 },
  51. false
  52. },
  53. { TIMESTAMP_5_00,
  54. TIMESTAMP_5_05,
  55. 0,
  56. false,
  57. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  58. false
  59. },
  60. { TIMESTAMP_5_01,
  61. TIMESTAMP_5_04,
  62. 0,
  63. true,
  64. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, 0 },
  65. false
  66. },
  67. { TIMESTAMP_5_01,
  68. TIMESTAMP_5_04,
  69. 0,
  70. false,
  71. { TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  72. false
  73. },
  74. { TIMESTAMP_5_05,
  75. TIMESTAMP_5_00,
  76. 0,
  77. true,
  78. { TIMESTAMP_5_05, TIMESTAMP_5_03, TIMESTAMP_5_02, TIMESTAMP_5_00, 0 },
  79. false
  80. },
  81. { TIMESTAMP_5_05,
  82. TIMESTAMP_5_00,
  83. 0,
  84. false,
  85. { TIMESTAMP_5_05, TIMESTAMP_5_03, TIMESTAMP_5_02, 0 },
  86. false
  87. },
  88. { TIMESTAMP_5_04,
  89. TIMESTAMP_5_01,
  90. 0,
  91. true,
  92. { TIMESTAMP_5_05, TIMESTAMP_5_03, TIMESTAMP_5_02, TIMESTAMP_5_00, 0 },
  93. false
  94. },
  95. { TIMESTAMP_5_04,
  96. TIMESTAMP_5_01,
  97. 0,
  98. false,
  99. { TIMESTAMP_5_03, TIMESTAMP_5_02, 0 },
  100. false
  101. },
  102. { TIMESTAMP_4_59,
  103. TIMESTAMP_5_05,
  104. 0,
  105. true,
  106. { TIMESTAMP_FIRST, TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, 0 },
  107. false
  108. },
  109. { TIMESTAMP_4_59,
  110. TIMESTAMP_5_05,
  111. 0,
  112. false,
  113. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  114. false
  115. },
  116. { TIMESTAMP_5_01,
  117. TIMESTAMP_5_07,
  118. 0,
  119. true,
  120. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, TIMESTAMP_5_06, TIMESTAMP_LAST, 0 },
  121. false
  122. },
  123. { TIMESTAMP_5_01,
  124. TIMESTAMP_5_07,
  125. 0,
  126. false,
  127. { TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, TIMESTAMP_5_06, 0 },
  128. false
  129. },
  130. { TIMESTAMP_5_00,
  131. TIMESTAMP_5_05,
  132. 3,
  133. true,
  134. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  135. true
  136. },
  137. { TIMESTAMP_5_00,
  138. TIMESTAMP_5_05,
  139. 3,
  140. false,
  141. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  142. false
  143. },
  144. { TIMESTAMP_5_01,
  145. TIMESTAMP_5_04,
  146. 3,
  147. true,
  148. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  149. true
  150. },
  151. { TIMESTAMP_5_01,
  152. TIMESTAMP_5_04,
  153. 3,
  154. false,
  155. { TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  156. false
  157. },
  158. { TIMESTAMP_5_05,
  159. TIMESTAMP_5_00,
  160. 3,
  161. true,
  162. { TIMESTAMP_5_05, TIMESTAMP_5_03, TIMESTAMP_5_02, 0 },
  163. true
  164. },
  165. { TIMESTAMP_5_05,
  166. TIMESTAMP_5_00,
  167. 3,
  168. false,
  169. { TIMESTAMP_5_05, TIMESTAMP_5_03, TIMESTAMP_5_02, 0 },
  170. false
  171. },
  172. { TIMESTAMP_5_04,
  173. TIMESTAMP_5_01,
  174. 3,
  175. true,
  176. { TIMESTAMP_5_05, TIMESTAMP_5_03, TIMESTAMP_5_02, 0 },
  177. true
  178. },
  179. { TIMESTAMP_5_04,
  180. TIMESTAMP_5_01,
  181. 3,
  182. false,
  183. { TIMESTAMP_5_03, TIMESTAMP_5_02, 0 },
  184. false
  185. },
  186. { TIMESTAMP_4_59,
  187. TIMESTAMP_5_05,
  188. 3,
  189. true,
  190. { TIMESTAMP_FIRST, TIMESTAMP_5_00, TIMESTAMP_5_02, 0 },
  191. true
  192. },
  193. { TIMESTAMP_4_59,
  194. TIMESTAMP_5_05,
  195. 3,
  196. false,
  197. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  198. false
  199. },
  200. { TIMESTAMP_5_01,
  201. TIMESTAMP_5_07,
  202. 3,
  203. true,
  204. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  205. true
  206. },
  207. { TIMESTAMP_5_01,
  208. TIMESTAMP_5_07,
  209. 3,
  210. false,
  211. { TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, 0 },
  212. true
  213. },
  214. { TIMESTAMP_5_00,
  215. TIMESTAMP_UNSPECIFIED,
  216. 3,
  217. true,
  218. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  219. true
  220. },
  221. { TIMESTAMP_5_00,
  222. TIMESTAMP_UNSPECIFIED,
  223. 3,
  224. false,
  225. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, 0 },
  226. true
  227. },
  228. { TIMESTAMP_5_00,
  229. TIMESTAMP_UNSPECIFIED,
  230. 6,
  231. true,
  232. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, TIMESTAMP_5_06, TIMESTAMP_LAST, 0 },
  233. false
  234. },
  235. { TIMESTAMP_5_00,
  236. TIMESTAMP_UNSPECIFIED,
  237. 6,
  238. false,
  239. { TIMESTAMP_5_00, TIMESTAMP_5_02, TIMESTAMP_5_03, TIMESTAMP_5_05, TIMESTAMP_5_06, 0 },
  240. false
  241. },
  242. { TIMESTAMP_5_07,
  243. TIMESTAMP_UNSPECIFIED,
  244. 6,
  245. true,
  246. { TIMESTAMP_5_06, TIMESTAMP_LAST, 0 },
  247. false
  248. },
  249. { TIMESTAMP_5_07,
  250. TIMESTAMP_UNSPECIFIED,
  251. 6,
  252. false,
  253. { NODATA, 0 },
  254. false
  255. },
  256. { TIMESTAMP_UNSPECIFIED,
  257. TIMESTAMP_5_06,
  258. 3,
  259. true,
  260. { TIMESTAMP_5_06,TIMESTAMP_5_05,TIMESTAMP_5_03, 0 },
  261. true
  262. },
  263. { TIMESTAMP_UNSPECIFIED,
  264. TIMESTAMP_5_06,
  265. 3,
  266. false,
  267. { TIMESTAMP_5_06,TIMESTAMP_5_05,TIMESTAMP_5_03, 0 },
  268. true
  269. },
  270. { TIMESTAMP_UNSPECIFIED,
  271. TIMESTAMP_5_06,
  272. 6,
  273. true,
  274. { TIMESTAMP_5_06,TIMESTAMP_5_05,TIMESTAMP_5_03,TIMESTAMP_5_02,TIMESTAMP_5_00,TIMESTAMP_FIRST, 0 },
  275. false
  276. },
  277. { TIMESTAMP_UNSPECIFIED,
  278. TIMESTAMP_5_06,
  279. 6,
  280. false,
  281. { TIMESTAMP_5_06, TIMESTAMP_5_05, TIMESTAMP_5_03, TIMESTAMP_5_02, TIMESTAMP_5_00, 0 },
  282. false
  283. },
  284. { TIMESTAMP_UNSPECIFIED,
  285. TIMESTAMP_4_48,
  286. 6,
  287. true,
  288. { TIMESTAMP_5_00, TIMESTAMP_FIRST, 0 },
  289. false
  290. },
  291. { TIMESTAMP_UNSPECIFIED,
  292. TIMESTAMP_4_48,
  293. 6,
  294. false,
  295. { NODATA, 0 },
  296. false
  297. },
  298. { TIMESTAMP_4_48,
  299. TIMESTAMP_4_48,
  300. 0,
  301. true,
  302. { TIMESTAMP_FIRST, TIMESTAMP_5_00, 0 },
  303. false
  304. },
  305. { TIMESTAMP_4_48,
  306. TIMESTAMP_4_48,
  307. 0,
  308. false,
  309. { NODATA, 0 },
  310. false
  311. },
  312. { TIMESTAMP_4_48,
  313. TIMESTAMP_4_48,
  314. 1,
  315. true,
  316. { TIMESTAMP_FIRST, 0 },
  317. true
  318. },
  319. { TIMESTAMP_4_48,
  320. TIMESTAMP_4_48,
  321. 1,
  322. false,
  323. { NODATA, 0 },
  324. false
  325. },
  326. { TIMESTAMP_4_48,
  327. TIMESTAMP_4_48,
  328. 2,
  329. true,
  330. { TIMESTAMP_FIRST,TIMESTAMP_5_00, 0 },
  331. false
  332. },
  333. { TIMESTAMP_5_00,
  334. TIMESTAMP_5_00,
  335. 0,
  336. true,
  337. { TIMESTAMP_5_00,TIMESTAMP_5_02, 0 },
  338. false
  339. },
  340. { TIMESTAMP_5_00,
  341. TIMESTAMP_5_00,
  342. 0,
  343. false,
  344. { TIMESTAMP_5_00, 0 },
  345. false
  346. },
  347. { TIMESTAMP_5_00,
  348. TIMESTAMP_5_00,
  349. 1,
  350. true,
  351. { TIMESTAMP_5_00, 0 },
  352. true
  353. },
  354. { TIMESTAMP_5_00,
  355. TIMESTAMP_5_00,
  356. 1,
  357. false,
  358. { TIMESTAMP_5_00, 0 },
  359. false
  360. },
  361. { TIMESTAMP_5_01,
  362. TIMESTAMP_5_01,
  363. 0,
  364. true,
  365. { TIMESTAMP_5_00, TIMESTAMP_5_02, 0 },
  366. false
  367. },
  368. { TIMESTAMP_5_01,
  369. TIMESTAMP_5_01,
  370. 0,
  371. false,
  372. { NODATA, 0 },
  373. false
  374. },
  375. { TIMESTAMP_5_01,
  376. TIMESTAMP_5_01,
  377. 1,
  378. true,
  379. { TIMESTAMP_5_00, 0 },
  380. true
  381. },
  382. { TIMESTAMP_5_01,
  383. TIMESTAMP_5_01,
  384. 1,
  385. false,
  386. { NODATA },
  387. false
  388. },
  389. {0,0,0,false,{ NODATA }, false} // last element
  390. };
  391. #endif /*UA_HISTORICAL_READ_TEST_DATA_H_*/