@ovok/native 0.4.6 → 0.4.8

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 (520) 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 +220 -0
  6. package/lib/commonjs/modules/bt-management/index.js.map +1 -1
  7. package/lib/commonjs/modules/bt-management/services/custom/compile-case-fields.js +49 -0
  8. package/lib/commonjs/modules/bt-management/services/custom/compile-case-fields.js.map +1 -0
  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 +53 -41
  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/custom/compile-custom-frame.js +48 -2
  16. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-frame.js.map +1 -1
  17. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js +98 -0
  18. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -0
  19. package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js +24 -1
  20. package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
  21. package/lib/commonjs/modules/bt-management/services/device-creator.js +19 -8
  22. package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
  23. package/lib/commonjs/modules/bt-management/services/devices/aoj/aoj.thermometers.js +85 -0
  24. package/lib/commonjs/modules/bt-management/services/devices/aoj/aoj.thermometers.js.map +1 -0
  25. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.frame-reader.js +8 -74
  26. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.frame-reader.js.map +1 -1
  27. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +155 -0
  28. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js.map +1 -0
  29. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js +9 -49
  30. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  31. package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js +17 -6
  32. package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
  33. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +21 -14
  34. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  35. package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +55 -0
  36. package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -0
  37. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +82 -29
  38. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  39. package/lib/commonjs/modules/bt-management/services/devices/frame-parser.js +2 -1
  40. package/lib/commonjs/modules/bt-management/services/devices/frame-parser.js.map +1 -1
  41. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.command-builder.js +48 -0
  42. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.command-builder.js.map +1 -0
  43. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.commands.js +37 -0
  44. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.commands.js.map +1 -0
  45. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-info.js +83 -0
  46. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-info.js.map +1 -0
  47. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-names.js +26 -0
  48. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-names.js.map +1 -0
  49. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-names.js +36 -0
  50. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-names.js.map +1 -0
  51. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +155 -0
  52. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -0
  53. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame-reader.js +98 -0
  54. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame-reader.js.map +1 -0
  55. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame.js +29 -0
  56. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame.js.map +1 -0
  57. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.identity-gate.js +103 -0
  58. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -0
  59. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.name-match.js +32 -0
  60. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.name-match.js.map +1 -0
  61. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.response-type.js +64 -0
  62. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.response-type.js.map +1 -0
  63. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js +143 -0
  64. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -0
  65. package/lib/commonjs/modules/bt-management/services/devices/polling-command-sequencer.js +38 -0
  66. package/lib/commonjs/modules/bt-management/services/devices/polling-command-sequencer.js.map +1 -0
  67. package/lib/commonjs/modules/bt-management/services/devices/sentinel-frame-reader.js +84 -0
  68. package/lib/commonjs/modules/bt-management/services/devices/sentinel-frame-reader.js.map +1 -0
  69. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +130 -0
  70. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -0
  71. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +55 -0
  72. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -0
  73. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +43 -0
  74. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -0
  75. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +113 -0
  76. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -0
  77. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js +120 -0
  78. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js.map +1 -0
  79. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-device.js +92 -0
  80. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-device.js.map +1 -0
  81. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js +64 -0
  82. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map +1 -0
  83. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +94 -0
  84. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -0
  85. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +124 -0
  86. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -0
  87. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +113 -0
  88. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -0
  89. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.lepod.js +117 -0
  90. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.lepod.js.map +1 -0
  91. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js +82 -0
  92. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -0
  93. package/lib/commonjs/modules/bt-management/types/command-sequencer.js +6 -0
  94. package/lib/commonjs/modules/bt-management/types/command-sequencer.js.map +1 -0
  95. package/lib/commonjs/modules/bt-management/types/custom-checksum-algorithm.js +2 -0
  96. package/lib/commonjs/modules/bt-management/types/custom-checksum-algorithm.js.map +1 -0
  97. package/lib/commonjs/modules/bt-management/types/custom-checksum-spec.js +6 -0
  98. package/lib/commonjs/modules/bt-management/types/custom-checksum-spec.js.map +1 -0
  99. package/lib/commonjs/modules/bt-management/types/custom-lepu-spec.js +2 -0
  100. package/lib/commonjs/modules/bt-management/types/custom-lepu-spec.js.map +1 -0
  101. package/lib/commonjs/modules/bt-management/types/custom-measurement-spec.js +6 -0
  102. package/lib/commonjs/modules/bt-management/types/custom-measurement-spec.js.map +1 -0
  103. package/lib/commonjs/modules/bt-management/types/device-command.js +2 -0
  104. package/lib/commonjs/modules/bt-management/types/device-command.js.map +1 -0
  105. package/lib/commonjs/modules/bt-management/types/integrated-devices.js +2 -0
  106. package/lib/commonjs/modules/bt-management/types/integrated-devices.js.map +1 -1
  107. package/lib/commonjs/modules/bt-management/types/measurement-group.js +6 -0
  108. package/lib/commonjs/modules/bt-management/types/measurement-group.js.map +1 -0
  109. package/lib/commonjs/modules/bt-management/utils/calculate-checksum.js +49 -0
  110. package/lib/commonjs/modules/bt-management/utils/calculate-checksum.js.map +1 -0
  111. package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js +21 -0
  112. package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
  113. package/lib/commonjs/modules/bt-management/utils/create-frame-validator.js +9 -0
  114. package/lib/commonjs/modules/bt-management/utils/create-frame-validator.js.map +1 -1
  115. package/lib/commonjs/modules/bt-management/utils/hex-to-bytes.js +19 -0
  116. package/lib/commonjs/modules/bt-management/utils/hex-to-bytes.js.map +1 -0
  117. package/lib/commonjs/modules/bt-management/utils/le-32-to-bytes.js +13 -0
  118. package/lib/commonjs/modules/bt-management/utils/le-32-to-bytes.js.map +1 -0
  119. package/lib/commonjs/modules/bt-management/utils/parse-measurement.js +10 -7
  120. package/lib/commonjs/modules/bt-management/utils/parse-measurement.js.map +1 -1
  121. package/lib/commonjs/modules/bt-management/utils/reject-custom-reading.js +34 -0
  122. package/lib/commonjs/modules/bt-management/utils/reject-custom-reading.js.map +1 -0
  123. package/lib/commonjs/modules/bt-management/utils/summarise-measurement-for-log.js +22 -0
  124. package/lib/commonjs/modules/bt-management/utils/summarise-measurement-for-log.js.map +1 -0
  125. package/lib/commonjs/modules/bt-management/utils/supported-measurement-type-keys.js +18 -0
  126. package/lib/commonjs/modules/bt-management/utils/supported-measurement-type-keys.js.map +1 -0
  127. package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js +3 -1
  128. package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
  129. package/lib/module/modules/bt-management/constants/integrated-devices-map.js +1 -1
  130. package/lib/module/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
  131. package/lib/module/modules/bt-management/index.js +20 -0
  132. package/lib/module/modules/bt-management/index.js.map +1 -1
  133. package/lib/module/modules/bt-management/services/custom/compile-case-fields.js +44 -0
  134. package/lib/module/modules/bt-management/services/custom/compile-case-fields.js.map +1 -0
  135. package/lib/module/modules/bt-management/services/custom/compile-case-shape.js +48 -0
  136. package/lib/module/modules/bt-management/services/custom/compile-case-shape.js.map +1 -0
  137. package/lib/module/modules/bt-management/services/custom/compile-custom-case.js +53 -41
  138. package/lib/module/modules/bt-management/services/custom/compile-custom-case.js.map +1 -1
  139. package/lib/module/modules/bt-management/services/custom/compile-custom-field.js +3 -0
  140. package/lib/module/modules/bt-management/services/custom/compile-custom-field.js.map +1 -1
  141. package/lib/module/modules/bt-management/services/custom/compile-custom-frame.js +48 -2
  142. package/lib/module/modules/bt-management/services/custom/compile-custom-frame.js.map +1 -1
  143. package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js +93 -0
  144. package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -0
  145. package/lib/module/modules/bt-management/services/custom/define-custom-device.js +24 -1
  146. package/lib/module/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
  147. package/lib/module/modules/bt-management/services/device-creator.js +20 -8
  148. package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
  149. package/lib/module/modules/bt-management/services/devices/aoj/aoj.thermometers.js +81 -0
  150. package/lib/module/modules/bt-management/services/devices/aoj/aoj.thermometers.js.map +1 -0
  151. package/lib/module/modules/bt-management/services/devices/bp2/bp2.frame-reader.js +8 -73
  152. package/lib/module/modules/bt-management/services/devices/bp2/bp2.frame-reader.js.map +1 -1
  153. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +150 -0
  154. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js.map +1 -0
  155. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js +9 -49
  156. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  157. package/lib/module/modules/bt-management/services/devices/bt-data-processor.js +17 -6
  158. package/lib/module/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
  159. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +21 -14
  160. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  161. package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +51 -0
  162. package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -0
  163. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +82 -29
  164. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  165. package/lib/module/modules/bt-management/services/devices/frame-parser.js +2 -1
  166. package/lib/module/modules/bt-management/services/devices/frame-parser.js.map +1 -1
  167. package/lib/module/modules/bt-management/services/devices/lepu/lepu.command-builder.js +43 -0
  168. package/lib/module/modules/bt-management/services/devices/lepu/lepu.command-builder.js.map +1 -0
  169. package/lib/module/modules/bt-management/services/devices/lepu/lepu.commands.js +33 -0
  170. package/lib/module/modules/bt-management/services/devices/lepu/lepu.commands.js.map +1 -0
  171. package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-info.js +79 -0
  172. package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-info.js.map +1 -0
  173. package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-names.js +22 -0
  174. package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-names.js.map +1 -0
  175. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-names.js +32 -0
  176. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-names.js.map +1 -0
  177. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +150 -0
  178. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -0
  179. package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame-reader.js +93 -0
  180. package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame-reader.js.map +1 -0
  181. package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame.js +24 -0
  182. package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame.js.map +1 -0
  183. package/lib/module/modules/bt-management/services/devices/lepu/lepu.identity-gate.js +98 -0
  184. package/lib/module/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -0
  185. package/lib/module/modules/bt-management/services/devices/lepu/lepu.name-match.js +27 -0
  186. package/lib/module/modules/bt-management/services/devices/lepu/lepu.name-match.js.map +1 -0
  187. package/lib/module/modules/bt-management/services/devices/lepu/lepu.response-type.js +59 -0
  188. package/lib/module/modules/bt-management/services/devices/lepu/lepu.response-type.js.map +1 -0
  189. package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js +140 -0
  190. package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -0
  191. package/lib/module/modules/bt-management/services/devices/polling-command-sequencer.js +34 -0
  192. package/lib/module/modules/bt-management/services/devices/polling-command-sequencer.js.map +1 -0
  193. package/lib/module/modules/bt-management/services/devices/sentinel-frame-reader.js +79 -0
  194. package/lib/module/modules/bt-management/services/devices/sentinel-frame-reader.js.map +1 -0
  195. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +123 -0
  196. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -0
  197. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +50 -0
  198. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -0
  199. package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +38 -0
  200. package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -0
  201. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +108 -0
  202. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -0
  203. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js +116 -0
  204. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js.map +1 -0
  205. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-device.js +87 -0
  206. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-device.js.map +1 -0
  207. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js +60 -0
  208. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map +1 -0
  209. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +89 -0
  210. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -0
  211. package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +118 -0
  212. package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -0
  213. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +108 -0
  214. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -0
  215. package/lib/module/modules/bt-management/services/devices/viatom/viatom.lepod.js +114 -0
  216. package/lib/module/modules/bt-management/services/devices/viatom/viatom.lepod.js.map +1 -0
  217. package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js +79 -0
  218. package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -0
  219. package/lib/module/modules/bt-management/types/command-sequencer.js +4 -0
  220. package/lib/module/modules/bt-management/types/command-sequencer.js.map +1 -0
  221. package/lib/module/modules/bt-management/types/custom-checksum-algorithm.js +2 -0
  222. package/lib/module/modules/bt-management/types/custom-checksum-algorithm.js.map +1 -0
  223. package/lib/module/modules/bt-management/types/custom-checksum-spec.js +4 -0
  224. package/lib/module/modules/bt-management/types/custom-checksum-spec.js.map +1 -0
  225. package/lib/module/modules/bt-management/types/custom-device-definition.js.map +1 -1
  226. package/lib/module/modules/bt-management/types/custom-lepu-spec.js +2 -0
  227. package/lib/module/modules/bt-management/types/custom-lepu-spec.js.map +1 -0
  228. package/lib/module/modules/bt-management/types/custom-measurement-spec.js +4 -0
  229. package/lib/module/modules/bt-management/types/custom-measurement-spec.js.map +1 -0
  230. package/lib/module/modules/bt-management/types/device-command.js +2 -0
  231. package/lib/module/modules/bt-management/types/device-command.js.map +1 -0
  232. package/lib/module/modules/bt-management/types/device-measurement-map.js +3 -3
  233. package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
  234. package/lib/module/modules/bt-management/types/integrated-devices.js +2 -0
  235. package/lib/module/modules/bt-management/types/integrated-devices.js.map +1 -1
  236. package/lib/module/modules/bt-management/types/measurement-group.js +4 -0
  237. package/lib/module/modules/bt-management/types/measurement-group.js.map +1 -0
  238. package/lib/module/modules/bt-management/utils/calculate-checksum.js +44 -0
  239. package/lib/module/modules/bt-management/utils/calculate-checksum.js.map +1 -0
  240. package/lib/module/modules/bt-management/utils/create-custom-field-parser.js +21 -0
  241. package/lib/module/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
  242. package/lib/module/modules/bt-management/utils/create-frame-validator.js +9 -0
  243. package/lib/module/modules/bt-management/utils/create-frame-validator.js.map +1 -1
  244. package/lib/module/modules/bt-management/utils/hex-to-bytes.js +14 -0
  245. package/lib/module/modules/bt-management/utils/hex-to-bytes.js.map +1 -0
  246. package/lib/module/modules/bt-management/utils/le-32-to-bytes.js +8 -0
  247. package/lib/module/modules/bt-management/utils/le-32-to-bytes.js.map +1 -0
  248. package/lib/module/modules/bt-management/utils/parse-measurement.js +10 -7
  249. package/lib/module/modules/bt-management/utils/parse-measurement.js.map +1 -1
  250. package/lib/module/modules/bt-management/utils/reject-custom-reading.js +29 -0
  251. package/lib/module/modules/bt-management/utils/reject-custom-reading.js.map +1 -0
  252. package/lib/module/modules/bt-management/utils/summarise-measurement-for-log.js +17 -0
  253. package/lib/module/modules/bt-management/utils/summarise-measurement-for-log.js.map +1 -0
  254. package/lib/module/modules/bt-management/utils/supported-measurement-type-keys.js +13 -0
  255. package/lib/module/modules/bt-management/utils/supported-measurement-type-keys.js.map +1 -0
  256. package/lib/typescript/commonjs/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
  257. package/lib/typescript/commonjs/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
  258. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +20 -0
  259. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
  260. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-fields.d.ts +13 -0
  261. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-fields.d.ts.map +1 -0
  262. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-shape.d.ts +19 -0
  263. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-shape.d.ts.map +1 -0
  264. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
  265. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -1
  266. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-frame.d.ts.map +1 -1
  267. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts +11 -0
  268. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -0
  269. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -1
  270. package/lib/typescript/commonjs/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
  271. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts +24 -0
  272. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts.map +1 -0
  273. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts +5 -8
  274. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts.map +1 -1
  275. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts +74 -0
  276. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -0
  277. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +6 -4
  278. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  279. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts +20 -1
  280. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
  281. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +12 -1
  282. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  283. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +30 -0
  284. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -0
  285. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +32 -2
  286. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  287. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/frame-parser.d.ts.map +1 -1
  288. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts +24 -0
  289. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts.map +1 -0
  290. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts +32 -0
  291. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts.map +1 -0
  292. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts +27 -0
  293. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts.map +1 -0
  294. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts +20 -0
  295. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts.map +1 -0
  296. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts +14 -0
  297. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts.map +1 -0
  298. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +75 -0
  299. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -0
  300. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts +28 -0
  301. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts.map +1 -0
  302. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts +12 -0
  303. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts.map +1 -0
  304. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts +81 -0
  305. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -0
  306. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts +17 -0
  307. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts.map +1 -0
  308. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts +33 -0
  309. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts.map +1 -0
  310. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +85 -0
  311. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -0
  312. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts +27 -0
  313. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts.map +1 -0
  314. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts +52 -0
  315. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts.map +1 -0
  316. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +53 -0
  317. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -0
  318. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +45 -0
  319. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -0
  320. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +18 -0
  321. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -0
  322. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +19 -0
  323. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -0
  324. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts +45 -0
  325. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts.map +1 -0
  326. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts +30 -0
  327. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts.map +1 -0
  328. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts +39 -0
  329. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts.map +1 -0
  330. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +35 -0
  331. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -0
  332. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts +44 -0
  333. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -0
  334. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts +32 -0
  335. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -0
  336. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts +25 -0
  337. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts.map +1 -0
  338. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts +39 -0
  339. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -0
  340. package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts +26 -0
  341. package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -0
  342. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts +43 -0
  343. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
  344. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-algorithm.d.ts +10 -0
  345. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-algorithm.d.ts.map +1 -0
  346. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-spec.d.ts +23 -0
  347. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-spec.d.ts.map +1 -0
  348. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts +5 -0
  349. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -1
  350. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-spec.d.ts +12 -0
  351. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-spec.d.ts.map +1 -1
  352. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-encoding.d.ts +7 -1
  353. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -1
  354. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-frame-spec.d.ts +8 -0
  355. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-frame-spec.d.ts.map +1 -1
  356. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts +44 -0
  357. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -0
  358. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-measurement-spec.d.ts +9 -0
  359. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-measurement-spec.d.ts.map +1 -0
  360. package/lib/typescript/commonjs/src/modules/bt-management/types/dependent-result-handler-params.d.ts +7 -0
  361. package/lib/typescript/commonjs/src/modules/bt-management/types/dependent-result-handler-params.d.ts.map +1 -1
  362. package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts +27 -0
  363. package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts.map +1 -0
  364. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
  365. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  366. package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts +3 -1
  367. package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
  368. package/lib/typescript/commonjs/src/modules/bt-management/types/measurement-group.d.ts +14 -0
  369. package/lib/typescript/commonjs/src/modules/bt-management/types/measurement-group.d.ts.map +1 -0
  370. package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts +17 -0
  371. package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
  372. package/lib/typescript/commonjs/src/modules/bt-management/utils/calculate-checksum.d.ts +13 -0
  373. package/lib/typescript/commonjs/src/modules/bt-management/utils/calculate-checksum.d.ts.map +1 -0
  374. package/lib/typescript/commonjs/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
  375. package/lib/typescript/commonjs/src/modules/bt-management/utils/create-frame-validator.d.ts.map +1 -1
  376. package/lib/typescript/commonjs/src/modules/bt-management/utils/hex-to-bytes.d.ts +10 -0
  377. package/lib/typescript/commonjs/src/modules/bt-management/utils/hex-to-bytes.d.ts.map +1 -0
  378. package/lib/typescript/commonjs/src/modules/bt-management/utils/le-32-to-bytes.d.ts +3 -0
  379. package/lib/typescript/commonjs/src/modules/bt-management/utils/le-32-to-bytes.d.ts.map +1 -0
  380. package/lib/typescript/commonjs/src/modules/bt-management/utils/parse-measurement.d.ts +4 -1
  381. package/lib/typescript/commonjs/src/modules/bt-management/utils/parse-measurement.d.ts.map +1 -1
  382. package/lib/typescript/commonjs/src/modules/bt-management/utils/reject-custom-reading.d.ts +15 -0
  383. package/lib/typescript/commonjs/src/modules/bt-management/utils/reject-custom-reading.d.ts.map +1 -0
  384. package/lib/typescript/commonjs/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts +9 -0
  385. package/lib/typescript/commonjs/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts.map +1 -0
  386. package/lib/typescript/commonjs/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts +10 -0
  387. package/lib/typescript/commonjs/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts.map +1 -0
  388. package/lib/typescript/module/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
  389. package/lib/typescript/module/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
  390. package/lib/typescript/module/src/modules/bt-management/index.d.ts +20 -0
  391. package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
  392. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-fields.d.ts +13 -0
  393. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-fields.d.ts.map +1 -0
  394. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-shape.d.ts +19 -0
  395. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-shape.d.ts.map +1 -0
  396. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
  397. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -1
  398. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-frame.d.ts.map +1 -1
  399. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts +11 -0
  400. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -0
  401. package/lib/typescript/module/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -1
  402. package/lib/typescript/module/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
  403. package/lib/typescript/module/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts +24 -0
  404. package/lib/typescript/module/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts.map +1 -0
  405. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts +5 -8
  406. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts.map +1 -1
  407. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts +74 -0
  408. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -0
  409. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +6 -4
  410. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  411. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts +20 -1
  412. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
  413. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +12 -1
  414. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  415. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +30 -0
  416. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -0
  417. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +32 -2
  418. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  419. package/lib/typescript/module/src/modules/bt-management/services/devices/frame-parser.d.ts.map +1 -1
  420. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts +24 -0
  421. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts.map +1 -0
  422. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts +32 -0
  423. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts.map +1 -0
  424. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts +27 -0
  425. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts.map +1 -0
  426. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts +20 -0
  427. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts.map +1 -0
  428. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts +14 -0
  429. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts.map +1 -0
  430. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +75 -0
  431. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -0
  432. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts +28 -0
  433. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts.map +1 -0
  434. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts +12 -0
  435. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts.map +1 -0
  436. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts +81 -0
  437. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -0
  438. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts +17 -0
  439. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts.map +1 -0
  440. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts +33 -0
  441. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts.map +1 -0
  442. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +85 -0
  443. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -0
  444. package/lib/typescript/module/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts +27 -0
  445. package/lib/typescript/module/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts.map +1 -0
  446. package/lib/typescript/module/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts +52 -0
  447. package/lib/typescript/module/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts.map +1 -0
  448. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +53 -0
  449. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -0
  450. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +45 -0
  451. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -0
  452. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +18 -0
  453. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -0
  454. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +19 -0
  455. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -0
  456. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts +45 -0
  457. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts.map +1 -0
  458. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts +30 -0
  459. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts.map +1 -0
  460. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts +39 -0
  461. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts.map +1 -0
  462. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +35 -0
  463. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -0
  464. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts +44 -0
  465. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -0
  466. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts +32 -0
  467. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -0
  468. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts +25 -0
  469. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts.map +1 -0
  470. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts +39 -0
  471. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -0
  472. package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts +26 -0
  473. package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -0
  474. package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts +43 -0
  475. package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
  476. package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-algorithm.d.ts +10 -0
  477. package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-algorithm.d.ts.map +1 -0
  478. package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-spec.d.ts +23 -0
  479. package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-spec.d.ts.map +1 -0
  480. package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts +5 -0
  481. package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -1
  482. package/lib/typescript/module/src/modules/bt-management/types/custom-device-spec.d.ts +12 -0
  483. package/lib/typescript/module/src/modules/bt-management/types/custom-device-spec.d.ts.map +1 -1
  484. package/lib/typescript/module/src/modules/bt-management/types/custom-field-encoding.d.ts +7 -1
  485. package/lib/typescript/module/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -1
  486. package/lib/typescript/module/src/modules/bt-management/types/custom-frame-spec.d.ts +8 -0
  487. package/lib/typescript/module/src/modules/bt-management/types/custom-frame-spec.d.ts.map +1 -1
  488. package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts +44 -0
  489. package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -0
  490. package/lib/typescript/module/src/modules/bt-management/types/custom-measurement-spec.d.ts +9 -0
  491. package/lib/typescript/module/src/modules/bt-management/types/custom-measurement-spec.d.ts.map +1 -0
  492. package/lib/typescript/module/src/modules/bt-management/types/dependent-result-handler-params.d.ts +7 -0
  493. package/lib/typescript/module/src/modules/bt-management/types/dependent-result-handler-params.d.ts.map +1 -1
  494. package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts +27 -0
  495. package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts.map +1 -0
  496. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
  497. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  498. package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts +3 -1
  499. package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
  500. package/lib/typescript/module/src/modules/bt-management/types/measurement-group.d.ts +14 -0
  501. package/lib/typescript/module/src/modules/bt-management/types/measurement-group.d.ts.map +1 -0
  502. package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts +17 -0
  503. package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
  504. package/lib/typescript/module/src/modules/bt-management/utils/calculate-checksum.d.ts +13 -0
  505. package/lib/typescript/module/src/modules/bt-management/utils/calculate-checksum.d.ts.map +1 -0
  506. package/lib/typescript/module/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
  507. package/lib/typescript/module/src/modules/bt-management/utils/create-frame-validator.d.ts.map +1 -1
  508. package/lib/typescript/module/src/modules/bt-management/utils/hex-to-bytes.d.ts +10 -0
  509. package/lib/typescript/module/src/modules/bt-management/utils/hex-to-bytes.d.ts.map +1 -0
  510. package/lib/typescript/module/src/modules/bt-management/utils/le-32-to-bytes.d.ts +3 -0
  511. package/lib/typescript/module/src/modules/bt-management/utils/le-32-to-bytes.d.ts.map +1 -0
  512. package/lib/typescript/module/src/modules/bt-management/utils/parse-measurement.d.ts +4 -1
  513. package/lib/typescript/module/src/modules/bt-management/utils/parse-measurement.d.ts.map +1 -1
  514. package/lib/typescript/module/src/modules/bt-management/utils/reject-custom-reading.d.ts +15 -0
  515. package/lib/typescript/module/src/modules/bt-management/utils/reject-custom-reading.d.ts.map +1 -0
  516. package/lib/typescript/module/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts +9 -0
  517. package/lib/typescript/module/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts.map +1 -0
  518. package/lib/typescript/module/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts +10 -0
  519. package/lib/typescript/module/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts.map +1 -0
  520. package/package.json +1 -1
