@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
@@ -1 +1 @@
1
- {"version":3,"names":["_measurementFieldCatalog","require","_caseType","_createCustomFieldParser","_compileCustomField","_customDeviceError","CASE_TYPES","result","CaseType","DEPENDENT","stream","STREAM","idle","OTHER","assertMeasurementTypeKey","id","path","caseSpec","key","measurementTypeKey","undefined","kind","customDeviceError","measurementFieldCatalog","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","compileCustomField","parseType","byteIndexes","customParserDefinition","createCustomFieldParser","compileCustomCase","caseType","String","caseValue","selector","toLowerCase","parseDefinitions","description","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-case.ts"],"mappings":";;;;;;AAEA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAMA,IAAAE,wBAAA,GAAAF,OAAA;AAEA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,UAAoD,GAAG;EAC3DC,MAAM,EAAEC,kBAAQ,CAACC,SAAS;EAC1BC,MAAM,EAAEF,kBAAQ,CAACG,MAAM;EACvBC,IAAI,EAAEJ,kBAAQ,CAACK;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,MAAM,IAAAC,oCAAiB,EACrBP,EAAE,EACF,GAAGC,IAAI,qBAAqB,EAC5B,gCACF,CAAC;IACH;IAEA,OAAOI,SAAS;EAClB;EAEA,IAAI,CAACG,gDAAuB,CAACL,GAAG,CAAC,EAAE;IACjC,MAAM,IAAAI,oCAAiB,EACrBP,EAAE,EACF,GAAGC,IAAI,qBAAqB,EAC5B,IAAIE,GAAG,6HAA6HM,MAAM,CAACC,IAAI,CAC7IF,gDACF,CAAC,CAACG,IAAI,CAAC,IAAI,CAAC,EACd,CAAC;EACH;EAEA,OAAOR,GAAG;AACZ,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CAACrB,EAAE,EAAEC,IAAI,EAAEqB,QAAQ,EAAElB,kBAAkB,CAAC;EAE5D,OAAO;IACLA,kBAAkB;IAClByC,QAAQ;IACRE,SAAS,EAAED,MAAM,CAAC5C,QAAQ,CAAC8C,QAAQ,IAAI,EAAE,CAAC,CAACC,WAAW,CAAC,CAAC;IACxDC,gBAAgB;IAChBC,WAAW,EAAEjD,QAAQ,CAACiD;EACxB,CAAC;AACH,CAAC;AAACC,OAAA,CAAAR,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_measurementFieldCatalog","require","_caseType","_compileCaseFields","_compileCaseShape","_customDeviceError","CASE_TYPES","result","CaseType","DEPENDENT","stream","STREAM","idle","OTHER","assertMeasurementTypeKey","id","path","caseSpec","key","measurementTypeKey","undefined","kind","customDeviceError","measurementFieldCatalog","Object","keys","join","declaredMeasurements","additional","additionalMeasurements","Array","isArray","measurement","fields","map","index","compileCustomCase","minLengthBytes","caseMinLengthBytes","assertCaseLength","repeatedRecords","assertRepeatedRecords","caseType","String","declared","length","caseValue","selector","toLowerCase","parseDefinitions","description","names","Set","measurements","forEach","measurementPath","push","compileFields","recordBytes","assertRequiredFields","fieldNames","field","name","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-case.ts"],"mappings":";;;;;;AAEA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAQA,IAAAE,kBAAA,GAAAF,OAAA;AAIA,IAAAG,iBAAA,GAAAH,OAAA;AAIA,IAAAI,kBAAA,GAAAJ,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMK,UAAoD,GAAG;EAC3DC,MAAM,EAAEC,kBAAQ,CAACC,SAAS;EAC1BC,MAAM,EAAEF,kBAAQ,CAACG,MAAM;EACvBC,IAAI,EAAEJ,kBAAQ,CAACK;AACjB,CAAC;AAED,MAAMC,wBAAwB,GAAGA,CAC/BC,EAAU,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kBAAkB;IAClBuB,QAAQ;IACRI,SAAS,EAAEH,MAAM,CAAC1B,QAAQ,CAAC8B,QAAQ,IAAI,EAAE,CAAC,CAACC,WAAW,CAAC,CAAC;IACxDC,gBAAgB;IAChBC,WAAW,EAAEjC,QAAQ,CAACiC,WAAW;IACjCG,YAAY;IACZ,IAAIb,eAAe,GAAG;MAAEA;IAAgB,CAAC,GAAG,CAAC,CAAC;EAChD,CAAC;AACH,CAAC;AAACuB,OAAA,CAAA3B,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -20,6 +20,9 @@ const assertByteIndexes = (id, path, field, minLengthBytes) => {
20
20
  throw (0, _customDeviceError.customDeviceError)(id, `${path}.byteIndexes`, "reads the same byte twice");
21
21
  }
22
22
  const encoding = field.encoding ?? "uint";
23
+ if (encoding === "ascii" && field.byteOrder === "little") {
24
+ throw (0, _customDeviceError.customDeviceError)(id, `${path}.byteOrder`, 'is "little" on an "ascii" field; decimal digits read left to right, so reversing them would turn 120 into 21');
25
+ }
23
26
  const required = WIDTHS[encoding];
