@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,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.supportedMeasurementTypeKeys = void 0;
7
+ /**
8
+ * The measurement types a device's declared services can produce.
9
+ *
10
+ * Read from the parsing cases rather than stated separately, so a device cannot advertise a
11
+ * measurement it has no case to decode, or omit one it does.
12
+ */
13
+ const supportedMeasurementTypeKeys = services => {
14
+ const declared = services.flatMap(service => service.monitorUuids.flatMap(monitor => monitor.parsingModel.cases.map(c => c.measurementTypeKey) || [])).filter(type => type !== undefined);
15
+ return [...new Set(declared.flat())];
16
+ };
17
+ exports.supportedMeasurementTypeKeys = supportedMeasurementTypeKeys;
18
+ //# sourceMappingURL=supported-measurement-type-keys.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["supportedMeasurementTypeKeys","services","declared","flatMap","service","monitorUuids","monitor","parsingModel","cases","map","c","measurementTypeKey","filter","type","undefined","Set","flat","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/supported-measurement-type-keys.ts"],"mappings":";;;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,4BAA4B,GACvCC,QAAuC,IACd;EACzB,MAAMC,QAAQ,GAAGD,QAAQ,CACtBE,OAAO,CAAEC,OAAO,IACfA,OAAO,CAACC,YAAY,CAACF,OAAO,CACzBG,OAAO,IACNA,OAAO,CAACC,YAAY,CAACC,KAAK,CAACC,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACC,kBAAkB,CAAC,IAAI,EACnE,CACF,CAAC,CACAC,MAAM,CAAEC,IAAI,IAAKA,IAAI,KAAKC,SAAS,CAAC;EAEvC,OAAO,CAAC,GAAG,IAAIC,GAAG,CAACb,QAAQ,CAACc,IAAI,CAAC,CAAC,CAAC,CAAC;AACtC,CAAC;AAACC,OAAA,CAAAjB,4BAAA,GAAAA,4BAAA","ignoreList":[]}
@@ -24,6 +24,8 @@ export const DEVICE_INSTRUCTION_PDFS = {
24
24
  [IntegratedDevices.CMED]: "",
25
25
  [IntegratedDevices.SP80B]: "",
26
26
  [IntegratedDevices.S5]: "",
27
- [IntegratedDevices.BGM]: ""
27
+ [IntegratedDevices.BGM]: "",
28
+ [IntegratedDevices.VEROVAL_DUO_CONTROL]: "",
29
+ [IntegratedDevices.VEROVAL_ECG]: ""
28
30
  };
29
31
  //# sourceMappingURL=device-instruction-pdfs.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["IntegratedDevices","pdfBaseUrl","DEVICE_INSTRUCTION_PDFS","BP2","F4","SPO2","PC60WF","ALIVE_COR","COSINUSS","AOJ20A","TAIDOC_GLUCOSE","GLUCOCHECK","CLEVERTEMP","FORATEMP","ANDESFITTEMP","FORA_SCALE","BC01","RPM_SCALE","CMED","SP80B","S5","BGM"],"sourceRoot":"../../../../../src","sources":["modules/bt-device/constants/device-instruction-pdfs.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,8BAAqB;;AAEvD;AACA;AACA,MAAMC,UAAU,GACd,2EAA2E;AAE7E,OAAO,MAAMC,uBAA0D,GAAG;EACxE,CAACF,iBAAiB,CAACG,GAAG,GAAG,GAAGF,UAAU,yBAAyB;EAC/D,CAACD,iBAAiB,CAACI,EAAE,GAAG,GAAGH,UAAU,yBAAyB;EAC9D,CAACD,iBAAiB,CAACK,IAAI,GAAG,GAAGJ,UAAU,yBAAyB;EAChE,CAACD,iBAAiB,CAACM,MAAM,GAAG,GAAGL,UAAU,2BAA2B;EACpE,CAACD,iBAAiB,CAACO,SAAS,GAAG,GAAGN,UAAU,sBAAsB;EAClE,CAACD,iBAAiB,CAACQ,QAAQ,GAAG,GAAGP,UAAU,sBAAsB;EACjE,CAACD,iBAAiB,CAACS,MAAM,GAAG,GAAGR,UAAU,oBAAoB;EAC7D,CAACD,iBAAiB,CAACU,cAAc,GAAG,GAAGT,UAAU,oBAAoB;EACrE,CAACD,iBAAiB,CAACW,UAAU,GAAG,GAAGV,UAAU,iBAAiB;EAC9D,CAACD,iBAAiB,CAACY,UAAU,GAAG,GAAGX,UAAU,oBAAoB;EACjE,CAACD,iBAAiB,CAACa,QAAQ,GAAG,GAAGZ,UAAU,gBAAgB;EAC3D,CAACD,iBAAiB,CAACc,YAAY,GAAG,GAAGb,UAAU,oBAAoB;EACnE,CAACD,iBAAiB,CAACe,UAAU,GAAG,GAAGd,UAAU,gBAAgB;EAC7D,CAACD,iBAAiB,CAACgB,IAAI,GAAG,GAAGf,UAAU,YAAY;EACnD,CAACD,iBAAiB,CAACiB,SAAS,GAAG,GAAGhB,UAAU,wBAAwB;EACpE,CAACD,iBAAiB,CAACkB,IAAI,GAAG,EAAE;EAC5B,CAAClB,iBAAiB,CAACmB,KAAK,GAAG,EAAE;EAC7B,CAACnB,iBAAiB,CAACoB,EAAE,GAAG,EAAE;EAC1B,CAACpB,iBAAiB,CAACqB,GAAG,GAAG;AAC3B,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["IntegratedDevices","pdfBaseUrl","DEVICE_INSTRUCTION_PDFS","BP2","F4","SPO2","PC60WF","ALIVE_COR","COSINUSS","AOJ20A","TAIDOC_GLUCOSE","GLUCOCHECK","CLEVERTEMP","FORATEMP","ANDESFITTEMP","FORA_SCALE","BC01","RPM_SCALE","CMED","SP80B","S5","BGM","VEROVAL_DUO_CONTROL","VEROVAL_ECG"],"sourceRoot":"../../../../../src","sources":["modules/bt-device/constants/device-instruction-pdfs.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,8BAAqB;;AAEvD;AACA;AACA,MAAMC,UAAU,GACd,2EAA2E;AAE7E,OAAO,MAAMC,uBAA0D,GAAG;EACxE,CAACF,iBAAiB,CAACG,GAAG,GAAG,GAAGF,UAAU,yBAAyB;EAC/D,CAACD,iBAAiB,CAACI,EAAE,GAAG,GAAGH,UAAU,yBAAyB;EAC9D,CAACD,iBAAiB,CAACK,IAAI,GAAG,GAAGJ,UAAU,yBAAyB;EAChE,CAACD,iBAAiB,CAACM,MAAM,GAAG,GAAGL,UAAU,2BAA2B;EACpE,CAACD,iBAAiB,CAACO,SAAS,GAAG,GAAGN,UAAU,sBAAsB;EAClE,CAACD,iBAAiB,CAACQ,QAAQ,GAAG,GAAGP,UAAU,sBAAsB;EACjE,CAACD,iBAAiB,CAACS,MAAM,GAAG,GAAGR,UAAU,oBAAoB;EAC7D,CAACD,iBAAiB,CAACU,cAAc,GAAG,GAAGT,UAAU,oBAAoB;EACrE,CAACD,iBAAiB,CAACW,UAAU,GAAG,GAAGV,UAAU,iBAAiB;EAC9D,CAACD,iBAAiB,CAACY,UAAU,GAAG,GAAGX,UAAU,oBAAoB;EACjE,CAACD,iBAAiB,CAACa,QAAQ,GAAG,GAAGZ,UAAU,gBAAgB;EAC3D,CAACD,iBAAiB,CAACc,YAAY,GAAG,GAAGb,UAAU,oBAAoB;EACnE,CAACD,iBAAiB,CAACe,UAAU,GAAG,GAAGd,UAAU,gBAAgB;EAC7D,CAACD,iBAAiB,CAACgB,IAAI,GAAG,GAAGf,UAAU,YAAY;EACnD,CAACD,iBAAiB,CAACiB,SAAS,GAAG,GAAGhB,UAAU,wBAAwB;EACpE,CAACD,iBAAiB,CAACkB,IAAI,GAAG,EAAE;EAC5B,CAAClB,iBAAiB,CAACmB,KAAK,GAAG,EAAE;EAC7B,CAACnB,iBAAiB,CAACoB,EAAE,GAAG,EAAE;EAC1B,CAACpB,iBAAiB,CAACqB,GAAG,GAAG,EAAE;EAC3B,CAACrB,iBAAiB,CAACsB,mBAAmB,GAAG,EAAE;EAC3C,CAACtB,iBAAiB,CAACuB,WAAW,GAAG;AACnC,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
 