@@ -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;AAEhC,MAAMC,UAAU,GAAGA,CAACC,IAAY,EAAEC,IAAY,EAAEC,IAAY,MAAM;EAChEF,IAAI;EACJG,WAAW,EAAE,CAACF,IAAI,EAAEA,IAAI,GAAG,CAAC,EAAEA,IAAI,GAAG,CAAC,CAAC;EACvCG,QAAQ,EAAE,OAAgB;EAC1BF;AACF,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,oBAAoB,GAAGvB,kBA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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,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,KAC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G,CAAC,GAAG,IAAI,CAACiC,OAAO,CAAC,CAAC,GAAG,IAAI,CAACG,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,IAAIhC,KAAK,CAACkB,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,EAAExB,KAAK,CAACgC,IAAI,CAAC,IAAI,EAAE,CAAC;AACtD;AAEA,MAAMW,mBAAmB,GAAGA,CAC1BnB,KAAmC,EACnCwB,GAAW,MACQ;EAAE,GAAGxB,KAAK;EAAEjB,KAAK,EAAE,CAACyC,GAAG,CAAC;EAAElB,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"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAG/C,SAASC,QAAQ,QAAQ,6BAA0B;AAInD,SAASC,eAAe,QAAQ,yBAAsB;AAEtD,SACEC,uBAAuB,EACvBC,0BAA0B,QACrB,0BAAuB;AAC9B,SAASC,kBAAkB,QAAQ,2BAAwB;AAE3D,MAAMC,OAAO,GAAG,sCAAsC;;AAEtD;AACA,MAAMC,aAAa,GAAG,sCAAsC;AAC5D,MAAMC,MAAM,GAAG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AAK,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;A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ACV,yBAAyB,IACrCI,wBACJ,CAAC;EACH;EAEA,OAAOS,OAAO;AAChB,CAAC;AAED,SACEJ,uBAAuB,EACvBV,mBAAmB,EACnBD,0BAA0B","ignoreList":[]}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ /** Every request is a fixed twenty-byte packet, zero filled but for its group and command. */
4
+ const PACKET_BYTES = 20;
5
+ const GROUP_INDEX = 1;
6
+ const COMMAND_INDEX = 2;
7
+ const PARAMETER_INDEX = 3;
8
+ const DOWNLOAD_GROUP = 4;
9
+ const DOWNLOAD_MODE = 1;
10
+ const DOWNLOAD_HEADER = 2;
11
+ const DOWNLOAD_RAW = 3;
12
+
13
+ /** The transfer's shape, from the vendor's own device table. */
14
+ const PAYLOAD_FROM = 4;
15
+ const PAYLOAD_BYTES = 16;
16
+ const HEADER_PACKETS = 5;
17
+ const PACKETS_PER_SEGMENT = 16;
18
+ const SEGMENTS = 34;
19
+ const BYTE_MASK = 0xff;
20
+ const BYTE_BITS = 8;
21
+ const toHex = byte => (byte & BYTE_MASK).toString(16).padStart(2, "0");
22
+ const packet = (write, command, parameters = []) => {
23
+ const bytes = new Array(PACKET_BYTES).fill(0);
24
+ bytes[GROUP_INDEX] = DOWNLOAD_GROUP;
25
+ bytes[COMMAND_INDEX] = command;
26
+ parameters.forEach((value, index) => {
27
+ bytes[PARAMETER_INDEX + index] = value;
28
+ });
29
+ return {
30
+ ...write,
31
+ frame: bytes.map(toHex)
32
+ };
33
+ };
34
+ const segmentParameters = segment => [segment & BYTE_MASK, segment >> BYTE_BITS & BYTE_MASK, segment >> BYTE_BITS * 2 & BYTE_MASK];
35
+ /**
36
+ * Downloads a recording from the Veroval ECG.
37
+ *
38
+ * The exchange is a fixed walk rather than a conversation: ask for the download mode, then
39
+ * the header, then each second of the recording in turn. The device answers each request
40
+ * with a known number of twenty-byte packets, sixteen payload bytes each, so the transfer is
41
+ * paced by counting them - which is how the vendor's own app paces it, and is the only thing
42
+ * that distinguishes one phase's packets from another's.
43
+ *
44
+ * A recording is thirty-four seconds at 128 Hz. Nothing is reported until all of it has
45
+ * arrived: a partial ECG that looked whole would be worse than none, and the count is what
46
+ * says it is whole.
47
+ */
48
+ export class VerovalEcgTransfer {
49
+ phase = "mode";
50
+ packets = 0;
51
+ segment = 0;
52
+ recording = [];
53
+ constructor(params) {
54
+ this.params = params;
55
+ }
56
+ initialCommands = () => [packet(this.params.write, DOWNLOAD_MODE)];
57
+ nextCommand = frame => {
58
+ if (this.phase === "done") {
59
+ return undefined;
60
+ }
61
+ if (this.phase === "mode") {
62
+ this.phase = "header";
63
+ this.packets = 0;
64
+ return [packet(this.params.write, DOWNLOAD_HEADER)];
65
+ }
66
+ this.packets += 1;
67
+ if (this.phase === "header") {
68
+ return this.packets < HEADER_PACKETS ? undefined : this.requestSegment(0);
69
+ }
70
+ this.recording.push(...frame.slice(PAYLOAD_FROM, PAYLOAD_FROM + PAYLOAD_BYTES));
71
+ return this.packets < PACKETS_PER_SEGMENT ? undefined : this.finishSegment();
72
+ };
73
+ finishSegment = () => {
74
+ this.segment += 1;
75
+ if (this.segment < SEGMENTS) {
76
+ return this.requestSegment(this.segment);
77
+ }
78
+ this.phase = "done";
79
+ this.params.onRecording(this.recording);
80
+ return undefined;
81
+ };
82
+ requestSegment = segment => {
83
+ this.phase = "raw";
84
+ this.packets = 0;
85
+ this.segment = segment;
86
+ return [packet(this.params.write, DOWNLOAD_RAW, segmentParameters(segment))];
87
+ };
88
+ }
89
+ //# sourceMappingURL=veroval.ecg-transfer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PACKET_BYTES","GROUP_INDEX","COMMAND_INDEX","PARAMETER_INDEX","DOWNLOAD_GROUP","DOWNLOAD_MODE","DOWNLOAD_HEADER","DOWNLOAD_RAW","PAYLOAD_FROM","PAYLOAD_BYTES","HEADER_PACKETS","PACKETS_PER_SEGMENT","SEGMENTS","BYTE_MASK","BYTE_BITS","toHex","byte","toString","padStart","packet","write","command","parameters","bytes","Array","fill","forEach","value","index","frame","map","segmentParameters","segment","VerovalEcgTransfer","phase","packets","recording","constructor","params","initialCommands","nextCommand","undefined","requestSegment","push","slice","finishSegment","onRecording"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-transfer.ts"],"mappings":";;AAGA;AACA,MAAMA,YAAY,GAAG,EAAE;AACvB,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,eAAe,GAAG,CAAC;AAEzB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,eAAe,GAAG,CAAC;AACzB,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,aAAa,GAAG,EAAE;AACxB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,mBAAmB,GAAG,EAAE;AAC9B,MAAMC,QAAQ,GAAG,EAAE;AAEnB,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,SAAS,GAAG,CAAC;AAEnB,MAAMC,KAAK,GAAIC,IAAY,IACzB,CAACA,IAAI,GAAGH,SAAS,EAAEI,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAElD,MAAMC,MAAM,GAAGA,CACbC,KAAmC,EACnCC,OAAe,EACfC,UAA6B,GAAG,EAAE,KAChB;EAClB,MAAMC,KAAK,GAAG,IAAIC,KAAK,CAASxB,YAAY,CAAC,CAACyB,IAAI,CAAC,CAAC,CAAC;EAErDF,KAAK,CAACtB,WAAW,CAAC,GAAGG,cAAc;EACnCmB,KAAK,CAACrB,aAAa,CAAC,GAAGmB,OAAO;EAC9BC,UAAU,CAACI,OAAO,CAAC,CAACC,KAAK,EAAEC,KAAK,KAAK;IACnCL,KAAK,CAACpB,eAAe,GAAGyB,KAAK,CAAC,GAAGD,KAAK;EACxC,CAAC,CAAC;EAEF,OAA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AK,CAACe,KAAK,CAACpC,YAAY,EAAEA,YAAY,GAAGC,aAAa,CAC3D,CAAC;IAED,OAAO,IAAI,CAAC0B,OAAO,GAAGxB,mBAAmB,GACrC8B,SAAS,GACT,IAAI,CAACI,aAAa,CAAC,CAAC;EAC1B,CAAC;EAEOA,aAAa,GAAGA,CAAA,KAA4C;IAClE,IAAI,CAACb,OAAO,IAAI,CAAC;IAEjB,IAAI,IAAI,CAACA,OAAO,GAAGpB,QAAQ,EAAE;MAC3B,OAAO,IAAI,CAAC8B,cAAc,CAAC,IAAI,CAACV,OAAO,CAAC;IAC1C;IAEA,IAAI,CAACE,KAAK,GAAG,MAAM;IACnB,IAAI,CAACI,MAAM,CAACQ,WAAW,CAAC,IAAI,CAACV,SAAS,CAAC;IAEvC,OAAOK,SAAS;EAClB,CAAC;EAEOC,cAAc,GAAIV,OAAe,IAA+B;IACtE,IAAI,CAACE,KAAK,GAAG,KAAK;IAClB,IAAI,CAACC,OAAO,GAAG,CAAC;IAChB,IAAI,CAACH,OAAO,GAAGA,OAAO;IAEtB,OAAO,CACLb,MAAM,CAAC,IAAI,CAACmB,MAAM,CAAClB,KAAK,EAAEb,YAAY,EAAEwB,iBAAiB,CAACC,OAAO,CAAC,CAAC,CACpE;EACH,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+
3
+ import { MeasurementTypeKey } from "@ovok/core";
4
+ import { lepuNameMatch } from "../lepu/lepu.name-match.js";
5
+ import { lepuDevice } from "../lepu/lepu.transports.js";
6
+
7
+ /**
8
+ * The Viatom blood-pressure monitors that report a reading over the realtime channel.
9
+ *
10
+ * The vendor documents BP2, BP2A and BP2T as one product group on one set of characteristics
11
+ * with one API, and the SDK's own BP2 device class has run against that protocol on real
12
+ * hardware. The byte offsets below are that class's, unchanged.
13
+ *
14
+ * BP2W and the BP3 range decode the same struct rather than merely sharing a transport:
15
+ * their interfaces build `Bp2BleRtData`, which holds the device state in its first nine
16
+ * bytes and the result immediately after, and all of them answer the same `RT_DATA` opcode.
17
+ * That is still one step short of BP2A and BP2T, which the vendor groups with BP2 outright.
18
+ */
19
+
20
+ /** Realtime data. Inert on this series: it reads state, it does not start a measurement. */
21
+ const RT_DATA = 0x08;
22
+
23
+ /**
24
+ * The command byte and the device's state byte together pick the case.
25
+ *
26
+ * The state is the first byte of the realtime payload and is what says whether the numbers
27
+ * that follow are a finished reading or a cuff still inflating.
28
+ */
29
+ const CASE_SELECTOR_BYTES = [1, 7];
30
+
31
+ /** Header, realtime state, and the result struct through its pulse-rate field. */
32
+ const MIN_LENGTH_BYTES = 28;
33
+ const READING = [{
34
+ name: "systolic",
35
+ byteIndexes: [20, 21],
36
+ byteOrder: "little",
37
+ encoding: "uint",
38
+ unit: "mmHg"
39
+ }, {
40
+ name: "diastolic",
41
+ byteIndexes: [22, 23],
42
+ byteOrder: "little",
43
+ encoding: "uint",
44
+ unit: "mmHg"
45
+ }, {
46
+ name: "heartRate",
47
+ byteIndexes: [26, 27],
48
+ byteOrder: "little",
49
+ encoding: "uint",
50
+ unit: "bpm"
51
+ }];
52
+ const result = (selector, description) => ({
53
+ selector,
54
+ kind: "result",
55
+ measurementTypeKey: MeasurementTypeKey.bloodPressure,
56
+ fields: [...READING],
57
+ description
58
+ });
59
+ const measuring = (selector, description) => ({
60
+ selector,
61
+ kind: "stream",
62
+ description
63
+ });
64
+
65
+ /**
66
+ * The states the series reports, and what each means for a reading.
67
+ *
68
+ * A finished measurement keeps reporting itself for as long as the device sits on the
69
+ * result screen, so the same numbers arrive on every poll. The state transition is what
70
+ * separates one measurement from the next, which is why the states in between are declared
71
+ * rather than ignored.
72
+ */
73
+ const BP2_CASES = [measuring("0804", "Cuff inflating or deflating"), result("0805", "Measurement finished"), measuring("080f", "Averaging run: a measurement is in progress"), measuring("0810", "Averaging run: waiting between measurements"), result("0811", "Averaging run finished, carrying the same payload")];
74
+ /**
75
+ * Declares one monitor of the BP2 series.
76
+ *
77
+ * `advertisedName` is the name the vendor's SDK matches - `BP2A`, `BP2T` - and the matcher
78
+ * derived from it excludes every longer name in the family, so a declaration for `BP2`
79
+ * cannot pick up a `BP2W`.
80
+ */
81
+ const viatomBpMonitor = (advertisedName, params) => lepuDevice({
82
+ id: params.id,
83
+ nameMatch: params.nameMatch ?? lepuNameMatch(advertisedName),
84
+ pollCommand: RT_DATA,
85
+ minLengthBytes: MIN_LENGTH_BYTES,
86
+ caseSelectorBytes: CASE_SELECTOR_BYTES,
87
+ cases: BP2_CASES.map(each => ({
88
+ ...each
89
+ })),
90
+ ...(params.expectedDeviceTypes ? {
91
+ expectedDeviceTypes: params.expectedDeviceTypes
92
+ } : {})
93
+ });
94
+
95
+ /** BP2A, the arm-cuff monitor of the series. */
96
+ const bp2aMonitor = params => viatomBpMonitor("BP2A", params);
97
+
98
+ /** BP2T, documented by the vendor alongside BP2 and BP2A as the same protocol. */
99
+ const bp2tMonitor = params => viatomBpMonitor("BP2T", params);
100
+
101
+ /** BP2W. Documented in its own section, but decoding the same realtime struct. */
102
+ const bp2wMonitor = params => viatomBpMonitor("BP2W", params);
103
+
104
+ /**
105
+ * The names the BP3 range advertises.
106
+ *
107
+ * Fifteen products differing in cuff and casing rather than in protocol, so declaring the
108
+ * range is one line per name:
109
+ *
110
+ * ```typescript
111
+ * const bp3Devices = BP3_MODEL_NAMES.map((name) =>
112
+ * viatomBpMonitor(name, { id: `viatom-${name.toLowerCase()}` }),
113
+ * );
114
+ * ```
115
+ */
116
+ const BP3_MODEL_NAMES = ["BP3", "BP3-B", "BP3-C1", "BP3-C2", "BP3A", "BP3B", "BP3C", "BP3D", "BP3E", "BP3F", "BP3G", "BP3H", "BP3K", "BP3L", "BP3Z"];
117
+ export { bp2aMonitor, bp2tMonitor, bp2wMonitor, BP3_MODEL_NAMES, viatomBpMonitor };
118
+ //# sourceMappingURL=viatom.bp-monitors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MeasurementTypeKey","lepuNameMatch","lepuDevice","RT_DATA","CASE_SELECTOR_BYTES","MIN_LENGTH_BYTES","READING","name","byteIndexes","byteOrder","encoding","unit","result","selector","description","kind","measurementTypeKey","bloodPressure","fields","measuring","BP2_CASES","viatomBpMonitor","advertisedName","params","id","nameMatch","pollCommand","minLengthBytes","caseSelectorBytes","cases","map","each","expectedDeviceTypes","bp2aMonitor","bp2tMonitor","bp2wMonitor","BP3_MODEL_NAMES"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.bp-monitors.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAK/C,SAASC,aAAa,QAAQ,4BAAyB;AACvD,SAASC,UAAU,QAAQ,4BAAyB;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMC,OAAO,GAAG,IAAI;;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;;AAElC;AACA,MAAMC,gBAAgB,GAAG,EAAE;AAE3B,MAAMC,OAA0B,GAAG,CACjC;EACEC,IAAI,EAAE,UAAU;EAChBC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;EACrBC,SAAS,EAAE,QAAQ;EACnBC,QAAQ,EAAE,MAAM;EAChBC,IAAI,EAAE;AACR,CAAC,EACD;EACEJ,IAAI,EAAE,WAAW;EACjBC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;EACrBC,SAAS,EAAE,QAAQ;EACnBC,QAAQ,EAAE,MAAM;EAChBC,IAAI,EAAE;AACR,CAAC,EACD;EACEJ,IAAI,EAAE,WAAW;EACjBC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;EACrBC,SAAS,EAAE,QAAQ;EACnBC,QAAQ,EAAE,MAAM;EAChBC,IAAI,EAAE;AACR,CAAC,CACF;AAED,MAAMC,MAAM,GAAGA,CAACC,QAAgB,EAAEC,WAAmB,MAAsB;EACzED,QAA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