@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
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.standardWeightScaleDevice = exports.standardThermometerDevice = exports.standardPulseOximeterDevice = exports.standardHeartRateDevice = exports.standardBloodPressureDevice = void 0;
7
7
  var _core = require("@ovok/core");
8
- var _defineCustomDevice = require("../../custom/define-custom-device.js");
8
+ var _standardGattProfile = require("./standard-gatt.profile.js");
9
9
  /**
10
10
  * Declarations for the Bluetooth SIG vital-signs profiles.
11
11
  *
@@ -23,73 +23,47 @@ var _defineCustomDevice = require("../../custom/define-custom-device.js");
23
23
  * such a device yields no reading rather than one that is quietly wrong.
24
24
  */
25
25
 
26
- /** Milliseconds a spot-check device may take to produce its reading. */
27
- const SPOT_CHECK_TIMEOUT_MS = 60_000;
28
- const sigUuid = assigned => `0000${assigned}-0000-1000-8000-00805f9b34fb`;
29
-
30
- /**
31
- * The flags byte selects the case, because it decides which optional fields are present and
32
- * therefore where the later ones sit. Every declared case reads the same offsets, so only
33
- * fields that keep their position across all of them may be declared.
34
- */
35
- const declareProfile = (params, profile) => (0, _defineCustomDevice.defineCustomDevice)({
36
- id: params.id,
37
- nameMatch: params.nameMatch,
38
- stuckDataTimeoutMs: params.stuckDataTimeoutMs ?? SPOT_CHECK_TIMEOUT_MS,
39
- services: [{
40
- uuid: sigUuid(profile.service),
41
- monitor: [{
42
- uuid: sigUuid(profile.characteristic),
43
- frame: {
44
- minLengthBytes: profile.minLengthBytes
45
- },
46
- caseSelectorBytes: [0],
47
- cases: profile.selectors.map(selector => ({
48
- selector,
49
- kind: "result",
50
- measurementTypeKey: profile.measurementTypeKey,
51
- fields: [...profile.fields]
52
- }))
53
- }]
54
- }]
55
- });
56
- const littleEndian = (name, byteIndexes, unit, encoding) => ({
57
- name,
58
- byteIndexes,
59
- byteOrder: "little",
60
- encoding,
61
- unit
62
- });
63
-
64
26
  /**
65
27
  * Blood Pressure Service 0x1810, Blood Pressure Measurement 0x2A35.
66
28
  *
67
- * The pulse rate is deliberately not read. Its offset moves with the timestamp flag, and
68
- * every byte a declaration reads must fit inside one `minLengthBytes` for the whole
69
- * characteristic - reading it would raise the minimum to sixteen bytes and reject the
70
- * shorter frames outright. The pressures sit at bytes 1-4 whatever the flags say, so they
71
- * are always safe. A device whose pulse matters needs a device class.
29
+ * The pressures sit at bytes 1-4 whatever the flags say. The pulse rate sits behind two of
30
+ * them: bit 1 puts a seven-byte timestamp in front of it and bit 2 says whether it is there
31
+ * at all, so it is read at byte 7 in one shape and byte 14 in the other, and each shape
32
+ * declares the length it needs. A device that reports no pulse still decodes, because the
33
+ * flags value it sends selects a case that never looks for one.
72
34
  */
