@ovok/native 0.4.7 → 0.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (245) hide show
  1. package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js +3 -1
  2. package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
  3. package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js +1 -1
  4. package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
  5. package/lib/commonjs/modules/bt-management/index.js +44 -0
  6. package/lib/commonjs/modules/bt-management/index.js.map +1 -1
  7. package/lib/commonjs/modules/bt-management/services/bt-manager.js +15 -13
  8. package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
  9. package/lib/commonjs/modules/bt-management/services/custom/compile-case-shape.js +52 -0
  10. package/lib/commonjs/modules/bt-management/services/custom/compile-case-shape.js.map +1 -0
  11. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-case.js +8 -2
  12. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-case.js.map +1 -1
  13. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-field.js +3 -0
  14. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-field.js.map +1 -1
  15. package/lib/commonjs/modules/bt-management/services/device-creator.js +12 -2
  16. package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
  17. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +184 -0
  18. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +1 -0
  19. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-frame-parser.js +114 -0
  20. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-frame-parser.js.map +1 -0
  21. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js +113 -51
  22. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
  23. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.main-services.js +41 -77
  24. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.main-services.js.map +1 -1
  25. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +15 -1
  26. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
  27. package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +20 -1
  28. package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
  29. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +30 -44
  30. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  31. package/lib/commonjs/modules/bt-management/services/devices/frame-parser.js +2 -1
  32. package/lib/commonjs/modules/bt-management/services/devices/frame-parser.js.map +1 -1
  33. package/lib/commonjs/modules/bt-management/services/devices/sentinel-frame-reader.js +84 -0
  34. package/lib/commonjs/modules/bt-management/services/devices/sentinel-frame-reader.js.map +1 -0
  35. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +27 -53
  36. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
  37. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +55 -0
  38. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -0
  39. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +43 -0
  40. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -0
  41. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +113 -0
  42. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -0
  43. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js +120 -0
  44. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js.map +1 -0
  45. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-device.js +92 -0
  46. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-device.js.map +1 -0
  47. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js +64 -0
  48. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map +1 -0
  49. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +94 -0
  50. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -0
  51. package/lib/commonjs/modules/bt-management/types/integrated-devices.js +2 -0
  52. package/lib/commonjs/modules/bt-management/types/integrated-devices.js.map +1 -1
  53. package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js +21 -0
  54. package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
  55. package/lib/commonjs/modules/bt-management/utils/parse-measurement.js +10 -7
  56. package/lib/commonjs/modules/bt-management/utils/parse-measurement.js.map +1 -1
  57. package/lib/commonjs/modules/bt-management/utils/reject-custom-reading.js +34 -0
  58. package/lib/commonjs/modules/bt-management/utils/reject-custom-reading.js.map +1 -0
  59. package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js +3 -1
  60. package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
  61. package/lib/module/modules/bt-management/constants/integrated-devices-map.js +1 -1
  62. package/lib/module/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
  63. package/lib/module/modules/bt-management/index.js +4 -0
  64. package/lib/module/modules/bt-management/index.js.map +1 -1
  65. package/lib/module/modules/bt-management/services/bt-manager.js +15 -13
  66. package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
  67. package/lib/module/modules/bt-management/services/custom/compile-case-shape.js +48 -0
  68. package/lib/module/modules/bt-management/services/custom/compile-case-shape.js.map +1 -0
  69. package/lib/module/modules/bt-management/services/custom/compile-custom-case.js +8 -2
  70. package/lib/module/modules/bt-management/services/custom/compile-custom-case.js.map +1 -1
  71. package/lib/module/modules/bt-management/services/custom/compile-custom-field.js +3 -0
  72. package/lib/module/modules/bt-management/services/custom/compile-custom-field.js.map +1 -1
  73. package/lib/module/modules/bt-management/services/device-creator.js +12 -2
  74. package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
  75. package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +180 -0
  76. package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +1 -0
  77. package/lib/module/modules/bt-management/services/devices/bc01/bc01-frame-parser.js +110 -0
  78. package/lib/module/modules/bt-management/services/devices/bc01/bc01-frame-parser.js.map +1 -0
  79. package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js +113 -51
  80. package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
  81. package/lib/module/modules/bt-management/services/devices/bc01/bc01.main-services.js +41 -77
  82. package/lib/module/modules/bt-management/services/devices/bc01/bc01.main-services.js.map +1 -1
  83. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +15 -1
  84. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
  85. package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +20 -1
  86. package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
  87. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +31 -45
  88. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  89. package/lib/module/modules/bt-management/services/devices/frame-parser.js +2 -1
  90. package/lib/module/modules/bt-management/services/devices/frame-parser.js.map +1 -1
  91. package/lib/module/modules/bt-management/services/devices/sentinel-frame-reader.js +79 -0
  92. package/lib/module/modules/bt-management/services/devices/sentinel-frame-reader.js.map +1 -0
  93. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +19 -45
  94. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
  95. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +50 -0
  96. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -0
  97. package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +38 -0
  98. package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -0
  99. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +108 -0
  100. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -0
  101. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js +116 -0
  102. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js.map +1 -0
  103. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-device.js +87 -0
  104. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-device.js.map +1 -0
  105. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js +60 -0
  106. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map +1 -0
  107. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +89 -0
  108. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -0
  109. package/lib/module/modules/bt-management/types/device-measurement-map.js +3 -3
  110. package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
  111. package/lib/module/modules/bt-management/types/integrated-devices.js +2 -0
  112. package/lib/module/modules/bt-management/types/integrated-devices.js.map +1 -1
  113. package/lib/module/modules/bt-management/utils/create-custom-field-parser.js +21 -0
  114. package/lib/module/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
  115. package/lib/module/modules/bt-management/utils/parse-measurement.js +10 -7
  116. package/lib/module/modules/bt-management/utils/parse-measurement.js.map +1 -1
  117. package/lib/module/modules/bt-management/utils/reject-custom-reading.js +29 -0
  118. package/lib/module/modules/bt-management/utils/reject-custom-reading.js.map +1 -0
  119. package/lib/typescript/commonjs/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
  120. package/lib/typescript/commonjs/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
  121. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +4 -0
  122. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
  123. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +0 -1
  124. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-shape.d.ts +19 -0
  126. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-shape.d.ts.map +1 -0
  127. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
  128. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -1
  129. package/lib/typescript/commonjs/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
  130. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts +53 -0
  131. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +1 -0
  132. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts +53 -0
  133. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts.map +1 -0
  134. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts +33 -13
  135. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts.map +1 -1
  136. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts +11 -17
  137. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts.map +1 -1
  138. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts +7 -0
  139. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
  140. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +11 -2
  141. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
  142. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +10 -13
  143. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  144. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/frame-parser.d.ts.map +1 -1
  145. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts +52 -0
  146. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts.map +1 -0
  147. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +22 -13
  148. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +45 -0
  150. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -0
  151. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +18 -0
  152. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -0
  153. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +19 -0
  154. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -0
  155. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts +45 -0
  156. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts.map +1 -0
  157. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts +30 -0
  158. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts.map +1 -0
  159. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts +39 -0
  160. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts.map +1 -0
  161. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +35 -0
  162. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -0
  163. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts +30 -0
  164. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
  165. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-encoding.d.ts +7 -1
  166. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -1
  167. package/lib/typescript/commonjs/src/modules/bt-management/types/dependent-result-handler-params.d.ts +7 -0
  168. package/lib/typescript/commonjs/src/modules/bt-management/types/dependent-result-handler-params.d.ts.map +1 -1
  169. package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts +9 -0
  170. package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts.map +1 -1
  171. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
  172. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  173. package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts +3 -1
  174. package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
  175. package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts +8 -0
  176. package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
  177. package/lib/typescript/commonjs/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
  178. package/lib/typescript/commonjs/src/modules/bt-management/utils/parse-measurement.d.ts +4 -1
  179. package/lib/typescript/commonjs/src/modules/bt-management/utils/parse-measurement.d.ts.map +1 -1
  180. package/lib/typescript/commonjs/src/modules/bt-management/utils/reject-custom-reading.d.ts +15 -0
  181. package/lib/typescript/commonjs/src/modules/bt-management/utils/reject-custom-reading.d.ts.map +1 -0
  182. package/lib/typescript/module/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
  183. package/lib/typescript/module/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
  184. package/lib/typescript/module/src/modules/bt-management/index.d.ts +4 -0
  185. package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
  186. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +0 -1
  187. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  188. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-shape.d.ts +19 -0
  189. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-shape.d.ts.map +1 -0
  190. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
  191. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -1
  192. package/lib/typescript/module/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
  193. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts +53 -0
  194. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +1 -0
  195. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts +53 -0
  196. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts.map +1 -0
  197. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts +33 -13
  198. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts.map +1 -1
  199. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts +11 -17
  200. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts.map +1 -1
  201. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts +7 -0
  202. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
  203. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +11 -2
  204. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
  205. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +10 -13
  206. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  207. package/lib/typescript/module/src/modules/bt-management/services/devices/frame-parser.d.ts.map +1 -1
  208. package/lib/typescript/module/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts +52 -0
  209. package/lib/typescript/module/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts.map +1 -0
  210. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +22 -13
  211. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
  212. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +45 -0
  213. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -0
  214. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +18 -0
  215. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -0
  216. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +19 -0
  217. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -0
  218. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts +45 -0
  219. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts.map +1 -0
  220. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts +30 -0
  221. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts.map +1 -0
  222. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts +39 -0
  223. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts.map +1 -0
  224. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +35 -0
  225. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -0
  226. package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts +30 -0
  227. package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
  228. package/lib/typescript/module/src/modules/bt-management/types/custom-field-encoding.d.ts +7 -1
  229. package/lib/typescript/module/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -1
  230. package/lib/typescript/module/src/modules/bt-management/types/dependent-result-handler-params.d.ts +7 -0
  231. package/lib/typescript/module/src/modules/bt-management/types/dependent-result-handler-params.d.ts.map +1 -1
  232. package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts +9 -0
  233. package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts.map +1 -1
  234. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
  235. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  236. package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts +3 -1
  237. package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
  238. package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts +8 -0
  239. package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
  240. package/lib/typescript/module/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
  241. package/lib/typescript/module/src/modules/bt-management/utils/parse-measurement.d.ts +4 -1
  242. package/lib/typescript/module/src/modules/bt-management/utils/parse-measurement.d.ts.map +1 -1
  243. package/lib/typescript/module/src/modules/bt-management/utils/reject-custom-reading.d.ts +15 -0
  244. package/lib/typescript/module/src/modules/bt-management/utils/reject-custom-reading.d.ts.map +1 -0
  245. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  import { MeasurementTypeKey } from "@ovok/core";
