@ovok/native 0.4.6 → 0.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (520) hide show
  1. package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js +3 -1
  2. package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
  3. package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js +1 -1
  4. package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
  5. package/lib/commonjs/modules/bt-management/index.js +220 -0
  6. package/lib/commonjs/modules/bt-management/index.js.map +1 -1
  7. package/lib/commonjs/modules/bt-management/services/custom/compile-case-fields.js +49 -0
  8. package/lib/commonjs/modules/bt-management/services/custom/compile-case-fields.js.map +1 -0
  9. package/lib/commonjs/modules/bt-management/services/custom/compile-case-shape.js +52 -0
  10. package/lib/commonjs/modules/bt-management/services/custom/compile-case-shape.js.map +1 -0
  11. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-case.js +53 -41
  12. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-case.js.map +1 -1
  13. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-field.js +3 -0
  14. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-field.js.map +1 -1
  15. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-frame.js +48 -2
  16. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-frame.js.map +1 -1
  17. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js +98 -0
  18. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -0
  19. package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js +24 -1
  20. package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
  21. package/lib/commonjs/modules/bt-management/services/device-creator.js +19 -8
  22. package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
  23. package/lib/commonjs/modules/bt-management/services/devices/aoj/aoj.thermometers.js +85 -0
  24. package/lib/commonjs/modules/bt-management/services/devices/aoj/aoj.thermometers.js.map +1 -0
  25. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.frame-reader.js +8 -74
  26. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.frame-reader.js.map +1 -1
  27. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +155 -0
  28. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js.map +1 -0
  29. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js +9 -49
  30. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  31. package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js +17 -6
  32. package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
  33. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +21 -14
  34. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  35. package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +55 -0
  36. package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -0
  37. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +82 -29
  38. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  39. package/lib/commonjs/modules/bt-management/services/devices/frame-parser.js +2 -1
  40. package/lib/commonjs/modules/bt-management/services/devices/frame-parser.js.map +1 -1
  41. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.command-builder.js +48 -0
  42. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.command-builder.js.map +1 -0
  43. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.commands.js +37 -0
  44. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.commands.js.map +1 -0
  45. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-info.js +83 -0
  46. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-info.js.map +1 -0
  47. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-names.js +26 -0
  48. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-names.js.map +1 -0
  49. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-names.js +36 -0
  50. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-names.js.map +1 -0
  51. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +155 -0
  52. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -0
  53. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame-reader.js +98 -0
  54. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame-reader.js.map +1 -0
  55. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame.js +29 -0
  56. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame.js.map +1 -0
  57. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.identity-gate.js +103 -0
  58. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -0
  59. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.name-match.js +32 -0
  60. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.name-match.js.map +1 -0
  61. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.response-type.js +64 -0
  62. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.response-type.js.map +1 -0
  63. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js +143 -0
  64. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -0
  65. package/lib/commonjs/modules/bt-management/services/devices/polling-command-sequencer.js +38 -0
  66. package/lib/commonjs/modules/bt-management/services/devices/polling-command-sequencer.js.map +1 -0
  67. package/lib/commonjs/modules/bt-management/services/devices/sentinel-frame-reader.js +84 -0
  68. package/lib/commonjs/modules/bt-management/services/devices/sentinel-frame-reader.js.map +1 -0
  69. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +130 -0
  70. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -0
  71. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +55 -0
  72. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -0
  73. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +43 -0
  74. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -0
  75. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +113 -0
  76. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -0
  77. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js +120 -0
  78. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js.map +1 -0
  79. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-device.js +92 -0
  80. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-device.js.map +1 -0
  81. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js +64 -0
  82. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map +1 -0
  83. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +94 -0
  84. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -0
  85. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +124 -0
  86. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -0
  87. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +113 -0
  88. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -0
  89. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.lepod.js +117 -0
  90. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.lepod.js.map +1 -0
  91. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js +82 -0
  92. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -0
  93. package/lib/commonjs/modules/bt-management/types/command-sequencer.js +6 -0
  94. package/lib/commonjs/modules/bt-management/types/command-sequencer.js.map +1 -0
  95. package/lib/commonjs/modules/bt-management/types/custom-checksum-algorithm.js +2 -0
  96. package/lib/commonjs/modules/bt-management/types/custom-checksum-algorithm.js.map +1 -0
  97. package/lib/commonjs/modules/bt-management/types/custom-checksum-spec.js +6 -0
  98. package/lib/commonjs/modules/bt-management/types/custom-checksum-spec.js.map +1 -0
  99. package/lib/commonjs/modules/bt-management/types/custom-lepu-spec.js +2 -0
  100. package/lib/commonjs/modules/bt-management/types/custom-lepu-spec.js.map +1 -0
  101. package/lib/commonjs/modules/bt-management/types/custom-measurement-spec.js +6 -0
  102. package/lib/commonjs/modules/bt-management/types/custom-measurement-spec.js.map +1 -0
  103. package/lib/commonjs/modules/bt-management/types/device-command.js +2 -0
  104. package/lib/commonjs/modules/bt-management/types/device-command.js.map +1 -0
  105. package/lib/commonjs/modules/bt-management/types/integrated-devices.js +2 -0
  106. package/lib/commonjs/modules/bt-management/types/integrated-devices.js.map +1 -1
  107. package/lib/commonjs/modules/bt-management/types/measurement-group.js +6 -0
  108. package/lib/commonjs/modules/bt-management/types/measurement-group.js.map +1 -0
  109. package/lib/commonjs/modules/bt-management/utils/calculate-checksum.js +49 -0
  110. package/lib/commonjs/modules/bt-management/utils/calculate-checksum.js.map +1 -0
  111. package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js +21 -0
  112. package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
  113. package/lib/commonjs/modules/bt-management/utils/create-frame-validator.js +9 -0
  114. package/lib/commonjs/modules/bt-management/utils/create-frame-validator.js.map +1 -1
  115. package/lib/commonjs/modules/bt-management/utils/hex-to-bytes.js +19 -0
  116. package/lib/commonjs/modules/bt-management/utils/hex-to-bytes.js.map +1 -0
  117. package/lib/commonjs/modules/bt-management/utils/le-32-to-bytes.js +13 -0
  118. package/lib/commonjs/modules/bt-management/utils/le-32-to-bytes.js.map +1 -0
  119. package/lib/commonjs/modules/bt-management/utils/parse-measurement.js +10 -7
  120. package/lib/commonjs/modules/bt-management/utils/parse-measurement.js.map +1 -1
  121. package/lib/commonjs/modules/bt-management/utils/reject-custom-reading.js +34 -0
  122. package/lib/commonjs/modules/bt-management/utils/reject-custom-reading.js.map +1 -0
  123. package/lib/commonjs/modules/bt-management/utils/summarise-measurement-for-log.js +22 -0
  124. package/lib/commonjs/modules/bt-management/utils/summarise-measurement-for-log.js.map +1 -0
  125. package/lib/commonjs/modules/bt-management/utils/supported-measurement-type-keys.js +18 -0
  126. package/lib/commonjs/modules/bt-management/utils/supported-measurement-type-keys.js.map +1 -0
  127. package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js +3 -1
  128. package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
  129. package/lib/module/modules/bt-management/constants/integrated-devices-map.js +1 -1
  130. package/lib/module/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
  131. package/lib/module/modules/bt-management/index.js +20 -0
  132. package/lib/module/modules/bt-management/index.js.map +1 -1
  133. package/lib/module/modules/bt-management/services/custom/compile-case-fields.js +44 -0
  134. package/lib/module/modules/bt-management/services/custom/compile-case-fields.js.map +1 -0
  135. package/lib/module/modules/bt-management/services/custom/compile-case-shape.js +48 -0
  136. package/lib/module/modules/bt-management/services/custom/compile-case-shape.js.map +1 -0
  137. package/lib/module/modules/bt-management/services/custom/compile-custom-case.js +53 -41
  138. package/lib/module/modules/bt-management/services/custom/compile-custom-case.js.map +1 -1
  139. package/lib/module/modules/bt-management/services/custom/compile-custom-field.js +3 -0
  140. package/lib/module/modules/bt-management/services/custom/compile-custom-field.js.map +1 -1
  141. package/lib/module/modules/bt-management/services/custom/compile-custom-frame.js +48 -2
  142. package/lib/module/modules/bt-management/services/custom/compile-custom-frame.js.map +1 -1
  143. package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js +93 -0
  144. package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -0
  145. package/lib/module/modules/bt-management/services/custom/define-custom-device.js +24 -1
  146. package/lib/module/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
  147. package/lib/module/modules/bt-management/services/device-creator.js +20 -8
  148. package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
  149. package/lib/module/modules/bt-management/services/devices/aoj/aoj.thermometers.js +81 -0
  150. package/lib/module/modules/bt-management/services/devices/aoj/aoj.thermometers.js.map +1 -0
  151. package/lib/module/modules/bt-management/services/devices/bp2/bp2.frame-reader.js +8 -73
  152. package/lib/module/modules/bt-management/services/devices/bp2/bp2.frame-reader.js.map +1 -1
  153. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +150 -0
  154. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js.map +1 -0
  155. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js +9 -49
  156. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  157. package/lib/module/modules/bt-management/services/devices/bt-data-processor.js +17 -6
  158. package/lib/module/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
  159. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +21 -14
  160. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  161. package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +51 -0
  162. package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -0
  163. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +82 -29
  164. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  165. package/lib/module/modules/bt-management/services/devices/frame-parser.js +2 -1
  166. package/lib/module/modules/bt-management/services/devices/frame-parser.js.map +1 -1
  167. package/lib/module/modules/bt-management/services/devices/lepu/lepu.command-builder.js +43 -0
  168. package/lib/module/modules/bt-management/services/devices/lepu/lepu.command-builder.js.map +1 -0
  169. package/lib/module/modules/bt-management/services/devices/lepu/lepu.commands.js +33 -0
  170. package/lib/module/modules/bt-management/services/devices/lepu/lepu.commands.js.map +1 -0
  171. package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-info.js +79 -0
  172. package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-info.js.map +1 -0
  173. package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-names.js +22 -0
  174. package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-names.js.map +1 -0
  175. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-names.js +32 -0
  176. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-names.js.map +1 -0
  177. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +150 -0
  178. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -0
  179. package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame-reader.js +93 -0
  180. package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame-reader.js.map +1 -0
  181. package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame.js +24 -0
  182. package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame.js.map +1 -0
  183. package/lib/module/modules/bt-management/services/devices/lepu/lepu.identity-gate.js +98 -0
  184. package/lib/module/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -0
  185. package/lib/module/modules/bt-management/services/devices/lepu/lepu.name-match.js +27 -0
  186. package/lib/module/modules/bt-management/services/devices/lepu/lepu.name-match.js.map +1 -0
  187. package/lib/module/modules/bt-management/services/devices/lepu/lepu.response-type.js +59 -0
  188. package/lib/module/modules/bt-management/services/devices/lepu/lepu.response-type.js.map +1 -0
  189. package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js +140 -0
  190. package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -0
  191. package/lib/module/modules/bt-management/services/devices/polling-command-sequencer.js +34 -0
  192. package/lib/module/modules/bt-management/services/devices/polling-command-sequencer.js.map +1 -0
  193. package/lib/module/modules/bt-management/services/devices/sentinel-frame-reader.js +79 -0
  194. package/lib/module/modules/bt-management/services/devices/sentinel-frame-reader.js.map +1 -0
  195. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +123 -0
  196. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -0
  197. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +50 -0
  198. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -0
  199. package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +38 -0
  200. package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -0
  201. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +108 -0
  202. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -0
  203. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js +116 -0
  204. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js.map +1 -0
  205. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-device.js +87 -0
  206. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-device.js.map +1 -0
  207. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js +60 -0
  208. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map +1 -0
  209. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +89 -0
  210. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -0
  211. package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +118 -0
  212. package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -0
  213. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +108 -0
  214. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -0
  215. package/lib/module/modules/bt-management/services/devices/viatom/viatom.lepod.js +114 -0
  216. package/lib/module/modules/bt-management/services/devices/viatom/viatom.lepod.js.map +1 -0
  217. package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js +79 -0
  218. package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -0
  219. package/lib/module/modules/bt-management/types/command-sequencer.js +4 -0
  220. package/lib/module/modules/bt-management/types/command-sequencer.js.map +1 -0
  221. package/lib/module/modules/bt-management/types/custom-checksum-algorithm.js +2 -0
  222. package/lib/module/modules/bt-management/types/custom-checksum-algorithm.js.map +1 -0
  223. package/lib/module/modules/bt-management/types/custom-checksum-spec.js +4 -0
  224. package/lib/module/modules/bt-management/types/custom-checksum-spec.js.map +1 -0
  225. package/lib/module/modules/bt-management/types/custom-device-definition.js.map +1 -1
  226. package/lib/module/modules/bt-management/types/custom-lepu-spec.js +2 -0
  227. package/lib/module/modules/bt-management/types/custom-lepu-spec.js.map +1 -0
  228. package/lib/module/modules/bt-management/types/custom-measurement-spec.js +4 -0
  229. package/lib/module/modules/bt-management/types/custom-measurement-spec.js.map +1 -0
  230. package/lib/module/modules/bt-management/types/device-command.js +2 -0
  231. package/lib/module/modules/bt-management/types/device-command.js.map +1 -0
  232. package/lib/module/modules/bt-management/types/device-measurement-map.js +3 -3
  233. package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
  234. package/lib/module/modules/bt-management/types/integrated-devices.js +2 -0
  235. package/lib/module/modules/bt-management/types/integrated-devices.js.map +1 -1
  236. package/lib/module/modules/bt-management/types/measurement-group.js +4 -0
  237. package/lib/module/modules/bt-management/types/measurement-group.js.map +1 -0
  238. package/lib/module/modules/bt-management/utils/calculate-checksum.js +44 -0
  239. package/lib/module/modules/bt-management/utils/calculate-checksum.js.map +1 -0
  240. package/lib/module/modules/bt-management/utils/create-custom-field-parser.js +21 -0
  241. package/lib/module/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
  242. package/lib/module/modules/bt-management/utils/create-frame-validator.js +9 -0
  243. package/lib/module/modules/bt-management/utils/create-frame-validator.js.map +1 -1
  244. package/lib/module/modules/bt-management/utils/hex-to-bytes.js +14 -0
  245. package/lib/module/modules/bt-management/utils/hex-to-bytes.js.map +1 -0
  246. package/lib/module/modules/bt-management/utils/le-32-to-bytes.js +8 -0
  247. package/lib/module/modules/bt-management/utils/le-32-to-bytes.js.map +1 -0
  248. package/lib/module/modules/bt-management/utils/parse-measurement.js +10 -7
  249. package/lib/module/modules/bt-management/utils/parse-measurement.js.map +1 -1
  250. package/lib/module/modules/bt-management/utils/reject-custom-reading.js +29 -0
  251. package/lib/module/modules/bt-management/utils/reject-custom-reading.js.map +1 -0
  252. package/lib/module/modules/bt-management/utils/summarise-measurement-for-log.js +17 -0
  253. package/lib/module/modules/bt-management/utils/summarise-measurement-for-log.js.map +1 -0
  254. package/lib/module/modules/bt-management/utils/supported-measurement-type-keys.js +13 -0
  255. package/lib/module/modules/bt-management/utils/supported-measurement-type-keys.js.map +1 -0
  256. package/lib/typescript/commonjs/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
  257. package/lib/typescript/commonjs/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
  258. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +20 -0
  259. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
  260. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-fields.d.ts +13 -0
  261. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-fields.d.ts.map +1 -0
  262. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-shape.d.ts +19 -0
  263. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-shape.d.ts.map +1 -0
  264. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
  265. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -1
  266. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-frame.d.ts.map +1 -1
  267. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts +11 -0
  268. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -0
  269. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -1
  270. package/lib/typescript/commonjs/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
  271. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts +24 -0
  272. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts.map +1 -0
  273. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts +5 -8
  274. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts.map +1 -1
  275. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts +74 -0
  276. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -0
  277. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +6 -4
  278. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  279. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts +20 -1
  280. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
  281. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +12 -1
  282. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  283. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +30 -0
  284. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -0
  285. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +32 -2
  286. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  287. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/frame-parser.d.ts.map +1 -1
  288. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts +24 -0
  289. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts.map +1 -0
  290. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts +32 -0
  291. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts.map +1 -0
  292. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts +27 -0
  293. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts.map +1 -0
  294. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts +20 -0
  295. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts.map +1 -0
  296. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts +14 -0
  297. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts.map +1 -0
  298. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +75 -0
  299. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -0
  300. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts +28 -0
  301. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts.map +1 -0
  302. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts +12 -0
  303. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts.map +1 -0
  304. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts +81 -0
  305. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -0
  306. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts +17 -0
  307. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts.map +1 -0
  308. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts +33 -0
  309. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts.map +1 -0
  310. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +85 -0
  311. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -0
  312. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts +27 -0
  313. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts.map +1 -0
  314. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts +52 -0
  315. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts.map +1 -0
  316. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +53 -0
  317. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -0
  318. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +45 -0
  319. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -0
  320. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +18 -0
  321. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -0
  322. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +19 -0
  323. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -0
  324. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts +45 -0
  325. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts.map +1 -0
  326. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts +30 -0
  327. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts.map +1 -0
  328. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts +39 -0
  329. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts.map +1 -0
  330. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +35 -0
  331. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -0
  332. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts +44 -0
  333. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -0
  334. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts +32 -0
  335. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -0
  336. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts +25 -0
  337. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts.map +1 -0
  338. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts +39 -0
  339. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -0
  340. package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts +26 -0
  341. package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -0
  342. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts +43 -0
  343. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
  344. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-algorithm.d.ts +10 -0
  345. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-algorithm.d.ts.map +1 -0
  346. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-spec.d.ts +23 -0
  347. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-spec.d.ts.map +1 -0
  348. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts +5 -0
  349. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -1
  350. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-spec.d.ts +12 -0
  351. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-spec.d.ts.map +1 -1
  352. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-encoding.d.ts +7 -1
  353. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -1
  354. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-frame-spec.d.ts +8 -0
  355. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-frame-spec.d.ts.map +1 -1
  356. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts +44 -0
  357. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -0
  358. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-measurement-spec.d.ts +9 -0
  359. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-measurement-spec.d.ts.map +1 -0
  360. package/lib/typescript/commonjs/src/modules/bt-management/types/dependent-result-handler-params.d.ts +7 -0
  361. package/lib/typescript/commonjs/src/modules/bt-management/types/dependent-result-handler-params.d.ts.map +1 -1
  362. package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts +27 -0
  363. package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts.map +1 -0
  364. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
  365. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  366. package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts +3 -1
  367. package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
  368. package/lib/typescript/commonjs/src/modules/bt-management/types/measurement-group.d.ts +14 -0
  369. package/lib/typescript/commonjs/src/modules/bt-management/types/measurement-group.d.ts.map +1 -0
  370. package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts +17 -0
  371. package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
  372. package/lib/typescript/commonjs/src/modules/bt-management/utils/calculate-checksum.d.ts +13 -0
  373. package/lib/typescript/commonjs/src/modules/bt-management/utils/calculate-checksum.d.ts.map +1 -0
  374. package/lib/typescript/commonjs/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
  375. package/lib/typescript/commonjs/src/modules/bt-management/utils/create-frame-validator.d.ts.map +1 -1
  376. package/lib/typescript/commonjs/src/modules/bt-management/utils/hex-to-bytes.d.ts +10 -0
  377. package/lib/typescript/commonjs/src/modules/bt-management/utils/hex-to-bytes.d.ts.map +1 -0
  378. package/lib/typescript/commonjs/src/modules/bt-management/utils/le-32-to-bytes.d.ts +3 -0
  379. package/lib/typescript/commonjs/src/modules/bt-management/utils/le-32-to-bytes.d.ts.map +1 -0
  380. package/lib/typescript/commonjs/src/modules/bt-management/utils/parse-measurement.d.ts +4 -1
  381. package/lib/typescript/commonjs/src/modules/bt-management/utils/parse-measurement.d.ts.map +1 -1
  382. package/lib/typescript/commonjs/src/modules/bt-management/utils/reject-custom-reading.d.ts +15 -0
  383. package/lib/typescript/commonjs/src/modules/bt-management/utils/reject-custom-reading.d.ts.map +1 -0
  384. package/lib/typescript/commonjs/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts +9 -0
  385. package/lib/typescript/commonjs/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts.map +1 -0
  386. package/lib/typescript/commonjs/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts +10 -0
  387. package/lib/typescript/commonjs/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts.map +1 -0
  388. package/lib/typescript/module/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
  389. package/lib/typescript/module/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
  390. package/lib/typescript/module/src/modules/bt-management/index.d.ts +20 -0
  391. package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
  392. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-fields.d.ts +13 -0
  393. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-fields.d.ts.map +1 -0
  394. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-shape.d.ts +19 -0
  395. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-shape.d.ts.map +1 -0
  396. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
  397. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -1
  398. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-frame.d.ts.map +1 -1
  399. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts +11 -0
  400. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -0
  401. package/lib/typescript/module/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -1
  402. package/lib/typescript/module/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
  403. package/lib/typescript/module/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts +24 -0
  404. package/lib/typescript/module/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts.map +1 -0
  405. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts +5 -8
  406. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts.map +1 -1
  407. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts +74 -0
  408. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -0
  409. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +6 -4
  410. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  411. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts +20 -1
  412. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
  413. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +12 -1
  414. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  415. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +30 -0
  416. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -0
  417. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +32 -2
  418. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  419. package/lib/typescript/module/src/modules/bt-management/services/devices/frame-parser.d.ts.map +1 -1
  420. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts +24 -0
  421. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts.map +1 -0
  422. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts +32 -0
  423. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts.map +1 -0
  424. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts +27 -0
  425. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts.map +1 -0
  426. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts +20 -0
  427. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts.map +1 -0
  428. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts +14 -0
  429. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts.map +1 -0
  430. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +75 -0
  431. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -0
  432. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts +28 -0
  433. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts.map +1 -0
  434. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts +12 -0
  435. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts.map +1 -0
  436. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts +81 -0
  437. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -0
  438. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts +17 -0
  439. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts.map +1 -0
  440. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts +33 -0
  441. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts.map +1 -0
  442. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +85 -0
  443. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -0
  444. package/lib/typescript/module/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts +27 -0
  445. package/lib/typescript/module/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts.map +1 -0
  446. package/lib/typescript/module/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts +52 -0
  447. package/lib/typescript/module/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts.map +1 -0
  448. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +53 -0
  449. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -0
  450. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +45 -0
  451. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -0
  452. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +18 -0
  453. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -0
  454. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +19 -0
  455. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -0
  456. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts +45 -0
  457. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts.map +1 -0
  458. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts +30 -0
  459. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts.map +1 -0
  460. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts +39 -0
  461. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts.map +1 -0
  462. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +35 -0
  463. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -0
  464. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts +44 -0
  465. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -0
  466. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts +32 -0
  467. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -0
  468. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts +25 -0
  469. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts.map +1 -0
  470. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts +39 -0
  471. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -0
  472. package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts +26 -0
  473. package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -0
  474. package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts +43 -0
  475. package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
  476. package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-algorithm.d.ts +10 -0
  477. package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-algorithm.d.ts.map +1 -0
  478. package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-spec.d.ts +23 -0
  479. package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-spec.d.ts.map +1 -0
  480. package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts +5 -0
  481. package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -1
  482. package/lib/typescript/module/src/modules/bt-management/types/custom-device-spec.d.ts +12 -0
  483. package/lib/typescript/module/src/modules/bt-management/types/custom-device-spec.d.ts.map +1 -1
  484. package/lib/typescript/module/src/modules/bt-management/types/custom-field-encoding.d.ts +7 -1
  485. package/lib/typescript/module/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -1
  486. package/lib/typescript/module/src/modules/bt-management/types/custom-frame-spec.d.ts +8 -0
  487. package/lib/typescript/module/src/modules/bt-management/types/custom-frame-spec.d.ts.map +1 -1
  488. package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts +44 -0
  489. package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -0
  490. package/lib/typescript/module/src/modules/bt-management/types/custom-measurement-spec.d.ts +9 -0
  491. package/lib/typescript/module/src/modules/bt-management/types/custom-measurement-spec.d.ts.map +1 -0
  492. package/lib/typescript/module/src/modules/bt-management/types/dependent-result-handler-params.d.ts +7 -0
  493. package/lib/typescript/module/src/modules/bt-management/types/dependent-result-handler-params.d.ts.map +1 -1
  494. package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts +27 -0
  495. package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts.map +1 -0
  496. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
  497. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  498. package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts +3 -1
  499. package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
  500. package/lib/typescript/module/src/modules/bt-management/types/measurement-group.d.ts +14 -0
  501. package/lib/typescript/module/src/modules/bt-management/types/measurement-group.d.ts.map +1 -0
  502. package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts +17 -0
  503. package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
  504. package/lib/typescript/module/src/modules/bt-management/utils/calculate-checksum.d.ts +13 -0
  505. package/lib/typescript/module/src/modules/bt-management/utils/calculate-checksum.d.ts.map +1 -0
  506. package/lib/typescript/module/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
  507. package/lib/typescript/module/src/modules/bt-management/utils/create-frame-validator.d.ts.map +1 -1
  508. package/lib/typescript/module/src/modules/bt-management/utils/hex-to-bytes.d.ts +10 -0
  509. package/lib/typescript/module/src/modules/bt-management/utils/hex-to-bytes.d.ts.map +1 -0
  510. package/lib/typescript/module/src/modules/bt-management/utils/le-32-to-bytes.d.ts +3 -0
  511. package/lib/typescript/module/src/modules/bt-management/utils/le-32-to-bytes.d.ts.map +1 -0
  512. package/lib/typescript/module/src/modules/bt-management/utils/parse-measurement.d.ts +4 -1
  513. package/lib/typescript/module/src/modules/bt-management/utils/parse-measurement.d.ts.map +1 -1
  514. package/lib/typescript/module/src/modules/bt-management/utils/reject-custom-reading.d.ts +15 -0
  515. package/lib/typescript/module/src/modules/bt-management/utils/reject-custom-reading.d.ts.map +1 -0
  516. package/lib/typescript/module/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts +9 -0
  517. package/lib/typescript/module/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts.map +1 -0
  518. package/lib/typescript/module/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts +10 -0
  519. package/lib/typescript/module/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts.map +1 -0
  520. package/package.json +1 -1
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.recordLepuIdentity = exports.createLepuSequencer = void 0;
7
+ var _sentryLogger = require("../../../../helpers/utils/sentry-logger.js");
8
+ var _lepuCommandBuilder = require("../lepu/lepu.command-builder.js");
9
+ var _lepuIdentityGate = require("../lepu/lepu.identity-gate.js");
10
+ /** Registration guarantees at least one start byte; this keeps the indexed read total. */
11
+ const DEFAULT_START_BYTE = "a5";
12
+ /**
13
+ * Builds the gate a Lepu declaration asks for.
14
+ *
15
+ * A fresh builder each time, because its sequence number is per connection: one shared
16
+ * across devices would interleave their counters, which is a defect the vendor's own global
17
+ * counter has.
18
+ *
19
+ * Frames are built with the first declared start byte. A device that accepts either still
20
+ * answers on the one it is addressed with, so the list matters for reading and its head for
21
+ * writing.
22
+ */
23
+ /**
24
+ * Records what the device said it was.
25
+ *
26
+ * The model number is logged because it is the only place one exists: the vendor's SDK
27
+ * never reads the field back, so a declaration written without it is completed by
28
+ * connecting once and reading this line.
29
+ */
30
+ const recordLepuIdentity = (deviceData, info) => {
31
+ deviceData.sn = info.serialNumber;
32
+ (0, _sentryLogger.sentryLogger)("info", "BT_MANAGER: Device identified itself", {
33
+ deviceId: deviceData.id,
34
+ deviceName: deviceData.name,
35
+ deviceType: info.deviceType,
36
+ branchCode: info.branchCode,
37
+ protocolMaxLength: info.protocolMaxLength
38
+ });
39
+ };
40
+ exports.recordLepuIdentity = recordLepuIdentity;
41
+ const createLepuSequencer = (lepu, report) => new _lepuIdentityGate.LepuIdentityGate({
42
+ write: {
43
+ serviceUuid: lepu.write.serviceUuid,
44
+ characteristicUuid: lepu.write.characteristicUuid
45
+ },
46
+ builder: new _lepuCommandBuilder.LepuCommandBuilder(lepu.startBytes[0] ?? DEFAULT_START_BYTE),
47
+ expectedDeviceTypes: lepu.expectedDeviceTypes,
48
+ ...(lepu.pollCommand === undefined ? {} : {
49
+ pollCommand: lepu.pollCommand
50
+ }),
51
+ onIdentified: report.onIdentified,
52
+ onRefused: report.onRefused
53
+ });
54
+ exports.createLepuSequencer = createLepuSequencer;
55
+ //# sourceMappingURL=custom-lepu-sequencer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_sentryLogger","require","_lepuCommandBuilder","_lepuIdentityGate","DEFAULT_START_BYTE","recordLepuIdentity","deviceData","info","sn","serialNumber","sentryLogger","deviceId","id","deviceName","name","deviceType","branchCode","protocolMaxLength","exports","createLepuSequencer","lepu","report","LepuIdentityGate","write","serviceUuid","characteristicUuid","builder","LepuCommandBuilder","startBytes","expectedDeviceTypes","pollCommand","undefined","onIdentified","onRefused"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/custom/custom-lepu-sequencer.ts"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAIA,IAAAC,mBAAA,GAAAD,OAAA;AAEA,IAAAE,iBAAA,GAAAF,OAAA;AAEA;AACA,MAAMG,kBAAkB,GAAG,IAAI;AAO/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,GAAGA,CACzBC,UAAsB,EACtBC,IAAoB,KACX;EACTD,UAAU,CAACE,EAAE,GAAGD,IAAI,CAACE,YAAY;EAEjC,IAAAC,0BAAY,EAAC,MAAM,EAAE,sCAAsC,EAAE;IAC3DC,QAAQ,EAAEL,UAAU,CAACM,EAAE;IACvBC,UAAU,EAAEP,UAAU,CAACQ,IAAI;IAC3BC,UAAU,EAAER,IAAI,CAACQ,UAAU;IAC3BC,UAAU,EAAET,IAAI,CAACS,UAAU;IAC3BC,iBAAiB,EAAEV,IAAI,CAACU;EAC1B,CAAC,CAAC;AACJ,CAAC;AAACC,OAAA,CAAAb,kBAAA,GAAAA,kBAAA;AAEF,MAAMc,mBAAmB,GAAGA,CAC1BC,IAAoB,EACpBC,MAAsB,KAEtB,IAAIC,kCAAgB,CAAC;EACnBC,KAAK,EAAE;IACLC,WAAW,EAAEJ,IAAI,CAACG,KAAK,CAACC,WAAW;IACnCC,kBAAkB,EAAEL,IAAI,CAACG,KAAK,CAACE;EACjC,CAAC;EACDC,OAAO,EAAE,IAAIC,sCAAkB,CAACP,IAAI,CAACQ,UAAU,CAAC,CAAC,CAAC,IAAIxB,kBAAkB,CAAC;EACzEyB,mBAAmB,EAAET,IAAI,CAACS,mBAAmB;EAC7C,IAAIT,IAAI,CAACU,WAAW,KAAKC,SAAS,GAAG,CAAC,CAAC,GAAG;IAAED,WAAW,EAAEV,IAAI,CAACU;EAAY,CAAC,CAAC;EAC5EE,YAAY,EAAEX,MAAM,CAACW,YAAY;EACjCC,SAAS,EAAEZ,MAAM,CAACY;AACpB,CAAC,CAAC;AAACf,OAAA,CAAAC,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -6,9 +6,11 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.CustomDevice = void 0;
7
7
  var _caseType = require("../../../types/case-type.js");