73
- const standardBloodPressureDevice = params => declareProfile(params, {
35
+ const standardBloodPressureDevice = params => (0, _standardGattProfile.declareProfile)(params, {
74
36
  service: "1810",
75
37
  characteristic: "2a35",
76
38
  minLengthBytes: 7,
77
39
  measurementTypeKey: _core.MeasurementTypeKey.bloodPressure,
78
40
  /** mmHg, with and without the timestamp and pulse the pressures sit in front of. */
79
41
  selectors: ["00", "02", "04", "06"],
80
- fields: [littleEndian("systolic", [1, 2], "mmHg", "sfloat"), littleEndian("diastolic", [3, 4], "mmHg", "sfloat")]
42
+ fields: [(0, _standardGattProfile.littleEndian)("systolic", [1, 2], "mmHg", "sfloat"), (0, _standardGattProfile.littleEndian)("diastolic", [3, 4], "mmHg", "sfloat")],
43
+ optionalFields: {
44
+ /** Pulse, no timestamp: it follows the mean pressure. */
45
+ "04": {
46
+ fields: [(0, _standardGattProfile.littleEndian)("heartRate", [7, 8], "bpm", "sfloat")],
47
+ minLengthBytes: 9
48
+ },
49
+ /** Pulse behind a seven-byte timestamp. */
50
+ "06": {
51
+ fields: [(0, _standardGattProfile.littleEndian)("heartRate", [14, 15], "bpm", "sfloat")],
52
+ minLengthBytes: 16
53
+ }
54
+ }
81
55
  });
82
56
 
83
57
  /** Health Thermometer Service 0x1809, Temperature Measurement 0x2A1C. */
84
58
  exports.standardBloodPressureDevice = standardBloodPressureDevice;
85
- const standardThermometerDevice = params => declareProfile(params, {
59
+ const standardThermometerDevice = params => (0, _standardGattProfile.declareProfile)(params, {
86
60
  service: "1809",
87
61
  characteristic: "2a1c",
88
62
  minLengthBytes: 5,
89
63
  measurementTypeKey: _core.MeasurementTypeKey.temperature,
90
64
  /** Celsius, with and without the timestamp that follows the reading. */
91
65
  selectors: ["00", "02"],
92
- fields: [littleEndian("bodyTemp", [1, 2, 3, 4], "Cel", "float")]
66
+ fields: [(0, _standardGattProfile.littleEndian)("bodyTemp", [1, 2, 3, 4], "Cel", "float")]
93
67
  });
94
68
 
95
69
  /** The SI weight resolution the specification fixes at five grams per count. */
@@ -101,7 +75,7 @@ const WEIGHT_KG_PER_COUNT = 0.005;
101
75
  *
102
76
  * The reading is a scaled integer rather than a float, so the resolution is applied here.
103
77
  */
104
- const standardWeightScaleDevice = params => declareProfile(params, {
78
+ const standardWeightScaleDevice = params => (0, _standardGattProfile.declareProfile)(params, {
105
79
  service: "181d",
106
80
  characteristic: "2a9d",
107
81
  minLengthBytes: 3,
@@ -109,7 +83,7 @@ const standardWeightScaleDevice = params => declareProfile(params, {
109
83
  /** Kilograms, with and without the timestamp that follows the reading. */
110
84
  selectors: ["00", "02"],
111
85
  fields: [{
112
- ...littleEndian("bodyWeight", [1, 2], "kg", "uint"),
86
+ ...(0, _standardGattProfile.littleEndian)("bodyWeight", [1, 2], "kg", "uint"),
113
87
  scale: WEIGHT_KG_PER_COUNT,
114
88
  decimals: 3
115
89
  }]
@@ -122,13 +96,13 @@ const standardWeightScaleDevice = params => declareProfile(params, {
122
96
  * specification: a spot-check measurement always carries both.
123
97
  */
124
98
  exports.standardWeightScaleDevice = standardWeightScaleDevice;
125
- const standardPulseOximeterDevice = params => declareProfile(params, {
99
+ const standardPulseOximeterDevice = params => (0, _standardGattProfile.declareProfile)(params, {
126
100
  service: "1822",
127
101
  characteristic: "2a5e",
128
102
  minLengthBytes: 5,
129
103
  measurementTypeKey: _core.MeasurementTypeKey.bloodOxygenPulseRate,
130
104
  selectors: ["00"],
131
- fields: [littleEndian("bloodOxygen", [1, 2], "%", "sfloat"), littleEndian("pulseRate", [3, 4], "bpm", "sfloat")]
105
+ fields: [(0, _standardGattProfile.littleEndian)("bloodOxygen", [1, 2], "%", "sfloat"), (0, _standardGattProfile.littleEndian)("pulseRate", [3, 4], "bpm", "sfloat")]
132
106
  });
133
107
 
134
108
  /**
@@ -139,7 +113,7 @@ const standardPulseOximeterDevice = params => declareProfile(params, {
139
113
  * is left out rather than made to displace it.
140
114
  */
141
115
  exports.standardPulseOximeterDevice = standardPulseOximeterDevice;
142
- const standardHeartRateDevice = params => declareProfile(params, {
116
+ const standardHeartRateDevice = params => (0, _standardGattProfile.declareProfile)(params, {
143
117
  service: "180d",
144
118
  characteristic: "2a37",
145
119
  minLengthBytes: 2,
@@ -1 +1 @@
1
- {"version":3,"names":["_core","require","_defineCustomDevice","SPOT_CHECK_TIMEOUT_MS","sigUuid","assigned","declareProfile","params","profile","defineCustomDevice","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","MeasurementTypeKey","bloodPressure","exports","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,IAAAA,KAAA,GAAAC,OAAA;AAIA,IAAAC,mBAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAME,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,KAEpB,IAAAC,sCAAkB,EAAC;EACjBC,EAAE,EAAEH,MAAM,CAACG,EAAE;EACbC,SAAS,EAAEJ,MAAM,CAACI,SAAS;EAC3BC,kBAAkB,EAAEL,MAAM,CAACK,kBAAkB,IAAIT,qBAAqB;EACtEU,QAAQ,EAAE,CACR;IACEC,IAAI,EAAEV,OAAO,CAACI,OAAO,CAACO,OAAO,CAAC;IAC9BC,OAAO,EAAE,CACP;MACEF,IAAI,EAAEV,OAAO,CAACI,OAAO,CAACS,cAAc,CAAC;MACrCC,KAAK,EAAE;QAAEC,cAAc,EAAEX,OAAO,CAACW;MAAe,CAAC;MACjDC,iBAAiB,EAAE,CAAC,CAAC,CAAC;MACtBC,KAAK,EAAEb,OAAO,CAACc,SAAS,CAACC,GAAG,CAAEC,QAAQ,KAAM;QAC1CA,QAAQ;QACRC,IAAI,EAAE,QAAiB;QACvBC,kBAAkB,EAAElB,OAAO,CAACkB,kBAAkB;QAC9CC,MAAM,EAAE,CAAC,GAAGnB,OAAO,CAACmB,MAAM;MAC5B,CAAC,CAAC;IACJ,CAAC;EAEL,CAAC;AAEL,CAAC,CAAC;AAEJ,MAAMC,YAAY,GAAGA,CACnBC,IAAY,EACZC,WAAqB,EACrBC,IAAY,EACZC,QAAqC,MAChB;EACrBH,I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,CACN;IAAEE,IAAI,EAAE,WAAW;IAAEC,WAAW,EAAE,CAAC,CAAC,CAAC;IAAEE,QAAQ,EAAE,MAAM;IAAED,IAAI,EAAE;EAAM,CAAC;AAE1E,CAAC,CAAC;AAACM,OAAA,CAAAU,uBAAA,GAAAA,uBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_core","require","_standardGattProfile","standardBloodPressureDevice","params","declareProfile","service","characteristic","minLengthBytes","measurementTypeKey","MeasurementTypeKey","bloodPressure","selectors","fields","littleEndian","optionalFields","exports","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,IAAAA,KAAA,GAAAC,OAAA;AAIA,IAAAC,oBAAA,GAAAD,OAAA;AAMA;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,MAAME,2BAA2B,GAC/BC,MAA4B,IAE5B,IAAAC,mCAAc,EAACD,MAAM,EAAE;EACrBE,OAAO,EAAE,MAAM;EACfC,cAAc,EAAE,MAAM;EACtBC,cAAc,EAAE,CAAC;EACjBC,kBAAkB,EAAEC,wBAAkB,CAACC,aAAa;EAEpD;EACAC,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;EACnCC,MAAM,EAAE,CACN,IAAAC,iCAAY,EAAC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAClD,IAAAA,iCAAY,EAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC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CAAAU,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.sigUuid = exports.littleEndian = exports.declareProfile = void 0;
7
+ var _defineCustomDevice = require("../../custom/define-custom-device.js");
8
+ /** Milliseconds a spot-check device may take to produce its reading. */
9
+ const SPOT_CHECK_TIMEOUT_MS = 60_000;
10
+ const sigUuid = assigned => `0000${assigned}-0000-1000-8000-00805f9b34fb`;
11
+
12
+ /**
13
+ * The flags byte selects the case, because it decides which optional fields are present and
14
+ * therefore where the later ones sit. Fields common to every shape are declared once; a
15
+ * field a flag adds is declared against the selector that carries it, at the offset that
16
+ * flag combination puts it and with the frame length that shape guarantees.
17
+ */
18
+ exports.sigUuid = sigUuid;
19
+ const declareProfile = (params, profile) => (0, _defineCustomDevice.defineCustomDevice)({
20
+ id: params.id,
21
+ nameMatch: params.nameMatch,
22
+ stuckDataTimeoutMs: params.stuckDataTimeoutMs ?? SPOT_CHECK_TIMEOUT_MS,
23
+ services: [{
24
+ uuid: sigUuid(profile.service),
25
+ monitor: [{
26
+ uuid: sigUuid(profile.characteristic),
27
+ frame: {
28
+ minLengthBytes: profile.minLengthBytes
29
+ },
30
+ caseSelectorBytes: [0],
31
+ cases: profile.selectors.map(selector => {
32
+ const optional = profile.optionalFields?.[selector];
33
+ return {
34
+ selector,
35
+ kind: "result",
36
+ measurementTypeKey: profile.measurementTypeKey,
37
+ fields: [...profile.fields, ...(optional?.fields ?? [])],
38
+ ...(optional ? {
39
+ minLengthBytes: optional.minLengthBytes
40
+ } : {})
41
+ };
42
+ })
43
+ }]
44
+ }]
45
+ });
46
+ exports.declareProfile = declareProfile;
47
+ const littleEndian = (name, byteIndexes, unit, encoding) => ({
48
+ name,
49
+ byteIndexes,
50
+ byteOrder: "little",
51
+ encoding,
52
+ unit
53
+ });
54
+ exports.littleEndian = littleEndian;
55
+ //# sourceMappingURL=standard-gatt.profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_defineCustomDevice","require","SPOT_CHECK_TIMEOUT_MS","sigUuid","assigned","exports","declareProfile","params","profile","defineCustomDevice","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,IAAAA,mBAAA,GAAAC,OAAA;AAEA;AACA,MAAMC,qBAAqB,GAAG,MAAM;AAyCpC,MAAMC,OAAO,GAAIC,QAAgB,IAC/B,OAAOA,QAAQ,8BAA8B;;AAE/C;AACA;AACA;AACA;AACA;AACA;AALAC,OAAA,CAAAF,OAAA,GAAAA,OAAA;AAMA,MAAMG,cAAc,GAAGA,CACrBC,MAA4B,EAC5BC,OAAoB,KAEpB,IAAAC,sCAAkB,EAAC;EACjBC,EAAE,EAAEH,MAAM,CAACG,EAAE;EACbC,SAAS,EAAEJ,MAAM,CAACI,SAAS;EAC3BC,kBAAkB,EAAEL,MAAM,CAACK,kBAAkB,IAAIV,qBAAqB;EACtEW,QAAQ,EAAE,CACR;IACEC,IAAI,EAAEX,OAAO,CAACK,OAAO,CAACO,OAAO,CAAC;IAC9BC,OAAO,EAAE,CACP;MACEF,IAAI,EAAEX,OAAO,CAACK,OAAO,CAACS,cAAc,CAAC;MACrCC,KAAK,EAAE;QAAEC,cAAc,EAAEX,OAAO,CAACW;MAAe,CAAC;MACjDC,iBAAiB,EAAE,CAAC,CAAC,CAAC;MACtBC,KAAK,EAAEb,OAAO,CAACc,SAAS,CAACC,GAAG,CAAEC,QAAQ,IAAK;QACzC,MAAMC,QAAQ,GAAGjB,OAAO,CAACkB,cAAc,GAAGF,QAAQ,CAAC;QAEnD,OAAO;UACLA,QAAQ;UACRG,IAAI,EAAE,QAAiB;UACvBC,kBAAkB,EAAEpB,OAAO,CAACoB,kBAAkB;UAC9CC,MAAM,EAAE,CAAC,GAAGrB,OAAO,CAACqB,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;AAACd,OAAA,CAAAC,cAAA,GAAAA,cAAA;AAEL,MAAMwB,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;AAAC5B,OAAA,CAAAyB,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.verovalCompactMonitor = exports.bpw26Monitor = exports.bpu26Monitor = exports.VEROVAL_BP_MODEL_NAMES = void 0;
7
+ var _standardGattDevices = require("../standard-gatt/standard-gatt.devices.js");
8
+ /**
9
+ * The Veroval compact+ blood-pressure monitors.
10
+ *
11
+ * There is nothing vendor-specific to decode here: these implement the Bluetooth
12
+ * blood-pressure profile as published - service 0x1810, measurement 0x2A35, notifications on
13
+ * the standard descriptor - so the layout comes from the specification and the SDK already
14
+ * reads it. What this adds is the identity, which is the only part the specification does
15
+ * not supply.
16
+ *
17
+ * The vendor's own app compares the advertised name for exact equality, ignoring case, so
18
+ * that is what these matchers do. The duo control and the Fusion are not here: those speak a
19
+ * protocol of their own on a private service, and so does the ECG.
20
+ */
21
+
22
+ const BPU_26 = "BPU26";
23
+ const BPW_26 = "BPW26";
24
+ const verovalCompactMonitor = (advertisedName, params) => (0, _standardGattDevices.standardBloodPressureDevice)({
25
+ id: params.id,
26
+ nameMatch: params.nameMatch ?? new RegExp(`^${advertisedName}$`, "i"),
27
+ ...(params.stuckDataTimeoutMs === undefined ? {} : {
28
+ stuckDataTimeoutMs: params.stuckDataTimeoutMs
29
+ })
30
+ });
31
+
32
+ /** BPU 26, the Veroval compact+ upper-arm monitor. */
33
+ exports.verovalCompactMonitor = verovalCompactMonitor;
34
+ const bpu26Monitor = params => verovalCompactMonitor(BPU_26, params);
35
+
36
+ /** BPW 26, the Veroval compact+ wrist monitor. */
37
+ exports.bpu26Monitor = bpu26Monitor;
38
+ const bpw26Monitor = params => verovalCompactMonitor(BPW_26, params);
39
+
40
+ /** The names these monitors advertise. */
41
+ exports.bpw26Monitor = bpw26Monitor;
42
+ const VEROVAL_BP_MODEL_NAMES = exports.VEROVAL_BP_MODEL_NAMES = [BPU_26, BPW_26];
43
+ //# sourceMappingURL=veroval.bp-monitors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_standardGattDevices","require","BPU_26","BPW_26","verovalCompactMonitor","advertisedName","params","standardBloodPressureDevice","id","nameMatch","RegExp","stuckDataTimeoutMs","undefined","exports","bpu26Monitor","bpw26Monitor","VEROVAL_BP_MODEL_NAMES"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.bp-monitors.ts"],"mappings":";;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AAEA;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,KAEvB,IAAAC,gDAA2B,EAAC;EAC1BC,EAAE,EAAEF,MAAM,CAACE,EAAE;EACbC,SAAS,EAAEH,MAAM,CAACG,SAAS,IAAI,IAAIC,MAAM,CAAC,IAAIL,cAAc,GAAG,EAAE,GAAG,CAAC;EACrE,IAAIC,MAAM,CAACK,kBAAkB,KAAKC,SAAS,GACvC,CAAC,CAAC,GACF;IAAED,kBAAkB,EAAEL,MAAM,CAACK;EAAmB,CAAC;AACvD,CAAC,CAAC;;AAEJ;AAAAE,OAAA,CAAAT,qBAAA,GAAAA,qBAAA;AACA,MAAMU,YAAY,GAAIR,MAAuB,IAC3CF,qBAAqB,CAACF,MAAM,EAAEI,MAAM,CAAC;;AAEvC;AAAAO,OAAA,CAAAC,YAAA,GAAAA,YAAA;AACA,MAAMC,YAAY,GAAIT,MAAuB,IAC3CF,qBAAqB,CAACD,MAAM,EAAEG,MAAM,CAAC;;AAEvC;AAAAO,OAAA,CAAAE,YAAA,GAAAA,YAAA;AACA,MAAMC,sBAAyC,GAAAH,OAAA,CAAAG,sBAAA,GAAG,CAACd,MAAM,EAAEC,MAAM,CAAC","ignoreList":[]}
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VerovalDuoControlDevice = void 0;
7
+ var _core = require("@ovok/core");
8
+ var _defineCustomDevice = require("../../custom/define-custom-device.js");
9
+ var _customDevice = require("../custom/custom.device.js");
10
+ var _sentinelFrameReader = require("../sentinel-frame-reader.js");
11
+ var _verovalDuoControlSequencer = require("./veroval.duo-control-sequencer.js");
12
+ const SERVICE = "5d4b8aa6-a26a-4a1b-99f5-cd4473c786e3";
13
+ const NOTIFY = "5d4b8aa6-a26a-4a1b-99f5-cd4473c786e4";
14
+ const WRITE = "5d4b8aa6-a26a-4a1b-99f5-cd4473c786e5";
15
+ const STX = "02";
16
+ const ETX = "03";
17
+ const ACK = "06";
18
+ const NAK = "15";
19
+
20
+ /** One stored measurement, as the device writes it: twenty-six characters. */
21
+ const RECORD_BYTES = 26;
22
+
23
+ /** A reply opens by echoing the four-character command it answers. */
24
+ const TAG_BYTES = 4;
25
+
26
+ /** `?MDR`, the reply carrying stored records. */
27
+ const DATA_REPLY = "3f4d4452";
28
+
29
+ /** `?MRN`, the reply carrying a record count. The sequencer reads it; no reading comes of it. */
30
+ const COUNT_REPLY = "3f4d524e";
31
+
32
+ /** Two memories of a hundred records each, plus the echo, with room to spare. */
33
+ const MAX_REPLY_BYTES = 8_192;
34
+
35
+ /** The device sleeps between measurements, so it is given a while to answer. */
36
+ const STUCK_TIMEOUT_MS = 120_000;
37
+ const asciiField = (name, from, unit) => ({
38
+ name,
39
+ byteIndexes: [from, from + 1, from + 2],
40
+ encoding: "ascii",
41
+ unit
42
+ });
43
+
44
+ /**
45
+ * The record layout, read from HARTMANN's own application.
46
+ *
47
+ * Offsets are relative to a record, and every field is decimal digits written as text. The
48
+ * timestamp at the front of each record is not declared: the SDK stamps a reading when it
49
+ * arrives, and a stored record's own clock would need the device's timezone to be
50
+ * meaningful.
51
+ */
52
+ const duoControlDefinition = (0, _defineCustomDevice.defineCustomDevice)({
53
+ id: "veroval-duo-control",
54
+ nameMatch: /^Veroval duo control$/i,
55
+ stuckDataTimeoutMs: STUCK_TIMEOUT_MS,
56
+ services: [{
57
+ uuid: SERVICE,
58
+ monitor: [{
59
+ uuid: NOTIFY,
60
+ frame: {
61
+ minLengthBytes: TAG_BYTES + RECORD_BYTES
62
+ },
63
+ caseSelectorBytes: [0, 1, 2, 3],
64
+ cases: [{
65
+ selector: DATA_REPLY,
66
+ kind: "result",
67
+ measurementTypeKey: _core.MeasurementTypeKey.bloodPressure,
68
+ description: "Stored measurements, one record each",
69
+ repeatedRecords: {
70
+ recordBytes: RECORD_BYTES,
71
+ from: TAG_BYTES
72
+ },
73
+ fields: [asciiField("systolic", 11, "mmHg"), asciiField("diastolic", 14, "mmHg"), asciiField("heartRate", 17, "bpm")]
74
+ }, {
75
+ selector: COUNT_REPLY,
76
+ kind: "idle",
77
+ description: "How many records a memory holds"
78
+ }]
79
+ }]
80
+ }]
81
+ });
82
+
83
+ /**
84
+ * The Veroval duo control.
85
+ *
86
+ * A device class rather than a declaration, because reading it is a conversation: the two
87
+ * user memories are asked in turn, and the device answers with bare control bytes as often
88
+ * as with payload. The decoding is still declared - the class supplies the framing and the
89
+ * walk, and nothing else.
90
+ *
91
+ * Readings are stored measurements, not live ones. The device hands over its history when
92
+ * asked, so what arrives was taken before the connection and may be days old.
93
+ */
94
+ class VerovalDuoControlDevice extends _customDevice.CustomDevice {
95
+ constructor(device, params) {
96
+ super(device, params, duoControlDefinition);
97
+ this.frameReader = new _sentinelFrameReader.SentinelFrameReader({
98
+ start: STX,
99
+ terminator: ETX,
100
+ maxFrameBytes: MAX_REPLY_BYTES,
101
+ standaloneBytes: [ACK, NAK]
102
+ });
103
+ this.createCommandSequencer = () => new _verovalDuoControlSequencer.VerovalDuoControlSequencer({
104
+ write: {
105
+ serviceUuid: SERVICE,
106
+ characteristicUuid: WRITE
107
+ },
108
+ onRefused: reason => this.onError?.(new Error(`Veroval duo control: ${reason}.`))
109
+ });
110
+ }
111
+ }
112
+ exports.VerovalDuoControlDevice = VerovalDuoControlDevice;
113
+ //# sourceMappingURL=veroval.duo-control-device.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_core","require","_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","defineCustomDevice","id","nameMatch","stuckDataTimeoutMs","services","uuid","monitor","frame","minLengthBytes","caseSelectorBytes","cases","selector","kind","measurementTypeKey","MeasurementTypeKey","bloodPressure","description","repeatedRecords","recordBytes","fields","VerovalDuoControlDevice","CustomDevice","constructor","device","params","frameReader","SentinelFrameReader","start","terminator","maxFrameBytes","standaloneBytes","createCommandSequencer","VerovalDuoControlSequencer","write","serviceUuid","characteristicUuid","onRefused","reason","onError","Error","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval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,OAAO,GAAG,IAAIC,KAAK,CAAC,wBAAwBF,MAAM,GAAG,CAAC;IAC/D,CAAC,CAAC;EACN;AACF;AAACG,OAAA,CAAApB,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VerovalDuoControlSequencer = void 0;
7
+ var _hexToByte = require("../../../utils/hex-to-byte.js");
8
+ /** The control bytes of the serial protocol this device speaks over BLE. */
9
+ const ACK = 0x06;
10
+ const NAK = 0x15;
11
+ const ENQ = "05";
12
+
13
+ /** The device holds two user memories, and each is asked for a count and then its data. */
14
+ const STEPS = ["?MRN1", "?MDR1A", "?MRN2", "?MDR2A"];
15
+
16
+ /** A reply echoes the four-character command it answers, after the byte the reader strips. */
17
+ const TAG_FROM = 0;
18
+ const TAG_BYTES = 4;
19
+ const COUNT_BYTES = 3;
20
+ const ASCII_ZERO = 0x30;
21
+ const ASCII_NINE = 0x39;
22
+ const asciiOf = (frame, from, count) => frame.slice(from, from + count).map(byte => String.fromCharCode((0, _hexToByte.hexToByte)(byte))).join("");
23
+ const asciiNumberOf = (frame, from, count) => {
24
+ const codes = frame.slice(from, from + count).map(byte => (0, _hexToByte.hexToByte)(byte));
25
+ if (codes.length !== count || codes.some(code => code < ASCII_ZERO || code > ASCII_NINE)) {
26
+ return undefined;
27
+ }
28
+ return Number(codes.map(code => code - ASCII_ZERO).join(""));
29
+ };
30
+ const asciiCommand = (write, text) => ({
31
+ ...write,
32
+ frame: [...text].map(character => character.charCodeAt(0).toString(16).padStart(2, "0")),
33
+ withoutResponse: true
34
+ });
35
+
36
+ /**
37
+ * Walks the Veroval duo control through its stored history.
38
+ *
39
+ * The device answers one request at a time and holds two user memories, so the exchange is
40
+ * a fixed walk: ask user one how many records it has, read them, then user two. A memory
41
+ * that reports none is skipped rather than read.
42
+ *
43
+ * Two of its replies are not payload at all. A bare `ACK` means the device has more to send
44
+ * and is waiting to be asked, which is what `ENQ` does - so an acknowledgement provokes an
45
+ * enquiry rather than advancing the walk. A bare `NAK` is a refusal and ends it.
46
+ *
47
+ * Everything here is derived from HARTMANN's own application. The one part that is an
48
+ * inference rather than a reading is `ENQ` as flow control: the app writes it on receiving
49
+ * `ACK`, which is what that pair means in the serial protocol this is descended from, but
50
+ * the pacing was not observed on hardware.
51
+ */
52
+ class VerovalDuoControlSequencer {
53
+ step = 0;
54
+ isDone = false;
55
+ constructor(params) {
56
+ this.params = params;
57
+ }
58
+ initialCommands = () => [this.commandFor(0)];
59
+ nextCommand = frame => {
60
+ if (this.isDone) {
61
+ return undefined;
62
+ }
63
+ if (frame.length === 1) {
64
+ return this.answerControlByte((0, _hexToByte.hexToByte)(frame[0] ?? "0"));
65
+ }
66
+ const tag = asciiOf(frame, TAG_FROM, TAG_BYTES);
67
+ if (tag === "?MRN") {
68
+ return this.answerCount(frame);
69
+ }
70
+ return tag === "?MDR" ? this.advance() : undefined;
71
+ };
72
+ answerControlByte = code => {
73
+ if (code === ACK) {
74
+ return [asciiCommandFromHex(this.params.write, ENQ)];
75
+ }
76
+ if (code === NAK) {
77
+ return this.stop("the device refused the request");
78
+ }
79
+ return undefined;
80
+ };
81
+
82
+ /**
83
+ * A memory reporting no records is skipped. Asking for the data of an empty memory is a
84
+ * request the device answers with nothing, which would stall the walk on its own reply.
85
+ */
86
+ answerCount = frame => {
87
+ const count = asciiNumberOf(frame, TAG_BYTES, COUNT_BYTES);
88
+ if (count === undefined) {
89
+ return this.stop("the device answered a record count that was not a number");
90
+ }
91
+ return count > 0 ? this.advance() : this.skipMemory();
92
+ };
93
+
94
+ /** Past this memory's data command, to the next memory's count. */
95
+ skipMemory = () => {
96
+ this.step += 1;
97
+ return this.advance();
98
+ };
99
+ advance = () => {
100
+ this.step += 1;
101
+ if (this.step >= STEPS.length) {
102
+ this.isDone = true;
103
+ return undefined;
104
+ }
105
+ return [this.commandFor(this.step)];
106
+ };
107
+ stop = reason => {
108
+ this.isDone = true;
109
+ this.params.onRefused(reason);
110
+ return undefined;
111
+ };
112
+ commandFor = step => asciiCommand(this.params.write, STEPS[step] ?? "");
113
+ }
114
+ exports.VerovalDuoControlSequencer = VerovalDuoControlSequencer;
115
+ const asciiCommandFromHex = (write, hex) => ({
116
+ ...write,
117
+ frame: [hex],
118
+ withoutResponse: true
119
+ });
120
+ //# sourceMappingURL=veroval.duo-control-sequencer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_hexToByte","require","ACK","NAK","ENQ","STEPS","TAG_FROM","TAG_BYTES","COUNT_BYTES","ASCII_ZERO","ASCII_NINE","asciiOf","frame","from","count","slice","map","byte","String","fromCharCode","hexToByte","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","exports","hex"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.ts"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAEA;AACA,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;;AAEhB;AACA,MAAMC,KAAK,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAU;;AAE7D;AACA,MAAMC,QAAQ,GAAG,CAAC;AAClB,MAAMC,SAAS,GAAG,CAAC;AACnB,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,UAAU,GAAG,IAAI;AACvB,MAAMC,UAAU,GAAG,IAAI;AAEvB,MAAMC,OAAO,GAAGA,CAACC,KAAwB,EAAEC,IAAY,EAAEC,KAAa,KACpEF,KAAK,CACFG,KAAK,CAACF,IAAI,EAAEA,IAAI,GAAGC,KAAK,CAAC,CACzBE,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AACG,UAAU,CAAC,CAAC;EACvD,CAAC;;EAED;EACQA,UAAU,GAAGA,CAAA,KAA4C;IAC/D,IAAI,CAACb,IAAI,IAAI,CAAC;IAEd,OAAO,IAAI,CAACU,OAAO,CAAC,CAAC;EACvB,CAAC;EAEOA,OAAO,GAAGA,CAAA,KAA4C;IAC5D,IAAI,CAACV,IAAI,IAAI,CAAC;IAEd,IAAI,IAAI,CAACA,IAAI,IAAIjC,KAAK,CAACmB,MAAM,EAAE;MAC7B,IAAI,CAACe,MAAM,GAAG,IAAI;MAElB,OAAOZ,SAAS;IAClB;IAEA,OAAO,CAAC,IAAI,CAACgB,UAAU,CAAC,IAAI,CAACL,IAAI,CAAC,CAAC;EACrC,CAAC;EAEOY,IAAI,GAAIE,MAAc,IAAgB;IAC5C,IAAI,CAACb,MAAM,GAAG,IAAI;IAClB,IAAI,CAACE,MAAM,CAACY,SAAS,CAACD,MAAM,CAAC;IAE7B,OAAOzB,SAAS;EAClB,CAAC;EAEOgB,UAAU,GAAIL,IAAY,IAChCT,YAAY,CAAC,IAAI,CAACY,MAAM,CAACX,KAAK,EAAEzB,KAAK,CAACiC,IAAI,CAAC,IAAI,EAAE,CAAC;AACtD;AAACgB,OAAA,CAAAjB,0BAAA,GAAAA,0BAAA;AAED,MAAMY,mBAAmB,GAAGA,CAC1BnB,KAAmC,EACnCyB,GAAW,MACQ;EAAE,GAAGzB,KAAK;EAAElB,KAAK,EAAE,CAAC2C,GAAG,CAAC;EAAEnB,eAAe,EAAE;AAAK,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.VerovalEcgDevice = void 0;
7
+ var _core = require("@ovok/core");
8
+ var _caseType = require("../../../types/case-type.js");
9
+ var _btManagedDevice = require("../bt-managed-device.js");
10
+ var _verovalEcgSamples = require("./veroval.ecg-samples.js");
11
+ var _verovalEcgTransfer = require("./veroval.ecg-transfer.js");
12
+ const SERVICE = "0000a000-0000-1000-8000-00805f9b34fb";
13
+
14
+ /** Requests go to one characteristic and every reply arrives on the other. */
15
+ const CONTROL_POINT = "00002a37-0000-1000-8000-00805f9b34fb";
16
+ const NOTIFY = "00002a36-0000-1000-8000-00805f9b34fb";
17
+
18
+ /** A recording is thirty-four seconds, and the device waits on a person before sending it. */
19
+ const STUCK_TIMEOUT_MS = 180_000;
20
+ const PREFERRED_MTU = 247;
21
+
22
+ /**
23
+ * Every notification matches this, and none of them is a measurement.
24
+ *
25
+ * The transfer assembles the recording itself and reports it once, so the parser is given a
26
+ * case that matches anything and decodes nothing. Without it each of the five hundred odd
27
+ * packets would be logged as a frame nothing declared.
28
+ */
29
+ const acceptEverything = {
30
+ caseValuePosition: [],
31
+ cases: [{
32
+ caseValue: "",
33
+ caseType: _caseType.CaseType.OTHER,
34
+ parseDefinitions: [],
35
+ description: "A packet of a download, assembled by the transfer"
36
+ }]
37
+ };
38
+
39
+ /**
40
+ * The Veroval ECG.
41
+ *
42
+ * Reading it is a download rather than a decode, so the whole recording is assembled before
43
+ * anything is reported: thirty-four seconds of samples at 128 Hz, two bytes each, converted
44
+ * to millivolts with the device's own calibration.
45
+ *
46
+ * The vendor's app plots a thirty-second window of this with a baseline-wander filter
47
+ * applied. That is a display transform, not calibration, so it is deliberately not
48
+ * reproduced here - what is reported is what the device recorded.
49
+ */
50
+ class VerovalEcgDevice extends _btManagedDevice.BTManagedDevice {
51
+ stuckDataTimeout = STUCK_TIMEOUT_MS;
52
+ preferredMtu = PREFERRED_MTU;
53
+ onStreamStart = undefined;
54
+ mainServices = [{
55
+ uuid: SERVICE,
56
+ monitorUuids: [{
57
+ uuid: NOTIFY,
58
+ parsingModel: acceptEverything
59
+ }]
60
+ }];
61
+ validatePackage = () => true;
62
+ createCommandSequencer = () => new _verovalEcgTransfer.VerovalEcgTransfer({
63
+ write: {
64
+ serviceUuid: SERVICE,
65
+ characteristicUuid: CONTROL_POINT
66
+ },
67
+ onRecording: this.reportRecording
68
+ });
69
+ constructor(device, params) {
70
+ super(device, params);
71
+ }
72
+
73
+ /** Nothing is reported per packet; the transfer reports the recording when it is whole. */
74
+ handleSuccessResult() {
75
+ return;
76
+ }
77
+ reportRecording = bytes => {
78
+ const diagramPoints = (0, _verovalEcgSamples.decodeVerovalEcgSamples)(bytes);
79
+ if (diagramPoints.length === 0) {
80
+ this.onError?.(new Error("Veroval ECG: the recording held no samples."));
81
+ return;
82
+ }
83
+ this.onResult?.({
84
+ measurementTypeKey: _core.MeasurementTypeKey.ecg,
85
+ caseType: _caseType.CaseType.RESULT,
86
+ diagramPoints,
87
+ duration: diagramPoints.length / _verovalEcgSamples.VEROVAL_ECG_SAMPLE_RATE_HZ
88
+ });
89
+ };
90
+ }
91
+ exports.VerovalEcgDevice = VerovalEcgDevice;
92
+ //# sourceMappingURL=veroval.ecg-device.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_core","require","_caseType","_btManagedDevice","_verovalEcgSamples","_verovalEcgTransfer","SERVICE","CONTROL_POINT","NOTIFY","STUCK_TIMEOUT_MS","PREFERRED_MTU","acceptEverything","caseValuePosition","cases","caseValue","caseType","CaseType","OTHER","parseDefinitions","description","VerovalEcgDevice","BTManagedDevice","stuckDataTimeout","preferredMtu","onStreamStart","undefined","mainServices","uuid","monitorUuids","parsingModel","validatePackage","createCommandSequencer","VerovalEcgTransfer","write","serviceUuid","characteristicUuid","onRecording","reportRecording","constructor","device","params","handleSuccessResult","bytes","diagramPoints","decodeVerovalEcgSamples","length","onError","Error","onResult","measurementTypeKey","MeasurementTypeKey","ecg","RESULT","duration","VEROVAL_ECG_SAMPLE_RATE_HZ","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-device.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,SAAA,GAAAD,OAAA;AAIA,IAAAE,gBAAA,GAAAF,OAAA;AAEA,IAAAG,kBAAA,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