4
- import { defineCustomDevice } from "../../custom/define-custom-device.js";
4
+ import { declareProfile, littleEndian } from "./standard-gatt.profile.js";
5
5
 
6
6
  /**
7
7
  * Declarations for the Bluetooth SIG vital-signs profiles.
@@ -20,52 +20,14 @@ import { defineCustomDevice } from "../../custom/define-custom-device.js";
20
20
  * such a device yields no reading rather than one that is quietly wrong.
21
21
  */
22
22
 
23
- /** Milliseconds a spot-check device may take to produce its reading. */
24
- const SPOT_CHECK_TIMEOUT_MS = 60_000;
25
- const sigUuid = assigned => `0000${assigned}-0000-1000-8000-00805f9b34fb`;
26
-
27
- /**
28
- * The flags byte selects the case, because it decides which optional fields are present and
29
- * therefore where the later ones sit. Every declared case reads the same offsets, so only
30
- * fields that keep their position across all of them may be declared.
31
- */
32
- const declareProfile = (params, profile) => defineCustomDevice({
33
- id: params.id,
34
- nameMatch: params.nameMatch,
35
- stuckDataTimeoutMs: params.stuckDataTimeoutMs ?? SPOT_CHECK_TIMEOUT_MS,
36
- services: [{
37
- uuid: sigUuid(profile.service),
38
- monitor: [{
39
- uuid: sigUuid(profile.characteristic),
40
- frame: {
41
- minLengthBytes: profile.minLengthBytes
42
- },
43
- caseSelectorBytes: [0],
44
- cases: profile.selectors.map(selector => ({
45
- selector,
46
- kind: "result",
47
- measurementTypeKey: profile.measurementTypeKey,
48
- fields: [...profile.fields]
49
- }))
50
- }]
51
- }]
52
- });
53
- const littleEndian = (name, byteIndexes, unit, encoding) => ({
54
- name,
55
- byteIndexes,
56
- byteOrder: "little",
57
- encoding,
58
- unit
59
- });
60
-
61
23
  /**
62
24
  * Blood Pressure Service 0x1810, Blood Pressure Measurement 0x2A35.
63
25
  *
64
- * The pulse rate is deliberately not read. Its offset moves with the timestamp flag, and
65
- * every byte a declaration reads must fit inside one `minLengthBytes` for the whole
66
- * characteristic - reading it would raise the minimum to sixteen bytes and reject the
67
- * shorter frames outright. The pressures sit at bytes 1-4 whatever the flags say, so they
68
- * are always safe. A device whose pulse matters needs a device class.
26
+ * The pressures sit at bytes 1-4 whatever the flags say. The pulse rate sits behind two of
27
+ * them: bit 1 puts a seven-byte timestamp in front of it and bit 2 says whether it is there
28
+ * at all, so it is read at byte 7 in one shape and byte 14 in the other, and each shape
29
+ * declares the length it needs. A device that reports no pulse still decodes, because the
30
+ * flags value it sends selects a case that never looks for one.
69
31
  */
