@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 { lepuNameMatch } from "../lepu/lepu.name-match.js";
5
+ import { lepuDevice } from "../lepu/lepu.transports.js";
6
+
7
+ /**
8
+ * The Viatom ECG recorders - ER1, ER2 and ER3.
9
+ *
10
+ * **What a declaration gets from these is the heart rate, not the waveform.** The ECG itself
11
+ * arrives as a stream of samples assembled across many notifications and belongs to a device
12
+ * class; the recorders also report a heart rate in the same realtime frame, at a fixed
13
+ * offset, and that is a reading a declaration can carry on its own.
14
+ *
15
+ * Their stored recordings are a separate matter and are reachable: these devices use the
16
+ * family's generic file opcodes, so `LepuFileTransfer` downloads their records unchanged.
17
+ * Turning a downloaded recording into a measurement still needs a device class.
18
+ *
19
+ * ## A note on the opcodes
20
+ *
21
+ * This range numbers its commands low, in the space where the family's meanings diverge
22
+ * most, so the poll is chosen deliberately rather than taken from whatever the vendor's SDK
23
+ * calls first:
24
+ *
25
+ * - `RT_PARAM` is `0x02` here and **`CALIBRATION_SLOPE` on a BP2**, a factory command that
26
+ * silently biases every subsequent blood-pressure reading. It is never sent, even though
27
+ * it would be the cheaper poll - it returns the parameters without the waveform.
28
+ * - `START_ECG` is `0x08` on a Lepod and `RT_DATA` on a BP2. It is never sent either.
29
+ *
30
+ * `RT_DATA` is a read on every one of them, which is why it is the poll here. The advertised
31
+ * name is what keeps these opcodes pointed at the right hardware, so a matcher for one of
32
+ * these devices should be narrowed, never widened.
33
+ */
34
+
35
+ /** Reads the realtime parameters and waveform. A read on every device in this range. */
36
+ const RT_DATA = 0x03;
37
+
38
+ /** The ER3 answers its realtime data on a different opcode from the rest of the range. */
39
+ const ER3_RT_DATA = 0x06;
40
+ const HEART_RATE_UNIT = "bpm";
41
+ /** ER1, ER2 and ER3 share one parameter block: the heart rate opens it. */
42
+ const ER_HEART_RATE_BYTES = [7, 8];
43
+ /**
44
+ * Declares one recorder, reporting the heart rate from its realtime frame.
45
+ *
46
+ * A recorder that is not against the skin reports a rate outside what a heart can beat at,
47
+ * so it is discarded rather than reported. The device marks that condition in bits of a
48
+ * status byte, which a declaration cannot select on, so a recorder left connected and unworn
49
+ * reports a decoding failure on each poll. Reading those bits quietly needs a device class.
50
+ */
51
+ const declareRecorder = (advertisedName, profile, params) => lepuDevice({
52
+ id: params.id,
53
+ nameMatch: params.nameMatch ?? lepuNameMatch(advertisedName),
54
+ transport: profile.transport,
55
+ pollCommand: profile.pollCommand,
56
+ minLengthBytes: profile.heartRateBytes[1] + 1,
57
+ caseSelectorBytes: [1],
58
+ cases: [{
59
+ selector: profile.pollCommand.toString(16).padStart(2, "0"),
60
+ kind: "result",
61
+ measurementTypeKey: MeasurementTypeKey.heartRate,
62
+ description: "Realtime parameters and waveform",
63
+ fields: [{
64
+ name: "heartRate",
65
+ byteIndexes: [...profile.heartRateBytes],
66
+ byteOrder: "little",
67
+ encoding: "uint",
68
+ unit: HEART_RATE_UNIT
69
+ }]
70
+ }],
71
+ ...(params.expectedDeviceTypes ? {
72
+ expectedDeviceTypes: params.expectedDeviceTypes
73
+ } : {})
74
+ });
75
+
76
+ /** The ER1, and the handheld recorders sold under other names on the same protocol. */
77
+ const er1Recorder = (advertisedName, params) => declareRecorder(advertisedName, {
78
+ pollCommand: RT_DATA,
79
+ heartRateBytes: ER_HEART_RATE_BYTES,
80
+ transport: "standard"
81
+ }, params);
82
+
83
+ /**
84
+ * The ER2, which reads the same block but over a link that grants nothing beyond the
85
+ * minimum. Asking it for the MTU the rest of the family grants is what the vendor's own SDK
86
+ * declines to do, and a command longer than the link carries is truncated rather than
87
+ * refused.
88
+ */
89
+ const er2Recorder = (advertisedName, params) => declareRecorder(advertisedName, {
90
+ pollCommand: RT_DATA,
91
+ heartRateBytes: ER_HEART_RATE_BYTES,
92
+ transport: "standardSmallMtu"
93
+ }, params);
94
+
95
+ /** The ER3, which reads the same parameter block from a different opcode. */
96
+ const er3Recorder = (advertisedName, params) => declareRecorder(advertisedName, {
97
+ pollCommand: ER3_RT_DATA,
98
+ heartRateBytes: ER_HEART_RATE_BYTES,
99
+ transport: "standard"
100
+ }, params);
101
+
102
+ /** The names the ER1 recorders advertise. */
103
+ const ER1_MODEL_NAMES = ["ER1", "ER1-H", "ER1-L", "ER1-S", "ER1-SP", "ER1-W", "ER1S", "HHM1"];
104
+
105
+ /** The names the ER2 recorders advertise, all of them on the small-MTU link. */
106
+ const ER2_MODEL_NAMES = ["ER2", "ER2-S", "HHM2", "HHM3", "LP ER2"];
107
+ export { er1Recorder, ER1_MODEL_NAMES, er2Recorder, ER2_MODEL_NAMES, er3Recorder };
108
+ //# sourceMappingURL=viatom.ecg-recorders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MeasurementTypeKey","lepuNameMatch","lepuDevice","RT_DATA","ER3_RT_DATA","HEART_RATE_UNIT","ER_HEART_RATE_BYTES","declareRecorder","advertisedName","profile","params","id","nameMatch","transport","pollCommand","minLengthBytes","heartRateBytes","caseSelectorBytes","cases","selector","toString","padStart","kind","measurementTypeKey","heartRate","description","fields","name","byteIndexes","byteOrder","encoding","unit","expectedDeviceTypes","er1Recorder","er2Recorder","er3Recorder","ER1_MODEL_NAMES","ER2_MODEL_NAMES"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.ecg-recorders.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAG/C,SAASC,aAAa,QAAQ,4BAAyB;AACvD,SAASC,UAAU,QAA2B,4BAAyB;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMC,OAAO,GAAG,IAAI;;AAEpB;AACA,MAAMC,WAAW,GAAG,IAAI;AAExB,MAAMC,eAAe,GAAG,KAAK;AAY7B;AACA,MAAMC,mBAAqC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AAoBpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAGA,CACtBC,cAAsB,EACtBC,OAAmB,EACnBC,MAAuB,KAEvBR,UAAU,CAAC;EACTS,EAAE,EAAED,MAAM,CAACC,EAAE;EACbC,SAAS,EAAEF,MAAM,CAACE,SAAS,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AAW,GAAGA,CAClB3B,cAAsB,EACtBE,MAAuB,KAEvBH,eAAe,CACbC,cAAc,EACd;EACEM,WAAW,EAAEV,WAAW;EACxBY,cAAc,EAAEV,mBAAmB;EACnCO,SAAS,EAAE;AACb,CAAC,EACDH,MACF,CAAC;;AAEH;AACA,MAAM0B,eAAkC,GAAG,CACzC,KAAK,EACL,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,CACP;;AAED;AACA,MAAMC,eAAkC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC;AAErF,SACEJ,WAAW,EACXG,eAAe,EACfF,WAAW,EACXG,eAAe,EACfF,WAAW","ignoreList":[]}
@@ -0,0 +1,114 @@
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 Lepod, a multi-parameter patient monitor.
9
+ *
10
+ * One realtime frame carries a heart rate, an oxygen saturation with its pulse rate, a
11
+ * respiration rate and a body temperature. They are four measurements taken by four
12
+ * instruments that happen to share a frame, so they are declared and reported separately: a
13
+ * temperature probe that is not attached is no reason to withhold the heart rate beside it.
14
+ *
15
+ * The ECG waveform in the same frame is not declared. It is a sample stream assembled across
16
+ * notifications and needs a device class; the recordings the device stores are reachable
17
+ * through the family's generic file opcodes.
18
+ */
19
+
20
+ /**
21
+ * Reads the realtime frame. A read - unlike `START_ECG`, which is `0x08` here and `RT_DATA`
22
+ * on a BP2, and `RT_PARAM`, which is `0x02` here and `CALIBRATION_SLOPE` on a BP2.
23
+ */
24
+ const RT_DATA = 0x03;
25
+
26
+ /** Header plus the parameter block through the temperature, which ends it. */
27
+ const MIN_LENGTH_BYTES = 46;
28
+
29
+ /** Frame offsets: the vendor's parameter block starts at the seven-byte header. */
30
+ const HEART_RATE = [31, 32];
31
+ const RESPIRATION_RATE = 34;
32
+ const BLOOD_OXYGEN = 36;
33
+ const PULSE_RATE = [37, 38];
34
+ const PERFUSION_INDEX = 39;
35
+ const TEMPERATURE = [44, 45];
36
+
37
+ /** The device counts perfusion in tenths of a percent and temperature in hundredths. */
38
+ const PERFUSION_SCALE = 0.1;
39
+ const TEMPERATURE_SCALE = 0.01;
40
+ const littleEndian = (name, byteIndexes, unit) => ({
41
+ name,
42
+ byteIndexes,
43
+ byteOrder: "little",
44
+ encoding: "uint",
45
+ unit
46
+ });
47
+ const LEPOD_MEASUREMENTS = [{
48
+ measurementTypeKey: MeasurementTypeKey.bloodOxygenPulseRate,
49
+ fields: [{
50
+ name: "bloodOxygen",
51
+ byteIndexes: [BLOOD_OXYGEN],
52
+ encoding: "uint",
53
+ unit: "%"
54
+ }, littleEndian("pulseRate", PULSE_RATE, "bpm"), {
55
+ name: "perfusionIndex",
56
+ byteIndexes: [PERFUSION_INDEX],
57
+ encoding: "uint",
58
+ unit: "%",
59
+ scale: PERFUSION_SCALE,
60
+ decimals: 1
61
+ }]
62
+ }, {
63
+ measurementTypeKey: MeasurementTypeKey.respiratoryRate,
64
+ fields: [{
65
+ name: "respiratoryRate",
66
+ byteIndexes: [RESPIRATION_RATE],
67
+ encoding: "uint",
68
+ unit: "/min"
69
+ }]
70
+ }, {
71
+ measurementTypeKey: MeasurementTypeKey.temperature,
72
+ fields: [{
73
+ name: "bodyTemp",
74
+ byteIndexes: TEMPERATURE,
75
+ byteOrder: "little",
76
+ encoding: "uint",
77
+ unit: "Cel",
78
+ scale: TEMPERATURE_SCALE,
79
+ decimals: 2
80
+ }]
81
+ }];
82
+ /**
83
+ * Declares a Lepod, reporting every reading its realtime frame carries.
84
+ *
85
+ * An instrument that is not attached reports a value outside the physiological range for
86
+ * what it measures, so that reading is discarded and reported while the others in the same
87
+ * frame are still delivered. The device also marks those conditions in bits of a lead-off
88
+ * byte, which a declaration cannot select on - reading them quietly needs a device class.
89
+ */
90
+ const lepodMonitor = (advertisedName, params) => lepuDevice({
91
+ id: params.id,
92
+ nameMatch: params.nameMatch ?? lepuNameMatch(advertisedName),
93
+ pollCommand: RT_DATA,
94
+ minLengthBytes: MIN_LENGTH_BYTES,
95
+ caseSelectorBytes: [1],
96
+ cases: [{
97
+ selector: "03",
98
+ kind: "result",
99
+ measurementTypeKey: MeasurementTypeKey.heartRate,
100
+ description: "Realtime parameters, waveform and lead state",
101
+ fields: [littleEndian("heartRate", HEART_RATE, "bpm")],
102
+ additionalMeasurements: LEPOD_MEASUREMENTS.map(each => ({
103
+ ...each
104
+ }))
105
+ }],
106
+ ...(params.expectedDeviceTypes ? {
107
+ expectedDeviceTypes: params.expectedDeviceTypes
108
+ } : {})
109
+ });
110
+
111
+ /** The names the Lepod range advertises. */
112
+ const LEPOD_MODEL_NAMES = ["Lepod", "LepodPro"];
113
+ export { LEPOD_MODEL_NAMES, lepodMonitor };
114
+ //# sourceMappingURL=viatom.lepod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MeasurementTypeKey","lepuNameMatch","lepuDevice","RT_DATA","MIN_LENGTH_BYTES","HEART_RATE","RESPIRATION_RATE","BLOOD_OXYGEN","PULSE_RATE","PERFUSION_INDEX","TEMPERATURE","PERFUSION_SCALE","TEMPERATURE_SCALE","littleEndian","name","byteIndexes","unit","byteOrder","encoding","LEPOD_MEASUREMENTS","measurementTypeKey","bloodOxygenPulseRate","fields","scale","decimals","respiratoryRate","temperature","lepodMonitor","advertisedName","params","id","nameMatch","pollCommand","minLengthBytes","caseSelectorBytes","cases","selector","kind","heartRate","description","additionalMeasurements","map","each","expectedDeviceTypes","LEPOD_MODEL_NAMES"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.lepod.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAK/C,SAASC,aAAa,QAAQ,4BAAyB;AACvD,SAASC,UAAU,QAAQ,4BAAyB;;AAEpD;AACA;AACA;AAC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AAU,CAAC;AAElE,SAASA,iBAAiB,EAAEjB,YAAY","ignoreList":[]}
@@ -0,0 +1,79 @@
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 pulse oximeters - the O2Ring, Oxyfit, KidsO2 and BabyO2 ranges.
9
+ *
10
+ * They share the family's framing and characteristics but not its opcodes: this range
11
+ * numbers its own commands, so realtime parameters are `0x17` here rather than the `0x08`
12
+ * the blood-pressure monitors answer, and its stored files are read with `0x03`-`0x05`
13
+ * rather than the generic `0xF1`-`0xF4`. A file transfer written for the rest of the family
14
+ * does not apply to these.
15
+ */
16
+
17
+ /** Realtime parameters. A read: it reports what the sensor sees and starts nothing. */
18
+ const RT_PARAM = 0x17;
19
+
20
+ /** Only the command byte, because what makes a reading valid here is a bit, not a byte. */
21
+ const CASE_SELECTOR_BYTES = [1];
22
+
23
+ /** Header plus the realtime parameters through the pulse rate. */
24
+ const MIN_LENGTH_BYTES = 10;
25
+ const PAYLOAD = 7;
26
+ const SPOT_CHECK_TIMEOUT_MS = 60_000;
27
+ /**
28
+ * Declares one oximeter of the range.
29
+ *
30
+ * **A finger that is not in the sensor yields no reading, reported as an error.** The device
31
+ * answers every poll whether or not it is measuring, and marks an unusable reading in two
32
+ * bits of a status byte - which a declaration cannot read, because a case is selected by
33
+ * whole bytes. What it can do is refuse the number: an oxygen saturation measured off the
34
+ * finger falls outside the physiological range, so it is discarded rather than reported.
35
+ * The reading is therefore never wrong, but a device left connected with nobody wearing it
36
+ * reports a decoding failure on each poll. Reading those bits quietly needs a device class.
37
+ */
38
+ const viatomOximeter = (advertisedName, params) => lepuDevice({
39
+ id: params.id,
40
+ nameMatch: params.nameMatch ?? lepuNameMatch(advertisedName),
41
+ stuckDataTimeoutMs: SPOT_CHECK_TIMEOUT_MS,
42
+ pollCommand: RT_PARAM,
43
+ minLengthBytes: MIN_LENGTH_BYTES,
44
+ caseSelectorBytes: CASE_SELECTOR_BYTES,
45
+ cases: [{
46
+ selector: "17",
47
+ kind: "result",
48
+ measurementTypeKey: MeasurementTypeKey.bloodOxygenPulseRate,
49
+ description: "Realtime parameters",
50
+ fields: [{
51
+ name: "bloodOxygen",
52
+ byteIndexes: [PAYLOAD],
53
+ encoding: "uint",
54
+ unit: "%"
55
+ }, {
56
+ name: "pulseRate",
57
+ byteIndexes: [PAYLOAD + 1, PAYLOAD + 2],
58
+ byteOrder: "little",
59
+ encoding: "uint",
60
+ unit: "bpm"
61
+ }]
62
+ }],
63
+ ...(params.expectedDeviceTypes ? {
64
+ expectedDeviceTypes: params.expectedDeviceTypes
65
+ } : {})
66
+ });
67
+
68
+ /**
69
+ * The names the oximeter range advertises.
70
+ *
71
+ * ```typescript
72
+ * const oximeters = VIATOM_OXIMETER_NAMES.map((name) =>
73
+ * viatomOximeter(name, { id: `viatom-${name.toLowerCase()}` }),
74
+ * );
75
+ * ```
76
+ */
77
+ const VIATOM_OXIMETER_NAMES = ["BBSM S1", "BBSM S2", "CMRing", "KidsO2-WPS", "O2 Intg", "O2M-WPS", "O2R WAVE", "O2RMed S", "O2Ring", "O2Ring S", "O2Ring SC", "O2Ring SF", "O2Ring SP", "O2Ring-RE", "O2RingF", "Oxyfit", "Oxyfit-WPS", "OxyU", "OxyU SE", "SI PO2"];
78
+ export { VIATOM_OXIMETER_NAMES, viatomOximeter };
79
+ //# sourceMappingURL=viatom.oximeters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MeasurementTypeKey","lepuNameMatch","lepuDevice","RT_PARAM","CASE_SELECTOR_BYTES","MIN_LENGTH_BYTES","PAYLOAD","SPOT_CHECK_TIMEOUT_MS","viatomOximeter","advertisedName","params","id","nameMatch","stuckDataTimeoutMs","pollCommand","minLengthBytes","caseSelectorBytes","cases","selector","kind","measurementTypeKey","bloodOxygenPulseRate","description","fields","name","byteIndexes","encoding","unit","byteOrder","expectedDeviceTypes","VIATOM_OXIMETER_NAMES"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.oximeters.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAG/C,SAASC,aAAa,QAAQ,4BAAyB;AACvD,SAASC,UAAU,QAAQ,4BAAyB;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMC,QAAQ,GAAG,IAAI;;AAErB;AACA,MAAMC,mBAAmB,GAAG,CAAC,CAAC,CAAC;;AAE/B;AACA,MAAMC,gBAAgB,GAAG,EAAE;AAE3B,MAAMC,OAAO,GAAG,CAAC;AAEjB,MAAMC,qBAAqB,GAAG,MAAM;AAoBpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAGA,CACrBC,cAAsB,EACtBC,MAA4B,KAE5BR,UAAU,CAAC;EACTS,EAAE,EAAED,MAAM,CAACC,EAAE;EACbC,SAAS,EAAEF,MAAM,CAACE,SAAS,IAAIX,aAAa,CAACQ,cAAc,CAAC;EAC5DI,kBAAkB,EAAEN,qBAAqB;EACzCO,WAAW,EAAEX,QAAQ;EACrBY,cAAc,EAAEV,gBAAgB;EAChCW,iBAAiB,EAAEZ,mBAAmB;EACtCa,KAAK,EAAE,CACL;IACEC,QAAQ,EAAE,IAAI;IACdC,IAAI,EAAE,QAAQ;IACdC,kBAAkB,EAAEpB,kBAAkB,CAACqB,oBAAoB;IAC3DC,WAAW,EAAE,qBAAqB;IAClCC,MAAM,EAAE,CACN;MACEC,IAAI,EAAE,aAAa;MACnBC,WAAW,EAAE,CAACnB,OAAO,CAAC;MACtBoB,QAAQ,EAAE,MAAM;MAChBC,IAAI,EAAE;IACR,CAAC,EACD;MACEH,IAAI,EAAE,WAAW;MACjBC,WAAW,EAAE,CAACnB,OAAO,GAAG,CAAC,EAAEA,OAAO,GAAG,CAAC,CAAC;MACvCsB,SAAS,EAAE,QAAQ;MACnBF,QAAQ,EAAE,MAAM;MAChBC,IAAI,EAAE;IACR,CAAC;EAEL,CAAC,CACF;EACD,IAAIjB,MAAM,CAACmB,mBAAmB,GAC1B;IAAEA,mBAAmB,EAAEnB,MAAM,CAACmB;EAAoB,CAAC,GACnD,CAAC,CAAC;AACR,CAAC,CAAC;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,qBAAwC,GAAG,CAC/C,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,SAAS,EACT,QAAQ,CACT;AAED,SAASA,qBAAqB,EAAEtB,cAAc","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=command-sequencer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/command-sequencer.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=custom-checksum-algorithm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-checksum-algorithm.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=custom-checksum-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-checksum-spec.ts"],"mappings":"","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["CUSTOM_DEVICE_BRAND"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-device-definition.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,qCAAkC;;AAQtE;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["CUSTOM_DEVICE_BRAND"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-device-definition.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,qCAAkC;;AAStE;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=custom-lepu-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-lepu-spec.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=custom-measurement-spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-measurement-spec.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=device-command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/device-command.ts"],"mappings":"","ignoreList":[]}
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { IntegratedDevices } from "./integrated-devices.js";
4
4
 