24
27
  if (required !== undefined && indexes.length !== required) {
25
28
  throw (0, _customDeviceError.customDeviceError)(id, `${path}.encoding`, `"${encoding}" needs exactly ${required} bytes, but ${indexes.length} byte index(es) are declared`);
@@ -1 +1 @@
1
- {"version":3,"names":["_measurementFieldCatalog","require","_customDeviceError","MAX_INTEGER_BYTES","WIDTHS","sfloat","float","assertByteIndexes","id","path","field","minLengthBytes","indexes","byteIndexes","Array","isArray","length","some","i","Number","isInteger","customDeviceError","Set","size","encoding","required","undefined","outOfFrame","filter","assertArithmetic","scale","isFinite","offset","decimals","compileCustomField","measurementTypeKey","catalog","measurementFieldCatalog","known","name","Object","keys","join","unit","min","max","byteOrder","reverse","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-field.ts"],"mappings":";;;;;;AAEA,IAAAA,wBAAA,GAAAC,OAAA;AAIA,IAAAC,kBAAA,GAAAD,OAAA;AAEA,MAAME,iBAAiB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KAAK,CAACO,GAAG,EAAE;IACtC,MAAM,IAAAxB,oCAAiB,EACrBb,EAAE,EACF,GAAGC,IAAI,EAAE,EACT,YAAYmC,GAAG,IAAIC,GAAG,IAAIP,KAAK,CAACK,IAAI,6CAA6CjC,KAAK,CAAC6B,IAAI,KAAKD,KAAK,CAACM,GAAG,IAAIN,KAAK,CAACO,GAAG,IAAIP,KAAK,CAACK,IAAI,GACtI,CAAC;EACH;EAEA,MAAM/B,OAAO,GAAG,CAAC,GAAGF,KAAK,CAACG,WAAW,CAAC;EAEtC,OAAO;IACL0B,IAAI,EAAE7B,KAAK,CAAC6B,IAAI;IAChB1B,WAAW,EAAEH,KAAK,CAACoC,SAAS,KAAK,QAAQ,GAAGlC,OAAO,CAACmC,OAAO,CAAC,CAAC,GAAGnC,OAAO;IACvEY,QAAQ,EAAEd,KAAK,CAACc,QAAQ,IAAI,MAAM;IAClCM,KAAK,EAAEpB,KAAK,CAACoB,KAAK,IAAI,CAAC;IACvBE,MAAM,EAAEtB,KAAK,CAACsB,MAAM,IAAI,CAAC;IACzBC,QAAQ,EAAEvB,KAAK,CAACuB,QAAQ;IACxBU,IAAI,EAAEL,KAAK,CAACK,IAAI;IAChBC,GAAG;IACHC;EACF,CAAC;AACH,CAAC;AAACG,OAAA,CAAAd,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_measurementFieldCatalog","require","_customDeviceError","MAX_INTEGER_BYTES","WIDTHS","sfloat","float","assertByteIndexes","id","path","field","minLengthBytes","indexes","byteIndexes","Array","isArray","length","some","i","Number","isInteger","customDeviceError","Set","size","encoding","byteOrder","required","undefined","outOfFrame","filter","assertArithmetic","scale","isFinite","offset","decimals","compileCustomField","measurementTypeKey","catalog","measurementFieldCatalog","known","name","Object","keys","join","unit","min","max","reverse","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-field.ts"],"mappings":";;;;;;AAEA,IAAAA,wBAAA,GAAAC,OAAA;AAIA,IA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CAAC,IAAID,GAAG,IAAIC,GAAG,EAAE;IAChE,MAAM,IAAAzB,oCAAiB,EACrBb,EAAE,EACF,GAAGC,IAAI,EAAE,EACT,gBAAgBoC,GAAG,YAAYC,GAAG,yBACpC,CAAC;EACH;EAEA,IAAID,GAAG,GAAGN,KAAK,CAACM,GAAG,IAAIC,GAAG,GAAGP,KAAK,CAACO,GAAG,EAAE;IACtC,MAAM,IAAAzB,oCAAiB,EACrBb,EAAE,EACF,GAAGC,IAAI,EAAE,EACT,YAAYoC,GAAG,IAAIC,GAAG,IAAIP,KAAK,CAACK,IAAI,6CAA6ClC,KAAK,CAAC8B,IAAI,KAAKD,KAAK,CAACM,GAAG,IAAIN,KAAK,CAACO,GAAG,IAAIP,KAAK,CAACK,IAAI,GACtI,CAAC;EACH;EAEA,MAAMhC,OAAO,GAAG,CAAC,GAAGF,KAAK,CAACG,WAAW,CAAC;EAEtC,OAAO;IACL2B,IAAI,EAAE9B,KAAK,CAAC8B,IAAI;IAChB3B,WAAW,EAAEH,KAAK,CAACe,SAAS,KAAK,QAAQ,GAAGb,OAAO,CAACmC,OAAO,CAAC,CAAC,GAAGnC,OAAO;IACvEY,QAAQ,EAAEd,KAAK,CAACc,QAAQ,IAAI,MAAM;IAClCO,KAAK,EAAErB,KAAK,CAACqB,KAAK,IAAI,CAAC;IACvBE,MAAM,EAAEvB,KAAK,CAACuB,MAAM,IAAI,CAAC;IACzBC,QAAQ,EAAExB,KAAK,CAACwB,QAAQ;IACxBU,IAAI,EAAEL,KAAK,CAACK,IAAI;IAChBC,GAAG;IACHC;EACF,CAAC;AACH,CAAC;AAACE,OAAA,CAAAb,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -4,9 +4,48 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.compileCustomFrame = void 0;
7
+ var _calculateChecksum = require("../../utils/calculate-checksum.js");
7
8
  var _customDeviceError = require("./custom-device-error.js");
8
9
  const HEX_BYTE = /^[0-9a-f]{2}$/;
9
10
 
11
+ /**
12
+ * Checks a checksum declaration against the frame it belongs to.
13
+ *
14
+ * Every byte it reads must be inside minLengthBytes, for the same reason field offsets are:
15
+ * a checksum verified against bytes the frame does not guarantee are present would pass on
16
+ * a truncated buffer and reject a whole one.
17
+ */
18
+ const compileChecksum = (id, path, minLengthBytes, checksum) => {
19
+ if (!(0, _calculateChecksum.isChecksumAlgorithm)(checksum.algorithm)) {
20
+ throw (0, _customDeviceError.customDeviceError)(id, `${path}.algorithm`, 'must be one of "crc8", "xor" or "sum"');
21
+ }
22
+ if (!Number.isInteger(checksum.index) || checksum.index < 0) {
23
+ throw (0, _customDeviceError.customDeviceError)(id, `${path}.index`, "must be a byte offset of at least 0");
24
+ }
25
+ if (checksum.index >= minLengthBytes) {
26
+ throw (0, _customDeviceError.customDeviceError)(id, `${path}.index`, `reads byte ${checksum.index}, which frame.minLengthBytes (${minLengthBytes}) does not guarantee is present`);
27
+ }
28
+ const from = checksum.from ?? 0;
29
+ if (!Number.isInteger(from) || from < 0) {
30
+ throw (0, _customDeviceError.customDeviceError)(id, `${path}.from`, "must be a byte offset of at least 0");
31
+ }
32
+ const byteCount = checksum.byteCount ?? checksum.index - from;
33
+ if (!Number.isInteger(byteCount) || byteCount < 1) {
34
+ throw (0, _customDeviceError.customDeviceError)(id, `${path}.byteCount`, "must cover at least one byte");
35
+ }
36
+ if (from + byteCount > minLengthBytes) {
37
+ throw (0, _customDeviceError.customDeviceError)(id, `${path}.byteCount`, `covers bytes ${from}-${from + byteCount - 1}, which frame.minLengthBytes (${minLengthBytes}) does not guarantee are present`);
38
+ }
39
+ if (checksum.index >= from && checksum.index < from + byteCount) {
40
+ throw (0, _customDeviceError.customDeviceError)(id, `${path}.index`, `is inside the bytes it covers (${from}-${from + byteCount - 1}), so it could never match`);
41
+ }
42
+ return Object.freeze({
43
+ ...checksum,
44
+ from,
45
+ byteCount
46
+ });
47
+ };
48
+
10
49
  /**
11
50
  * Checks that a frame declaration can actually recognise a complete package, and returns a
12
51
  * frozen, lower-cased copy of it.
@@ -33,11 +72,15 @@ const compileCustomFrame = (id, path, frame) => {
33
72
  if (header.length > minLengthBytes) {
34
73
  throw (0, _customDeviceError.customDeviceError)(id, `${path}.header`, `is ${header.length} bytes, which does not fit inside minLengthBytes (${minLengthBytes})`);
35
74
  }
75
+ const checksum = frame.checksum ? compileChecksum(id, `${path}.checksum`, minLengthBytes, frame.checksum) : undefined;
36
76
  const length = frame.length;
37
77
  if (!length) {
38
78
  return Object.freeze({
39
79
  header: Object.freeze(header),
40
- minLengthBytes
80
+ minLengthBytes,
81
+ ...(checksum ? {
82
+ checksum
83
+ } : {})
41
84
  });
42
85
  }
43
86
  if (!Number.isInteger(length.index) || length.index < 0) {
@@ -57,7 +100,10 @@ const compileCustomFrame = (id, path, frame) => {
57
100
  minLengthBytes,
58
101
  length: Object.freeze({
59
102
  ...length
60
- })
103
+ }),
104
+ ...(checksum ? {
105
+ checksum
106
+ } : {})
61
107
  });
62
108
  };
63
109
  exports.compileCustomFrame = compileCustomFrame;
@@ -1 +1 @@
1
- {"version":3,"names":["_customDeviceError","require","HEX_BYTE","compileCustomFrame","id","path","frame","minLengthBytes","Number","isInteger","customDeviceError","declaredHeader","header","Array","isArray","map","byte","String","toLowerCase","some","test","length","Object","freeze","index","widthBytes","overheadBytes","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-frame.ts"],"mappings":";;;;;;AAEA,IAAAA,kBAAA,GAAAC,OAAA;AAEA,MAAMC,QAAQ,GAAG,eAAe;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,kBAAkB,GAAGA,CAChCC,EAAU,EACVC,IAAY,EACZC,KAAsB,KACF;EACpB,MAAMC,cAAc,GAAGD,KAAK,EAAEC,cAAc;EAE5C,IAAI,CAACC,MAAM,CAACC,SAAS,CAACF,cAAc,CAAC,IAAIA,cAAc,GAAG,CAAC,EAAE;IAC3D,MAA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IJ,MAAM,CAACI,UAAU,KAAK,CAAC,EAAE;IACtD,MAAM,IAAAf,oCAAiB,EAACN,EAAE,EAAE,GAAGC,IAAI,oBAAoB,EAAE,gBAAgB,CAAC;EAC5E;EAEA,IAAI,CAACG,MAAM,CAACC,SAAS,CAACY,MAAM,CAACK,aAAa,CAAC,IAAIL,MAAM,CAACK,aAAa,GAAG,CAAC,EAAE;IACvE,MAAM,IAAAhB,oCAAiB,EACrBN,EAAE,EACF,GAAGC,IAAI,uBAAuB,EAC9B,sCACF,CAAC;EACH;EAEA,IAAIgB,MAAM,CAACG,KAAK,GAAGH,MAAM,CAACI,UAAU,GAAGlB,cAAc,EAAE;IACrD,MAAM,IAAAG,oCAAiB,EACrBN,EAAE,EACF,GAAGC,IAAI,SAAS,EAChB,eAAegB,MAAM,CAACG,KAAK,IAAIH,MAAM,CAACG,KAAK,GAAGH,MAAM,CAACI,UAAU,GAAG,CAAC,iCAAiClB,cAAc,kCACpH,CAAC;EACH;EAEA,OAAOe,MAAM,CAACC,MAAM,CAAC;IACnBX,MAAM,EAAEU,MAAM,CAACC,MAAM,CAACX,MAAM,CAAa;IACzCL,cAAc;IACdc,MAAM,EAAEC,MAAM,CAACC,MAAM,CAAC;MAAE,GAAGF;IAAO,CAAC;EACrC,CAAC,CAAC;AACJ,CAAC;AAACM,OAAA,CAAAxB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_calculateChecksum","require","_customDeviceError","HEX_BYTE","compileChecksum","id","path","minLengthBytes","checksum","isChecksumAlgorithm","algorithm","customDeviceError","Number","isInteger","index","from","byteCount","Object","freeze","compileCustomFrame","frame","declaredHeader","header","Array","isArray","map","byte","String","toLowerCase","some","test","length","undefined","widthBytes","overheadBytes","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-frame.ts"],"mappings":";;;;;;AAEA,IAAAA,kBAAA,GAAAC,OAAA;AAEA,IAAAC,kBAAA,GAAAD,OAAA;AAEA,M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CAAC,IAAIH,MAAM,CAACG,aAAa,GAAG,CAAC,EAAE;IACvE,MAAM,IAAAvB,oCAAiB,EACrBN,EAAE,EACF,GAAGC,IAAI,uBAAuB,EAC9B,sCACF,CAAC;EACH;EAEA,IAAIyB,MAAM,CAACjB,KAAK,GAAGiB,MAAM,CAACE,UAAU,GAAG1B,cAAc,EAAE;IACrD,MAAM,IAAAI,oCAAiB,EACrBN,EAAE,EACF,GAAGC,IAAI,SAAS,EAChB,eAAeyB,MAAM,CAACjB,KAAK,IAAIiB,MAAM,CAACjB,KAAK,GAAGiB,MAAM,CAACE,UAAU,GAAG,CAAC,iCAAiC1B,cAAc,kCACpH,CAAC;EACH;EAEA,OAAOU,MAAM,CAACC,MAAM,CAAC;IACnBI,MAAM,EAAEL,MAAM,CAACC,MAAM,CAACI,MAAM,CAAa;IACzCf,cAAc;IACdwB,MAAM,EAAEd,MAAM,CAACC,MAAM,CAAC;MAAE,GAAGa;IAAO,CAAC,CAAC;IACpC,IAAIvB,QAAQ,GAAG;MAAEA;IAAS,CAAC,GAAG,CAAC,CAAC;EAClC,CAAC,CAAC;AACJ,CAAC;AAAC2B,OAAA,CAAAhB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.compileCustomLepu = void 0;
7
+ var _customDeviceError = require("./custom-device-error.js");
8
+ var _normalizeBleUuid = require("./normalize-ble-uuid.js");
9
+ const HEX_BYTE = /^[0-9a-f]{2}$/;
10
+ const MAX_OPCODE = 0xff;
11
+ const MAX_DEVICE_TYPE = 0xffff;
12
+ const assertStartBytes = (id, startBytes) => {
13
+ if (!Array.isArray(startBytes) || startBytes.length === 0) {
14
+ throw (0, _customDeviceError.customDeviceError)(id, "lepu.startBytes", "must list at least one frame start byte, such as [\"a5\"]");
15
+ }
16
+ return startBytes.map((byte, index) => {
17
+ const normalized = String(byte).toLowerCase();
18
+ if (!HEX_BYTE.test(normalized)) {
19
+ throw (0, _customDeviceError.customDeviceError)(id, `lepu.startBytes[${index}]`, `is "${String(byte)}"; it must be exactly two hex digits`);
20
+ }
21
+ return normalized;
22
+ });
23
+ };
24
+ const assertDeviceTypes = (id, deviceTypes) => {
25
+ if (!Array.isArray(deviceTypes)) {
26
+ throw (0, _customDeviceError.customDeviceError)(id, "lepu.expectedDeviceTypes", "must be an array of the model numbers this declaration was written for");
27
+ }
28
+ return deviceTypes.map((deviceType, index) => {
29
+ if (!Number.isInteger(deviceType) || deviceType < 0 || deviceType > MAX_DEVICE_TYPE) {
30
+ throw (0, _customDeviceError.customDeviceError)(id, `lepu.expectedDeviceTypes[${index}]`, `is ${String(deviceType)}; a model number is a whole number between 0 and ${MAX_DEVICE_TYPE}`);
31
+ }
32
+ return deviceType;
33
+ });
34
+ };
35
+
36
+ /**
37
+ * The opcode to poll with, once the device has been identified.
38
+ *
39
+ * Identification is the advertised name unless `expectedDeviceTypes` narrows it further.
40
+ * The name is what the vendor's own SDK binds every one of its products on - a 732-line
41
+ * cascade of name checks resolving to 176 models - so requiring more than that to poll at
42
+ * all would hold this SDK to a bar the hardware's own maker does not meet, and would leave
43
+ * every device undeclarable.
44
+ *
45
+ * Naming the models is still the stronger declaration, and is worth doing once the numbers
46
+ * are known: the family's low opcodes act, and a frame built for the wrong product is still
47
+ * well formed, so a name that matched the wrong hardware would not be caught by anything
48
+ * else in the protocol.
49
+ */
50
+ const assertPollCommand = (id, lepu) => {
51
+ const {
52
+ pollCommand
53
+ } = lepu;
54
+ if (pollCommand === undefined) {
55
+ return undefined;
56
+ }
57
+ if (!Number.isInteger(pollCommand) || pollCommand < 0 || pollCommand > MAX_OPCODE) {
58
+ throw (0, _customDeviceError.customDeviceError)(id, "lepu.pollCommand", `is ${String(pollCommand)}; an opcode is a whole number between 0 and ${MAX_OPCODE}`);
59
+ }
60
+ return pollCommand;
61
+ };
62
+
63
+ /**
64
+ * Validates the Lepu declaration and normalises its UUIDs.
65
+ *
66
+ * The write service has to be one the declaration already monitors: a command written to a
67
+ * service the device never opened is accepted by nothing and answered by nothing, which
68
+ * looks exactly like hardware that is simply not responding.
69
+ */
70
+ const compileCustomLepu = (id, spec, serviceUuids) => {
71
+ const lepu = spec.lepu;
72
+ if (!lepu) {
73
+ return undefined;
74
+ }
75
+ if (spec.services.some(service => service.write)) {
76
+ throw (0, _customDeviceError.customDeviceError)(id, "services[].write", "cannot be declared alongside lepu, which builds its own commands and addresses them through lepu.write");
77
+ }
78
+ const startBytes = assertStartBytes(id, lepu.startBytes);
79
+ const expectedDeviceTypes = assertDeviceTypes(id, lepu.expectedDeviceTypes);
80
+ const pollCommand = assertPollCommand(id, lepu);
81
+ const serviceUuid = (0, _normalizeBleUuid.normalizeBleUuid)(id, "lepu.write.serviceUuid", lepu.write?.serviceUuid);
82
+ if (!serviceUuids.includes(serviceUuid)) {
83
+ throw (0, _customDeviceError.customDeviceError)(id, "lepu.write.serviceUuid", `is "${serviceUuid}", which this device does not declare among its services`);
84
+ }
85
+ return {
86
+ startBytes,
87
+ expectedDeviceTypes,
88
+ ...(pollCommand === undefined ? {} : {
89
+ pollCommand
90
+ }),
91
+ write: {
92
+ serviceUuid,
93
+ characteristicUuid: (0, _normalizeBleUuid.normalizeBleUuid)(id, "lepu.write.characteristicUuid", lepu.write?.characteristicUuid)
94
+ }
95
+ };
96
+ };
97
+ exports.compileCustomLepu = compileCustomLepu;
98
+ //# sourceMappingURL=compile-custom-lepu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_customDeviceError","require","_normalizeBleUuid","HEX_BYTE","MAX_OPCODE","MAX_DEVICE_TYPE","assertStartBytes","id","startBytes","Array","isArray","length","customDeviceError","map","byte","index","normalized","String","toLowerCase","test","assertDeviceTypes","deviceTypes","deviceType","Number","isInteger","assertPollCommand","lepu","pollCommand","undefined","compileCustomLepu","spec","serviceUuids","services","some","service","write","expectedDeviceTypes","serviceUuid","normalizeBleUuid","includes","characteristicUuid","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-lepu.ts"],"mappings":";;;;;;AAGA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAEA,MAAME,QAAQ,GAAG,eAAe;AAChC,MAAMC,UAAU,GAAG,IAAI;AACvB,MAAMC,eAAe,GAAG,MAAM;AAE9B,MAAMC,gBAAgB,GAAGA,CAACC,EAAU,EAAEC,UAAmB,KAAe;EACtE,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,UAAU,CAAC,IAAIA,UAAU,CAACG,MAAM,KAAK,CAAC,EAAE;IACzD,MAAM,IAAAC,oCAAiB,EACrBL,EAAE,EACF,iBAAiB,EACjB,2DACF,CAAC;EACH;EAEA,OAAOC,UAAU,CAACK,GAAG,CAAC,CAACC,IAAI,EAAEC,KAAK,KAAK;IACrC,MAAMC,UAAU,GAAGC,MAAM,CAACH,IAAI,CAAC,CAACI,WAAW,CAAC,CAAC;IAE7C,IAAI,CAACf,QAAQ,CAACgB,IAAI,CAACH,UAAU,CAAC,EAAE;MAC9B,MAAM,IAAAJ,oCAAiB,EACrBL,EAAE,EACF,mBAAmBQ,KAAK,GAAG,EAC3B,OAAOE,MAAM,CAACH,IAAI,CAAC,sCACrB,CAAC;IACH;IAEA,OAAOE,UAAU;EACnB,CAAC,CAAC;AACJ,CAAC;AAED,MAAMI,iBAAiB,GAAGA,CAACb,EAAU,EAAEc,WAAoB,KAAe;EACxE,IAAI,CAACZ,KAAK,CAACC,OAAO,CAACW,WAAW,CAAC,EAAE;IAC/B,MAAM,IAAAT,oCAAiB,EACrBL,EAAE,EACF,0BAA0B,EAC1B,wEACF,CAAC;EACH;EAEA,OAAOc,WAAW,CAACR,GAAG,CAAC,CAACS,UAAU,EAAEP,KAAK,KAAK;IAC5C,IACE,CAACQ,MAAM,CAACC,SAAS,CAACF,UAAU,CAAC,IAC5BA,UAAU,GAAc,CAAC,IACzBA,UAAU,GAAcjB,eA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B,IAAI,CAACU,mBAAmB,CAAC;EAC3E,MAAMT,WAAW,GAAGF,iBAAiB,CAAClB,EAAE,EAAEmB,IAAI,CAAC;EAE/C,MAAMW,WAAW,GAAG,IAAAC,kCAAgB,EAClC/B,EAAE,EACF,wBAAwB,EACxBmB,IAAI,CAACS,KAAK,EAAEE,WACd,CAAC;EAED,IAAI,CAACN,YAAY,CAACQ,QAAQ,CAACF,WAAW,CAAC,EAAE;IACvC,MAAM,IAAAzB,oCAAiB,EACrBL,EAAE,EACF,wBAAwB,EACxB,OAAO8B,WAAW,0DACpB,CAAC;EACH;EAEA,OAAO;IACL7B,UAAU;IACV4B,mBAAmB;IACnB,IAAIT,WAAW,KAAKC,SAAS,GAAG,CAAC,CAAC,GAAG;MAAED;IAAY,CAAC,CAAC;IACrDQ,KAAK,EAAE;MACLE,WAAW;MACXG,kBAAkB,EAAE,IAAAF,kCAAgB,EAClC/B,EAAE,EACF,+BAA+B,EAC/BmB,IAAI,CAACS,KAAK,EAAEK,kBACd;IACF;EACF,CAAC;AACH,CAAC;AAACC,OAAA,CAAAZ,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -6,11 +6,16 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.defineCustomDevice = void 0;
7
7
  var _customDeviceBrand = require("../../constants/custom-device-brand.js");
8
8
  var _integratedDevices = require("../../types/integrated-devices.js");
9
+ var _compileCustomLepu = require("./compile-custom-lepu.js");
9
10
  var _compileCustomMonitor = require("./compile-custom-monitor.js");
10
11
  var _customDeviceError = require("./custom-device-error.js");
11
12
  var _normalizeBleUuid = require("./normalize-ble-uuid.js");
12
13
  const MIN_STUCK_TIMEOUT_MS = 1_000;
13
14
 
15
+ /** The smallest MTU a BLE link has, and the largest an ATT packet may declare. */
16
+ const MIN_MTU = 23;
17
+ const MAX_MTU = 517;
18
+
14
19
  // The SDK's own F4 scale waits this long, because it sleeps while still connected.
15
20
  const MAX_STUCK_TIMEOUT_MS = 6_000_000;
16
21
  const HEX_BYTES = /^([0-9a-f]{2})+$/;
@@ -46,6 +51,16 @@ const assertStuckTimeout = (id, spec) => {
46
51
  }
47
52
  return timeout;
48
53
  };