3
3
  import { IntegratedDevices } from "../types/integrated-devices.js";
4
- export const integratedDevicesMap = new Map([[/^BP2 \d{4}$/, IntegratedDevices.BP2], [/^F4$/, IntegratedDevices.F4], [/^Oxyfit \d{4}$/, IntegratedDevices.SPO2], [/^OxySmart \d{4}$/, IntegratedDevices.PC60WF], [/^AOJ-20A$/, IntegratedDevices.AOJ20A], [/^TAIDOC TD4216(?: \w+)?$/, IntegratedDevices.TAIDOC_GLUCOSE], [/^GlucoCheck Gold$/, IntegratedDevices.GLUCOCHECK], [/^FORA IR20$/, IntegratedDevices.FORATEMP], [/^TEMP$/, IntegratedDevices.ANDESFITTEMP], [/^two$/, IntegratedDevices.COSINUSS], [/^cmed$/, IntegratedDevices.CMED], [/^BC01\d{4}$/, IntegratedDevices.BC01], [/^FORA W550$/, IntegratedDevices.FORA_SCALE], [/^GBS-2012-B$/, IntegratedDevices.RPM_SCALE], [/^TAIDOC TD1107$/, IntegratedDevices.CLEVERTEMP], [/^PULMO80BEXPGC\d{6}$/, IntegratedDevices.SP80B], [/^Le S5$/, IntegratedDevices.S5], [/^TeleBGM Gen1 BLE$/, IntegratedDevices.BGM]]);
4
+ export const integratedDevicesMap = new Map([[/^BP2 \d{4}$/, IntegratedDevices.BP2], [/^F4$/, IntegratedDevices.F4], [/^Oxyfit \d{4}$/, IntegratedDevices.SPO2], [/^OxySmart \d{4}$/, IntegratedDevices.PC60WF], [/^AOJ-20A$/, IntegratedDevices.AOJ20A], [/^TAIDOC TD4216(?: \w+)?$/, IntegratedDevices.TAIDOC_GLUCOSE], [/^GlucoCheck Gold$/, IntegratedDevices.GLUCOCHECK], [/^FORA IR20$/, IntegratedDevices.FORATEMP], [/^TEMP$/, IntegratedDevices.ANDESFITTEMP], [/^two$/, IntegratedDevices.COSINUSS], [/^cmed$/, IntegratedDevices.CMED], [/^BC01\d{4}$/, IntegratedDevices.BC01], [/^FORA W550$/, IntegratedDevices.FORA_SCALE], [/^GBS-2012-B$/, IntegratedDevices.RPM_SCALE], [/^TAIDOC TD1107$/, IntegratedDevices.CLEVERTEMP], [/^PULMO80BEXPGC\d{6}$/, IntegratedDevices.SP80B], [/^Le S5$/, IntegratedDevices.S5], [/^TeleBGM Gen1 BLE$/, IntegratedDevices.BGM], [/^Veroval duo control$/i, IntegratedDevices.VEROVAL_DUO_CONTROL], [/^Veroval ECG$/i, IntegratedDevices.VEROVAL_ECG]]);
5
5
  //# sourceMappingURL=integrated-devices-map.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["IntegratedDevices","integratedDevicesMap","Map","BP2","F4","SPO2","PC60WF","AOJ20A","TAIDOC_GLUCOSE","GLUCOCHECK","FORATEMP","ANDESFITTEMP","COSINUSS","CMED","BC01","FORA_SCALE","RPM_SCALE","CLEVERTEMP","SP80B","S5","BGM"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/constants/integrated-devices-map.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,gCAA6B;AAE/D,OAAO,MAAMC,oBAAoB,GAAG,IAAIC,GAAG,CAA4B,CACrE,CAAC,aAAa,EAAEF,iBAAiB,CAACG,GAAG,CAAC,EACtC,CAAC,MAAM,EAAEH,iBAAiB,CAACI,EAAE,CAAC,EAC9B,CAAC,gBAAgB,EAAEJ,iBAAiB,CAACK,IAAI,CAAC,EAC1C,CAAC,kBAAkB,EAAEL,iBAAiB,CAACM,MAAM,CAAC,EAC9C,CAAC,WAAW,EAAEN,iBAAiB,CAACO,MAAM,CAAC,EACvC,CAAC,0BAA0B,EAAEP,iBAAiB,CAACQ,cAAc,CAAC,EAC9D,CAAC,mBAAmB,EAAER,iBAAiB,CAACS,UAAU,CAAC,EACnD,CAAC,aAAa,EAAET,iBAAiB,CAACU,QAAQ,CAAC,EAC3C,CAAC,QAAQ,EAAEV,iBAAiB,CAACW,YAAY,CAAC,EAC1C,CAAC,OAAO,EAAEX,iBAAiB,CAACY,QAAQ,CAAC,EACrC,CAAC,QAAQ,EAAEZ,iBAAiB,CAACa,IAAI,CAAC,EAClC,CAAC,aAAa,EAAEb,iBAAiB,CAACc,IAAI,CAAC,EACvC,CAAC,aAAa,EAAEd,iBAAiB,CAACe,UAAU,CAAC,EAC7C,CAAC,cAAc,EAAEf,iBAAiB,CAACgB,SAAS,CAAC,EAC7C,CAAC,iBAAiB,EAAEhB,iBAAiB,CAACiB,UAAU,CAAC,EACjD,CAAC,sBAAsB,EAAEjB,iBAAiB,CAACkB,KAAK,CAAC,EACjD,CAAC,SAAS,EAAElB,iBAAiB,CAACmB,EAAE,CAAC,EACjC,CAAC,oBAAoB,EAAEnB,iBAAiB,CAACoB,GAAG,CAAC,CAC9C,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["IntegratedDevices","integratedDevicesMap","Map","BP2","F4","SPO2","PC60WF","AOJ20A","TAIDOC_GLUCOSE","GLUCOCHECK","FORATEMP","ANDESFITTEMP","COSINUSS","CMED","BC01","FORA_SCALE","RPM_SCALE","CLEVERTEMP","SP80B","S5","BGM","VEROVAL_DUO_CONTROL","VEROVAL_ECG"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/constants/integrated-devices-map.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,gCAA6B;AAE/D,OAAO,MAAMC,oBAAoB,GAAG,IAAIC,GAAG,CAA4B,CACrE,CAAC,aAAa,EAAEF,iBAAiB,CAACG,GAAG,CAAC,EACtC,CAAC,MAAM,EAAEH,iBAAiB,CAACI,EAAE,CAAC,EAC9B,CAAC,gBAAgB,EAAEJ,iBAAiB,CAACK,IAAI,CAAC,EAC1C,CAAC,kBAAkB,EAAEL,iBAAiB,CAACM,MAAM,CAAC,EAC9C,CAAC,WAAW,EAAEN,iBAAiB,CAACO,MAAM,CAAC,EACvC,CAAC,0BAA0B,EAAEP,iBAAiB,CAACQ,cAAc,CAAC,EAC9D,CAAC,mBAAmB,EAAER,iBAAiB,CAACS,UAAU,CAAC,EACnD,CAAC,aAAa,EAAET,iBAAiB,CAACU,QAAQ,CAAC,EAC3C,CAAC,QAAQ,EAAEV,iBAAiB,CAACW,YAAY,CAAC,EAC1C,CAAC,OAAO,EAAEX,iBAAiB,CAACY,QAAQ,CAAC,EACrC,CAAC,QAAQ,EAAEZ,iBAAiB,CAACa,IAAI,CAAC,EAClC,CAAC,aAAa,EAAEb,iBAAiB,CAACc,IAAI,CAAC,EACvC,CAAC,aAAa,EAAEd,iBAAiB,CAACe,UAAU,CAAC,EAC7C,CAAC,cAAc,EAAEf,iBAAiB,CAACgB,SAAS,CAAC,EAC7C,CAAC,iBAAiB,EAAEhB,iBAAiB,CAACiB,UAAU,CAAC,EACjD,CAAC,sBAAsB,EAAEjB,iBAAiB,CAACkB,KAAK,CAAC,EACjD,CAAC,SAAS,EAAElB,iBAAiB,CAACmB,EAAE,CAAC,EACjC,CAAC,oBAAoB,EAAEnB,iBAAiB,CAACoB,GAAG,CAAC,EAC7C,CAAC,wBAAwB,EAAEpB,iBAAiB,CAACqB,mBAAmB,CAAC,EACjE,CAAC,gBAAgB,EAAErB,iBAAiB,CAACsB,WAAW,CAAC,CAClD,CAAC","ignoreList":[]}