70
32
  const standardBloodPressureDevice = params => declareProfile(params, {
71
33
  service: "1810",
@@ -74,7 +36,19 @@ const standardBloodPressureDevice = params => declareProfile(params, {
74
36
  measurementTypeKey: MeasurementTypeKey.bloodPressure,
75
37
  /** mmHg, with and without the timestamp and pulse the pressures sit in front of. */
76
38
  selectors: ["00", "02", "04", "06"],
77
- fields: [littleEndian("systolic", [1, 2], "mmHg", "sfloat"), littleEndian("diastolic", [3, 4], "mmHg", "sfloat")]
39
+ fields: [littleEndian("systolic", [1, 2], "mmHg", "sfloat"), littleEndian("diastolic", [3, 4], "mmHg", "sfloat")],
40
+ optionalFields: {
41
+ /** Pulse, no timestamp: it follows the mean pressure. */
42
+ "04": {
43
+ fields: [littleEndian("heartRate", [7, 8], "bpm", "sfloat")],
44
+ minLengthBytes: 9
45
+ },
46
+ /** Pulse behind a seven-byte timestamp. */
47
+ "06": {
48
+ fields: [littleEndian("heartRate", [14, 15], "bpm", "sfloat")],
49
+ minLengthBytes: 16
50
+ }
51
+ }
78
52
  });
79
53
 
80
54
  /** Health Thermometer Service 0x1809, Temperature Measurement 0x2A1C. */
@@ -1 +1 @@
1
- {"version":3,"names":["MeasurementTypeKey","defineCustomDevice","SPOT_CHECK_TIMEOUT_MS","sigUuid","assigned","declareProfile","params","profile","id","nameMatch","stuckDataTimeoutMs","services","uuid","service","monitor","characteristic","frame","minLengthBytes","caseSelectorBytes","cases","selectors","map","selector","kind","measurementTypeKey","fields","littleEndian","name","byteIndexes","unit","encoding","byteOrder","standardBloodPressureDevice","bloodPressure","standardThermometerDevice","temperature","WEIGHT_KG_PER_COUNT","standardWeightScaleDevice","bodyWeight","scale","decimals","standardPulseOximeterDevice","bloodOxygenPulseRate","standardHeartRateDevice","heartRate"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAI/C,SAASC,kBAAkB,QAAQ,sCAAmC;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMC,qBAAqB,GAAG,MAAM;AA6BpC,MAAMC,OAAO,GAAIC,QAAgB,IAC/B,OAAOA,QAAQ,8BAA8B;;AAE/C;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAGA,CACrBC,MAA4B,EAC5BC,OAAoB,KAEpBN,kBAAkB,CAAC;EACjBO,EAAE,EAAEF,MAAM,CAACE,EAAE;EACbC,SAAS,EAAEH,MAAM,CAACG,SAAS;EAC3BC,kBAAkB,EAAEJ,MAAM,CAACI,kBAAkB,IAAIR,qBAAqB;EACtES,QAAQ,EAAE,CACR;IACEC,IAAI,EAAET,OAAO,CAACI,OAAO,CAACM,OAAO,CAAC;IAC9BC,OAAO,EAAE,CACP;MACEF,IAAI,EAAET,OAAO,CAACI,OAAO,CAACQ,cAAc,CAAC;MACrCC,KAAK,EAAE;QAAEC,cAA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;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMiB,uBAAuB,GAC3BrC,MAA4B,IAE5BD,cAAc,CAACC,MAAM,EAAE;EACrBO,OAAO,EAAE,MAAM;EACfE,cAAc,EAAE,MAAM;EACtBE,cAAc,EAAE,CAAC;EACjBO,kBAAkB,EAAExB,kBAAkB,CAAC4C,SAAS;EAChDxB,SAAS,EAAE,CAAC,IAAI,CAAC;EACjBK,MAAM,EAAE,CACN;IAAEE,IAAI,EAAE,WAAW;IAAEC,WAAW,EAAE,CAAC,CAAC,CAAC;IAAEE,QAAQ,EAAE,MAAM;IAAED,IAAI,EAAE;EAAM,CAAC;AAE1E,CAAC,CAAC;AAEJ,SACEG,2BAA2B,EAC3BW,uBAAuB,EACvBF,2BAA2B,EAC3BP,yBAAyB,EACzBG,yBAAyB","ignoreList":[]}
1
+ {"version":3,"names":["MeasurementTypeKey","declareProfile","littleEndian","standardBloodPressureDevice","params","service","characteristic","minLengthBytes","measurementTypeKey","bloodPressure","selectors","fields","optionalFields","standardThermometerDevice","temperature","WEIGHT_KG_PER_COUNT","standardWeightScaleDevice","bodyWeight","scale","decimals","standardPulseOximeterDevice","bloodOxygenPulseRate","standardHeartRateDevice","heartRate","name","byteIndexes","encoding","unit"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAI/C,SACEC,cAAc,EACdC,YAAY,QAEP,4BAAyB;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,2BAA2B,GAC/BC,MAA4B,IAE5BH,cAAc,CAACG,MAAM,EAAE;EACrBC,OAAO,EAAE,MAAM;EACfC,cAAc,EAAE,MAAM;EACtBC,cAAc,EAAE,CAAC;EACjBC,kBAAkB,EAAER,k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AAI,EAAE;EAAM,CAAC;AAE1E,CAAC,CAAC;AAEJ,SACExB,2BAA2B,EAC3BmB,uBAAuB,EACvBF,2BAA2B,EAC3BP,yBAAyB,EACzBG,yBAAyB","ignoreList":[]}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ import { defineCustomDevice } from "../../custom/define-custom-device.js";
4
+
5
+ /** Milliseconds a spot-check device may take to produce its reading. */
6
+ const SPOT_CHECK_TIMEOUT_MS = 60_000;
7
+ const sigUuid = assigned => `0000${assigned}-0000-1000-8000-00805f9b34fb`;
8
+
9
+ /**
10
+ * The flags byte selects the case, because it decides which optional fields are present and
11
+ * therefore where the later ones sit. Fields common to every shape are declared once; a
12
+ * field a flag adds is declared against the selector that carries it, at the offset that
13
+ * flag combination puts it and with the frame length that shape guarantees.
14
+ */
15
+ const declareProfile = (params, profile) => defineCustomDevice({
16
+ id: params.id,
17
+ nameMatch: params.nameMatch,
18
+ stuckDataTimeoutMs: params.stuckDataTimeoutMs ?? SPOT_CHECK_TIMEOUT_MS,
19
+ services: [{
20
+ uuid: sigUuid(profile.service),
21
+ monitor: [{
22
+ uuid: sigUuid(profile.characteristic),
23
+ frame: {
24
+ minLengthBytes: profile.minLengthBytes
25
+ },
26
+ caseSelectorBytes: [0],
27
+ cases: profile.selectors.map(selector => {
28
+ const optional = profile.optionalFields?.[selector];
29
+ return {
30
+ selector,
31
+ kind: "result",
32
+ measurementTypeKey: profile.measurementTypeKey,
33
+ fields: [...profile.fields, ...(optional?.fields ?? [])],
34
+ ...(optional ? {
35
+ minLengthBytes: optional.minLengthBytes
36
+ } : {})
37
+ };
38
+ })
39
+ }]
40
+ }]
41
+ });
42
+ const littleEndian = (name, byteIndexes, unit, encoding) => ({
43
+ name,
44
+ byteIndexes,
45
+ byteOrder: "little",
46
+ encoding,
47
+ unit
48
+ });
49
+ export { declareProfile, littleEndian, sigUuid };
50
+ //# sourceMappingURL=standard-gatt.profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["defineCustomDevice","SPOT_CHECK_TIMEOUT_MS","sigUuid","assigned","declareProfile","params","profile","id","nameMatch","stuckDataTimeoutMs","services","uuid","service","monitor","characteristic","frame","minLengthBytes","caseSelectorBytes","cases","selectors","map","selector","optional","optionalFields","kind","measurementTypeKey","fields","littleEndian","name","byteIndexes","unit","encoding","byteOrder"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.ts"],"mappings":";;AAIA,SAASA,kBAAkB,QAAQ,sCAAmC;;AAEtE;AACA,MAAMC,qBAAqB,GAAG,MAAM;AAyCpC,MAAMC,OAAO,GAAIC,QAAgB,IAC/B,OAAOA,QAAQ,8BAA8B;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAGA,CACrBC,MAA4B,EAC5BC,OAAoB,KAEpBN,kBAAkB,CAAC;EACjBO,EAAE,EAAEF,MAAM,CAACE,EAAE;EACbC,SAAS,EAAEH,MAAM,CAACG,SAAS;EAC3BC,kBAAkB,EAAEJ,MAAM,CAACI,kBAAkB,IAAIR,qBAAqB;EACtES,QAAQ,EAAE,CACR;IACEC,IAAI,EAAET,OAAO,CAACI,OAAO,CAACM,OAAO,CAAC;IAC9BC,OAAO,EAAE,CACP;MACEF,IAAI,EAAET,OAAO,CAACI,OAAO,CAACQ,cAAc,CAAC;MACrCC,KAAK,EAAE;QAAEC,cAAc,EAAEV,OAAO,CAACU;MAAe,CAAC;MACjDC,iBAAiB,EAAE,CAAC,CAAC,CAAC;MACtBC,KAAK,EAAEZ,OAAO,CAACa,SAAS,CAACC,GAAG,CAAEC,QAAQ,IAAK;QACzC,MAAMC,QAAQ,GAAGhB,OAAO,CAACiB,cAAc,GAAGF,QAAQ,CAAC;QAEnD,OAAO;UACLA,QAAQ;UACRG,IAAI,EAAE,QAAiB;UACvBC,kBAAkB,EAAEnB,OAAO,CAACmB,kBAAkB;UAC9CC,MAAM,EAAE,CAAC,GAAGpB,OAAO,CAACoB,MAAM,EAAE,IAAIJ,QAAQ,EAAEI,MAAM,IAAI,EAAE,CAAC,CAAC;UACxD,IAAIJ,QAAQ,GACR;YAAEN,cAAc,EAAEM,QAAQ,CAACN;UAAe,CAAC,GAC3C,CAAC,CAAC;QACR,CAAC;MACH,CAAC;IACH,CAAC;EAEL,CAAC;AAEL,CAAC,CAAC;AAEJ,MAAMW,YAAY,GAAGA,CACnBC,IAAY,EACZC,WAAqB,EACrBC,IAAY,EACZC,QAAqC,MAChB;EACrBH,IAAI;EACJC,WAAW;EACXG,SAAS,EAAE,QAAQ;EACnBD,QAAQ;EACRD;AACF,CAAC,CAAC;AAEF,SAAS1B,cAAc,EAAEuB,YAAY,EAAEzB,OAAO","ignoreList":[]}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ import { standardBloodPressureDevice } from "../standard-gatt/standard-gatt.devices.js";
4
+
5
+ /**
6
+ * The Veroval compact+ blood-pressure monitors.
7
+ *
8
+ * There is nothing vendor-specific to decode here: these implement the Bluetooth
9
+ * blood-pressure profile as published - service 0x1810, measurement 0x2A35, notifications on
10
+ * the standard descriptor - so the layout comes from the specification and the SDK already
11
+ * reads it. What this adds is the identity, which is the only part the specification does
12
+ * not supply.
13
+ *
14
+ * The vendor's own app compares the advertised name for exact equality, ignoring case, so
15
+ * that is what these matchers do. The duo control and the Fusion are not here: those speak a
16
+ * protocol of their own on a private service, and so does the ECG.
17
+ */
18
+
19
+ const BPU_26 = "BPU26";
20
+ const BPW_26 = "BPW26";
21
+ const verovalCompactMonitor = (advertisedName, params) => standardBloodPressureDevice({
22
+ id: params.id,
23
+ nameMatch: params.nameMatch ?? new RegExp(`^${advertisedName}$`, "i"),
24
+ ...(params.stuckDataTimeoutMs === undefined ? {} : {
25
+ stuckDataTimeoutMs: params.stuckDataTimeoutMs
26
+ })
27
+ });
28
+
29
+ /** BPU 26, the Veroval compact+ upper-arm monitor. */
30
+ const bpu26Monitor = params => verovalCompactMonitor(BPU_26, params);
31
+
32
+ /** BPW 26, the Veroval compact+ wrist monitor. */
33
+ const bpw26Monitor = params => verovalCompactMonitor(BPW_26, params);
34
+
35
+ /** The names these monitors advertise. */
36
+ const VEROVAL_BP_MODEL_NAMES = [BPU_26, BPW_26];
37
+ export { bpu26Monitor, bpw26Monitor, VEROVAL_BP_MODEL_NAMES, verovalCompactMonitor };
38
+ //# sourceMappingURL=veroval.bp-monitors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["standardBloodPressureDevice","BPU_26","BPW_26","verovalCompactMonitor","advertisedName","params","id","nameMatch","RegExp","stuckDataTimeoutMs","undefined","bpu26Monitor","bpw26Monitor","VEROVAL_BP_MODEL_NAMES"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.bp-monitors.ts"],"mappings":";;AACA,SAASA,2BAA2B,QAAQ,2CAAwC;;AAEpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,MAAM,GAAG,OAAO;AACtB,MAAMC,MAAM,GAAG,OAAO;AActB,MAAMC,qBAAqB,GAAGA,CAC5BC,cAAsB,EACtBC,MAAuB,KAEvBL,2BAA2B,CAAC;EAC1BM,EAAE,EAAED,MAAM,CAACC,EAAE;EACbC,SAAS,EAAEF,MAAM,CAACE,SAAS,IAAI,IAAIC,MAAM,CAAC,IAAIJ,cAAc,GAAG,EAAE,GAAG,CAAC;EACrE,IAAIC,MAAM,CAACI,kBAAkB,KAAKC,SAAS,GACvC,CAAC,CAAC,GACF;IAAED,kBAAkB,EAAEJ,MAAM,CAACI;EAAmB,CAAC;AACvD,CAAC,CAAC;;AAEJ;AACA,MAAME,YAAY,GAAIN,MAAuB,IAC3CF,qBAAqB,CAACF,MAAM,EAAEI,MAAM,CAAC;;AAEvC;AACA,MAAMO,YAAY,GAAIP,MAAuB,IAC3CF,qBAAqB,CAACD,MAAM,EAAEG,MAAM,CAAC;;AAEvC;AACA,MAAMQ,sBAAyC,GAAG,CAACZ,MAAM,EAAEC,MAAM,CAAC;AAElE,SACES,YAAY,EACZC,YAAY,EACZC,sBAAsB,EACtBV,qBAAqB","ignoreList":[]}
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+
3
+ import { MeasurementTypeKey } from "@ovok/core";
4
+ import { defineCustomDevice } from "../../custom/define-custom-device.js";
5
+ import { CustomDevice } from "../custom/custom.device.js";
6
+ import { SentinelFrameReader } from "../sentinel-frame-reader.js";
7
+ import { VerovalDuoControlSequencer } from "./veroval.duo-control-sequencer.js";
8
+ const SERVICE = "5d4b8aa6-a26a-4a1b-99f5-cd4473c786e3";
9
+ const NOTIFY = "5d4b8aa6-a26a-4a1b-99f5-cd4473c786e4";
10
+ const WRITE = "5d4b8aa6-a26a-4a1b-99f5-cd4473c786e5";
11
+ const STX = "02";
12
+ const ETX = "03";
13
+ const ACK = "06";
14
+ const NAK = "15";
15
+
16
+ /** One stored measurement, as the device writes it: twenty-six characters. */
17
+ const RECORD_BYTES = 26;
18
+
19
+ /** A reply opens by echoing the four-character command it answers. */
20
+ const TAG_BYTES = 4;
21
+
22
+ /** `?MDR`, the reply carrying stored records. */
23
+ const DATA_REPLY = "3f4d4452";
24
+
25
+ /** `?MRN`, the reply carrying a record count. The sequencer reads it; no reading comes of it. */
26
+ const COUNT_REPLY = "3f4d524e";
27
+
28
+ /** Two memories of a hundred records each, plus the echo, with room to spare. */
29
+ const MAX_REPLY_BYTES = 8_192;
30
+
31
+ /** The device sleeps between measurements, so it is given a while to answer. */
32
+ const STUCK_TIMEOUT_MS = 120_000;
33
+ const asciiField = (name, from, unit) => ({
34
+ name,
35
+ byteIndexes: [from, from + 1, from + 2],
36
+ encoding: "ascii",
37
+ unit
38
+ });
39
+
40
+ /**
41
+ * The record layout, read from HARTMANN's own application.
42
+ *
43
+ * Offsets are relative to a record, and every field is decimal digits written as text. The
44
+ * timestamp at the front of each record is not declared: the SDK stamps a reading when it
45
+ * arrives, and a stored record's own clock would need the device's timezone to be
46
+ * meaningful.
47
+ */
48
+ const duoControlDefinition = defineCustomDevice({
49
+ id: "veroval-duo-control",
50
+ nameMatch: /^Veroval duo control$/i,
51
+ stuckDataTimeoutMs: STUCK_TIMEOUT_MS,
52
+ services: [{
53
+ uuid: SERVICE,
54
+ monitor: [{
55
+ uuid: NOTIFY,
56
+ frame: {
57
+ minLengthBytes: TAG_BYTES + RECORD_BYTES
58
+ },
59
+ caseSelectorBytes: [0, 1, 2, 3],
60
+ cases: [{
61
+ selector: DATA_REPLY,
62
+ kind: "result",
63
+ measurementTypeKey: MeasurementTypeKey.bloodPressure,
64
+ description: "Stored measurements, one record each",
65
+ repeatedRecords: {
66
+ recordBytes: RECORD_BYTES,
67
+ from: TAG_BYTES
68
+ },
69
+ fields: [asciiField("systolic", 11, "mmHg"), asciiField("diastolic", 14, "mmHg"), asciiField("heartRate", 17, "bpm")]
70
+ }, {
71
+ selector: COUNT_REPLY,
72
+ kind: "idle",
73
+ description: "How many records a memory holds"
74
+ }]
75
+ }]
76
+ }]
77
+ });
78
+
79
+ /**
80
+ * The Veroval duo control.
81
+ *
82
+ * A device class rather than a declaration, because reading it is a conversation: the two
83
+ * user memories are asked in turn, and the device answers with bare control bytes as often
84
+ * as with payload. The decoding is still declared - the class supplies the framing and the
85
+ * walk, and nothing else.
86
+ *
87
+ * Readings are stored measurements, not live ones. The device hands over its history when
88
+ * asked, so what arrives was taken before the connection and may be days old.
89
+ */
90
+ export class VerovalDuoControlDevice extends CustomDevice {
91
+ constructor(device, params) {
92
+ super(device, params, duoControlDefinition);
93
+ this.frameReader = new SentinelFrameReader({
94
+ start: STX,
95
+ terminator: ETX,
96
+ maxFrameBytes: MAX_REPLY_BYTES,
97
+ standaloneBytes: [ACK, NAK]
98
+ });
99
+ this.createCommandSequencer = () => new VerovalDuoControlSequencer({
100
+ write: {
101
+ serviceUuid: SERVICE,
102
+ characteristicUuid: WRITE
103
+ },
104
+ onRefused: reason => this.onError?.(new Error(`Veroval duo control: ${reason}.`))
105
+ });
106
+ }
107
+ }
108
+ //# sourceMappingURL=veroval.duo-control-device.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MeasurementTypeKey","defineCustomDevice","CustomDevice","SentinelFrameReader","VerovalDuoControlSequencer","SERVICE","NOTIFY","WRITE","STX","ETX","ACK","NAK","RECORD_BYTES","TAG_BYTES","DATA_REPLY","COUNT_REPLY","MAX_REPLY_BYTES","STUCK_TIMEOUT_MS","asciiField","name","from","unit","byteIndexes","encoding","duoControlDefinition","id","nameMatch","stuckDataTimeoutMs","services","uuid","monitor","frame","minLengthBytes","caseSelectorBytes","cases","selector","kind","measurementTypeKey","bloodPressure","description","repeatedRecords","recordBytes","fields","VerovalDuoControlDevice","constructor","device","params","frameReader","start","terminator","maxFrameBytes","standaloneBytes","createCommandSequencer","write","serviceUuid","characteristicUuid","onRefused","reason","onError","Error"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.duo-control-device.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAK/C,SAASC,kBAAkB,QAAQ,sCAAmC;AACtE,SAASC,YAAY,QAAQ,4BAAyB;AACtD,SAASC,mBAAmB,QAAQ,6BAA0B;AAE9D,SAASC,0BAA0B,QAAQ,oCAAiC;AAE5E,MAAMC,OAAO,GAAG,sCAAsC;AACtD,MAAMC,MAAM,GAAG,sCAAsC;AACrD,MAAMC,KAAK,GAAG,sCAAsC;AAEpD,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;;AAEhB;AACA,MAAMC,YAAY,GAAG,EAAE;;AAEvB;AACA,MAAMC,SAAS,GAAG,CAAC;;AAEnB;AACA,MAAMC,UAAU,GAAG,UAAU;;AAE7B;AACA,MAAMC,WAAW,GAAG,UAAU;;AAE9B;AACA,MAAMC,eAAe,GAAG,KAAK;;AAE7B;AACA,MAAMC,gBAAgB,GAAG,OAAO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AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMI,uBAAuB,SAASzC,YAAY,CAAC;EACjD0C,WAAWA,CAChBC,MAAc,EACdC,MAA0C,EAC1C;IACA,KAAK,CAACD,MAAM,EAAEC,MAAM,EAAEtB,oBAAoB,CAAC;IAE3C,IAAI,CAACuB,WAAW,GAAG,IAAI5C,mBAAmB,CAAC;MACzC6C,KAAK,EAAExC,GAAG;MACVyC,UAAU,EAAExC,GAAG;MACfyC,aAAa,EAAElC,eAAe;MAC9BmC,eAAe,EAAE,CAACzC,GAAG,EAAEC,GAAG;IAC5B,CAAC,CAAC;IAEF,IAAI,CAACyC,sBAAsB,GAAG,MAC5B,IAAIhD,0BAA0B,CAAC;MAC7BiD,KAAK,EAAE;QAAEC,WAAW,EAAEjD,OAAO;QAAEkD,kBAAkB,EAAEhD;MAAM,CAAC;MAC1DiD,SAAS,EAAGC,MAAM,IAChB,IAAI,CAACC,OAAO,GAAG,IAAIC,KAAK,CAAC,wBAAwBF,MAAM,GAAG,CAAC;IAC/D,CAAC,CAAC;EACN;AACF","ignoreList":[]}
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+
3
+ import { hexToByte } from "../../../utils/hex-to-byte.js";
4
+
5
+ /** The control bytes of the serial protocol this device speaks over BLE. */
6
+ const ACK = 0x06;
7
+ const NAK = 0x15;
8
+ const ENQ = "05";
9
+
10
+ /** The device holds two user memories, and each is asked for a count and then its data. */
11
+ const STEPS = ["?MRN1", "?MDR1A", "?MRN2", "?MDR2A"];
12
+
13
+ /** A reply echoes the four-character command it answers, after the byte the reader strips. */
14
+ const TAG_FROM = 0;
15
+ const TAG_BYTES = 4;
16
+ const COUNT_BYTES = 3;
17
+ const ASCII_ZERO = 0x30;
18
+ const ASCII_NINE = 0x39;
19
+ const asciiOf = (frame, from, count) => frame.slice(from, from + count).map(byte => String.fromCharCode(hexToByte(byte))).join("");
20
+ const asciiNumberOf = (frame, from, count) => {
21
+ const codes = frame.slice(from, from + count).map(byte => hexToByte(byte));
22
+ if (codes.length !== count || codes.some(code => code < ASCII_ZERO || code > ASCII_NINE)) {
23
+ return undefined;
24
+ }
25
+ return Number(codes.map(code => code - ASCII_ZERO).join(""));
26
+ };
27
+ const asciiCommand = (write, text) => ({
28
+ ...write,
29
+ frame: [...text].map(character => character.charCodeAt(0).toString(16).padStart(2, "0")),
30
+ withoutResponse: true
31
+ });
32
+
33
+ /**
34
+ * Walks the Veroval duo control through its stored history.
35
+ *
36
+ * The device answers one request at a time and holds two user memories, so the exchange is
37
+ * a fixed walk: ask user one how many records it has, read them, then user two. A memory
38
+ * that reports none is skipped rather than read.
39
+ *
40
+ * Two of its replies are not payload at all. A bare `ACK` means the device has more to send
41
+ * and is waiting to be asked, which is what `ENQ` does - so an acknowledgement provokes an
42
+ * enquiry rather than advancing the walk. A bare `NAK` is a refusal and ends it.
43
+ *
44
+ * Everything here is derived from HARTMANN's own application. The one part that is an
45
+ * inference rather than a reading is `ENQ` as flow control: the app writes it on receiving
46
+ * `ACK`, which is what that pair means in the serial protocol this is descended from, but
47
+ * the pacing was not observed on hardware.
48
+ */
49
+ export class VerovalDuoControlSequencer {
50
+ step = 0;
51
+ isDone = false;
52
+ constructor(params) {
53
+ this.params = params;
54
+ }
55
+ initialCommands = () => [this.commandFor(0)];
56
+ nextCommand = frame => {
57
+ if (this.isDone) {
58
+ return undefined;
59
+ }
60
+ if (frame.length === 1) {
61
+ return this.answerControlByte(hexToByte(frame[0] ?? "0"));
62
+ }
63
+ const tag = asciiOf(frame, TAG_FROM, TAG_BYTES);
64
+ if (tag === "?MRN") {
65
+ return this.answerCount(frame);
66
+ }
67
+ return tag === "?MDR" ? this.advance() : undefined;
68
+ };
69
+ answerControlByte = code => {
70
+ if (code === ACK) {
71
+ return [asciiCommandFromHex(this.params.write, ENQ)];
72
+ }
73
+ if (code === NAK) {
74
+ return this.stop("the device refused the request");
75
+ }
76
+ return undefined;
77
+ };
78
+
79
+ /**
80
+ * A memory reporting no records is skipped. Asking for the data of an empty memory is a
81
+ * request the device answers with nothing, which would stall the walk on its own reply.
82
+ */
83
+ answerCount = frame => {
84
+ const count = asciiNumberOf(frame, TAG_BYTES, COUNT_BYTES);
85
+ if (count === undefined) {
86
+ return this.stop("the device answered a record count that was not a number");
87
+ }
88
+ return count > 0 ? this.advance() : this.skipMemory();
89
+ };
90
+
91
+ /** Past this memory's data command, to the next memory's count. */
92
+ skipMemory = () => {
93
+ this.step += 1;
94
+ return this.advance();
95
+ };
96
+ advance = () => {
97
+ this.step += 1;
98
+ if (this.step >= STEPS.length) {
99
+ this.isDone = true;
100
+ return undefined;
101
+ }
102
+ return [this.commandFor(this.step)];
103
+ };
104
+ stop = reason => {
105
+ this.isDone = true;
106
+ this.params.onRefused(reason);
107
+ return undefined;
108
+ };
109
+ commandFor = step => asciiCommand(this.params.write, STEPS[step] ?? "");
110
+ }
111
+ const asciiCommandFromHex = (write, hex) => ({
112
+ ...write,
113
+ frame: [hex],
114
+ withoutResponse: true
115
+ });
116
+ //# sourceMappingURL=veroval.duo-control-sequencer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["hexToByte","ACK","NAK","ENQ","STEPS","TAG_FROM","TAG_BYTES","COUNT_BYTES","ASCII_ZERO","ASCII_NINE","asciiOf","frame","from","count","slice","map","byte","String","fromCharCode","join","asciiNumberOf","codes","length","some","code","undefined","Number","asciiCommand","write","text","character","charCodeAt","toString","padStart","withoutResponse","VerovalDuoControlSequencer","step","isDone","constructor","params","initialCommands","commandFor","nextCommand","answerControlByte","tag","answerCount","advance","asciiCommandFromHex","stop","skipMemory","reason","onRefused","hex"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.ts"],"mappings":";;AAEA,SAASA,SAAS,QAAQ,+BAA4B;;AAEtD;AACA,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;;AAEhB;AACA,MAAMC,KAA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,eAAe,EAAE;AAAK,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+
3
+ import { MeasurementTypeKey } from "@ovok/core";
4
+ import { CaseType } from "../../../types/case-type.js";
5
+ import { BTManagedDevice } from "../bt-managed-device.js";
6
+ import { decodeVerovalEcgSamples, VEROVAL_ECG_SAMPLE_RATE_HZ } from "./veroval.ecg-samples.js";
7
+ import { VerovalEcgTransfer } from "./veroval.ecg-transfer.js";
8
+ const SERVICE = "0000a000-0000-1000-8000-00805f9b34fb";
9
+
10
+ /** Requests go to one characteristic and every reply arrives on the other. */
11
+ const CONTROL_POINT = "00002a37-0000-1000-8000-00805f9b34fb";
12
+ const NOTIFY = "00002a36-0000-1000-8000-00805f9b34fb";
13
+
14
+ /** A recording is thirty-four seconds, and the device waits on a person before sending it. */
15
+ const STUCK_TIMEOUT_MS = 180_000;
16
+ const PREFERRED_MTU = 247;
17
+
18
+ /**
19
+ * Every notification matches this, and none of them is a measurement.
20
+ *
21
+ * The transfer assembles the recording itself and reports it once, so the parser is given a
22
+ * case that matches anything and decodes nothing. Without it each of the five hundred odd
23
+ * packets would be logged as a frame nothing declared.
24
+ */
25
+ const acceptEverything = {
26
+ caseValuePosition: [],
27
+ cases: [{
28
+ caseValue: "",
29
+ caseType: CaseType.OTHER,
30
+ parseDefinitions: [],
31
+ description: "A packet of a download, assembled by the transfer"
32
+ }]
33
+ };
34
+
35
+ /**
36
+ * The Veroval ECG.
37
+ *
38
+ * Reading it is a download rather than a decode, so the whole recording is assembled before
39
+ * anything is reported: thirty-four seconds of samples at 128 Hz, two bytes each, converted
40
+ * to millivolts with the device's own calibration.
41
+ *
42
+ * The vendor's app plots a thirty-second window of this with a baseline-wander filter
43
+ * applied. That is a display transform, not calibration, so it is deliberately not
44
+ * reproduced here - what is reported is what the device recorded.
45
+ */
46
+ export class VerovalEcgDevice extends BTManagedDevice {
47
+ stuckDataTimeout = STUCK_TIMEOUT_MS;
48
+ preferredMtu = PREFERRED_MTU;
49
+ onStreamStart = undefined;
50
+ mainServices = [{
51
+ uuid: SERVICE,
52
+ monitorUuids: [{
53
+ uuid: NOTIFY,
54
+ parsingModel: acceptEverything
55
+ }]
56
+ }];
57
+ validatePackage = () => true;
58
+ createCommandSequencer = () => new VerovalEcgTransfer({
59
+ write: {
60
+ serviceUuid: SERVICE,
61
+ characteristicUuid: CONTROL_POINT
62
+ },
63
+ onRecording: this.reportRecording
64
+ });
65
+ constructor(device, params) {
66
+ super(device, params);
67
+ }
68
+
69
+ /** Nothing is reported per packet; the transfer reports the recording when it is whole. */
70
+ handleSuccessResult() {
71
+ return;
72
+ }
73
+ reportRecording = bytes => {
74
+ const diagramPoints = decodeVerovalEcgSamples(bytes);
75
+ if (diagramPoints.length === 0) {
76
+ this.onError?.(new Error("Veroval ECG: the recording held no samples."));
77
+ return;
78
+ }
79
+ this.onResult?.({
80
+ measurementTypeKey: MeasurementTypeKey.ecg,
81
+ caseType: CaseType.RESULT,
82
+ diagramPoints,
83
+ duration: diagramPoints.length / VEROVAL_ECG_SAMPLE_RATE_HZ
84
+ });
85
+ };
86
+ }
87
+ //# sourceMappingURL=veroval.ecg-device.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MeasurementTypeKey","CaseType","BTManagedDevice","decodeVerovalEcgSamples","VEROVAL_ECG_SAMPLE_RATE_HZ","VerovalEcgTransfer","SERVICE","CONTROL_POINT","NOTIFY","STUCK_TIMEOUT_MS","PREFERRED_MTU","acceptEverything","caseValuePosition","cases","caseValue","caseType","OTHER","parseDefinitions","description","VerovalEcgDevice","stuckDataTimeout","preferredMtu","onStreamStart","undefined","mainServices","uuid","monitorUuids","parsingModel","validatePackage","createCommandSequencer","write","serviceUuid","characteristicUuid","onRecording","reportRecording","constructor","device","params","handleSuccessResult","bytes","diagramPoints","length","onError","Error","onResult","measurementTypeKey","ecg","RESULT","duration"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-device.ts"],"m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AAc,EACdC,MAAyD,EACzD;IACA,KAAK,CAACD,MAAM,EAAEC,MAAM,CAAC;EACvB;;EAEA;EACUC,mBAAmBA,CAAA,EAAS;IACpC;EACF;EAEQJ,eAAe,GAAIK,KAAwB,IAAW;IAC5D,MAAMC,aAAa,GAAGrC,uBAAuB,CAACoC,KAAK,CAAC;IAEpD,IAAIC,aAAa,CAACC,MAAM,KAAK,CAAC,EAAE;MAC9B,IAAI,CAACC,OAAO,GAAG,IAAIC,KAAK,CAAC,6CAA6C,CAAC,CAAC;MAExE;IACF;IAEA,IAAI,CAACC,QAAQ,GAAG;MACdC,kBAAkB,EAAE7C,kBAAkB,CAAC8C,GAAG;MAC1C/B,QAAQ,EAAEd,QAAQ,CAAC8C,MAAM;MACzBP,aAAa;MACbQ,QAAQ,EAAER,aAAa,CAACC,MAAM,GAAGrC;IACnC,CAAC,CAAC;EACJ,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ import { hexToByte } from "../../../utils/hex-to-byte.js";
4
+ const SAMPLE_BYTES = 2;
5
+ const BYTE_BITS = 8;
6
+ const SIGN_BIT = 0x8000;
7
+ const SIGNED_16_RANGE = 0x10000;
8
+
9
+ /**
10
+ * How fast the device samples.
11
+ *
12
+ * Not taken on trust: the vendor's own plotting step works out to two two-hundred-and-fifty
13
+ * sixths of a second, and its transfer is thirty-four segments of sixteen packets of sixteen
14
+ * bytes - which is 256 bytes, 128 samples, one second per segment. Both say 128 Hz.
15
+ */
16
+ const VEROVAL_ECG_SAMPLE_RATE_HZ = 128;
17
+
18
+ /**
19
+ * The calibration the recording is read with.
20
+ *
21
+ * This is the EDF convention - a linear map from counts onto a physical range - and the
22
+ * device states its own in the header it sends before the curve. These are the values the
23
+ * vendor's app falls back to, and are what the SDK uses until a header supplies otherwise:
24
+ * the full signed sixteen-bit range spans plus or minus 27.68 mV.
25
+ */
26
+ const DEFAULT_CALIBRATION = {
27
+ physicalMinimumMicrovolts: -27_680,
28
+ physicalMaximumMicrovolts: 27_680,
29
+ digitalMinimum: -32_768,
30
+ digitalMaximum: 32_767
31
+ };
32
+ const MICROVOLTS_PER_MILLIVOLT = 1000;
33
+ /** Samples are two bytes, most significant first, and signed. */
34
+ const signedSampleAt = (bytes, index) => {
35
+ const raw = hexToByte(bytes[index] ?? "0") << BYTE_BITS | hexToByte(bytes[index + 1] ?? "0");
36
+ return raw & SIGN_BIT ? raw - SIGNED_16_RANGE : raw;
37
+ };
38
+
39
+ /**
40
+ * Turns the bytes of a recording into millivolts.
41
+ *
42
+ * A trailing odd byte is ignored: half a sample is not a sample. The conversion is the
43
+ * device's own, applied as it states it rather than reduced to a single factor, so a header
44
+ * that reports a different range still decodes correctly.
45
+ */
46
+ const decodeVerovalEcgSamples = (bytes, calibration = DEFAULT_CALIBRATION) => {
47
+ const physicalRange = calibration.physicalMaximumMicrovolts - calibration.physicalMinimumMicrovolts;
48
+ const digitalRange = calibration.digitalMaximum - calibration.digitalMinimum;
49
+ const samples = [];
50
+ if (digitalRange === 0) {
51
+ return samples;
52
+ }
53
+ for (let index = 0; index + 1 < bytes.length; index += SAMPLE_BYTES) {
54
+ const counts = signedSampleAt(bytes, index) - calibration.digitalMinimum;
55
+ samples.push((counts * physicalRange / digitalRange + calibration.physicalMinimumMicrovolts) / MICROVOLTS_PER_MILLIVOLT);
56
+ }
57
+ return samples;
58
+ };
59
+ export { decodeVerovalEcgSamples, DEFAULT_CALIBRATION, VEROVAL_ECG_SAMPLE_RATE_HZ };
60
+ //# sourceMappingURL=veroval.ecg-samples.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["hexToByte","SAMPLE_BYTES","BYTE_BITS","SIGN_BIT","SIGNED_16_RANGE","VEROVAL_ECG_SAMPLE_RATE_HZ","DEFAULT_CALIBRATION","physicalMinimumMicrovolts","physicalMaximumMicrovolts","digitalMinimum","digitalMaximum","MICROVOLTS_PER_MILLIVOLT","signedSampleAt","bytes","index","raw","decodeVerovalEcgSamples","calibration","physicalRange","digitalRange","samples","length","counts","push"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-samples.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,+BAA4B;AAEtD,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,SAAS,GAAG,CAAC;AACnB,MAAMC,QAAQ,GAAG,MAAM;AACvB,MAAMC,eAAe,GAAG,OAAO;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,0BAA0B,GAAG,GAAG;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAG;EAC1BC,yBAAyB,EAAE,CAAC,MAAM;EAClCC,yBAAyB,EAAE,MAAM;EACjCC,cAAc,EAAE,CAAC,MAAM;EACvBC,cAAc,EAAE;AAClB,CAAU;AAEV,MAAMC,wBAAwB,GAAG,IAAI;AASrC;AACA,MAAMC,cAAc,GAAGA,CAACC,KAAwB,EAAEC,KAAa,KAAa;EAC1E,MAAMC,GAAG,GACNf,SAAS,CAACa,KAAK,CAACC,KAAK,CAAC,IAAI,GAAG,CAAC,IAAIZ,SAAS,GAC5CF,SAAS,CAACa,KAAK,CAACC,KAAK,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC;EAEpC,OAAOC,GAAG,GAAGZ,QAAQ,GAAGY,GAAG,GAAGX,eAAe,GAAGW,GAAG;AACrD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,uBAAuB,GAAGA,CAC9BH,KAAwB,EACxBI,WAA2B,GAAGX,mBAAmB,KACpC;EACb,MAAMY,aAAa,GACjBD,WAAW,CAACT,yBAAyB,GAAGS,WAAW,CAACV,yBAAyB;EAE/E,MAAMY,YAAY,GAAGF,WAAW,CAACP,cAAc,GAAGO,WAAW,CAACR,cAAc;EAC5E,MAAMW,OAAiB,GAAG,EAAE;EAE5B,IAAID,YAAY,KAAK,CAAC,EAAE;IACtB,OAAOC,OAAO;EACh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