5
- /**
6
- * A built-in device has a measurement type the SDK knows statically. A device registered
7
- * through defineCustomDevice reports the catalog-checked properties its declaration named.
5
+ /**
6
+ * A built-in device has a measurement type the SDK knows statically. A device registered
7
+ * through defineCustomDevice reports the catalog-checked properties its declaration named.
8
8
  */
9
9
  //# sourceMappingURL=device-measurement-map.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/device-measurement-map.ts"],"mappings":";;AAWA,SAASA,iBAAiB,QAAQ,yBAAsB;;AAwBxD;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/device-measurement-map.ts"],"mappings":";;AAWA,SAASA,iBAAiB,QAAQ,yBAAsB;;AA0BxD;AACA;AACA;AACA","ignoreList":[]}
@@ -20,6 +20,8 @@ export let IntegratedDevices = /*#__PURE__*/function (IntegratedDevices) {
20
20
  IntegratedDevices["S5"] = "Le S5";
21
21
  IntegratedDevices["ALIVE_COR"] = "alivecor";
22
22
  IntegratedDevices["BGM"] = "BGM";
23
+ IntegratedDevices["VEROVAL_DUO_CONTROL"] = "Veroval duo control";
24
+ IntegratedDevices["VEROVAL_ECG"] = "Veroval ECG";
23
25
  return IntegratedDevices;
24
26
  }({});