@@ -12,9 +12,12 @@ export * from "./types/custom-device-spec.js";
12
12
  export * from "./types/custom-field-encoding.js";
13
13
  export * from "./types/custom-field-spec.js";
14
14
  export * from "./types/custom-frame-spec.js";
15
+ export * from "./types/custom-lepu-spec.js";
15
16
  export * from "./types/custom-measurement.js";
16
17
  export * from "./types/custom-monitor-spec.js";
17
18
  export * from "./types/custom-service-spec.js";
19
+ export * from "./types/command-sequencer.js";
20
+ export * from "./types/device-command.js";
18
21
  export * from "./types/device-key.js";
19
22
  export * from "./types/device-key-of.js";
20
23
  export * from "./types/device-data.js";
@@ -32,6 +35,23 @@ export * from "./services/devices/bt-managed-device.js";
32
35
  export * from "./services/devices/custom/custom.device.js";
33
36
  export * from "./services/bt-manager.js";
34
37
  export * from "./services/custom/define-custom-device.js";
38
+ export * from "./services/devices/standard-gatt/standard-gatt.devices.js";
39
+ export * from "./services/devices/veroval/veroval.bp-monitors.js";
40
+ export * from "./services/devices/veroval/veroval.duo-control-device.js";
41
+ export * from "./services/devices/veroval/veroval.ecg-device.js";
42
+ export * from "./services/devices/veroval/veroval.ecg-samples.js";
43
+ export * from "./services/devices/lepu/lepu.transports.js";
44
+ export * from "./services/devices/aoj/aoj.thermometers.js";
45
+ export * from "./services/devices/viatom/viatom.bp-monitors.js";
46
+ export * from "./services/devices/viatom/viatom.oximeters.js";
47
+ export * from "./services/devices/viatom/viatom.ecg-recorders.js";
48
+ export * from "./services/devices/viatom/viatom.lepod.js";
49
+ export * from "./services/devices/lepu/lepu.device-names.js";
50
+ export * from "./services/devices/lepu/lepu.name-match.js";
51
+ export * from "./services/devices/lepu/lepu.commands.js";
52
+ export * from "./services/devices/lepu/lepu.device-info.js";
53
+ export * from "./services/devices/lepu/lepu.file-transfer.js";
54
+ export * from "./services/devices/lepu/lepu.response-type.js";
35
55
  export * from "./constants/measurement-field-catalog.js";
36
56
  export * from "./components/bt-provider.js";
37
57
  export * from "./components/default-permission-fallback.js";