54
+ const assertPreferredMtu = (id, spec) => {
55
+ const mtu = spec.preferredMtu;
56
+ if (mtu === undefined) {
57
+ return undefined;
58
+ }
59
+ if (!Number.isInteger(mtu) || mtu < MIN_MTU || mtu > MAX_MTU) {
60
+ throw (0, _customDeviceError.customDeviceError)(id, "preferredMtu", `is ${String(mtu)}; it must be a whole number between ${MIN_MTU} and ${MAX_MTU}`);
61
+ }
62
+ return mtu;
63
+ };
49
64
  const compileWrite = (id, path, write) => {
50
65
  if (!write) {
51
66
  return undefined;
@@ -72,6 +87,7 @@ const defineCustomDevice = spec => {
72
87
  const id = assertIdentity(spec);
73
88
  const nameMatch = compileNameMatch(id, spec);
74
89
  const stuckDataTimeout = assertStuckTimeout(id, spec);
90
+ const preferredMtu = assertPreferredMtu(id, spec);
75
91
  if (!Array.isArray(spec.services) || spec.services.length === 0) {
76
92
  throw (0, _customDeviceError.customDeviceError)(id, "services", "must declare at least one service");
77
93
  }
@@ -105,6 +121,7 @@ const defineCustomDevice = spec => {
105
121
  writeUuid: compileWrite(id, path, service.write)
106
122
  };
107
123
  });
124
+ const lepu = (0, _compileCustomLepu.compileCustomLepu)(id, spec, mainServices.map(service => service.uuid));
108
125
  return {
109
126
  [_customDeviceBrand.CUSTOM_DEVICE_BRAND]: true,
110
127
  id: id,
@@ -113,7 +130,13 @@ const defineCustomDevice = spec => {
113
130
  mainServices,
114
131
  stuckDataTimeout,
115
132
  fields,
116
- frames
133
+ frames,
134
+ ...(preferredMtu === undefined ? {} : {
135
+ preferredMtu
136
+ }),
137
+ ...(lepu === undefined ? {} : {
138
+ lepu
139
+ })
117
140
  };
118
141
  };
119
142
  exports.defineCustomDevice = defineCustomDevice;
@@ -1 +1 @@
1
- {"version":3,"names":["_customDeviceBrand","require","_integratedDevices","_compileCustomMonitor","_customDeviceError","_normalizeBleUuid","MIN_STUCK_TIMEOUT_MS","MAX_STUCK_TIMEOUT_MS","HEX_BYTES","assertIdentity","spec","id","trim","customDeviceError","String","builtIn","Object","values","IntegratedDevices","find","name","toLowerCase","compileNameMatch","nameMatch","RegExp","global","sticky","exact","replace","assertStuckTimeout","timeout","stuckDataTimeoutMs","Number","isInteger","compileWrite","path","write","undefined","commandHex","test","uuid","normalizeBleUuid","mainCommandUuid","defineCustomDevice","stuckDataTimeout","Array","isArray","services","length","fields","Map","frames","seenCharacteristics","Set","mainServices","map","service","serviceIndex","monitor","monitorUuids","monitorIndex","monitorPath","characteristic","frame","compileCustomMonitor","has","add","set","writeUuid","CUSTOM_DEVICE_BRAND","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/define-custom-device.ts"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAMA,IAAAC,kBAAA,GAAAD,OAAA;AAGA,IAAAE,qBAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAEA,MAAMK,oBAAoB,GAAG,KAAK;;AAElC;AACA,MAAMC,oBAAoB,GAAG,SAAS;AACtC,MAAMC,SAAS,GAAG,kBAAkB;AAEpC,MAAMC,cAAc,GAAIC,IAAsB,IAAa;EACzD,MAAMC,EAAE,GAAG,OAAOD,IAAI,EAAEC,EAAE,KAAK,QAAQ,GAAGD,IAAI,CAACC,EAAE,CAACC,IAAI,CAAC,CAAC,GAAG,EAAE;EAE7D,IAAI,CAACD,EAAE,EAAE;IACP,MAAM,IAAAE,oCAAiB,EAACC,MAAM,CAACJ,IAAI,EAAEC,EAAE,CAAC,EAAE,IAAI,EAAE,mBAAmB,CAAC;EACtE;EAEA,MAAMI,OAAO,GAAGC,MAAM,CAACC,MAAM,CAACC,oCAAiB,CAAC,CAACC,IAAI,CAClDC,IAAI,IAAKA,IAAI,CAACC,WAAW,CAAC,CAAC,KAAKV,EAAE,CAACU,WAAW,C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YAAY;MACZS,SAAS,EAAElC,YAAY,CAACvB,EAAE,EAAEwB,IAAI,EAAEqB,OAAO,CAACpB,KAAK;IACjD,CAAC;EACH,CAAC,CAAC;EAEF,OAAO;IACL,CAACiC,sCAAmB,GAAG,IAAI;IAC3B1D,EAAE,EAAEA,EAAoB;IACxBD,IAAI;IACJa,SAAS;IACT+B,YAAY;IACZV,gBAAgB;IAChBK,MAAM;IACNE;EACF,CAAC;AACH,CAAC;AAACmB,OAAA,CAAA3B,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_customDeviceBrand","require","_integratedDevices","_compileCustomLepu","_compileCustomMonitor","_customDeviceError","_normalizeBleUuid","MIN_STUCK_TIMEOUT_MS","MIN_MTU","MAX_MTU","MAX_STUCK_TIMEOUT_MS","HEX_BYTES","assertIdentity","spec","id","trim","customDeviceError","String","builtIn","Object","values","IntegratedDevices","find","name","toLowerCase","compileNameMatch","nameMatch","RegExp","global","sticky","exact","replace","assertStuckTimeout","timeout","stuckDataTimeoutMs","Number","isInteger","assertPreferredMtu","mtu","preferredMtu","undefined","compileWrite","path","write","commandHex","test","uuid","normalizeBleUuid","mainCommandUuid","defineCustomDevice","stuckDataTimeout","Array","isArray","services","length","fields","Map","frames","seenCharacteristics","Set","mainServices","map","service","serviceIndex","monitor","monitorUuids","monitorIndex","monitorPath","characteristic","frame","compileCustomMonitor","has","add","set","writeUuid","lepu","compileCustomLepu","CUSTOM_DEVICE_BRAND","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/define-custom-device.ts"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAMA,IAAAC,kBAAA,GAAAD,OAAA;AAGA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAEA,MAAMM,oBAAoB,GAAG,KAAK;;AAElC;AACA,MA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AC;EAEF,MAAMgC,IAAI,GAAG,IAAAC,oCAAiB,EAC5B9D,EAAE,EACFD,IAAI,EACJ+C,YAAY,CAACC,GAAG,CAAEC,OAAO,IAAKA,OAAO,CAAChB,IAAI,CAC5C,CAAC;EAED,OAAO;IACL,CAAC+B,sCAAmB,GAAG,IAAI;IAC3B/D,EAAE,EAAEA,EAAoB;IACxBD,IAAI;IACJa,SAAS;IACTkC,YAAY;IACZV,gBAAgB;IAChBK,MAAM;IACNE,MAAM;IACN,IAAIlB,YAAY,KAAKC,SAAS,GAAG,CAAC,CAAC,GAAG;MAAED;IAAa,CAAC,CAAC;IACvD,IAAIoC,IAAI,KAAKnC,SAAS,GAAG,CAAC,CAAC,GAAG;MAAEmC;IAAK,CAAC;EACxC,CAAC;AACH,CAAC;AAACG,OAAA,CAAA7B,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -12,6 +12,23 @@ var _bp2Device = require("./devices/bp2/bp2.device.js");
12
12
  var _customDevice = require("./devices/custom/custom.device.js");
13
13
  var _f4Device = require("./devices/f4/f4.device.js");
14
14
  var _spo2Device = require("./devices/spo/spo2.device.js");
15
+ var _verovalDuoControlDevice = require("./devices/veroval/veroval.duo-control-device.js");
16
+ var _verovalEcgDevice = require("./devices/veroval/veroval.ecg-device.js");
17
+ /**
18
+ * The built-in names the SDK can actually build.
19
+ *
20
+ * `integratedDevicesMap` matches more names than this, on purpose: matching is what names a
21
+ * device in a scan result and a device list, which is useful for hardware the SDK cannot
22
+ * yet decode. Connecting to one of those is what fails, and it fails saying so.
23
+ */
24
+ const DEVICE_CLASSES = {
25
+ [_integratedDevices.IntegratedDevices.BP2]: _bp2Device.BP2Device,
26
+ [_integratedDevices.IntegratedDevices.F4]: _f4Device.F4Device,
27
+ [_integratedDevices.IntegratedDevices.PC60WF]: _spo2Device.SPO2Device,
28
+ [_integratedDevices.IntegratedDevices.BC01]: _bc01Device.BC01Device,
29
+ [_integratedDevices.IntegratedDevices.VEROVAL_DUO_CONTROL]: _verovalDuoControlDevice.VerovalDuoControlDevice,
30
+ [_integratedDevices.IntegratedDevices.VEROVAL_ECG]: _verovalEcgDevice.VerovalEcgDevice
31
+ };
15
32
  const collectCustomDevices = acceptedDevices => {
16
33
  const customDevices = new Map();
17
34
  const matchers = new Set();
@@ -71,15 +88,9 @@ class DeviceCreator {
71
88
  // @ts-expect-error - the caller asked for this custom device by its own id
72
89
  return new _customDevice.CustomDevice(params.device, params, custom);
73
90
  }
74
- const deviceMap = {
75
- [_integratedDevices.IntegratedDevices.BP2]: _bp2Device.BP2Device,
76
- [_integratedDevices.IntegratedDevices.F4]: _f4Device.F4Device,
77
- [_integratedDevices.IntegratedDevices.PC60WF]: _spo2Device.SPO2Device,
78
- [_integratedDevices.IntegratedDevices.BC01]: _bc01Device.BC01Device
79
- };
80
- const deviceClass = deviceMap[params.deviceName];
91
+ const deviceClass = DEVICE_CLASSES[params.deviceName];
81
92
  if (!deviceClass) {
82
- throw new Error(`Device ${params.device.name} not found`);
93
+ throw new Error(`"${params.deviceName}" is a name the SDK matches during a scan but has no decoder for, so "${params.device.name}" cannot be connected. The names it can decode are ${Object.keys(DEVICE_CLASSES).join(", ")}; anything else needs a declaration registered with defineCustomDevice and passed in acceptedDevices.`);
83
94
  }
84
95
 
85
96
  // @ts-expect-error - This is a workaround to allow the deviceClass to be instantiated with the correct type
@@ -1 +1 @@
1
- {"version":3,"names":["_integratedDevicesMap","require","_integratedDevices","_isCustomDeviceDefinition","_bc01Device","_bp2Device","_customDevice","_f4Device","_spo2Device","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","isCustomDeviceDefinition","Error","has","id","nameMatch","source","set","add","DeviceCreator","deviceNameCache","CACHE_MAX_SIZE","constructor","acceptedDeviceNames","getDeviceName","foundName","undefined","get","matched","matchDeviceName","cacheDeviceName","createDevice","params","String","deviceName","trim","device","name","custom","CustomDevice","deviceMap","IntegratedDevices","BP2","BP2Device","F4","F4Device","PC60WF","SPO2Device","BC01","BC01Device","deviceClass","destroy","clear","regex","deviceType","integratedDevicesMap","test","some","values","size","firstKey","keys","next","value","delete","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/device-creator.ts"],"mappings":";;;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAMA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,yBAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAEA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAEA,MAAMQ,oBAAoB,GACxBC,eAA0C,IACF;EACxC,MAAMC,aAAa,GAAG,IAAIC,GAAG,CAAiC,CAAC;EAC/D,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAAS,CAAC;EAElCJ,eAAe,CAACK,OAAO,CAAC,CAACC,KAAK,EAAEC,KAAK,KAAK;IACxC,IAAI,OAAOD,KAAK,KAAK,QAAQ,EAAE;MAC7B;IACF;IAEA,IAAI,CAAC,IAAAE,kDAAwB,EAACF,KAAK,CAAC,EAAE;MACpC,MAAM,IAAIG,KAAK,CACb,mBAAmBF,KAAK,sDAC1B,CAAC;IACH;IAEA,IAAIN,aAAa,CAACS,GAAG,CAACJ,KAAK,CAACK,EAAE,CAAC,EAAE;MAC/B,MAAM,IAAIF,KAAK,CACb,mBAAmBF,KAAK,kCAAkCD,KAAK,CAACK,EAAE,SACpE,CAAC;IACH;IAEA,IAAIR,QAAQ,CAACO,GAAG,CAACJ,KAAK,CAACM,SAAS,CAACC,MAAM,CAAC,EAAE;MACxC,MAAM,IAAIJ,KAAK,CACb,mBAAmBF,KAAK,OAAOD,KAAK,CAACK,EAAE,yGACzC,CAAC;IACH;IAEAV,aAAa,CAACa,GAAG,CAACR,KAAK,CAACK,EAAE,EAAEL,KAAK,CAAC;IAClCH,QAAQ,CAACY,GAAG,CAACT,KAAK,CAACM,S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,IAAI,CAACtB,UAAU,CAAC,EAAE;QACrC,OAAOI,MAAM,CAACxB,EAAE;MAClB;IACF;IAEA,OAAOY,SAAS;EAClB,CAAC;EAEOI,eAAeA,CACrBI,UAAkB,EAClBoB,UAA4B,EACtB;IACN;IACA,IAAI,IAAI,CAAClC,eAAe,CAACuC,IAAI,IAAI,IAAI,CAACtC,cAAc,EAAE;MACpD,MAAMuC,QAAQ,GAAG,IAAI,CAACxC,eAAe,CAACyC,IAAI,CAAC,CAAC,CAACC,IAAI,CAAC,CAAC,CAACC,KAAK;MAEzD,IAAIH,QAAQ,KAAKlC,SAAS,EAAE;QAC1B,IAAI,CAACN,eAAe,CAAC4C,MAAM,CAACJ,QAAQ,CAAC;MACvC;IACF;IAEA,IAAI,CAACxC,eAAe,CAACH,GAAG,CAACiB,UAAU,EAAEoB,UAAU,CAAC;EAClD;AACF;AAACW,OAAA,CAAA9C,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["_integratedDevicesMap","require","_integratedDevices","_isCustomDeviceDefinition","_bc01Device","_bp2Device","_customDevice","_f4Device","_spo2Device","_verovalDuoControlDevice","_verovalEcgDevice","DEVICE_CLASSES","IntegratedDevices","BP2","BP2Device","F4","F4Device","PC60WF","SPO2Device","BC01","BC01Device","VEROVAL_DUO_CONTROL","VerovalDuoControlDevice","VEROVAL_ECG","VerovalEcgDevice","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","isCustomDeviceDefinition","Error","has","id","nameMatch","source","set","add","DeviceCreator","deviceNameCache","CACHE_MAX_SIZE","constructor","acceptedDeviceNames","getDeviceName","foundName","undefined","get","matched","matchDeviceName","cacheDeviceName","createDevice","params","String","deviceName","trim","device","name","custom","CustomDevice","deviceClass","Object","keys","join","destroy","clear","regex","deviceType","integratedDevicesMap","test","some","values","size","firstKey","next","value","delete","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/device-creator.ts"],"mappings":";;;;;;AAAA,IAAAA,qB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AOA,UAAU;MACnB;IACF;IAEA,KAAK,MAAMT,MAAM,IAAI,IAAI,CAAClC,aAAa,CAAC+C,MAAM,CAAC,CAAC,EAAE;MAChD,IAAIb,MAAM,CAACvB,SAAS,CAACkC,IAAI,CAACf,UAAU,CAAC,EAAE;QACrC,OAAOI,MAAM,CAACxB,EAAE;MAClB;IACF;IAEA,OAAOY,SAAS;EAClB,CAAC;EAEOI,eAAeA,CACrBI,UAAkB,EAClBa,UAA4B,EACtB;IACN;IACA,IAAI,IAAI,CAAC3B,eAAe,CAACgC,IAAI,IAAI,IAAI,CAAC/B,cAAc,EAAE;MACpD,MAAMgC,QAAQ,GAAG,IAAI,CAACjC,eAAe,CAACsB,IAAI,CAAC,CAAC,CAACY,IAAI,CAAC,CAAC,CAACC,KAAK;MAEzD,IAAIF,QAAQ,KAAK3B,SAAS,EAAE;QAC1B,IAAI,CAACN,eAAe,CAACoC,MAAM,CAACH,QAAQ,CAAC;MACvC;IACF;IAEA,IAAI,CAACjC,eAAe,CAACH,GAAG,CAACiB,UAAU,EAAEa,UAAU,CAAC;EAClD;AACF;AAACU,OAAA,CAAAtC,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.aoj20aThermometer = void 0;
7
+ var _core = require("@ovok/core");
8
+ var _defineCustomDevice = require("../../custom/define-custom-device.js");
9
+ /**
10
+ * Declarations for the AOJ Medical thermometers.
11
+ *
12
+ * Their frame is `aa | 01 | cmd | len | payload | xor`, where the checksum covers everything
13
+ * from the device-type byte up to itself. It is not the Lepu framing, despite both being
14
+ * reachable from the same vendor app: no complement byte, no sequence number, a one-byte
15
+ * length and an exclusive-or rather than a CRC.
16
+ */
17
+
18
+ /** Every frame opens with these two: a fixed start byte and a fixed device type. */
19
+ const FRAME_HEADER = ["aa", "01"];
20
+ const COMMAND_BYTE = 2;
21
+
22
+ /** Header, a three-byte payload and the checksum. */
23
+ const FRAME_BYTES = 8;
24
+ const CHECKSUM_INDEX = 7;
25
+
26
+ /** The checksum starts after the start byte, which it does not cover. */
27
+ const CHECKSUM_FROM = 1;
28
+ const PAYLOAD = 4;
29
+
30
+ /** The device answers a realtime-temperature request with this. */
31
+ const TEMPERATURE_REPLY = "c1";
32
+
33
+ /** Hundredths of a degree, big-endian - the one field in this family that is not little. */
34
+ const TEMPERATURE_SCALE = 0.01;
35
+ const TEMPERATURE_DECIMALS = 2;
36
+ const SPOT_CHECK_TIMEOUT_MS = 60_000;
37
+ /**
38
+ * The AOJ-20A infrared thermometer.
39
+ *
40
+ * Declared without a write characteristic, because the device sends its reading rather than
41
+ * waiting to be asked: the vendor app has a request for it, calls it from nowhere, and still
42
+ * displays temperatures - so the reply arrives when someone takes a measurement. Not writing
43
+ * also means not polling, which for a spot-check device would otherwise re-report the same
44
+ * reading for as long as the link stayed up.
45
+ *
46
+ * Only the realtime reply is declared. The stored-history reply shares the header and would
47
+ * need its own case; nothing reads history yet, and a case that decoded it into the same
48
+ * measurement would post old readings as though they had just been taken.
49
+ */
50
+ const aoj20aThermometer = params => (0, _defineCustomDevice.defineCustomDevice)({
51
+ id: params.id,
52
+ nameMatch: params.nameMatch,
53
+ stuckDataTimeoutMs: params.stuckDataTimeoutMs ?? SPOT_CHECK_TIMEOUT_MS,
54
+ services: [{
55
+ uuid: "ffe0",
56
+ monitor: [{
57
+ uuid: "ffe1",
58
+ frame: {
59
+ header: FRAME_HEADER,
60
+ minLengthBytes: FRAME_BYTES,
61
+ checksum: {
62
+ algorithm: "xor",
63
+ index: CHECKSUM_INDEX,
64
+ from: CHECKSUM_FROM
65
+ }
66
+ },
67
+ caseSelectorBytes: [COMMAND_BYTE],
68
+ cases: [{
69
+ selector: TEMPERATURE_REPLY,
70
+ kind: "result",
71
+ measurementTypeKey: _core.MeasurementTypeKey.temperature,
72
+ fields: [{
73
+ name: "bodyTemp",
74
+ byteIndexes: [PAYLOAD, PAYLOAD + 1],
75
+ byteOrder: "big",
76
+ unit: "Cel",
77
+ scale: TEMPERATURE_SCALE,
78
+ decimals: TEMPERATURE_DECIMALS
79
+ }]
80
+ }]
81
+ }]
82
+ }]
83
+ });
84
+ exports.aoj20aThermometer = aoj20aThermometer;
85
+ //# sourceMappingURL=aoj.thermometers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_core","require","_defineCustomDevice","FRAME_HEADER","COMMAND_BYTE","FRAME_BYTES","CHECKSUM_INDEX","CHECKSUM_FROM","PAYLOAD","TEMPERATURE_REPLY","TEMPERATURE_SCALE","TEMPERATURE_DECIMALS","SPOT_CHECK_TIMEOUT_MS","aoj20aThermometer","params","defineCustomDevice","id","nameMatch","stuckDataTimeoutMs","services","uuid","monitor","frame","header","minLengthBytes","checksum","algorithm","index","from","caseSelectorBytes","cases","selector","kind","measurementTypeKey","MeasurementTypeKey","temperature","fields","name","byteIndexes","byteOrder","unit","scale","decimals","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/aoj/aoj.thermometers.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,mBAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAME,YAAY,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC;AAEjC,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,cAAc,GAAG,CAAC;;AAExB;AACA,MAAMC,aAAa,GAAG,CAAC;AAEvB,MAAMC,OAAO,GAAG,CAAC;;AAEjB;AACA,MAAMC,iBAAiB,GAAG,IAAI;;AAE9B;AACA,MAAMC,iBAAiB,GAAG,IAAI;AAC9B,MAAMC,oBAAoB,GAAG,CAAC;AAE9B,MAAMC,qBAAqB,GAAG,MAAM;AAapC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC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