25
27
  //# sourceMappingURL=integrated-devices.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/integrated-devices.ts"],"mappings":";;AAAA,WAAYA,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/integrated-devices.ts"],"mappings":";;AAAA,WAAYA,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=measurement-group.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/measurement-group.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ import { calculateCrc8 } from "./calculate-crc-8.js";
4
+ import { hexToByte } from "./hex-to-byte.js";
5
+ const BYTE_MASK = 0xff;
6
+ const foldBytes = (covered, combine) => covered.reduce((total, byte) => combine(total, hexToByte(byte || "0")) & BYTE_MASK, 0);
7
+
8
+ /**
9
+ * One implementation per algorithm, looked up by name.
10
+ *
11
+ * A map rather than a switch, so adding an algorithm is adding an entry, and so a
12
+ * declaration naming one that does not exist is rejected at registration instead of falling
13
+ * through to a default that would accept every frame.
14
+ */
15
+ const ALGORITHMS = {
16
+ crc8: covered => calculateCrc8(covered, covered.length),
17
+ xor: covered => foldBytes(covered, (total, byte) => total ^ byte),
18
+ sum: covered => foldBytes(covered, (total, byte) => total + byte)
19
+ };
20
+ const isChecksumAlgorithm = candidate => typeof candidate === "string" && candidate in ALGORITHMS;
21
+
22
+ /** The bytes a checksum covers, defaulting to everything between `from` and the checksum. */
23
+ const coveredBytes = (pkg, checksum) => {
24
+ const from = checksum.from ?? 0;
25
+ const byteCount = checksum.byteCount ?? checksum.index - from;
26
+ return pkg.slice(from, from + byteCount);
27
+ };
28
+
29
+ /**
30
+ * Whether a buffer's checksum byte matches the bytes it covers.
31
+ *
32
+ * A buffer too short to hold the checksum byte fails rather than reading it as zero: an
33
+ * absent byte is not a matching byte, and treating it as one would let a truncated
34
+ * notification through as a valid reading.
35
+ */
36
+ const hasValidChecksum = (pkg, checksum) => {
37
+ const declared = pkg[checksum.index];
38
+ if (declared === undefined) {
39
+ return false;
40
+ }
41
+ return ALGORITHMS[checksum.algorithm](coveredBytes(pkg, checksum)) === hexToByte(declared);
42
+ };
43
+ export { hasValidChecksum, isChecksumAlgorithm };
44
+ //# sourceMappingURL=calculate-checksum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["calculateCrc8","hexToByte","BYTE_MASK","foldBytes","covered","combine","reduce","total","byte","ALGORITHMS","crc8","length","xor","sum","isChecksumAlgorithm","candidate","coveredBytes","pkg","checksum","from","byteCount","index","slice","hasValidChecksum","declared","undefined","algorithm"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/calculate-checksum.ts"],"mappings":";;AAGA,SAASA,aAAa,QAAQ,sBAAmB;AACjD,SAASC,SAAS,QAAQ,kBAAe;AAEzC,MAAMC,SAAS,GAAG,IAAI;AAEtB,MAAMC,SAAS,GAAGA,CAChBC,OAAiB,EACjBC,OAAgD,KAEhDD,OAAO,CAACE,MAAM,CACZ,CAACC,KAAK,EAAEC,IAAI,KAAKH,OAAO,CAACE,KAAK,EAAEN,SAAS,CAACO,IAAI,IAAI,GAAG,CAAC,CAAC,GAAGN,SAAS,EACnE,CACF,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMO,UAGL,GAAG;EACFC,IAAI,EAAGN,OAAO,IAAKJ,aAAa,CAACI,OAAO,EAAEA,OAAO,CAACO,MAAM,CAAC;EACzDC,GAAG,EAAGR,OAAO,IAAKD,SAAS,CAACC,OAAO,EAAE,CAACG,KAAK,EAAEC,IAAI,KAAKD,KAAK,GAAGC,IAAI,CAAC;EACnEK,GAAG,EAAGT,OAAO,IAAKD,SAAS,CAACC,OAAO,EAAE,CAACG,KAAK,EAAEC,IAAI,KAAKD,KAAK,GAAGC,IAAI;AACpE,CAAC;AAED,MAAMM,mBAAmB,GACvBC,SAAkB,IAElB,OAAOA,SAAS,KAAK,QAAQ,IAAIA,SAAS,IAAIN,UAAU;;AAE1D;AACA,MAAMO,YAAY,GAAGA,CAACC,GAAa,EAAEC,QAA4B,KAAe;EAC9E,MAAMC,IAAI,GAAGD,QAAQ,CAACC,IAAI,IAAI,CAAC;EAC/B,MAAMC,SAAS,GAAGF,QAAQ,CAACE,SAAS,IAAIF,QAAQ,CAACG,KAAK,GAAGF,IAAI;EAE7D,OAAOF,GAAG,CAACK,KAAK,CAACH,IAAI,EAAEA,IAAI,GAAGC,SAAS,CAAC;AAC1C,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,gBAAgB,GAAGA,CACvBN,GAAa,EACbC,QAA4B,KAChB;EACZ,MAAMM,QAAQ,GAAGP,GAAG,CAACC,QAAQ,CAACG,KAAK,CAAC;EAEpC,IAAIG,QAAQ,KAAKC,SAAS,EAAE;IAC1B,OAAO,KAAK;EACd;EAEA,OACEhB,UAAU,CAACS,QAAQ,CAACQ,SAAS,CAAC,CAACV,YAAY,CAACC,GAAG,EAAEC,QAAQ,CAAC,CAAC,KAC3DjB,SAAS,CAACuB,QAAQ,CAAC;AAEvB,CAAC;AAED,SAASD,gBAAgB,EAAET,mBAAmB","ignoreList":[]}
@@ -2,7 +2,28 @@
2
2
 