@@ -1 +1 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/bt-management/index.ts"],"mappings":";;AAAA,cAAc,gCAA6B;AAC3C,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,6BAA0B;AACxC,cAAc,qCAAkC;AAChD,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,8BAA2B;AACzC,cAAc,+BAA4B;AAC1C,cAAc,gCAA6B;AAC3C,cAAc,gCAA6B;AAC3C,cAAc,uBAAoB;AAClC,cAAc,0BAAuB;AACrC,cAAc,wBAAqB;AACnC,cAAc,0BAAuB;AACrC,cAAc,+BAA4B;AAC1C,cAAc,6BAA0B;AACxC,cAAc,yBAAsB;AACpC,cAAc,0BAAuB;AACrC,cAAc,6BAA0B;AACxC,cAAc,sCAAmC;AACjD,cAAc,4BAAyB;AACvC,cAAc,2BAAwB;AACtC,cAAc,0CAAuC;AAErD,cAAc,yCAAsC;AACpD,cAAc,4CAAyC;AACvD,cAAc,0BAAuB;AACrC,cAAc,2CAAwC;AAEtD,cAAc,0CAAuC;AAErD,cAAc,6BAA0B;AACxC,cAAc,6CAA0C;AACxD,cAAc,oCAAiC","ignoreList":[]}
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/bt-management/index.ts"],"mappings":";;AAAA,cAAc,gCAA6B;AAC3C,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,6BAA0B;AACxC,cAAc,qCAAkC;AAChD,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,gCAA6B;AAC3C,cAAc,gCAA6B;AAC3C,cAAc,8BAA2B;AACzC,cAAc,2BAAwB;AACtC,cAAc,uBAAoB;AAClC,cAAc,0BAAuB;AACrC,cAAc,wBAAqB;AACnC,cAAc,0BAAuB;AACrC,cAAc,+BAA4B;AAC1C,cAAc,6BAA0B;AACxC,cAAc,yBAAsB;AACpC,cAAc,0BAAuB;AACrC,cAAc,6BAA0B;AACxC,cAAc,sCAAmC;AACjD,cAAc,4BAAyB;AACvC,cAAc,2BAAwB;AACtC,cAAc,0CAAuC;AAErD,cAAc,yCAAsC;AACpD,cAAc,4CAAyC;AACvD,cAAc,0BAAuB;AACrC,cAAc,2CAAwC;AACtD,cAAc,2DAAwD;AACtE,cAAc,mDAAgD;AAC9D,cAAc,0DAAuD;AACrE,cAAc,kDAA+C;AAC7D,cAAc,mDAAgD;AAC9D,cAAc,4CAAyC;AACvD,cAAc,4CAAyC;AACvD,cAAc,iDAA8C;AAC5D,cAAc,+CAA4C;AAC1D,cAAc,mDAAgD;AAC9D,cAAc,2CAAwC;AACtD,cAAc,8CAA2C;AACzD,cAAc,4CAAyC;AACvD,cAAc,0CAAuC;AACrD,cAAc,6CAA0C;AACxD,cAAc,+CAA4C;AAC1D,cAAc,+CAA4C;AAE1D,cAAc,0CAAuC;AAErD,cAAc,6BAA0B;AACxC,cAAc,6CAA0C;AACxD,cAAc,oCAAiC","ignoreList":[]}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ import { measurementFieldCatalog } from "../../constants/measurement-field-catalog.js";
4
+ import { createCustomFieldParser } from "../../utils/create-custom-field-parser.js";
5
+ import { compileCustomField } from "./compile-custom-field.js";
6
+ import { customDeviceError } from "./custom-device-error.js";
7
+ const registerField = (id, path, compiled, measurementTypeKey, fields) => {
8
+ const key = `${measurementTypeKey}:${compiled.name}`;
9
+ const existing = fields.get(key);
10
+ if (existing && (existing.min !== compiled.min || existing.max !== compiled.max)) {
11
+ throw customDeviceError(id, path, `declares ${compiled.name} with different bounds (${compiled.min}-${compiled.max}) than an earlier case (${existing.min}-${existing.max}); a property must mean the same thing in every frame`);
12
+ }
13
+ fields.set(key, compiled);
14
+ };
15
+
16
+ /**
17
+ * A reading must carry every property that makes it that measurement. A blood pressure
18
+ * without a diastolic is not a partial blood pressure, it is a clinical record of something
19
+ * the device never reported, so the declaration is refused rather than the reading dropped.
20
+ */
21
+ const assertRequiredFields = (id, path, declared, measurementTypeKey) => {
22
+ const catalog = measurementFieldCatalog[measurementTypeKey] ?? {};
23
+ const declaredNames = new Set(declared.map(field => field?.name));
24
+ const missing = Object.entries(catalog).filter(([name, field]) => field.required && !declaredNames.has(name)).map(([name]) => name);
25
+ if (missing.length > 0) {
26
+ throw customDeviceError(id, `${path}.fields`, `does not declare ${missing.join(", ")}, which ${measurementTypeKey} needs to be a complete reading`);
27
+ }
28
+ };
29
+ const compileFields = (id, path, declared, measurementTypeKey, minLengthBytes, fields, names) => declared.map((field, index) => {
30
+ if (names.has(field.name)) {
31
+ throw customDeviceError(id, `${path}.fields[${index}].name`, `"${field.name}" is declared twice in this frame; a property name must be unique across every reading the frame carries, because the decoded frame is one flat object`);
32
+ }
33
+ names.add(field.name);
34
+ const compiled = compileCustomField(id, `${path}.fields[${index}]`, field, measurementTypeKey, minLengthBytes);
35
+ registerField(id, path, compiled, measurementTypeKey, fields);
36
+ return {
37
+ name: compiled.name,
38
+ parseType: "custom",
39
+ byteIndexes: compiled.byteIndexes,
40
+ customParserDefinition: createCustomFieldParser(compiled)
41
+ };
42
+ });
43
+ export { assertRequiredFields, compileFields };
44
+ //# sourceMappingURL=compile-case-fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["measurementFieldCatalog","createCustomFieldParser","compileCustomField","customDeviceError","registerField","id","path","compiled","measurementTypeKey","fields","key","name","existing","get","min","max","set","assertRequiredFields","declared","catalog","declaredNames","Set","map","field","missing","Object","entries","filter","required","has","length","join","compileFields","minLengthBytes","names","index","add","parseType","byteIndexes","customParserDefinition"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-case-fields.ts"],"mappings":";;AAEA,SAASA,uBAAuB,QAAQ,8CAA2C;AAInF,SAASC,uBAAuB,QAAQ,2CAAwC;AAEhF,SAASC,kBAAkB,QAAQ,2BAAwB;AAC3D,SAASC,iBAAiB,QAAQ,0BAAuB;AAEzD,MAAMC,aAAa,GAAGA,CACpBC,EAAU,EACVC,IAAY,EACZC,QAA6B,EAC7BC,kBAAsC,EACtCC,MAAwC,KAC/B;EACT,MAAMC,GAAG,GAAG,GAAGF,kBAAkB,IAAID,QAAQ,CAACI,IAAI,EAAE;EACpD,MAAMC,QAAQ,GAAGH,MAAM,CAACI,GAAG,CAACH,GAAG,CAAC;EAEhC,IACEE,QAAQ,KACPA,QAAQ,CAACE,GAAG,KAAKP,QAAQ,CAACO,GAAG,IAAIF,QAAQ,CAACG,GAAG,KAAKR,QAAQ,CAACQ,GAAG,CAAC,EAChE;IACA,MAAMZ,iBAAiB,CACrBE,EAAE,EACFC,IAAI,EACJ,YAAYC,QAAQ,CAACI,IAAI,2BAA2BJ,QAAQ,CAACO,GAAG,IAAIP,QAAQ,CAACQ,GAAG,2BAA2BH,QAAQ,CAACE,GAAG,IAAIF,QAAQ,CAACG,GAAG,uDACzI,CAAC;EACH;EAEAN,MAAM,CAACO,GAAG,CAACN,GAAG,EAAEH,QAAQ,CAAC;AAC3B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMU,oBAAoB,GAAGA,CAC3BZ,EAAU,EACVC,IAAY,EACZY,QAA2B,EAC3BV,kBAAsC,KAC7B;EACT,MAAMW,OAAO,GAAGnB,uBAAuB,CAACQ,kBA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EAAEC,IAAI,EAAEC,QAAQ,EAAEC,kBAAkB,EAAEC,MAAM,CAAC;EAE7D,OAAO;IACLE,IAAI,EAAEJ,QAAQ,CAACI,IAAI;IACnB0B,SAAS,EAAE,QAAQ;IACnBC,WAAW,EAAE/B,QAAQ,CAAC+B,WAAW;IACjCC,sBAAsB,EAAEtC,uBAAuB,CAACM,QAAQ;EAC1D,CAAC;AACH,CAAC,CAAC;AAEJ,SAASU,oBAAoB,EAAEe,aAAa","ignoreList":[]}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ import { customDeviceError } from "./custom-device-error.js";
4
+
5
+ /**
6
+ * How long a frame of this shape is, which may be longer than the shortest the
7
+ * characteristic emits but never shorter: the selector chose this shape, so its own fields
8
+ * are the ones that have to fit.
9
+ */
10
+ const assertCaseLength = (id, path, caseSpec, frameMinLengthBytes) => {
11
+ const declared = caseSpec.minLengthBytes;
12
+ if (declared === undefined) {
13
+ return frameMinLengthBytes;
14
+ }
15
+ if (!Number.isInteger(declared) || declared < frameMinLengthBytes) {
16
+ throw customDeviceError(id, `${path}.minLengthBytes`, `is ${String(declared)}; it must be a whole number of bytes no smaller than frame.minLengthBytes (${frameMinLengthBytes})`);
17
+ }
18
+ return declared;
19
+ };
20
+
21
+ /**
22
+ * A frame that is a run of records, and how wide one is.
23
+ *
24
+ * The characteristic has to guarantee at least one whole record, otherwise a declaration
25
+ * whose fields all fit could still never decode anything.
26
+ */
27
+ const assertRepeatedRecords = (id, path, caseSpec, frameMinLengthBytes) => {
28
+ const declared = caseSpec.repeatedRecords;
29
+ if (!declared) {
30
+ return undefined;
31
+ }
32
+ const from = declared.from ?? 0;
33
+ if (!Number.isInteger(declared.recordBytes) || declared.recordBytes < 1) {
34
+ throw customDeviceError(id, `${path}.repeatedRecords.recordBytes`, `is ${String(declared.recordBytes)}; a record is a whole number of bytes, at least one`);
35
+ }
36
+ if (!Number.isInteger(from) || from < 0) {
37
+ throw customDeviceError(id, `${path}.repeatedRecords.from`, `is ${String(declared.from)}; it must be a byte offset of zero or more`);
38
+ }
39
+ if (from + declared.recordBytes > frameMinLengthBytes) {
40
+ throw customDeviceError(id, `${path}.repeatedRecords`, `needs ${from + declared.recordBytes} bytes for one record, which frame.minLengthBytes (${frameMinLengthBytes}) does not guarantee`);
41
+ }
42
+ return {
43
+ recordBytes: declared.recordBytes,
44
+ from
45
+ };
46
+ };
47
+ export { assertCaseLength, assertRepeatedRecords };
48
+ //# sourceMappingURL=compile-case-shape.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["customDeviceError","assertCaseLength","id","path","caseSpec","frameMinLengthBytes","declared","minLengthBytes","undefined","Number","isInteger","String","assertRepeatedRecords","repeatedRecords","from","recordBytes"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-case-shape.ts"],"mappings":";;AAEA,SAASA,iBAAiB,QAAQ,0BAAuB;;AAEzD;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CACvBC,EAAU,EACVC,IAAY,EACZC,QAAwB,EACxBC,mBAA2B,KAChB;EACX,MAAMC,QAAQ,GAAGF,QAAQ,CAACG,cAAc;EAExC,IAAID,QAAQ,KAAKE,SAAS,EAAE;IAC1B,OAAOH,mBAAmB;EAC5B;EAEA,IAAI,CAACI,MAAM,CAACC,SAAS,CAACJ,QAAQ,CAAC,IAAIA,QAAQ,GAAGD,mBAAmB,EAAE;IACjE,MAAML,iBAAiB,CACrBE,EAAE,EACF,GAAGC,IAAI,iBAAiB,EACxB,MAAMQ,MAAM,CAACL,QAAQ,CAAC,8EAA8ED,mBAAmB,GACzH,CAAC;EACH;EAEA,OAAOC,QAAQ;AACjB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,qBAAqB,GAAGA,CAC5BV,EAAU,EACVC,IAAY,EACZC,QAAwB,EACxBC,mBAA2B,KAC2B;EACtD,MAAMC,QAAQ,GAAGF,QAAQ,CAACS,eAAe;EAEzC,IAAI,CAACP,QAAQ,EAAE;IACb,OAAOE,SAAS;EAClB;EAEA,MAAMM,IAAI,GAAGR,QAAQ,CAACQ,IAAI,IAAI,CAAC;EAE/B,IAAI,CAACL,MAAM,CAACC,SAAS,CAACJ,QAAQ,CAACS,WAAW,CAAC,IAAIT,QAAQ,CAACS,WAAW,GAAG,CAAC,EAAE;IACvE,MAAMf,iBAAiB,CACrBE,EAAE,EACF,GAAGC,IAAI,8BAA8B,EACrC,MAAMQ,MAAM,CAACL,QAAQ,CAACS,WAAW,CAAC,qDACpC,CAAC;EACH;EAEA,IAAI,CAACN,MAAM,CAACC,SAAS,CAACI,IAAI,CAAC,IAAIA,IAAI,GAAG,CAAC,EAAE;IACvC,MAAMd,iBAAiB,CACrBE,EAAE,EACF,GAAGC,IAAI,uBAAuB,EAC9B,MAAMQ,MAAM,CAACL,QAAQ,CAACQ,IAAI,CAAC,4CAC7B,CAAC;EACH;EAEA,IAAIA,IAAI,GAAGR,QAAQ,CAACS,WAAW,GAAGV,mBAAmB,EAAE;IACrD,MAAML,iBAAiB,CACrBE,EAAE,EACF,GAAGC,IAAI,kBAAkB,EACzB,SAASW,IAAI,GAAGR,QAAQ,CAACS,WAAW,sDAAsDV,mBAAmB,sBAC/G,CAAC;EACH;EAEA,OAAO;IAAEU,WAAW,EAAET,QAAQ,CAACS,WAAW;IAAED;EAAK,CAAC;AACpD,CAAC;AAED,SAASb,gBAAgB,EAAEW,qBAAqB","ignoreList":[]}
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { measurementFieldCatalog } from "../../constants/measurement-field-catalog.js";
4
4
  import { CaseType } from "../../types/case-type.js";