8
8
  var _createFrameValidator = require("../../../utils/create-frame-validator.js");
9
+ var _parseMeasurement = require("../../../utils/parse-measurement.js");
10
+ var _rejectCustomReading = require("../../../utils/reject-custom-reading.js");
9
11
  var _btManagedDevice = require("../bt-managed-device.js");
10
- const RESERVED_KEYS = ["measurementTypeKey", "caseType"];
11
-
12
+ var _lepuFrameReader = require("../lepu/lepu.frame-reader.js");
13
+ var _customLepuSequencer = require("./custom-lepu-sequencer.js");
12
14
  /**
13
15
  * Runs a device registered with defineCustomDevice.
14
16
  *
@@ -25,10 +27,37 @@ class CustomDevice extends _btManagedDevice.BTManagedDevice {
25
27
  this.definition = definition;
26
28
  this.mainServices = definition.mainServices;
27
29
  this.stuckDataTimeout = definition.stuckDataTimeout;
30
+ if (definition.preferredMtu !== undefined) {
31
+ this.preferredMtu = definition.preferredMtu;
32
+ }
33
+ this.declareLepuProtocol(definition);
28
34
  definition.frames.forEach((frame, uuid) => {
29
35
  this.validators.set(uuid, (0, _createFrameValidator.createFrameValidator)(frame));
30
36
  });
31
37
  }
38
+
39
+ /**
40
+ * Gives a Lepu declaration its frame reader and its command sequence.
41
+ *
42
+ * Both or neither: the reader finds frame edges the family's own way, and the gate is
43
+ * what decides anything may be sent at all. A declaration that had the reader without the
44
+ * gate would poll hardware it had not identified, which is the case the gate exists for.
45
+ */
46
+ declareLepuProtocol(definition) {
47
+ const lepu = definition.lepu;
48
+ if (!lepu) {
49
+ return;
50
+ }
51
+ this.frameReader = new _lepuFrameReader.LepuFrameReader(lepu.startBytes);
52
+ this.createCommandSequencer = () => (0, _customLepuSequencer.createLepuSequencer)(lepu, {
53
+ onIdentified: this.onIdentified,
54
+ onRefused: this.onIdentityRefused
55
+ });
56
+ }
57
+ onIdentified = info => (0, _customLepuSequencer.recordLepuIdentity)(this.deviceData, info);
58
+ onIdentityRefused = reason => {
59
+ this.onError?.(new Error(`Custom device "${this.definition.id}" was not addressed: ${reason}.`));
60
+ };
32
61
  validatePackage = (pkg, uuid) => {
33
62
  const validate = this.validators.get(String(uuid ?? "").toLowerCase());
34
63
  if (!validate) {
@@ -44,7 +73,7 @@ class CustomDevice extends _btManagedDevice.BTManagedDevice {
44
73
  */
45
74
  handleDependentResult = data => {
46
75
  try {
47
- this.report(data.parsedData);
76
+ this.reportFrame(data);
48
77
  } catch (error) {
49
78
  this.onError?.(error);
50
79
  }
@@ -64,39 +93,63 @@ class CustomDevice extends _btManagedDevice.BTManagedDevice {
64
93
  handleSuccessResult() {
65
94
  return;
66
95
  }
67
- report(parsedData) {
68
- const measurementTypeKey = parsedData.measurementTypeKey;
69
- if (!measurementTypeKey) {
70
- this.fail("a result frame carries no measurement type", parsedData);
96
+
97
+ /**
98
+ * Reports what the frame carried, which may be more than one reading.
99
+ *
100
+ * A device handing over its stored history answers one request with every record it
101
+ * holds, back to back. Those were taken at different times and are separate readings, so
102
+ * each record is decoded and reported on its own. A trailing part-record is ignored: half
103
+ * a record is not a reading.
104
+ */
105
+ reportFrame(data) {
106
+ const repeated = data.parsingCase.repeatedRecords;
107
+ if (!repeated || !data.frame) {
108
+ this.report(data.parsedData, data.parsingCase);
71
109
  return;
72
110
  }
73
- const names = Object.keys(parsedData).filter(key => !RESERVED_KEYS.includes(key));
74
- if (names.length === 0) {
75
- this.fail("a result frame decoded no properties", parsedData);
76
- return;
111
+ const records = Math.floor((data.frame.length - repeated.from) / repeated.recordBytes);
112
+ for (let record = 0; record < records; record++) {
113
+ this.report((0, _parseMeasurement.parseMeasurement)(data.frame, data.parsingCase, repeated.from + record * repeated.recordBytes), data.parsingCase);
77
114
  }
78
- const rejection = names.map(name => this.reject(measurementTypeKey, name, parsedData[name])).find(message => message !== undefined);
79
- if (rejection) {
80
- this.fail(rejection, parsedData);
115
+ }
116
+
117
+ /**
118
+ * Reports every reading the frame carried.
119
+ *
120
+ * One frame is often one reading, but a multi-parameter monitor sends a heart rate, an
121
+ * oxygen saturation and a temperature together. Those are separate measurements, so they
122
+ * are reported separately rather than merged into one object whose properties came from
123
+ * different instruments.
124
+ *
125
+ * A reading that fails its checks is discarded on its own. A temperature the device could
126
+ * not take is no reason to withhold the heart rate in the same frame.
127
+ */
128
+ report(parsedData, parsingCase) {
129
+ const measurements = parsingCase.measurements ?? [];
130
+ if (measurements.length === 0) {
131
+ this.discard("a result frame carries no measurement type", parsedData);
81
132
  return;
82
133
  }
83
- this.onResult?.(parsedData);
134
+ measurements.forEach(measurement => this.reportMeasurement(parsedData, measurement));
84
135
  }
85
- reject(measurementTypeKey, name, value) {
86
- const field = this.definition.fields.get(`${measurementTypeKey}:${name}`);
87
- if (!field) {
88
- return `decoded "${name}", which is not declared for ${measurementTypeKey}`;
89
- }
90
- if (typeof value !== "number" || !Number.isFinite(value)) {
91
- return `could not decode ${name}; the frame was shorter than the declaration expects`;
92
- }
93
- if (value < field.min || value > field.max) {
94
- return `decoded ${name} = ${value} ${field.unit}, outside the accepted range ${field.min}-${field.max} ${field.unit}`;
95
- }
96
- return undefined;
136
+ discard(reason, parsedData) {
137
+ this.onError?.((0, _rejectCustomReading.discardedReadingError)(this.definition.id, reason, parsedData));
97
138
  }
98
- fail(reason, parsedData) {
99
- this.onError?.(new Error(`Custom device "${this.definition.id}": ${reason}. The reading was discarded (decoded ${JSON.stringify(parsedData)}).`));
139
+ reportMeasurement(parsedData, measurement) {
140
+ const reading = {
141
+ caseType: parsedData.caseType,
142
+ measurementTypeKey: measurement.measurementTypeKey
143
+ };
144
+ measurement.fieldNames.forEach(name => {
145
+ reading[name] = parsedData[name];
146
+ });
147
+ const rejection = measurement.fieldNames.map(name => (0, _rejectCustomReading.rejectCustomReading)(this.definition.fields, measurement.measurementTypeKey, name, reading[name])).find(message => message !== undefined);
148
+ if (rejection) {
149
+ this.discard(rejection, reading);
150
+ return;
151
+ }
152
+ this.onResult?.(reading);
100
153
  }
101
154
  }
102
155
  exports.CustomDevice = CustomDevice;
@@ -1 +1 @@
1
- {"version":3,"names":["_caseType","require","_createFrameValidator","_btManagedDevice","RESERVED_KEYS","CustomDevice","BTManagedDevice","validators","Map","constructor","device","params","definition","mainServices","stuckDataTimeout","frames","forEach","frame","uuid","set","createFrameValidator","validatePackage","pkg","validate","get","String","toLowerCase","handleDependentResult","data","report","parsedData","error","onError","parsingCase","caseType","CaseType","OTHER","handleSuccessResult","measurementTypeKey","fail","names","Object","keys","filter","key","includes","length","rejection","map","name","reject","find","message","undefined","onResult","value","field","fields","Number","isFinite","min","max","unit","reason","Error","id","JSON","stringify","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/custom/custom.device.ts"],"mappings":";;;;;;AAEA,IAAAA,SAAA,GAAAC,OAAA;AAQA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,gBAAA,GAAAF,OAAA;AAKA,MAAMG,aAAa,GAAG,CAAC,oBAAoB,EAAE,UAAU,CAAC;;AAExD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,YAAY,SAASC,gCAAe,CAAiB;EAM/CC,UAAU,GAAG,IAAIC,GAAG,CAAqC,CAAC;EAE3EC,WAAWA,CACTC,MAAc,EACdC,MAA0C,EAC1CC,UAAkC,EAClC;IACA,KAAK,CAACF,MAAM,EAAEC,MAAM,CAAC;IAErB,IAAI,CAACC,UAAU,GAAGA,UAAU;IAC5B,IAAI,CA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ACvH;IAEA,OAAOT,SAAS;EAClB;EAEQd,IAAIA,CAACwB,MAAc,EAAEjC,UAAwB,EAAQ;IAC3D,IAAI,CAACE,OAAO,GACV,IAAIgC,KAAK,CACP,kBAAkB,IAAI,CAACpD,UAAU,CAACqD,EAAE,MAAMF,MAAM,wCAAwCG,IAAI,CAACC,SAAS,CAACrC,UAAU,CAAC,IACpH,CACF,CAAC;EACH;AACF;AAACsC,OAAA,CAAA/D,YAAA,GAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["_caseType","require","_createFrameValidator","_parseMeasurement","_rejectCustomReading","_btManagedDevice","_lepuFrameReader","_customLepuSequencer","CustomDevice","BTManagedDevice","validators","Map","constructor","device","params","definition","mainServices","stuckDataTimeout","preferredMtu","undefined","declareLepuProtocol","frames","forEach","frame","uuid","set","createFrameValidator","lepu","frameReader","LepuFrameReader","startBytes","createCommandSequencer","createLepuSequencer","onIdentified","onRefused","onIdentityRefused","info","recordLepuIdentity","deviceData","reason","onError","Error","id","validatePackage","pkg","validate","get","String","toLowerCase","handleDependentResult","data","reportFrame","error","parsingCase","caseType","CaseType","OTHER","handleSuccessResult","repeated","repeatedRecords","report","parsedData","records","Math","floor","length","from","recordBytes","record","parseMeasurement","measurements","discard","measurement","reportMeasurement","discardedReadingError","reading","measurementTypeKey","fieldNames","name","rejection","map","rejectCustomReading","fields","find","message","onResult","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/custom/custom.device.ts"],"mappings":";;;;;;AAEA,IAAAA,SAAA,GAAAC,OAAA;AAUA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AAIA,IAAAI,gBAAA,GAAAJ,OAAA;AAEA,IAAAK,gBAAA,GAAAL,OAAA;AAEA,IAAAM,oBAAA,GAAAN,OAAA;AAQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMO,YAAY,SAASC,gC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AU,CACrCG,GAAG,CAAEF,IAAI,IACR,IAAAG,wCAAmB,EACjB,IAAI,CAAClE,UAAU,CAACmE,MAAM,EACtBV,WAAW,CAACI,kBAAkB,EAC9BE,IAAI,EACJH,OAAO,CAACG,IAAI,CACd,CACF,CAAC,CACAK,IAAI,CAAEC,OAAO,IAAKA,OAAO,KAAKjE,SAAS,CAAC;IAE3C,IAAI4D,SAAS,EAAE;MACb,IAAI,CAACR,OAAO,CAACQ,SAAS,EAAEJ,OAAO,CAAC;MAEhC;IACF;IAEA,IAAI,CAACU,QAAQ,GAAGV,OAAO,CAAC;EAC1B;AAEF;AAACW,OAAA,CAAA9E,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -34,7 +34,8 @@ class FrameParser {
34
34
  return {
35
35
  parsingCase,
36
36
  measurementTypeKey: parsingCase.measurementTypeKey,
37
- parsedData: parsedData
37
+ parsedData: parsedData,
38
+ frame
38
39
  };
39
40
  }
40
41
  findParsingModel(uuid) {
@@ -1 +1 @@
1
- {"version":3,"names":["_parseMeasurement","require","FrameParser","constructor","mainServices","parse","uuid","frame","parsingModel","findParsingModel","caseValue","readCaseValue","parsingCase","cases","find","declared","parsedData","parseMeasurement","measurementTypeKey","mainService","characteristic","monitorUuids","monitored","toLowerCase","undefined","caseValuePosition","map","index","join","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/frame-parser.ts"],"mappings":";;;;;;AAMA,IAAAA,iBAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,WAAW,CAAwB;EAC9CC,WAAWA,CAAkBC,YAA2C,EAAE;IAAA,KAA7CA,YAA2C,GAA3CA,YAA2C;EAAG;EAEpEC,KAAKA,CACVC,IAAY,EACZC,KAAe,EAC8B;IAC7C,MAAMC,YAAY,GAAG,IAAI,CAACC,gBAAgB,CAACH,IAAI,CAAC;IAEhD,IAAI,CAACE,YAAY,EAAE;MACjB;IACF;IAEA,MAAME,SAAS,GAAG,IAAI,CAACC,aAAa,CAACH,YAAY,EAAED,KAAK,CAAC;IAEzD,MAAMK,WAAW,GAAGJ,YAAY,CAACK,KAAK,EAAEC,IAAI,CACzCC,QAAQ,IAAKA,QAAQ,CAACL,SAAS,KAAKA,SACvC,CAAC;IAED,IAAI,CAACE,WAAW,EAAE;MAChB;IACF;IAEA,MAAMI,UAAU,GAAG,IAAAC,kCAAgB,EAACV,KAAK,EAAEK,WAAW,CAAC;IAEvD,IAAI,CAACI,UAAU,EAAE;MACf;IACF;IAEA,OAAO;MACLJ,WAAW;MACXM,kBAAkB,EAAEN,WAAW,CAACM,kBAAkB;MAClDF,UAAU,EAAEA;IACd,CAAC;EACH;EAEQP,gBAAgBA,CAACH,IAAY,EAA4B;IAC/D,KAAK,MAAMa,WAAW,IAAI,IAAI,CAACf,YAAY,EAAE;MAC3C,MAAMgB,cAAc,GAAGD,WAAW,CAACE,YAAY,CAACP,IAAI,CACjDQ,SAAS,IAAKA,SAAS,CAAChB,IAAI,CAACiB,WAAW,CAAC,CAAC,KAAKjB,IAAI,CAACiB,WAAW,CAAC,CACnE,CAAC;MAED,IAAIH,cAAc,EAAE;QAClB,OAAOA,cAAc,CAACZ,YAAY;MACpC;IACF;IAEA,OAAOgB,SAAS;EAClB;EAEQb,aAAaA,CAACH,YAA0B,EAAED,KAAe,EAAU;IACzE,OACEC,YAAY,CAACiB,iBAAiB,EAAEC,GAAG,CAAEC,KAAK,IAAKpB,KAAK,CAACoB,KAAK,CAAC,CAAC,CAACC,IAAI,CAAC,EAAE,CAAC,IACrE,EAAE;EAEN;AACF;AAACC,OAAA,CAAA3B,WAAA,GAAAA,WAAA","ignoreList":[]}
1
+ {"version":3,"names":["_parseMeasurement","require","FrameParser","constructor","mainServices","parse","uuid","frame","parsingModel","findParsingModel","caseValue","readCaseValue","parsingCase","cases","find","declared","parsedData","parseMeasurement","measurementTypeKey","mainService","characteristic","monitorUuids","monitored","toLowerCase","undefined","caseValuePosition","map","index","join","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/frame-parser.ts"],"mappings":";;;;;;AAMA,IAAAA,iBAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,WAAW,CAAwB;EAC9CC,WAAWA,CAAkBC,YAA2C,EAAE;IAAA,KAA7CA,YAA2C,GAA3CA,YAA2C;EAAG;EAEpEC,KAAKA,CACVC,IAAY,EACZC,KAAe,EAC8B;IAC7C,MAAMC,YAAY,GAAG,IAAI,CAACC,gBAAgB,CAACH,IAAI,CAAC;IAEhD,IAAI,CAACE,YAAY,EAAE;MACjB;IACF;IAEA,MAAME,SAAS,GAAG,IAAI,CAACC,aAAa,CAACH,YAAY,EAAED,KAAK,CAAC;IAEzD,MAAMK,WAAW,GAAGJ,YAAY,CAACK,KAAK,EAAEC,IAAI,CACzCC,QAAQ,IAAKA,QAAQ,CAACL,SAAS,KAAKA,SACvC,CAAC;IAED,IAAI,CAACE,WAAW,EAAE;MAChB;IACF;IAEA,MAAMI,UAAU,GAAG,IAAAC,kCAAgB,EAACV,KAAK,EAAEK,WAAW,CAAC;IAEvD,IAAI,CAACI,UAAU,EAAE;MACf;IACF;IAEA,OAAO;MACLJ,WAAW;MACXM,kBAAkB,EAAEN,WAAW,CAACM,kBAAkB;MAClDF,UAAU,EAAEA,UAAwC;MACpDT;IACF,CAAC;EACH;EAEQE,gBAAgBA,CAACH,IAAY,EAA4B;IAC/D,KAAK,MAAMa,WAAW,IAAI,IAAI,CAACf,YAAY,EAAE;MAC3C,MAAMgB,cAAc,GAAGD,WAAW,CAACE,YAAY,CAACP,IAAI,CACjDQ,SAAS,IAAKA,SAAS,CAAChB,IAAI,CAACiB,WAAW,CAAC,CAAC,KAAKjB,IAAI,CAACiB,WAAW,CAAC,CACnE,CAAC;MAED,IAAIH,cAAc,EAAE;QAClB,OAAOA,cAAc,CAACZ,YAAY;MACpC;IACF;IAEA,OAAOgB,SAAS;EAClB;EAEQb,aAAaA,CAACH,YAA0B,EAAED,KAAe,EAAU;IACzE,OACEC,YAAY,CAACiB,iBAAiB,EAAEC,GAAG,CAAEC,KAAK,IAAKpB,KAAK,CAACoB,KAAK,CAAC,CAAC,CAACC,IAAI,CAAC,EAAE,CAAC,IACrE,EAAE;EAEN;AACF;AAACC,OAAA,CAAA3B,WAAA,GAAAA,WAAA","ignoreList":[]}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LepuCommandBuilder = void 0;
7
+ var _calculateCrc = require("../../../utils/calculate-crc-8.js");
8
+ const REQUEST_TYPE = 0x00;
9
+ const BYTE_MASK = 0xff;
10
+ const BYTE_VALUES = 0x100;
11
+
12
+ /** The sequence number wraps here, matching the vendor's own counter. */
13
+ const MAX_SEQUENCE_NUMBER = 254;
14
+ const toHex = byte => (byte & BYTE_MASK).toString(16).padStart(2, "0");
15
+
16
+ /**
17
+ * Builds the commands a Lepu device accepts.
18
+ *
19
+ * Layout: `start | cmd | ~cmd | type | seq | lenLow lenHigh | payload | crc8`, the same frame
20
+ * the device answers with. The type byte is 0x00 on a request, and the checksum covers every
21
+ * byte before it.
22
+ *
23
+ * The sequence number is write-only bookkeeping: it wraps at 254 and nothing in the response
24
+ * path reads it back, so it cannot correlate a reply to its request. Correlation is by opcode,
25
+ * and the protocol relies on at most one command being outstanding - which is the constraint
26
+ * any sequencer built on this has to respect.
27
+ *
28
+ * The counter makes a builder stateful, so each connection needs its own. One builder shared
29
+ * across devices would interleave their sequence numbers, which is a defect the vendor's own
30
+ * global counter has and this avoids by construction.
31
+ */
32
+ class LepuCommandBuilder {
33
+ sequenceNumber = 0;
34
+ constructor(startByte = "a5") {
35
+ this.startByte = startByte;
36
+ }
37
+ build(command, payload = []) {
38
+ const header = [this.startByte, toHex(command), toHex(~command), toHex(REQUEST_TYPE), toHex(this.sequenceNumber), toHex(payload.length), toHex(Math.floor(payload.length / BYTE_VALUES))];
39
+ const frame = [...header, ...payload.map(toHex)];
40
+ this.advanceSequence();
41
+ return [...frame, toHex((0, _calculateCrc.calculateCrc8)(frame, frame.length))];
42
+ }
43
+ advanceSequence() {
44
+ this.sequenceNumber = this.sequenceNumber >= MAX_SEQUENCE_NUMBER ? 0 : this.sequenceNumber + 1;
45
+ }
46
+ }
47
+ exports.LepuCommandBuilder = LepuCommandBuilder;
48
+ //# sourceMappingURL=lepu.command-builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_calculateCrc","require","REQUEST_TYPE","BYTE_MASK","BYTE_VALUES","MAX_SEQUENCE_NUMBER","toHex","byte","toString","padStart","LepuCommandBuilder","sequenceNumber","constructor","startByte","build","command","payload","header","length","Math","floor","frame","map","advanceSequence","calculateCrc8","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.command-builder.ts"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAEA,MAAMC,YAAY,GAAG,IAAI;AACzB,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,WAAW,GAAG,KAAK;;AAEzB;AACA,MAAMC,mBAAmB,GAAG,GAAG;AAE/B,MAAMC,KAAK,GAAIC,IAAY,IACzB,CAACA,IAAI,GAAGJ,SAAS,EAAEK,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,kBAAkB,CAAC;EACtBC,cAAc,GAAG,CAAC;EAEnBC,WAAWA,CAAkBC,SAAiB,GAAG,IAAI,EAAE;IAAA,KAA1BA,SAAiB,GAAjBA,SAAiB;EAAU;EAExDC,KAAKA,CAACC,OAAe,EAAEC,OAA0B,GAAG,EAAE,EAAY;IACvE,MAAMC,MAAM,GAAG,CACb,IAAI,CAACJ,SAAS,EACdP,KAAK,CAACS,OAAO,CAAC,EACdT,KAAK,CAAC,CAACS,OAAO,CAAC,EACfT,KAAK,CAACJ,YAAY,CAAC,EACnBI,KAAK,CAAC,IAAI,CAACK,cAAc,CAAC,EAC1BL,KAAK,CAACU,OAAO,CAACE,MAAM,CAAC,EACrBZ,KAAK,CAACa,IAAI,CAACC,KAAK,CAACJ,OAAO,CAACE,MAAM,GAAGd,WAAW,CAAC,CAAC,CAChD;IAED,MAAMiB,KAAK,GAAG,CAAC,GAAGJ,MAAM,EAAE,GAAGD,OAAO,CAACM,GAAG,CAAChB,KAAK,CAAC,CAAC;IAEhD,IAAI,CAACiB,eAAe,CAAC,CAAC;IAEtB,OAAO,CAAC,GAAGF,KAAK,EAAEf,KAAK,CAAC,IAAAkB,2BAAa,EAACH,KAAK,EAAEA,KAAK,CAACH,MAAM,CAAC,CAAC,CAAC;EAC9D;EAEQK,eAAeA,CAAA,EAAS;IAC9B,IAAI,CAACZ,cAAc,GACjB,IAAI,CAACA,cAAc,IAAIN,mBAAmB,GAAG,CAAC,GAAG,IAAI,CAACM,cAAc,GAAG,CAAC;EAC5E;AACF;AAACc,OAAA,CAAAf,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LepuCommand = void 0;
7
+ /**
8
+ * The commands every Lepu device understands.
9
+ *
10
+ * These are the generic opcodes, shared across the whole family. Device-specific opcodes live
11
+ * below 0x40 and belong with their driver, because the same number means different things on
12
+ * different hardware - 0x08 polls realtime data on a BP2 and starts a measurement on others.
13
+ * That collision is why this module holds only the opcodes that are genuinely common, and why
14
+ * a driver must never assume a low opcode is safe to send to an unidentified device.
15
+ */
16
+ const LepuCommand = exports.LepuCommand = {
17
+ /** Link keepalive and round-trip test. Inert. */
18
+ ECHO: 0xe0,
19
+ /**
20
+ * Device information, including the model string.
21
+ *
22
+ * Inert and identical family-wide, which makes it the one command safe to send before a
23
+ * device has been identified - and therefore the way to confirm what something is before
24
+ * addressing it with an opcode that means something else on the wrong hardware.
25
+ */
26
+ GET_INFO: 0xe1,
27
+ GET_BATTERY: 0xe4,
28
+ /** Enumerate the records stored on the device. */
29
+ GET_FILE_LIST: 0xf1,
30
+ /** Begin a read: a 20-byte payload of file name plus a 32-bit offset. */
31
+ READ_FILE_START: 0xf2,
32
+ /** Fetch the next chunk of the file being read. */
33
+ READ_FILE_DATA: 0xf3,
34
+ /** End the read and release the device's file handle. */
35
+ READ_FILE_END: 0xf4
36
+ };
37
+ //# sourceMappingURL=lepu.commands.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["LepuCommand","exports","ECHO","GET_INFO","GET_BATTERY","GET_FILE_LIST","READ_FILE_START","READ_FILE_DATA","READ_FILE_END"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.commands.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG;EACzB;EACAE,IAAI,EAAE,IAAI;EAEV;AACF;AACA;AACA;AACA;AACA;AACA;EACEC,QAAQ,EAAE,IAAI;EAEdC,WAAW,EAAE,IAAI;EAEjB;EACAC,aAAa,EAAE,IAAI;EAEnB;EACAC,eAAe,EAAE,IAAI;EAErB;EACAC,cAAc,EAAE,IAAI;EAEpB;EACAC,aAAa,EAAE;AACjB,CAAU","ignoreList":[]}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.parseLepuDeviceInfo = void 0;
7
+ var _hexToByte = require("../../../utils/hex-to-byte.js");
8
+ var _le16FromHex = require("../../../utils/le-16-from-hex.js");
9
+ var _lepuCommands = require("./lepu.commands.js");
10
+ var _lepuResponseType = require("./lepu.response-type.js");
11
+ const COMMAND_INDEX = 1;
12
+ const HEADER_BYTES = 7;
13
+
14
+ /** Offsets within the payload, per the vendor's own `Bp2DeviceInfo` layout. */
15
+ const BRANCH_CODE_OFFSET = 9;
16
+ const BRANCH_CODE_BYTES = 8;
17
+ const DEVICE_TYPE_OFFSET = 20;
18
+ const PROTOCOL_MAX_LENGTH_OFFSET = 31;
19
+ const SERIAL_LENGTH_OFFSET = 37;
20
+ const SERIAL_OFFSET = 38;
21
+
22
+ /** The vendor clamps the reported serial length, implying firmware has overstated it. */
23
+ const MAX_SERIAL_BYTES = 18;
24
+
25
+ /** Everything up to and including the serial length. Less than this is not device info. */
26
+ const MIN_PAYLOAD_BYTES = SERIAL_OFFSET;
27
+ const NUL = 0;
28
+
29
+ /**
30
+ * Reads a zero-padded ASCII field.
31
+ *
32
+ * These fields are fixed width rather than length-prefixed, so the padding is where the
33
+ * value ends. Reading the full width would append NULs to every string.
34
+ */
35
+ const asciiAt = (frame, start, length) => {
36
+ let text = "";
37
+ for (let index = start; index < start + length; index++) {
38
+ const byte = (0, _hexToByte.hexToByte)(frame[index] ?? "0");
39
+ if (byte === NUL) {
40
+ return text;
41
+ }
42
+ text += String.fromCharCode(byte);
43
+ }
44
+ return text;
45
+ };
46
+
47
+ /** What a Lepu device says it is, in answer to `GET_INFO`. */
48
+
49
+ /**
50
+ * Reads the reply to `GET_INFO`, or nothing if the frame is not one.
51
+ *
52
+ * The command byte is checked rather than assumed, because this is the answer a driver
53
+ * decides its identity on: parsing some other frame as device info would produce a model
54
+ * number out of whatever bytes happened to sit at offset 20, and the gate would then pass
55
+ * on a coincidence.
56
+ *
57
+ * A frame too short to hold the layout is refused for the same reason, as is one whose
58
+ * response type is anything but success: an error reply carries a reason where the device
59
+ * information would be, and reading it as a model number would identify the hardware from
60
+ * an error code. The vendor's own struct is at least 56 bytes; anything shorter than the
61
+ * serial length field cannot be read without inventing the parts that are missing.
62
+ */
63
+ const parseLepuDeviceInfo = frame => {
64
+ if ((0, _hexToByte.hexToByte)(frame[COMMAND_INDEX] ?? "0") !== _lepuCommands.LepuCommand.GET_INFO) {
65
+ return undefined;
66
+ }
67
+ if (!(0, _lepuResponseType.isLepuSuccess)(frame)) {
68
+ return undefined;
69
+ }
70
+ if (frame.length < HEADER_BYTES + MIN_PAYLOAD_BYTES) {
71
+ return undefined;
72
+ }
73
+ const payload = HEADER_BYTES;
74
+ const serialLength = Math.min((0, _hexToByte.hexToByte)(frame[payload + SERIAL_LENGTH_OFFSET] ?? "0"), MAX_SERIAL_BYTES);
75
+ return {
76
+ deviceType: (0, _le16FromHex.le16FromHex)(frame, payload + DEVICE_TYPE_OFFSET),
77
+ protocolMaxLength: (0, _le16FromHex.le16FromHex)(frame, payload + PROTOCOL_MAX_LENGTH_OFFSET),
78
+ branchCode: asciiAt(frame, payload + BRANCH_CODE_OFFSET, BRANCH_CODE_BYTES),
79
+ serialNumber: asciiAt(frame, payload + SERIAL_OFFSET, serialLength)
80
+ };
81
+ };
82
+ exports.parseLepuDeviceInfo = parseLepuDeviceInfo;
83
+ //# sourceMappingURL=lepu.device-info.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_hexToByte","require","_le16FromHex","_lepuCommands","_lepuResponseType","COMMAND_INDEX","HEADER_BYTES","BRANCH_CODE_OFFSET","BRANCH_CODE_BYTES","DEVICE_TYPE_OFFSET","PROTOCOL_MAX_LENGTH_OFFSET","SERIAL_LENGTH_OFFSET","SERIAL_OFFSET","MAX_SERIAL_BYTES","MIN_PAYLOAD_BYTES","NUL","asciiAt","frame","start","length","text","index","byte","hexToByte","String","fromCharCode","parseLepuDeviceInfo","LepuCommand","GET_INFO","undefined","isLepuSuccess","payload","serialLength","Math","min","deviceType","le16FromHex","protocolMaxLength","branchCode","serialNumber","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.device-info.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAEA,MAAMI,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GAAGQ,iBAAiB,EAAE;IACnD,OAAOe,SAAS;EAClB;EAEA,MAAME,OAAO,GAAGzB,YAAY;EAE5B,MAAM0B,YAAY,GAAGC,IAAI,CAACC,GAAG,CAC3B,IAAAX,oBAAS,EAACN,KAAK,CAACc,OAAO,GAAGpB,oBAAoB,CAAC,IAAI,GAAG,CAAC,EACvDE,gBACF,CAAC;EAED,OAAO;IACLsB,UAAU,EAAE,IAAAC,wBAAW,EAACnB,KAAK,EAAEc,OAAO,GAAGtB,kBAAkB,CAAC;IAC5D4B,iBAAiB,EAAE,IAAAD,wBAAW,EAACnB,KAAK,EAAEc,OAAO,GAAGrB,0BAA0B,CAAC;IAC3E4B,UAAU,EAAEtB,OAAO,CAACC,KAAK,EAAEc,OAAO,GAAGxB,kBAAkB,EAAEC,iBAAiB,CAAC;IAC3E+B,YAAY,EAAEvB,OAAO,CAACC,KAAK,EAAEc,OAAO,GAAGnB,aAAa,EAAEoB,YAAY;EACpE,CAAC;AACH,CAAC;AAACQ,OAAA,CAAAd,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.LEPU_DEVICE_NAMES = void 0;
7
+ /**
8
+ * The names the Lepu/Viatom family advertises, as its own SDK matches them.
9
+ *
10
+ * Taken from the vendor's `getDeviceModel`, a 732-line cascade of substring checks that is
11
+ * the whole of how that SDK decides which product it is talking to. The order there matters,
12
+ * because 27 of these names are a prefix of another - `BP2` of `BP2A`, `BP2T`, `BP2W` and
13
+ * three more - so a check that ran in the wrong order would bind a BP2W as a BP2 and poll it
14
+ * with an opcode written for different hardware.
15
+ *
16
+ * It is that function's vocabulary, not a catalogue of everything the vendor sells: a few
17
+ * products - the ER3 and the M12 among them - are identified elsewhere in that app and never
18
+ * reach this list. `lepuNameMatch` accepts a name that is absent, and derives no exclusions
19
+ * for it, which is correct exactly when no name here extends it.
20
+ *
21
+ * They are held here as a flat vocabulary rather than an ordered cascade, because
22
+ * `lepuNameMatch` derives the exclusions from the list itself. Adding a name automatically
23
+ * narrows every name it extends, which an ordered list would leave to whoever inserted it.
24
+ */
25
+ const LEPU_DEVICE_NAMES = exports.LEPU_DEVICE_NAMES = ["AI-S100", "AITele", "AIView VS", "AP-20", "AP-20-WPS", "AirBP", "Aura_BP2", "BBSM BS1", "BBSM P1", "BBSM S1", "BBSM S2", "BBSM S3", "BM10", "BP2", "BP2A", "BP2A Nexus", "BP2B", "BP2T", "BP2V", "BP2W", "BP3", "BP3-B", "BP3-C1", "BP3-C2", "BP3A", "BP3B", "BP3C", "BP3D", "BP3E", "BP3F", "BP3G", "BP3H", "BP3K", "BP3L", "BP3Z", "BP4 Flex", "BPWATCH", "BUZUD-CML", "Band-WU", "Bioland-BGM", "CB1L-1", "CMB590611", "CMB590840", "CMB592254", "CMI_PC303", "CMRing", "CMTouch", "CPR Feedback", "CPR-01", "CPR-02", "CheckADV", "Checkme", "Checkme EX", "Checkme Pod", "Checkme Pod-WPS", "Checkme lite A", "CheckmeLE", "CheckmeLP", "DUAL-SPP", "EM-B", "EM-W", "ER1", "ER1-H", "ER1-L", "ER1-S", "ER1-SP", "ER1-W", "ER1S", "ER2", "ER2-S", "EZY-HB-01", "EZY-HBB-02", "GM_300SNT", "GM_300SNT-BLE", "Genial-T31", "HDM3D", "HDM3G", "HHM1", "HHM2", "HHM3", "HHM4", "JFK1001", "JFR1001", "KCA", "KCB", "KS-60FW", "KardiaBP", "KidsO2-WPS", "LBM-1", "LEPU AED", "LEPU ER1", "LEPU-ER2", "LP ER2", "LP-BP2W", "LPM311", "LPRE", "Le S5", "Le-F2 Pro", "Le-W", "LeRes", "Lepod", "LepodPro", "Lepu PO6", "Lescale F3", "Lescale F4L", "Lescale F4P", "Lescale P3", "M5", "MY-SS2501", "N9+BP2", "O2 Intg", "O2M-WPS", "O2R WAVE", "O2RMed S", "O2Ring", "O2Ring S", "O2Ring SC", "O2Ring SF", "O2Ring SP", "O2Ring-RE", "O2RingF", "OxyU", "OxyU SE", "Oxyfit", "Oxyfit-WPS", "PC-100", "PC-200", "PC-200-BLE", "PC-60B_SN", "PC-60F_SN", "PC-60NW", "PC-60NW-1_SN", "PC-60NW-WPS", "PC-60NW_BLE", "PC-60NW_SN", "PC-66B", "PC-68B", "PC66B-VE", "PC80B", "PC80B-BLE", "PC80B_BLE:", "PC_300SNT", "PC_300SNT-BLE", "PF-10", "PF-10AW", "PF-10AW-1", "PF-10AW1", "PF-10BW", "PF-10BW1", "PF-10BWS", "PF-20", "PF-20AW", "PF-20B", "PF10AW-ME", "PF10BW-VE", "PM10", "PO6B-WE", "POD-1W-WU", "POD-1_SN", "POD-2B_SN", "PoctorM3102", "QC-200", "R10", "R11", "R20", "R200", "R21", "S5W-VU", "S5W_SN", "S6W", "S6W1", "S7BW", "S7W", "S8-AW", "SA10AW-PU", "SHQFlex", "SHQO2Pro", "SI PO2", "SI PO4", "SI PO6", "SP-20", "SP-20-BLE", "SP-20-WPS", "T-201", "TMB-2288", "TMB_2088", "VCOMIN", "VTM AD5", "W12c", "WBP-02", "ZH-SG", "ZH-SG-A606", "aed_box", "iGate", "int-ER2", "le B1", "le S1"];
26
+ //# sourceMappingURL=lepu.device-names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["LEPU_DEVICE_NAMES","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.device-names.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,iBAAoC,GAAAC,OAAA,CAAAD,iBAAA,GAAG,CAClD,SAAS,EACT,QAAQ,EACR,WAAW,EACX,OAAO,EACP,WAAW,EACX,OAAO,EACP,UAAU,EACV,UAAU,EACV,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,MAAM,EACN,KAAK,EACL,MAAM,EACN,YAA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QAAQ,EACR,YAAY,EACZ,WAAW,EACX,WAAW,EACX,SAAS,EACT,cAAc,EACd,aAAa,EACb,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,OAAO,EACP,WAAW,EACX,YAAY,EACZ,WAAW,EACX,eAAe,EACf,OAAO,EACP,SAAS,EACT,WAAW,EACX,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,OAAO,EACP,SAAS,EACT,QAAQ,EACR,WAAW,EACX,WAAW,EACX,MAAM,EACN,SAAS,EACT,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa,EACb,QAAQ,EACR,KAAK,EACL,KAAK,EACL,KAAK,EACL,MAAM,EACN,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,EACP,WAAW,EACX,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,WAAW,EACX,WAAW,EACX,OAAO,EACP,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,EACT,MAAM,EACN,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,EACT,OAAO,EACP,SAAS,EACT,OAAO,EACP,OAAO,CACR","ignoreList":[]}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.lepuNamesFrom = exports.lepuNameBytes = exports.NAME_BYTES = void 0;
7
+ var _hexToByte = require("../../../utils/hex-to-byte.js");
8
+ /** Names are a fixed sixteen bytes, zero padded, in both the listing and the request. */
9
+ const NAME_BYTES = exports.NAME_BYTES = 16;
10
+ const BYTE_MASK = 0xff;
11
+ const NUL = 0;
12
+
13
+ /**
14
+ * A file name as the device expects it: sixteen bytes, zero padded, truncated.
15
+ *
16
+ * The truncation is the device's, not ours - it copies at most sixteen bytes and pads the
17
+ * rest - so two names that agree in their first sixteen bytes are the same file as far as
18
+ * the protocol is concerned.
19
+ */
20
+ const lepuNameBytes = name => Array.from({
21
+ length: NAME_BYTES
22
+ }, (_, index) => index < name.length ? name.charCodeAt(index) & BYTE_MASK : NUL);
23
+
24
+ /** The names in a file listing: a count, then that many fixed-width padded names. */
25
+ exports.lepuNameBytes = lepuNameBytes;
26
+ const lepuNamesFrom = payload => {
27
+ const count = (0, _hexToByte.hexToByte)(payload[0] ?? "0");
28
+ return Array.from({
29
+ length: count
30
+ }, (_, index) => {
31
+ const start = 1 + index * NAME_BYTES;
32
+ return payload.slice(start, start + NAME_BYTES).map(byte => (0, _hexToByte.hexToByte)(byte)).filter(byte => byte !== NUL).map(byte => String.fromCharCode(byte)).join("").trim();
33
+ }).filter(name => name.length > 0);
34
+ };
35
+ exports.lepuNamesFrom = lepuNamesFrom;
36
+ //# sourceMappingURL=lepu.file-names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_hexToByte","require","NAME_BYTES","exports","BYTE_MASK","NUL","lepuNameBytes","name","Array","from","length","_","index","charCodeAt","lepuNamesFrom","payload","count","hexToByte","start","slice","map","byte","filter","String","fromCharCode","join","trim"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.file-names.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA;AACA,MAAMC,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,EAAE;AACrB,MAAME,SAAS,GAAG,IAAI;AACtB,MAAMC,GAAG,GAAG,CAAC;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAIC,IAAY,IACjCC,KAAK,CAACC,IAAI,CAAC;EAAEC,MAAM,EAAER;AAAW,CAAC,EAAE,CAACS,CAAC,EAAEC,KAAK,KAC1CA,KAAK,GAAGL,IAAI,CAACG,MAAM,GAAGH,IAAI,CAACM,UAAU,CAACD,KAAK,CAAC,GAAGR,SAAS,GAAGC,GAC7D,CAAC;;AAEH;AAAAF,O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