3
3
  import { decodeMedicalFloat } from "./decode-medical-float.js";
4
4
  const HEX_ONLY = /^[0-9a-f]+$/;
5
+ const ASCII_ZERO = 0x30;
6
+ const ASCII_NINE = 0x39;
7
+ const HEX_BYTE = /../g;
8
+
9
+ /**
10
+ * Reads bytes that are decimal digits written as characters, not a number.
11
+ *
12
+ * A byte outside "0"-"9" makes the whole field undefined rather than being skipped: these
13
+ * records are fixed width and a non-digit means the field was not what the declaration
14
+ * says it is, so decoding the rest of it would report a number built from part of a value.
15
+ */
16
+ const fromAsciiDigits = hex => {
17
+ const codes = (hex.match(HEX_BYTE) ?? []).map(byte => parseInt(byte, 16));
18
+ if (codes.length === 0 || codes.some(code => code < ASCII_ZERO || code > ASCII_NINE)) {
19
+ return undefined;
20
+ }
21
+ return Number(codes.map(code => code - ASCII_ZERO).join(""));
22
+ };
5
23
  const toRaw = (hex, field) => {
24
+ if (field.encoding === "ascii") {
25
+ return fromAsciiDigits(hex);
26
+ }
6
27
  const raw = parseInt(hex, 16);
7
28
  const bits = hex.length * 4;
8
29
  if (field.encoding === "int") {
@@ -1 +1 @@
1
- {"version":3,"names":["decodeMedicalFloat","HEX_ONLY","toRaw","hex","field","raw","parseInt","bits","length","encoding","sign","createCustomFieldParser","assembledHex","toLowerCase","byteIndexes","test","undefined","Number","isFinite","value","scale","offset","decimals","factor","Math","round"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/create-custom-field-parser.ts"],"mappings":";;AAEA,SAASA,kBAAkB,QAAQ,2BAAwB;AAE3D,MAAMC,QAAQ,GAAG,aAAa;AAE9B,MAAMC,KAAK,GAAGA,CACZC,GAAW,EACXC,KAA0B,KACH;EACvB,MAAMC,GAAG,GAAGC,QAAQ,CAACH,GAAG,EAAE,EAAE,CAAC;EAC7B,MAAMI,IAAI,GAAGJ,GAAG,CAACK,MAAM,GAAG,CAAC;EAE3B,IAAIJ,KAAK,CAACK,QAAQ,KAAK,KAAK,EAAE;IAC5B,MAAMC,IAAI,GAAG,CAAC,KAAKH,IAAI,GAAG,CAAC,CAAC;IAE5B,OAAOF,GAAG,IAAIK,IAAI,GAAGL,GAAG,GAAGK,IAAI,GAAG,CAAC,GAAGL,GAAG;EAC3C;EAEA,IAAID,KAAK,CAACK,QAAQ,KAAK,QAAQ,EAAE;IAC/B,OAAOT,kBAAkB,CAACK,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;EACvC;EAEA,IAAID,KAAK,CAACK,QAAQ,KAAK,OAAO,EAAE;IAC9B,OAAOT,kBAAkB,CAACK,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;EACvC;EAEA,OAAOA,GAAG;AACZ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMM,uBAAuB,GACjCP,KAA0B,IAC1BQ,YAAoB,IAAyB;EAC5C,MAAMT,GAAG,GAAG,CAACS,YAAY,IAAI,EAAE,EAAEC,WAAW,CAAC,CAAC;EAE9C,IACEV,GAAG,CAACK,MAAM,KAAKJ,KAAK,CAACU,WAAW,CAACN,MAAM,GAAG,CAAC,IAC3C,CAACP,QAAQ,CAACc,IAAI,CAACZ,GAAG,CAAC,EACnB;IACA,OAAOa,SAAS;EAClB;EAEA,MAAMX,GAAG,GAAGH,KAAK,CAACC,GAAG,EAAEC,KAAK,CAAC;EAE7B,IAAIC,GAAG,KAAKW,SAAS,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACb,GAAG,CAAC,EAAE;IAC9C,OAAOW,SAAS;EAClB;EAEA,MAAMG,KAAK,GAAGd,GAAG,GAAGD,KAAK,CAACgB,KAAK,GAAGhB,KAAK,CAACiB,MAAM;EAE9C,IAAI,CAACJ,MAAM,CAACC,QAAQ,CAACC,KAAK,CAAC,EAAE;IAC3B,OAAOH,SAAS;EAClB;EAEA,IAAIZ,KAAK,CAACkB,QAAQ,KAAKN,SAAS,EAAE;IAChC,OAAOG,KAAK;EACd;EAEA,MAAMI,MAAM,GAAG,EAAE,IAAInB,KAAK,CAACkB,QAAQ;EAEnC,OAAOE,IAAI,CAACC,KAAK,CAACN,KAAK,GAAGI,MAAM,CAAC,GAAGA,MAAM;AAC5C,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["decodeMedicalFloat","HEX_ONLY","ASCII_ZERO","ASCII_NINE","HEX_BYTE","fromAsciiDigits","hex","codes","match","map","byte","parseInt","length","some","code","undefined","Number","join","toRaw","field","encoding","raw","bits","sign","createCustomFieldParser","assembledHex","toLowerCase","byteIndexes","test","isFinite","value","scale","offset","decimals","factor","Math","round"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/create-custom-field-parser.ts"],"mappings":";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
+ import { hasValidChecksum } from "./calculate-checksum.js";
3
4
  const byteAt = (pkg, index) => parseInt(pkg[index] ?? "0", 16);
4
5
  const announcedLength = (pkg, length) => {
5
6
  const bytes = [];
@@ -27,6 +28,14 @@ export const createFrameValidator = frame => pkg => {
27
28
  return false;
28
29
  }
29
30
  }
31
+
32
+ /**
33
+ * Checked before the length, because a corrupted buffer can carry a plausible length.
34
+ * A frame that fails here is discarded rather than decoded at a wrong value.
35
+ */
36
+ if (frame.checksum && !hasValidChecksum(pkg, frame.checksum)) {
37
+ return false;
38
+ }
30
39
  if (!frame.length) {
31
40
  return true;
32
41
  }
@@ -1 +1 @@
1
- {"version":3,"names":["byteAt","pkg","index","parseInt","announcedLength","length","bytes","i","widthBytes","push","ordered","byteOrder","reverse","reduce","total","byte","createFrameValidator","frame","minLengthBytes","header","toLowerCase","overheadBytes"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/create-frame-validator.ts"],"mappings":";;AAEA,MAAMA,MAAM,GAAGA,CAACC,GAAa,EAAEC,KAAa,KAC1CC,QAAQ,CAACF,GAAG,CAACC,KAAK,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC;AAEjC,MAAME,eAAe,GAAGA,CACtBH,GAAa,EACbI,MAA8C,KACnC;EACX,MAAMC,KAAe,GAAG,EAAE;EAE1B,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,MAAM,CAACG,UAAU,EAAED,CAAC,EAAE,EAAE;IAC1CD,KAAK,CAACG,IAAI,CAACT,MAAM,CAACC,GAAG,EAAEI,MAAM,CAACH,KAAK,GAAGK,CAAC,CAAC,CAAC;EAC3C;EAEA,MAAMG,OAAO,GAAGL,MAAM,CAACM,SAAS,KAAK,QAAQ,GAAGL,KAAK,CAACM,OAAO,CAAC,CAAC,GAAGN,KAAK;EAEvE,OAAOI,OAAO,CAACG,MAAM,CAAC,CAACC,KAAK,EAAEC,IAAI,KAAKD,KAAK,GAAG,GAAG,GAAGC,IAAI,EAAE,CAAC,CAAC;AAC/D,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,GAC9BC,KAAsB,IACtBhB,GAAa,IAAc;EAC1B,IAAIA,GAAG,CAACI,MAAM,GAAGY,KAAK,CAACC,cAAc,EAAE;IACrC,OAAO,KAAK;EACd;EAEA,MAAMC,MAAM,GAAGF,KAAK,CAACE,MAAM,IAAI,EAAE;EAEjC,KAAK,IAAIZ,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGY,MAAM,CAACd,MAAM,EAAEE,CAAC,EAAE,EAAE;IACtC,IAAI,CAACN,GAAG,CAACM,CAAC,CAAC,IAAI,EAAE,EAAEa,WAAW,CAAC,CAAC,KAAKD,MAAM,CAACZ,CAAC,CAAC,EAAE;MAC9C,OAAO,KAAK;IACd;EACF;EAEA,IAAI,CAACU,KAAK,CAACZ,MAAM,EAAE;IACjB,OAAO,IAAI;EACb;EAEA,OACEJ,GAAG,CAACI,MAAM,IACVY,KAAK,CAACZ,MAAM,CAACgB,aAAa,GAAGjB,eAAe,CAACH,GAAG,EAAEgB,KAAK,CAACZ,MAAM,CAAC;AAEnE,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["hasValidChecksum","byteAt","pkg","index","parseInt","announcedLength","length","bytes","i","widthBytes","push","ordered","byteOrder","reverse","reduce","total","byte","createFrameValidator","frame","minLengthBytes","header","toLowerCase","checksum","overheadBytes"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/create-frame-validator.ts"],"mappings":";;AAEA,SAASA,gBAAgB,QAAQ,yBAAsB;AAEvD,MAAMC,MAAM,GAAGA,CAACC,GAAa,EAAEC,KAAa,KAC1CC,QAAQ,CAACF,GAAG,CAACC,KAAK,CAAC,IAAI,GAAG,EAAE,EAAE,CAAC;AAEjC,MAAME,eAAe,GAAGA,CACtBH,GAAa,EACbI,MAA8C,KACnC;EACX,MAAMC,KAAe,GAAG,EAAE;EAE1B,KAAK,IAAIC,CAAC,G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AEgB,KAAK,CAACZ,MAAM,CAAC;AAEnE,CAAC","ignoreList":[]}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ const HEX_BYTE = /[0-9a-f]{2}/g;
4
+
5
+ /**
6
+ * Splits a hex string into the bytes it spells: "a508f7" -> ["a5","08","f7"].
7
+ *
8
+ * Anything that is not a pair of hex digits is dropped, so a malformed string yields a
9
+ * shorter command rather than a byte that is half a value. Both callers hand it hex that
10
+ * was already validated - a declaration checks it at registration, and a built frame is
11
+ * assembled a byte at a time - so the dropping is a floor, not a path anything relies on.
12
+ */
13
+ export const hexToBytes = hex => hex.toLowerCase().match(HEX_BYTE) ?? [];
14
+ //# sourceMappingURL=hex-to-bytes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["HEX_BYTE","hexToBytes","hex","toLowerCase","match"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/hex-to-bytes.ts"],"mappings":";;AAAA,MAAMA,QAAQ,GAAG,cAAc;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAIC,GAAW,IACpCA,GAAG,CAACC,WAAW,CAAC,CAAC,CAACC,KAAK,CAACJ,QAAQ,CAAC,IAAI,EAAE","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ const BYTE_MASK = 0xff;
4
+ const BYTE_BITS = 8;
5
+
6
+ /** Little-endian unsigned 32-bit: 0x0000000A -> [0x0a, 0x00, 0x00, 0x00]. */
7
+ export const le32ToBytes = value => [value & BYTE_MASK, value >> BYTE_BITS & BYTE_MASK, value >> BYTE_BITS * 2 & BYTE_MASK, value >> BYTE_BITS * 3 & BYTE_MASK];
8
+ //# sourceMappingURL=le-32-to-bytes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BYTE_MASK","BYTE_BITS","le32ToBytes","value"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/le-32-to-bytes.ts"],"mappings":";;AAAA,MAAMA,SAAS,GAAG,IAAI;AACtB,MAAMC,SAAS,GAAG,CAAC;;AAEnB;AACA,OAAO,MAAMC,WAAW,GAAIC,KAAa,IAAe,CACtDA,KAAK,GAAGH,SAAS,EAChBG,KAAK,IAAIF,SAAS,GAAID,SAAS,EAC/BG,KAAK,IAAKF,SAAS,GAAG,CAAE,GAAID,SAAS,EACrCG,KAAK,IAAKF,SAAS,GAAG,CAAE,GAAID,SAAS,CACvC","ignoreList":[]}
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
2
 
3
- export const parseMeasurement = (measurementInHex, parsingCase) => {
3
+ /**
4
+ * @param byteOffset added to every declared index, for a frame that repeats one record.
5
+ */
6
+ export const parseMeasurement = (measurementInHex, parsingCase, byteOffset = 0) => {
4
7
  const parserDefinitions = parsingCase.parseDefinitions;
5
8
  const result = parserDefinitions.reduce((acc, parserDefinition) => {
6
- const parsingValue = getFullValueForMeasurementProperty(measurementInHex, parserDefinition);
9
+ const parsingValue = getFullValueForMeasurementProperty(measurementInHex, parserDefinition, byteOffset);
7
10
  if (parserDefinition.customParserDefinition) {
8
11
  acc[parserDefinition.name] = parserDefinition.customParserDefinition(parsingValue);
9
12
  } else {
@@ -19,14 +22,14 @@ export const parseMeasurement = (measurementInHex, parsingCase) => {
19
22
  return measurement;
20
23
  };
21
24
 
22
- /** Example: We received message ["1A","02", "00", "50"]. Value for weight is on indexes 2,3. Which means we need to combine 2nd and 3rd indexes to get result
23
- * This method will combine them and return string "0050".
24
- * Indexes should be written in ParseDeinition
25
+ /** Example: We received message ["1A","02", "00", "50"]. Value for weight is on indexes 2,3. Which means we need to combine 2nd and 3rd indexes to get result
26
+ * This method will combine them and return string "0050".
27
+ * Indexes should be written in ParseDeinition
25
28
  */
26
- const getFullValueForMeasurementProperty = (messageInHex, parseDefinition) => {
29
+ const getFullValueForMeasurementProperty = (messageInHex, parseDefinition, byteOffset) => {
27
30
  let valuesInString = "";
28
31
  for (let i = 0; i < parseDefinition.byteIndexes.length; i++) {
29
- valuesInString += messageInHex[parseDefinition.byteIndexes[i] || "0"];
32
+ valuesInString += messageInHex[(parseDefinition.byteIndexes[i] ?? 0) + byteOffset];
30
33
  }
31
34
  return valuesInString;
32
35
  };