5
- import { createCustomFieldParser } from "../../utils/create-custom-field-parser.js";
6
- import { compileCustomField } from "./compile-custom-field.js";
5
+ import { assertRequiredFields, compileFields } from "./compile-case-fields.js";
6
+ import { assertCaseLength, assertRepeatedRecords } from "./compile-case-shape.js";
7
7
  import { customDeviceError } from "./custom-device-error.js";
8
8
 
9
9
  /**
@@ -33,48 +33,34 @@ const assertMeasurementTypeKey = (id, path, caseSpec) => {
33
33
  }
34
34
  return key;
35
35
  };
36
- const registerField = (id, path, compiled, measurementTypeKey, fields) => {
37
- const key = `${measurementTypeKey}:${compiled.name}`;
38
- const existing = fields.get(key);
39
- if (existing && (existing.min !== compiled.min || existing.max !== compiled.max)) {
40
- throw customDeviceError(id, path, `declares ${compiled.name} with different bounds (${compiled.min}-${compiled.max}) than an earlier case (${existing.min}-${existing.max}); a property must mean the same thing in every frame`);
41
- }
42
- fields.set(key, compiled);
43
- };
44
36
 
45
37
  /**
46
- * A reading must carry every property that makes it that measurement. A blood pressure
47
- * without a diastolic is not a partial blood pressure, it is a clinical record of something
48
- * the device never reported, so the declaration is refused rather than the reading dropped.
38
+ * Every reading the frame carries, the declared one first.
39
+ *
40
+ * A frame reporting one measurement and a frame reporting six are the same shape here, so
41
+ * nothing downstream needs to know which it was reading.
49
42
  */
50
- const assertRequiredFields = (id, path, declared, measurementTypeKey) => {
51
- const catalog = measurementFieldCatalog[measurementTypeKey] ?? {};
52
- const declaredNames = new Set(declared.map(field => field?.name));
53
- const missing = Object.entries(catalog).filter(([name, field]) => field.required && !declaredNames.has(name)).map(([name]) => name);
54
- if (missing.length > 0) {
55
- throw customDeviceError(id, `${path}.fields`, `does not declare ${missing.join(", ")}, which ${measurementTypeKey} needs to be a complete reading`);
43
+ const declaredMeasurements = (id, path, caseSpec, measurementTypeKey) => {
44
+ const additional = caseSpec.additionalMeasurements ?? [];
45
+ if (!Array.isArray(additional)) {
46
+ throw customDeviceError(id, `${path}.additionalMeasurements`, "must be an array of further readings this frame carries");
56
47
  }
57
- };
58
- const compileFields = (id, path, declared, measurementTypeKey, minLengthBytes, fields) => {
59
- const names = new Set();
60
- return declared.map((field, index) => {
61
- if (names.has(field.name)) {
62
- throw customDeviceError(id, `${path}.fields[${index}].name`, `"${field.name}" is declared twice in this case`);
48
+ return [{
49
+ path,
50
+ measurement: {
51
+ measurementTypeKey,
52
+ fields: caseSpec.fields ?? []
63
53
  }
64
- names.add(field.name);
65
- const compiled = compileCustomField(id, `${path}.fields[${index}]`, field, measurementTypeKey, minLengthBytes);
66
- registerField(id, path, compiled, measurementTypeKey, fields);
67
- return {
68
- name: compiled.name,
69
- parseType: "custom",
70
- byteIndexes: compiled.byteIndexes,
71
- customParserDefinition: createCustomFieldParser(compiled)
72
- };
73
- });
54
+ }, ...additional.map((measurement, index) => ({
55
+ path: `${path}.additionalMeasurements[${index}]`,
56
+ measurement
57
+ }))];
74
58
  };
75
59
 
76
60
  /** Validates one declared frame shape and turns it into a parsing case. */
77
61
  export const compileCustomCase = (id, path, caseSpec, minLengthBytes, fields) => {
62
+ const caseMinLengthBytes = assertCaseLength(id, path, caseSpec, minLengthBytes);
63
+ const repeatedRecords = assertRepeatedRecords(id, path, caseSpec, minLengthBytes);
78
64
  const caseType = CASE_TYPES[caseSpec.kind];
79
65
  if (!caseType) {
80
66
  throw customDeviceError(id, `${path}.kind`, `is "${String(caseSpec.kind)}"; expected ${Object.keys(CASE_TYPES).join(", ")}`);
@@ -82,7 +68,7 @@ export const compileCustomCase = (id, path, caseSpec, minLengthBytes, fields) =>
82
68
  const measurementTypeKey = assertMeasurementTypeKey(id, path, caseSpec);
83
69
  const declared = caseSpec.fields ?? [];
84
70
  if (caseSpec.kind !== "result") {
85
- if (declared.length > 0) {
71
+ if (declared.length > 0 || caseSpec.additionalMeasurements) {
86
72
  throw customDeviceError(id, path, 'declares fields, but fields may be declared on only a "result" case');
87
73
  }
88
74
  return {
@@ -97,16 +83,42 @@ export const compileCustomCase = (id, path, caseSpec, minLengthBytes, fields) =>
97
83
  throw customDeviceError(id, path, 'is a "result" case and must declare at least one field');
98
84
  }
99
85
 
100
- // Every field is checked first, so a misspelt property is reported as the typo it is
101
- // rather than as the required property it failed to satisfy.
102
- const parseDefinitions = compileFields(id, path, declared, measurementTypeKey, minLengthBytes, fields);
103
- assertRequiredFields(id, path, declared, measurementTypeKey);
86
+ /** Shared, so a property declared under two readings in one frame is refused. */
87
+ const names = new Set();
88
+ const parseDefinitions = [];
89
+ const measurements = [];
90
+ declaredMeasurements(id, path, caseSpec, measurementTypeKey).forEach(({
91
+ path: measurementPath,
92
+ measurement
93
+ }) => {
94
+ const key = assertMeasurementTypeKey(id, measurementPath, {
95
+ ...measurement,
96
+ kind: "result",
97
+ selector: caseSpec.selector
98
+ });
99
+ if (!key || (measurement.fields ?? []).length === 0) {
100
+ throw customDeviceError(id, measurementPath, "is a reading and must declare at least one field");
101
+ }
102
+
103
+ // Every field is checked first, so a misspelt property is reported as the typo it is
104
+ // rather than as the required property it failed to satisfy.
105
+ parseDefinitions.push(...compileFields(id, measurementPath, measurement.fields, key, repeatedRecords?.recordBytes ?? caseMinLengthBytes, fields, names));
106
+ assertRequiredFields(id, measurementPath, measurement.fields, key);
107
+ measurements.push({
108
+ measurementTypeKey: key,
109
+ fieldNames: measurement.fields.map(field => field.name)
110
+ });
111
+ });
104
112
  return {
105
113
  measurementTypeKey,
106
114
  caseType,
107
115
  caseValue: String(caseSpec.selector ?? "").toLowerCase(),
108
116
  parseDefinitions,
109
- description: caseSpec.description
117
+ description: caseSpec.description,
118
+ measurements,
119
+ ...(repeatedRecords ? {
120
+ repeatedRecords
121
+ } : {})
110
122
  };
111
123
  };
112
124
  //# sourceMappingURL=compile-custom-case.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["measurementFieldCatalog","CaseType","createCustomFieldParser","compileCustomField","customDeviceError","CASE_TYPES","result","DEPENDENT","stream","STREAM","idle","OTHER","assertMeasurementTypeKey","id","path","caseSpec","key","measurementTypeKey","undefined","kind","Object","keys","join","registerField","compiled","fields","name","existing","get","min","max","set","assertRequiredFields","declared","catalog","declaredNames","Set","map","field","missing","entries","filter","required","has","length","compileFields","minLengthBytes","names","index","add","parseType","byteIndexes","customParserDefinition","compileCustomCase","caseType","String","caseValue","selector","toLowerCase","parseDefinitions","description"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-case.ts"],"mappings":";;AAEA,SAASA,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","assertRequiredFields","compileFields","assertCaseLength","assertRepeatedRecords","customDeviceError","CASE_TYPES","result","DEPENDENT","stream","STREAM","idle","OTHER","assertMeasurementTypeKey","id","path","caseSpec","key","measurementTypeKey","undefined","kind","Object","keys","join","declaredMeasurements","additional","additionalMeasurements","Array","isArray","measurement","fields","map","index","compileCustomCase","minLengthBytes","caseMinLengthBytes","repeatedRecords","caseType","String","declared","length","caseValue","selector","toLowerCase","parseDefinitions","description","names","Set","measurements","forEach","measurementPath","push","recordBytes","fieldNames","field","name"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-case.ts"],"mappings":";;AAEA,SAASA,uBAAuB,QAAQ,8CAA2C;AACnF,SAASC,QAAQ,QAAQ,0BAAuB;AAQhD,SACEC,oBAAoB,EACpBC,aAAa,QACR,0BAAuB;AAC9B,SACEC,gBAAgB,EAChBC,qBAAqB,QAChB,yBAAsB;AAC7B,SAASC,iBAAiB,QAAQ,0BAAuB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAoD,GAAG;EAC3DC,MAAM,EAAEP,QAAQ,CAACQ,SAAS;EAC1BC,MAAM,EAAET,QAAQ,CAACU,MAAM;EACvBC,IAAI,EAAEX,QAAQ,CAACY;AACjB,CAAC;AAED,MAAMC,wBAAwB,GAAGA,CAC/BC,EAAU,EACVC,IAAY,EACZC,QAAwB,KACW;EACnC,MAAMC,GAAG,GAAGD,QAAQ,CAACE,kBAAkB;EAEvC,IAAID,GAAG,KAAKE,SAAS,EAAE;IACrB,IAAIH,QAAQ,CAACI,IAAI,KAAK,QAAQ,EAAE;MAC9B,MAAMf,iBAAiB,CACrBS,EAAE,EACF,GAAGC,IAAI,qBAAqB,EAC5B,gCACF,CAAC;IACH;IAEA,OAAOI,SAAS;EAClB;EAEA,IAAI,CAACpB,uBAAuB,CAACkB,GAAG,CAAC,EAAE;IACjC,MAAMZ,iBAAiB,CACrBS,EAAE,EACF,GAAGC,IAAI,qB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xD,GAAGrB,WAAW;MACdT,IAAI,EAAE,QAAQ;MACdsB,QAAQ,EAAE1B,QAAQ,CAAC0B;IACrB,CAAC,CAAC;IAEF,IAAI,CAACzB,GAAG,IAAI,CAACY,WAAW,CAACC,MAAM,IAAI,EAAE,EAAEU,MAAM,KAAK,CAAC,EAAE;MACnD,MAAMnC,iBAAiB,CACrBS,EAAE,EACFoC,eAAe,EACf,kDACF,CAAC;IACH;;IAEA;IACA;IACAN,gBAAgB,CAACO,IAAI,CACnB,GAAGjD,aAAa,CACdY,EAAE,EACFoC,eAAe,EACfrB,WAAW,CAACC,MAAM,EAClBb,GAAG,EACHmB,eAAe,EAAEgB,WAAW,IAAIjB,kBAAkB,EAClDL,MAAM,EACNgB,KACF,CACF,CAAC;IAED7C,oBAAoB,CAACa,EAAE,EAAEoC,eAAe,EAAErB,WAAW,CAACC,MAAM,EAAEb,GAAG,CAAC;IAElE+B,YAAY,CAACG,IAAI,CAAC;MAChBjC,kBAAkB,EAAED,GAAG;MACvBoC,UAAU,EAAExB,WAAW,CAACC,MAAM,CAACC,GAAG,CAAEuB,KAAK,IAAKA,KAAK,CAACC,IAAI;IAC1D,CAAC,CAAC;EACJ,CACF,CAAC;EAED,OAAO;IACLrC,kBAAkB;IAClBmB,QAAQ;IACRI,SAAS,EAAEH,MAAM,CAACtB,QAAQ,CAAC0B,QAAQ,IAAI,EAAE,CAAC,CAACC,WAAW,CAAC,CAAC;IACxDC,gBAAgB;IAChBC,WAAW,EAAE7B,QAAQ,CAAC6B,WAAW;IACjCG,YAAY;IACZ,IAAIZ,eAAe,GAAG;MAAEA;IAAgB,CAAC,GAAG,CAAC,CAAC;EAChD,CAAC;AACH,CAAC","ignoreList":[]}
@@ -16,6 +16,9 @@ const assertByteIndexes = (id, path, field, minLengthBytes) => {
16
16
  throw customDeviceError(id, `${path}.byteIndexes`, "reads the same byte twice");
17
17
  }
18
18
  const encoding = field.encoding ?? "uint";
19
+ if (encoding === "ascii" && field.byteOrder === "little") {
20
+ throw customDeviceError(id, `${path}.byteOrder`, 'is "little" on an "ascii" field; decimal digits read left to right, so reversing them would turn 120 into 21');
21
+ }
19
22
  const required = WIDTHS[encoding];
20
23
  if (required !== undefined && indexes.length !== required) {
21
24
  throw customDeviceError(id, `${path}.encoding`, `"${encoding}" needs exactly ${required} bytes, but ${indexes.length} byte index(es) are declared`);
@@ -1 +1 @@
1
- {"version":3,"names":["measurementFieldCatalog","customDeviceError","MAX_INTEGER_BYTES","WIDTHS","sfloat","float","assertByteIndexes","id","path","field","minLengthBytes","indexes","byteIndexes","Array","isArray","length","some","i","Number","isInteger","Set","size","encoding","required","undefined","outOfFrame","filter","assertArithmetic","scale","isFinite","offset","decimals","compileCustomField","measurementTypeKey","catalog","known","name","Object","keys","join","unit","min","max","byteOrder","reverse"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-field.ts"],"mappings":";;AAEA,SAASA,uBAAuB,QAAQ,8CAA2C;AAInF,SAASC,iBAAiB,QAAQ,0BAAuB;AAEzD,MAAMC,iBAAiB,GAAG,CAAC;AAE3B,MAAMC,MAAgE,GAAG;EACvEC,MAAM,EAAE,CAAC;EACTC,KAAK,EAAE;AACT,CAAC;AAED,MAAMC,iBAAiB,GAAGA,CACxBC,EAAU,EACVC,IAAY,EACZC,KAAsB,EACtBC,cAAsB,KACb;EACT,MAAMC,OAAO,GAAGF,KAAK,CAACG,WAAW;EAEjC,IACE,CAACC,KAAK,CAACC,OAAO,CAACH,OAAO,CAAC,IACvBA,OAAO,CAACI,MAAM,KAAK,CAAC,IACpBJ,OAAO,CAACK,IAAI,CAAEC,CAAC,IAAK,CAACC,MAAM,CAACC,SAAS,CAACF,CAAC,CAAC,IAAIA,CAAC,GAAG,CAAC,CAAC,EAClD;IACA,MAAMhB,iBAAiB,CACrBM,EAAE,EACF,GAAGC,IAAI,cAAc,EACrB,0EACF,CAAC;EACH;EAEA,IAAI,IAAIY,GAAG,CAACT,OAAO,CAAC,CAACU,IAAI,K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B,MAAM,IAAI,CAAC;IACzBC,QAAQ,EAAEtB,KAAK,CAACsB,QAAQ;IACxBS,IAAI,EAAEL,KAAK,CAACK,IAAI;IAChBC,GAAG;IACHC;EACF,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["measurementFieldCatalog","customDeviceError","MAX_INTEGER_BYTES","WIDTHS","sfloat","float","assertByteIndexes","id","path","field","minLengthBytes","indexes","byteIndexes","Array","isArray","length","some","i","Number","isInteger","Set","size","encoding","byteOrder","required","undefined","outOfFrame","filter","assertArithmetic","scale","isFinite","offset","decimals","compileCustomField","measurementTypeKey","catalog","known","name","Object","keys","join","unit","min","max","reverse"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-field.ts"],"mappings":";;AAEA,SAASA,uBAAuB,QAAQ,8CAA2C;AAInF,SAASC,iBAAiB,QAAQ,0BAAuB;AAEzD,MAAMC,iBAAiB,GAAG,CAAC;AAE3B,MAAMC,MAAgE,GAAG;EACvEC,MAAM,EAAE,CAAC;EACTC,KAAK,EAAE;AACT,CAAC;AAED,MAAMC,iBAAiB,GAAGA,CACxBC,EAAU,EACVC,IAAY,EACZC,KAAsB,EACtBC,cAAsB,KACb;EACT,MAAMC,OAAO,GAAGF,KAAK,CAACG,WAAW;EAEjC,IACE,CAACC,KAAK,CAACC,OAAO,CAACH,OAAO,CAAC,IACvBA,OAAO,CAACI,MAAM,KAAK,CAAC,IACpBJ,OAAO,CAACK,IAAI,CAAEC,CAAC,IAAK,CAACC,MAAM,CAACC,SAAS,CAACF,CAAC,CAAC,IAAIA,CAAC,GAAG,CAAC,CAAC,EAClD;IACA,MAAMhB,iBAAiB,CACrBM,EAAE,EACF,GAAGC,IAAI,cAAc,EACrB,0EACF,CAAC;EACH;EAEA,IAAI,IAAIY,GAAG,CAACT,OAAO,CAAC,CAACU,IAAI,KAAKV,OAAO,CAACI,MAAM,EAAE;IAC5C,MAAMd,iBAAiB,CACrBM,EAAE,EACF,GAAGC,IAAI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,EAAEpB,KAAK,CAACoB,KAAK,IAAI,CAAC;IACvBE,MAAM,EAAEtB,KAAK,CAACsB,MAAM,IAAI,CAAC;IACzBC,QAAQ,EAAEvB,KAAK,CAACuB,QAAQ;IACxBS,IAAI,EAAEL,KAAK,CAACK,IAAI;IAChBC,GAAG;IACHC;EACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1,8 +1,47 @@
1
1
  "use strict";
2
2
 
3
+ import { isChecksumAlgorithm } from "../../utils/calculate-checksum.js";
3
4
  import { customDeviceError } from "./custom-device-error.js";
4
5
  const HEX_BYTE = /^[0-9a-f]{2}$/;
5
6
 
7
+ /**
8
+ * Checks a checksum declaration against the frame it belongs to.
9
+ *
10
+ * Every byte it reads must be inside minLengthBytes, for the same reason field offsets are:
11
+ * a checksum verified against bytes the frame does not guarantee are present would pass on
12
+ * a truncated buffer and reject a whole one.
13
+ */
14
+ const compileChecksum = (id, path, minLengthBytes, checksum) => {
15
+ if (!isChecksumAlgorithm(checksum.algorithm)) {
16
+ throw customDeviceError(id, `${path}.algorithm`, 'must be one of "crc8", "xor" or "sum"');
17
+ }
18
+ if (!Number.isInteger(checksum.index) || checksum.index < 0) {
19
+ throw customDeviceError(id, `${path}.index`, "must be a byte offset of at least 0");
20
+ }
21
+ if (checksum.index >= minLengthBytes) {
22
+ throw customDeviceError(id, `${path}.index`, `reads byte ${checksum.index}, which frame.minLengthBytes (${minLengthBytes}) does not guarantee is present`);
23
+ }
24
+ const from = checksum.from ?? 0;
25
+ if (!Number.isInteger(from) || from < 0) {
26
+ throw customDeviceError(id, `${path}.from`, "must be a byte offset of at least 0");
27
+ }
28
+ const byteCount = checksum.byteCount ?? checksum.index - from;
29
+ if (!Number.isInteger(byteCount) || byteCount < 1) {
30
+ throw customDeviceError(id, `${path}.byteCount`, "must cover at least one byte");
31
+ }
32
+ if (from + byteCount > minLengthBytes) {
33
+ throw customDeviceError(id, `${path}.byteCount`, `covers bytes ${from}-${from + byteCount - 1}, which frame.minLengthBytes (${minLengthBytes}) does not guarantee are present`);
34
+ }
35
+ if (checksum.index >= from && checksum.index < from + byteCount) {
36
+ throw customDeviceError(id, `${path}.index`, `is inside the bytes it covers (${from}-${from + byteCount - 1}), so it could never match`);
37
+ }
38
+ return Object.freeze({
39
+ ...checksum,
40
+ from,
41
+ byteCount
42
+ });
43
+ };
44
+
6
45
  /**
7
46
  * Checks that a frame declaration can actually recognise a complete package, and returns a
8
47
  * frozen, lower-cased copy of it.
@@ -29,11 +68,15 @@ export const compileCustomFrame = (id, path, frame) => {
29
68
  if (header.length > minLengthBytes) {
30
69
  throw customDeviceError(id, `${path}.header`, `is ${header.length} bytes, which does not fit inside minLengthBytes (${minLengthBytes})`);
31
70
  }
71
+ const checksum = frame.checksum ? compileChecksum(id, `${path}.checksum`, minLengthBytes, frame.checksum) : undefined;
32
72
  const length = frame.length;
33
73
  if (!length) {
34
74
  return Object.freeze({
35
75
  header: Object.freeze(header),
36
- minLengthBytes
76
+ minLengthBytes,
77
+ ...(checksum ? {
78
+ checksum
79
+ } : {})
37
80
  });
38
81
  }
39
82
  if (!Number.isInteger(length.index) || length.index < 0) {
@@ -53,7 +96,10 @@ export const compileCustomFrame = (id, path, frame) => {
53
96
  minLengthBytes,
54
97
  length: Object.freeze({
55
98
  ...length
56
- })
99
+ }),
100
+ ...(checksum ? {
101
+ checksum
102
+ } : {})
57
103
  });
58
104
  };
59
105
  //# sourceMappingURL=compile-custom-frame.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["customDeviceError","HEX_BYTE","compileCustomFrame","id","path","frame","minLengthBytes","Number","isInteger","declaredHeader","header","Array","isArray","map","byte","String","toLowerCase","some","test","length","Object","freeze","index","widthBytes","overheadBytes"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-frame.ts"],"mappings":";;AAEA,SAASA,iBAAiB,QAAQ,0BAAuB;AAEzD,MAAMC,QAAQ,GAAG,eAAe;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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AACW,MAAM,CAACG,KAAK,CAAC,IAAIH,MAAM,CAACG,KAAK,GAAG,CAAC,EAAE;IACvD,MAAMtB,iBAAiB,CACrBG,EAAE,EACF,GAAGC,IAAI,eAAe,EACtB,qCACF,CAAC;EACH;EAEA,IAAIe,MAAM,CAACI,UAAU,KAAK,CAAC,IAAIJ,MAAM,CAACI,UAAU,KAAK,CAAC,EAAE;IACtD,MAAMvB,iBAAiB,CAACG,EAAE,EAAE,GAAGC,IAAI,oBAAoB,EAAE,gBAAgB,CAAC;EAC5E;EAEA,IAAI,CAACG,MAAM,CAACC,SAAS,CAACW,MAAM,CAACK,aAAa,CAAC,IAAIL,MAAM,CAACK,aAAa,GAAG,CAAC,EAAE;IACvE,MAAMxB,iBAAiB,CACrBG,EAAE,EACF,GAAGC,IAAI,uBAAuB,EAC9B,sCACF,CAAC;EACH;EAEA,IAAIe,MAAM,CAACG,KAAK,GAAGH,MAAM,CAACI,UAAU,GAAGjB,cAAc,EAAE;IACrD,MAAMN,iBAAiB,CACrBG,EAAE,EACF,GAAGC,IAAI,SAAS,EAChB,eAAee,MAAM,CAACG,KAAK,IAAIH,MAAM,CAACG,KAAK,GAAGH,MAAM,CAACI,UAAU,GAAG,CAAC,iCAAiCjB,cAAc,kCACpH,CAAC;EACH;EAEA,OAAOc,MAAM,CAACC,MAAM,CAAC;IACnBX,MAAM,EAAEU,MAAM,CAACC,MAAM,CAACX,MAAM,CAAa;IACzCJ,cAAc;IACda,MAAM,EAAEC,MAAM,CAACC,MAAM,CAAC;MAAE,GAAGF;IAAO,CAAC;EACrC,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["isChecksumAlgorithm","customDeviceError","HEX_BYTE","compileChecksum","id","path","minLengthBytes","checksum","algorithm","Number","isInteger","index","from","byteCount","Object","freeze","compileCustomFrame","frame","declaredHeader","header","Array","isArray","map","byte","String","toLowerCase","some","test","length","undefined","widthBytes","overheadBytes"],"sourceRoot":"../../../../../../src","sources":["modules/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