@ovok/native 0.4.7 → 0.4.9

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 (245) 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 +44 -0
  6. package/lib/commonjs/modules/bt-management/index.js.map +1 -1
  7. package/lib/commonjs/modules/bt-management/services/bt-manager.js +15 -13
  8. package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
  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 +8 -2
  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/device-creator.js +12 -2
  16. package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
  17. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +184 -0
  18. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +1 -0
  19. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-frame-parser.js +114 -0
  20. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-frame-parser.js.map +1 -0
  21. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js +113 -51
  22. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
  23. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.main-services.js +41 -77
  24. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.main-services.js.map +1 -1
  25. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +15 -1
  26. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
  27. package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +20 -1
  28. package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
  29. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +30 -44
  30. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  31. package/lib/commonjs/modules/bt-management/services/devices/frame-parser.js +2 -1
  32. package/lib/commonjs/modules/bt-management/services/devices/frame-parser.js.map +1 -1
  33. package/lib/commonjs/modules/bt-management/services/devices/sentinel-frame-reader.js +84 -0
  34. package/lib/commonjs/modules/bt-management/services/devices/sentinel-frame-reader.js.map +1 -0
  35. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +27 -53
  36. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
  37. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +55 -0
  38. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -0
  39. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +43 -0
  40. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -0
  41. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +113 -0
  42. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -0
  43. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js +120 -0
  44. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js.map +1 -0
  45. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-device.js +92 -0
  46. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-device.js.map +1 -0
  47. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js +64 -0
  48. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map +1 -0
  49. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +94 -0
  50. package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -0
  51. package/lib/commonjs/modules/bt-management/types/integrated-devices.js +2 -0
  52. package/lib/commonjs/modules/bt-management/types/integrated-devices.js.map +1 -1
  53. package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js +21 -0
  54. package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
  55. package/lib/commonjs/modules/bt-management/utils/parse-measurement.js +10 -7
  56. package/lib/commonjs/modules/bt-management/utils/parse-measurement.js.map +1 -1
  57. package/lib/commonjs/modules/bt-management/utils/reject-custom-reading.js +34 -0
  58. package/lib/commonjs/modules/bt-management/utils/reject-custom-reading.js.map +1 -0
  59. package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js +3 -1
  60. package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
  61. package/lib/module/modules/bt-management/constants/integrated-devices-map.js +1 -1
  62. package/lib/module/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
  63. package/lib/module/modules/bt-management/index.js +4 -0
  64. package/lib/module/modules/bt-management/index.js.map +1 -1
  65. package/lib/module/modules/bt-management/services/bt-manager.js +15 -13
  66. package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
  67. package/lib/module/modules/bt-management/services/custom/compile-case-shape.js +48 -0
  68. package/lib/module/modules/bt-management/services/custom/compile-case-shape.js.map +1 -0
  69. package/lib/module/modules/bt-management/services/custom/compile-custom-case.js +8 -2
  70. package/lib/module/modules/bt-management/services/custom/compile-custom-case.js.map +1 -1
  71. package/lib/module/modules/bt-management/services/custom/compile-custom-field.js +3 -0
  72. package/lib/module/modules/bt-management/services/custom/compile-custom-field.js.map +1 -1
  73. package/lib/module/modules/bt-management/services/device-creator.js +12 -2
  74. package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
  75. package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +180 -0
  76. package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +1 -0
  77. package/lib/module/modules/bt-management/services/devices/bc01/bc01-frame-parser.js +110 -0
  78. package/lib/module/modules/bt-management/services/devices/bc01/bc01-frame-parser.js.map +1 -0
  79. package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js +113 -51
  80. package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
  81. package/lib/module/modules/bt-management/services/devices/bc01/bc01.main-services.js +41 -77
  82. package/lib/module/modules/bt-management/services/devices/bc01/bc01.main-services.js.map +1 -1
  83. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +15 -1
  84. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
  85. package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +20 -1
  86. package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
  87. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +31 -45
  88. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  89. package/lib/module/modules/bt-management/services/devices/frame-parser.js +2 -1
  90. package/lib/module/modules/bt-management/services/devices/frame-parser.js.map +1 -1
  91. package/lib/module/modules/bt-management/services/devices/sentinel-frame-reader.js +79 -0
  92. package/lib/module/modules/bt-management/services/devices/sentinel-frame-reader.js.map +1 -0
  93. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +19 -45
  94. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
  95. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +50 -0
  96. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -0
  97. package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +38 -0
  98. package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -0
  99. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +108 -0
  100. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -0
  101. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js +116 -0
  102. package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js.map +1 -0
  103. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-device.js +87 -0
  104. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-device.js.map +1 -0
  105. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js +60 -0
  106. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map +1 -0
  107. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +89 -0
  108. package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -0
  109. package/lib/module/modules/bt-management/types/device-measurement-map.js +3 -3
  110. package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
  111. package/lib/module/modules/bt-management/types/integrated-devices.js +2 -0
  112. package/lib/module/modules/bt-management/types/integrated-devices.js.map +1 -1
  113. package/lib/module/modules/bt-management/utils/create-custom-field-parser.js +21 -0
  114. package/lib/module/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
  115. package/lib/module/modules/bt-management/utils/parse-measurement.js +10 -7
  116. package/lib/module/modules/bt-management/utils/parse-measurement.js.map +1 -1
  117. package/lib/module/modules/bt-management/utils/reject-custom-reading.js +29 -0
  118. package/lib/module/modules/bt-management/utils/reject-custom-reading.js.map +1 -0
  119. package/lib/typescript/commonjs/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
  120. package/lib/typescript/commonjs/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
  121. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +4 -0
  122. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
  123. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +0 -1
  124. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  125. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-shape.d.ts +19 -0
  126. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-shape.d.ts.map +1 -0
  127. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
  128. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -1
  129. package/lib/typescript/commonjs/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
  130. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts +53 -0
  131. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +1 -0
  132. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts +53 -0
  133. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts.map +1 -0
  134. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts +33 -13
  135. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts.map +1 -1
  136. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts +11 -17
  137. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts.map +1 -1
  138. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts +7 -0
  139. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
  140. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +11 -2
  141. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
  142. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +10 -13
  143. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  144. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/frame-parser.d.ts.map +1 -1
  145. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts +52 -0
  146. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts.map +1 -0
  147. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +22 -13
  148. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +45 -0
  150. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -0
  151. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +18 -0
  152. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -0
  153. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +19 -0
  154. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -0
  155. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts +45 -0
  156. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts.map +1 -0
  157. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts +30 -0
  158. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts.map +1 -0
  159. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts +39 -0
  160. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts.map +1 -0
  161. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +35 -0
  162. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -0
  163. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts +30 -0
  164. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
  165. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-encoding.d.ts +7 -1
  166. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -1
  167. package/lib/typescript/commonjs/src/modules/bt-management/types/dependent-result-handler-params.d.ts +7 -0
  168. package/lib/typescript/commonjs/src/modules/bt-management/types/dependent-result-handler-params.d.ts.map +1 -1
  169. package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts +9 -0
  170. package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts.map +1 -1
  171. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
  172. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  173. package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts +3 -1
  174. package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
  175. package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts +8 -0
  176. package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
  177. package/lib/typescript/commonjs/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
  178. package/lib/typescript/commonjs/src/modules/bt-management/utils/parse-measurement.d.ts +4 -1
  179. package/lib/typescript/commonjs/src/modules/bt-management/utils/parse-measurement.d.ts.map +1 -1
  180. package/lib/typescript/commonjs/src/modules/bt-management/utils/reject-custom-reading.d.ts +15 -0
  181. package/lib/typescript/commonjs/src/modules/bt-management/utils/reject-custom-reading.d.ts.map +1 -0
  182. package/lib/typescript/module/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
  183. package/lib/typescript/module/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
  184. package/lib/typescript/module/src/modules/bt-management/index.d.ts +4 -0
  185. package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
  186. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +0 -1
  187. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  188. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-shape.d.ts +19 -0
  189. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-shape.d.ts.map +1 -0
  190. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
  191. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -1
  192. package/lib/typescript/module/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
  193. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts +53 -0
  194. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +1 -0
  195. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts +53 -0
  196. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts.map +1 -0
  197. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts +33 -13
  198. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts.map +1 -1
  199. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts +11 -17
  200. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts.map +1 -1
  201. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts +7 -0
  202. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
  203. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +11 -2
  204. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
  205. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +10 -13
  206. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  207. package/lib/typescript/module/src/modules/bt-management/services/devices/frame-parser.d.ts.map +1 -1
  208. package/lib/typescript/module/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts +52 -0
  209. package/lib/typescript/module/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts.map +1 -0
  210. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +22 -13
  211. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
  212. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +45 -0
  213. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -0
  214. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +18 -0
  215. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -0
  216. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +19 -0
  217. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -0
  218. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts +45 -0
  219. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts.map +1 -0
  220. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts +30 -0
  221. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts.map +1 -0
  222. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts +39 -0
  223. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts.map +1 -0
  224. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +35 -0
  225. package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -0
  226. package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts +30 -0
  227. package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
  228. package/lib/typescript/module/src/modules/bt-management/types/custom-field-encoding.d.ts +7 -1
  229. package/lib/typescript/module/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -1
  230. package/lib/typescript/module/src/modules/bt-management/types/dependent-result-handler-params.d.ts +7 -0
  231. package/lib/typescript/module/src/modules/bt-management/types/dependent-result-handler-params.d.ts.map +1 -1
  232. package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts +9 -0
  233. package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts.map +1 -1
  234. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
  235. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  236. package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts +3 -1
  237. package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
  238. package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts +8 -0
  239. package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
  240. package/lib/typescript/module/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
  241. package/lib/typescript/module/src/modules/bt-management/utils/parse-measurement.d.ts +4 -1
  242. package/lib/typescript/module/src/modules/bt-management/utils/parse-measurement.d.ts.map +1 -1
  243. package/lib/typescript/module/src/modules/bt-management/utils/reject-custom-reading.d.ts +15 -0
  244. package/lib/typescript/module/src/modules/bt-management/utils/reject-custom-reading.d.ts.map +1 -0
  245. package/package.json +1 -1
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+
3
+ /** Every request is a fixed twenty-byte packet, zero filled but for its group and command. */
4
+ const PACKET_BYTES = 20;
5
+ const GROUP_INDEX = 1;
6
+ const COMMAND_INDEX = 2;
7
+ const PARAMETER_INDEX = 3;
8
+ const DOWNLOAD_GROUP = 4;
9
+ const DOWNLOAD_MODE = 1;
10
+ const DOWNLOAD_HEADER = 2;
11
+ const DOWNLOAD_RAW = 3;
12
+
13
+ /** The transfer's shape, from the vendor's own device table. */
14
+ const PAYLOAD_FROM = 4;
15
+ const PAYLOAD_BYTES = 16;
16
+ const HEADER_PACKETS = 5;
17
+ const PACKETS_PER_SEGMENT = 16;
18
+ const SEGMENTS = 34;
19
+ const BYTE_MASK = 0xff;
20
+ const BYTE_BITS = 8;
21
+ const toHex = byte => (byte & BYTE_MASK).toString(16).padStart(2, "0");
22
+ const packet = (write, command, parameters = []) => {
23
+ const bytes = new Array(PACKET_BYTES).fill(0);
24
+ bytes[GROUP_INDEX] = DOWNLOAD_GROUP;
25
+ bytes[COMMAND_INDEX] = command;
26
+ parameters.forEach((value, index) => {
27
+ bytes[PARAMETER_INDEX + index] = value;
28
+ });
29
+ return {
30
+ ...write,
31
+ frame: bytes.map(toHex)
32
+ };
33
+ };
34
+ const segmentParameters = segment => [segment & BYTE_MASK, segment >> BYTE_BITS & BYTE_MASK, segment >> BYTE_BITS * 2 & BYTE_MASK];
35
+ /**
36
+ * Downloads a recording from the Veroval ECG.
37
+ *
38
+ * The exchange is a fixed walk rather than a conversation: ask for the download mode, then
39
+ * the header, then each second of the recording in turn. The device answers each request
40
+ * with a known number of twenty-byte packets, sixteen payload bytes each, so the transfer is
41
+ * paced by counting them - which is how the vendor's own app paces it, and is the only thing
42
+ * that distinguishes one phase's packets from another's.
43
+ *
44
+ * A recording is thirty-four seconds at 128 Hz. Nothing is reported until all of it has
45
+ * arrived: a partial ECG that looked whole would be worse than none, and the count is what
46
+ * says it is whole.
47
+ */
48
+ export class VerovalEcgTransfer {
49
+ phase = "mode";
50
+ packets = 0;
51
+ segment = 0;
52
+ recording = [];
53
+ constructor(params) {
54
+ this.params = params;
55
+ }
56
+ initialCommands = () => [packet(this.params.write, DOWNLOAD_MODE)];
57
+ nextCommand = frame => {
58
+ if (this.phase === "done") {
59
+ return undefined;
60
+ }
61
+ if (this.phase === "mode") {
62
+ this.phase = "header";
63
+ this.packets = 0;
64
+ return [packet(this.params.write, DOWNLOAD_HEADER)];
65
+ }
66
+ this.packets += 1;
67
+ if (this.phase === "header") {
68
+ return this.packets < HEADER_PACKETS ? undefined : this.requestSegment(0);
69
+ }
70
+ this.recording.push(...frame.slice(PAYLOAD_FROM, PAYLOAD_FROM + PAYLOAD_BYTES));
71
+ return this.packets < PACKETS_PER_SEGMENT ? undefined : this.finishSegment();
72
+ };
73
+ finishSegment = () => {
74
+ this.segment += 1;
75
+ if (this.segment < SEGMENTS) {
76
+ return this.requestSegment(this.segment);
77
+ }
78
+ this.phase = "done";
79
+ this.params.onRecording(this.recording);
80
+ return undefined;
81
+ };
82
+ requestSegment = segment => {
83
+ this.phase = "raw";
84
+ this.packets = 0;
85
+ this.segment = segment;
86
+ return [packet(this.params.write, DOWNLOAD_RAW, segmentParameters(segment))];
87
+ };
88
+ }
89
+ //# sourceMappingURL=veroval.ecg-transfer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["PACKET_BYTES","GROUP_INDEX","COMMAND_INDEX","PARAMETER_INDEX","DOWNLOAD_GROUP","DOWNLOAD_MODE","DOWNLOAD_HEADER","DOWNLOAD_RAW","PAYLOAD_FROM","PAYLOAD_BYTES","HEADER_PACKETS","PACKETS_PER_SEGMENT","SEGMENTS","BYTE_MASK","BYTE_BITS","toHex","byte","toString","padStart","packet","write","command","parameters","bytes","Array","fill","forEach","value","index","frame","map","segmentParameters","segment","VerovalEcgTransfer","phase","packets","recording","constructor","params","initialCommands","nextCommand","undefined","requestSegment","push","slice","finishSegment","onRecording"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-transfer.ts"],"mappings":";;AAGA;AACA,MAAMA,YAAY,GAAG,EAAE;AACvB,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,eAAe,GAAG,CAAC;AAEzB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,eAAe,GAAG,CAAC;AACzB,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,aAAa,GAAG,EAAE;AACxB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,mBAAmB,GAAG,EAAE;AAC9B,MAAMC,QAAQ,GAAG,EAAE;AAEnB,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,SAAS,GAAG,CAAC;AAEnB,MAAMC,KAAK,GAAIC,IAAY,IACzB,CAACA,IAAI,GAAGH,SAAS,EAAEI,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAElD,MAAMC,MAAM,GAAGA,CACbC,KAAmC,EACnCC,OAAe,EACfC,UAA6B,GAAG,EAAE,KAChB;EAClB,MAAMC,KAAK,GAAG,IAAIC,KAAK,CAASxB,YAAY,CAAC,CAACyB,IAAI,CAAC,CAAC,CAAC;EAErDF,KAAK,CAACtB,WAAW,CAAC,GAAGG,cAAc;EACnCmB,KAAK,CAACrB,aAAa,CAAC,GAAGmB,OAAO;EAC9BC,UAAU,CAACI,OAAO,CAAC,CAACC,KAAK,EAAEC,KAAK,KAAK;IACnCL,KAAK,CAACpB,eAAe,GAAGyB,KAAK,CAAC,GAAGD,KAAK;EACxC,CAAC,CAAC;EAEF,OAAO;IAAE,GAAGP,KAAK;IAAES,KAAK,EAAEN,KAAK,CAACO,GAAG,CAACf,KAAK;EAAE,CAAC;AAC9C,CAAC;AAED,MAAMgB,iBAAiB,GAAIC,OAAe,IAAe,CACvDA,OAAO,GAAGnB,SAAS,EAClBmB,OAAO,IAAIlB,SAAS,GAAID,SAAS,EACjCmB,OAAO,IAAKlB,SAAS,GAAG,CAAE,GAAID,SAAS,CACzC;AAaD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMoB,kBAAkB,CAA6B;EAClDC,KAAK,GAAU,MAAM;EACrBC,OAAO,GAAG,CAAC;EACXH,OAAO,GAAG,CAAC;EACXI,SAAS,GAAa,EAAE;EAEzBC,WAAWA,CAAkBC,MAAyB,EAAE;IAAA,KAA3BA,MAAyB,GAAzBA,MAAyB;EAAG;EAEzDC,eAAe,GAAGA,CAAA,KAAgC,CACvDpB,MAAM,CAAC,IAAI,CAACmB,MAAM,CAAClB,KAAK,EAAEf,aAAa,CAAC,CACzC;EAEMmC,WAAW,GAChBX,KAAwB,IACiB;IACzC,IAAI,IAAI,CAACK,KAAK,KAAK,MAAM,EAAE;MACzB,OAAOO,SAAS;IAClB;IAEA,IAAI,IAAI,CAACP,KAAK,KAAK,MAAM,EAAE;MACzB,IAAI,CAACA,KAAK,GAAG,QAAQ;MACrB,IAAI,CAACC,OAAO,GAAG,CAAC;MAEhB,OAAO,CAAChB,MAAM,CAAC,IAAI,CAACmB,MAAM,CAAClB,KAAK,EAAEd,eAAe,CAAC,CAAC;IACrD;IAEA,IAAI,CAAC6B,OAAO,IAAI,CAAC;IAEjB,IAAI,IAAI,CAACD,KAAK,KAAK,QAAQ,EAAE;MAC3B,OAAO,IAAI,CAACC,OAAO,GAAGzB,cAAc,GAAG+B,SAAS,GAAG,IAAI,CAACC,cAAc,CAAC,CAAC,CAAC;IAC3E;IAEA,IAAI,CAACN,SAAS,CAACO,IAAI,CACjB,GAAGd,KAAK,CAACe,KAAK,CAACpC,YAAY,EAAEA,YAAY,GAAGC,aAAa,CAC3D,CAAC;IAED,OAAO,IAAI,CAAC0B,OAAO,GAAGxB,mBAAmB,GACrC8B,SAAS,GACT,IAAI,CAACI,aAAa,CAAC,CAAC;EAC1B,CAAC;EAEOA,aAAa,GAAGA,CAAA,KAA4C;IAClE,IAAI,CAACb,OAAO,IAAI,CAAC;IAEjB,IAAI,IAAI,CAACA,OAAO,GAAGpB,QAAQ,EAAE;MAC3B,OAAO,IAAI,CAAC8B,cAAc,CAAC,IAAI,CAACV,OAAO,CAAC;IAC1C;IAEA,IAAI,CAACE,KAAK,GAAG,MAAM;IACnB,IAAI,CAACI,MAAM,CAACQ,WAAW,CAAC,IAAI,CAACV,SAAS,CAAC;IAEvC,OAAOK,SAAS;EAClB,CAAC;EAEOC,cAAc,GAAIV,OAAe,IAA+B;IACtE,IAAI,CAACE,KAAK,GAAG,KAAK;IAClB,IAAI,CAACC,OAAO,GAAG,CAAC;IAChB,IAAI,CAACH,OAAO,GAAGA,OAAO;IAEtB,OAAO,CACLb,MAAM,CAAC,IAAI,CAACmB,MAAM,CAAClB,KAAK,EAAEb,YAAY,EAAEwB,iBAAiB,CAACC,OAAO,CAAC,CAAC,CACpE;EACH,CAAC;AACH","ignoreList":[]}
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { IntegratedDevices } from "./integrated-devices.js";
4
4
 
5
- /**
6
- * A built-in device has a measurement type the SDK knows statically. A device registered
7
- * through defineCustomDevice reports the catalog-checked properties its declaration named.
5
+ /**
6
+ * A built-in device has a measurement type the SDK knows statically. A device registered
7
+ * through defineCustomDevice reports the catalog-checked properties its declaration named.
8
8
  */
9
9
  //# sourceMappingURL=device-measurement-map.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/device-measurement-map.ts"],"mappings":";;AAWA,SAASA,iBAAiB,QAAQ,yBAAsB;;AAwBxD;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/device-measurement-map.ts"],"mappings":";;AAWA,SAASA,iBAAiB,QAAQ,yBAAsB;;AA0BxD;AACA;AACA;AACA","ignoreList":[]}
@@ -20,6 +20,8 @@ export let IntegratedDevices = /*#__PURE__*/function (IntegratedDevices) {
20
20
  IntegratedDevices["S5"] = "Le S5";
21
21
  IntegratedDevices["ALIVE_COR"] = "alivecor";
22
22
  IntegratedDevices["BGM"] = "BGM";
23
+ IntegratedDevices["VEROVAL_DUO_CONTROL"] = "Veroval duo control";
24
+ IntegratedDevices["VEROVAL_ECG"] = "Veroval ECG";
23
25
  return IntegratedDevices;
24
26
  }({});
25
27
  //# sourceMappingURL=integrated-devices.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/integrated-devices.ts"],"mappings":";;AAAA,WAAYA,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/integrated-devices.ts"],"mappings":";;AAAA,WAAYA,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
@@ -2,7 +2,28 @@
2
2
 
3
3
  import { decodeMedicalFloat } from "./decode-medical-float.js";
4
4
  const HEX_ONLY = /^[0-9a-f]+$/;
5
+ const ASCII_ZERO = 0x30;
6
+ const ASCII_NINE = 0x39;
7
+ const HEX_BYTE = /../g;
8
+
9
+ /**
10
+ * Reads bytes that are decimal digits written as characters, not a number.
11
+ *
12
+ * A byte outside "0"-"9" makes the whole field undefined rather than being skipped: these
13
+ * records are fixed width and a non-digit means the field was not what the declaration
14
+ * says it is, so decoding the rest of it would report a number built from part of a value.
15
+ */
16
+ const fromAsciiDigits = hex => {
17
+ const codes = (hex.match(HEX_BYTE) ?? []).map(byte => parseInt(byte, 16));
18
+ if (codes.length === 0 || codes.some(code => code < ASCII_ZERO || code > ASCII_NINE)) {
19
+ return undefined;
20
+ }
21
+ return Number(codes.map(code => code - ASCII_ZERO).join(""));
22
+ };
5
23
  const toRaw = (hex, field) => {
24
+ if (field.encoding === "ascii") {
25
+ return fromAsciiDigits(hex);
26
+ }
6
27
  const raw = parseInt(hex, 16);
7
28
  const bits = hex.length * 4;
8
29
  if (field.encoding === "int") {
@@ -1 +1 @@
1
- {"version":3,"names":["decodeMedicalFloat","HEX_ONLY","toRaw","hex","field","raw","parseInt","bits","length","encoding","sign","createCustomFieldParser","assembledHex","toLowerCase","byteIndexes","test","undefined","Number","isFinite","value","scale","offset","decimals","factor","Math","round"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/create-custom-field-parser.ts"],"mappings":";;AAEA,SAASA,kBAAkB,QAAQ,2BAAwB;AAE3D,MAAMC,QAAQ,GAAG,aAAa;AAE9B,MAAMC,KAAK,GAAGA,CACZC,GAAW,EACXC,KAA0B,KACH;EACvB,MAAMC,GAAG,GAAGC,QAAQ,CAACH,GAAG,EAAE,EAAE,CAAC;EAC7B,MAAMI,IAAI,GAAGJ,GAAG,CAACK,MAAM,GAAG,CAAC;EAE3B,IAAIJ,KAAK,CAACK,QAAQ,KAAK,KAAK,EAAE;IAC5B,MAAMC,IAAI,GAAG,CAAC,KAAKH,IAAI,GAAG,CAAC,CAAC;IAE5B,OAAOF,GAAG,IAAIK,IAAI,GAAGL,GAAG,GAAGK,IAAI,GAAG,CAAC,GAAGL,GAAG;EAC3C;EAEA,IAAID,KAAK,CAACK,QAAQ,KAAK,QAAQ,EAAE;IAC/B,OAAOT,kBAAkB,CAACK,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;EACvC;EAEA,IAAID,KAAK,CAACK,QAAQ,KAAK,OAAO,EAAE;IAC9B,OAAOT,kBAAkB,CAACK,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;EACvC;EAEA,OAAOA,GAAG;AACZ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMM,uBAAuB,GACjCP,KAA0B,IAC1BQ,YAAoB,IAAyB;EAC5C,MAAMT,GAAG,GAAG,CAACS,YAAY,IAAI,EAAE,EAAEC,WAAW,CAAC,CAAC;EAE9C,IACEV,GAAG,CAACK,MAAM,KAAKJ,KAAK,CAACU,WAAW,CAACN,MAAM,GAAG,CAAC,IAC3C,CAACP,QAAQ,CAACc,IAAI,CAACZ,GAAG,CAAC,EACnB;IACA,OAAOa,SAAS;EAClB;EAEA,MAAMX,GAAG,GAAGH,KAAK,CAACC,GAAG,EAAEC,KAAK,CAAC;EAE7B,IAAIC,GAAG,KAAKW,SAAS,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACb,GAAG,CAAC,EAAE;IAC9C,OAAOW,SAAS;EAClB;EAEA,MAAMG,KAAK,GAAGd,GAAG,GAAGD,KAAK,CAACgB,KAAK,GAAGhB,KAAK,CAACiB,MAAM;EAE9C,IAAI,CAACJ,MAAM,CAACC,QAAQ,CAACC,KAAK,CAAC,EAAE;IAC3B,OAAOH,SAAS;EAClB;EAEA,IAAIZ,KAAK,CAACkB,QAAQ,KAAKN,SAAS,EAAE;IAChC,OAAOG,KAAK;EACd;EAEA,MAAMI,MAAM,GAAG,EAAE,IAAInB,KAAK,CAACkB,QAAQ;EAEnC,OAAOE,IAAI,CAACC,KAAK,CAACN,KAAK,GAAGI,MAAM,CAAC,GAAGA,MAAM;AAC5C,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["decodeMedicalFloat","HEX_ONLY","ASCII_ZERO","ASCII_NINE","HEX_BYTE","fromAsciiDigits","hex","codes","match","map","byte","parseInt","length","some","code","undefined","Number","join","toRaw","field","encoding","raw","bits","sign","createCustomFieldParser","assembledHex","toLowerCase","byteIndexes","test","isFinite","value","scale","offset","decimals","factor","Math","round"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/create-custom-field-parser.ts"],"mappings":"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","ignoreList":[]}
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
2
 
3
- export const parseMeasurement = (measurementInHex, parsingCase) => {
3
+ /**
4
+ * @param byteOffset added to every declared index, for a frame that repeats one record.
5
+ */
6
+ export const parseMeasurement = (measurementInHex, parsingCase, byteOffset = 0) => {
4
7
  const parserDefinitions = parsingCase.parseDefinitions;
5
8
  const result = parserDefinitions.reduce((acc, parserDefinition) => {
6
- const parsingValue = getFullValueForMeasurementProperty(measurementInHex, parserDefinition);
9
+ const parsingValue = getFullValueForMeasurementProperty(measurementInHex, parserDefinition, byteOffset);
7
10
  if (parserDefinition.customParserDefinition) {
8
11
  acc[parserDefinition.name] = parserDefinition.customParserDefinition(parsingValue);
9
12
  } else {
@@ -19,14 +22,14 @@ export const parseMeasurement = (measurementInHex, parsingCase) => {
19
22
  return measurement;
20
23
  };
21
24
 
22
- /** Example: We received message ["1A","02", "00", "50"]. Value for weight is on indexes 2,3. Which means we need to combine 2nd and 3rd indexes to get result
23
- * This method will combine them and return string "0050".
24
- * Indexes should be written in ParseDeinition
25
+ /** Example: We received message ["1A","02", "00", "50"]. Value for weight is on indexes 2,3. Which means we need to combine 2nd and 3rd indexes to get result
26
+ * This method will combine them and return string "0050".
27
+ * Indexes should be written in ParseDeinition
25
28
  */
26
- const getFullValueForMeasurementProperty = (messageInHex, parseDefinition) => {
29
+ const getFullValueForMeasurementProperty = (messageInHex, parseDefinition, byteOffset) => {
27
30
  let valuesInString = "";
28
31
  for (let i = 0; i < parseDefinition.byteIndexes.length; i++) {
29
- valuesInString += messageInHex[parseDefinition.byteIndexes[i] || "0"];
32
+ valuesInString += messageInHex[(parseDefinition.byteIndexes[i] ?? 0) + byteOffset];
30
33
  }
31
34
  return valuesInString;
32
35
  };
@@ -1 +1 @@
1
- {"version":3,"names":["parseMeasurement","measurementInHex","parsingCase","parserDefinitions","parseDefinitions","result","reduce","acc","parserDefinition","parsingValue","getFullValueForMeasurementProperty","customParserDefinition","name","parseInt","measurement","measurementTypeKey","caseType","messageInHex","parseDefinition","valuesInString","i","byteIndexes","length"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/parse-measurement.ts"],"mappings":";;AAMA,OAAO,MAAMA,gBAAgB,GAAGA,CAC9BC,gBAA0B,EAC1BC,WAAwB,KACiB;EACzC,MAAMC,iBAAiB,GAAGD,WAAW,CAACE,gBAAgB;EAEtD,MAAMC,MAAM,GAAGF,iBAAiB,CAACG,MAAM,CACrC,CAACC,GAAG,EAAEC,gBAAgB,KAAK;IACzB,MAAMC,YAAY,GAAGC,kCAAkC,CACrDT,gBAAgB,EAChBO,gBACF,CAAC;IAED,IAAIA,gBAAgB,CAACG,sBAAsB,EAAE;MAC3CJ,GAAG,CAACC,gBAAgB,CAACI,IAAI,CAAC,GACxBJ,gBAAgB,CAACG,sBAAsB,CAACF,YAAY,CAAC;IACzD,CAAC,MAAM;MACLF,GAAG,CAACC,gBAAgB,CAACI,IAAI,CAAC,GAAGC,QAAQ,CAACJ,YAAY,EAAE,EAAE,CAAC;IACzD;IAEA,OAAOF,GAAG;EACZ,CAAC;EACD;EACA,CAAC,CACH,CAAC;EAED,MAAMO,WAAW,GAAGT,MAA8C;EAElES,WAAW,CAACC,kBAAkB,GAAGb,WAAW,CAACa,kBAAmB;EAChED,WAAW,CAACE,QAAQ,GAAGd,WAAW,CAACc,QAAQ;EAE3C,OAAOF,WAAW;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMJ,kCAAkC,GAAGA,CACzCO,YAAsB,EACtBC,eAAiC,KACtB;EACX,IAAIC,cAAc,GAAG,EAAE;EAEvB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,eAAe,CAACG,WAAW,CAACC,MAAM,EAAEF,CAAC,EAAE,EAAE;IAC3DD,cAAc,IAAIF,YAAY,CAACC,eAAe,CAACG,WAAW,CAACD,CAAC,CAAC,IAAI,GAAG,CAAC;EACvE;EAEA,OAAOD,cAAc;AACvB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["parseMeasurement","measurementInHex","parsingCase","byteOffset","parserDefinitions","parseDefinitions","result","reduce","acc","parserDefinition","parsingValue","getFullValueForMeasurementProperty","customParserDefinition","name","parseInt","measurement","measurementTypeKey","caseType","messageInHex","parseDefinition","valuesInString","i","byteIndexes","length"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/parse-measurement.ts"],"mappings":";;AAMA;AACA;AACA;AACA,OAAO,MAAMA,gBAAgB,GAAGA,CAC9BC,gBAA0B,EAC1BC,WAAwB,EACxBC,UAAU,GAAG,CAAC,KAC2B;EACzC,MAAMC,iBAAiB,GAAGF,WAAW,CAACG,gBAAgB;EAEtD,MAAMC,MAAM,GAAGF,iBAAiB,CAACG,MAAM,CACrC,CAACC,GAAG,EAAEC,gBAAgB,KAAK;IACzB,MAAMC,YAAY,GAAGC,kCAAkC,CACrDV,gBAAgB,EAChBQ,gBAAgB,EAChBN,UACF,CAAC;IAED,IAAIM,gBAAgB,CAACG,sBAAsB,EAAE;MAC3CJ,GAAG,CAACC,gBAAgB,CAACI,IAAI,CAAC,GACxBJ,gBAAgB,CAACG,sBAAsB,CAACF,YAAY,CAAC;IACzD,CAAC,MAAM;MACLF,GAAG,CAACC,gBAAgB,CAACI,IAAI,CAAC,GAAGC,QAAQ,CAACJ,YAAY,EAAE,EAAE,CAAC;IACzD;IAEA,OAAOF,GAAG;EACZ,CAAC;EACD;EACA,CAAC,CACH,CAAC;EAED,MAAMO,WAAW,GAAGT,MAA8C;EAElES,WAAW,CAACC,kBAAkB,GAAGd,WAAW,CAACc,kBAAmB;EAChED,WAAW,CAACE,QAAQ,GAAGf,WAAW,CAACe,QAAQ;EAE3C,OAAOF,WAAW;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMJ,kCAAkC,GAAGA,CACzCO,YAAsB,EACtBC,eAAiC,EACjChB,UAAkB,KACP;EACX,IAAIiB,cAAc,GAAG,EAAE;EAEvB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,eAAe,CAACG,WAAW,CAACC,MAAM,EAAEF,CAAC,EAAE,EAAE;IAC3DD,cAAc,IACZF,YAAY,CAAC,CAACC,eAAe,CAACG,WAAW,CAACD,CAAC,CAAC,IAAI,CAAC,IAAIlB,UAAU,CAAC;EACpE;EAEA,OAAOiB,cAAc;AACvB,CAAC","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ /** The reading that was thrown away, and why, so a decoding fault can be diagnosed. */
4
+ const discardedReadingError = (deviceId, reason, parsedData) => new Error(`Custom device "${deviceId}": ${reason}. The reading was discarded (decoded ${JSON.stringify(parsedData)}).`);
5
+
6
+ /**
7
+ * Why a decoded property is not a reading, or nothing when it is.
8
+ *
9
+ * The checks are the last thing between a misread frame and a clinical record, so each one
10
+ * says what was wrong rather than returning a bare false: a property the measurement does
11
+ * not have is a declaration mistake, a value that is not a finite number is a frame shorter
12
+ * than the declaration expects, and a value outside the envelope is a decoding fault
13
+ * wearing the shape of a reading.
14
+ */
15
+ const rejectCustomReading = (fields, measurementTypeKey, name, value) => {
16
+ const field = fields.get(`${measurementTypeKey}:${name}`);
17
+ if (!field) {
18
+ return `decoded "${name}", which is not declared for ${measurementTypeKey}`;
19
+ }
20
+ if (typeof value !== "number" || !Number.isFinite(value)) {
21
+ return `could not decode ${name}; the frame was shorter than the declaration expects`;
22
+ }
23
+ if (value < field.min || value > field.max) {
24
+ return `decoded ${name} = ${value} ${field.unit}, outside the accepted range ${field.min}-${field.max} ${field.unit}`;
25
+ }
26
+ return undefined;
27
+ };
28
+ export { discardedReadingError, rejectCustomReading };
29
+ //# sourceMappingURL=reject-custom-reading.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["discardedReadingError","deviceId","reason","parsedData","Error","JSON","stringify","rejectCustomReading","fields","measurementTypeKey","name","value","field","get","Number","isFinite","min","max","unit","undefined"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/reject-custom-reading.ts"],"mappings":";;AAEA;AACA,MAAMA,qBAAqB,GAAGA,CAC5BC,QAAgB,EAChBC,MAAc,EACdC,UAAmB,KAEnB,IAAIC,KAAK,CACP,kBAAkBH,QAAQ,MAAMC,MAAM,wCAAwCG,IAAI,CAACC,SAAS,CAACH,UAAU,CAAC,IAC1G,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,mBAAmB,GAAGA,CAC1BC,MAAgD,EAChDC,kBAA0B,EAC1BC,IAAY,EACZC,KAAc,KACS;EACvB,MAAMC,KAAK,GAAGJ,MAAM,CAACK,GAAG,CAAC,GAAGJ,kBAAkB,IAAIC,IAAI,EAAE,CAAC;EAEzD,IAAI,CAACE,KAAK,EAAE;IACV,OAAO,YAAYF,IAAI,gCAAgCD,kBAAkB,EAAE;EAC7E;EAEA,IAAI,OAAOE,KAAK,KAAK,QAAQ,IAAI,CAACG,MAAM,CAACC,QAAQ,CAACJ,KAAK,CAAC,EAAE;IACxD,OAAO,oBAAoBD,IAAI,sDAAsD;EACvF;EAEA,IAAIC,KAAK,GAAGC,KAAK,CAACI,GAAG,IAAIL,KAAK,GAAGC,KAAK,CAACK,GAAG,EAAE;IAC1C,OAAO,WAAWP,IAAI,MAAMC,KAAK,IAAIC,KAAK,CAACM,IAAI,gCAAgCN,KAAK,CAACI,GAAG,IAAIJ,KAAK,CAACK,GAAG,IAAIL,KAAK,CAACM,IAAI,EAAE;EACvH;EAEA,OAAOC,SAAS;AAClB,CAAC;AAED,SAASnB,qBAAqB,EAAEO,mBAAmB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"device-instruction-pdfs.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-device/constants/device-instruction-pdfs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAOxD,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAoBrE,CAAC"}
1
+ {"version":3,"file":"device-instruction-pdfs.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-device/constants/device-instruction-pdfs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAOxD,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAsBrE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"integrated-devices-map.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/constants/integrated-devices-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,eAAO,MAAM,oBAAoB,gCAmB/B,CAAC"}
1
+ {"version":3,"file":"integrated-devices-map.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/constants/integrated-devices-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,eAAO,MAAM,oBAAoB,gCAqB/B,CAAC"}
@@ -34,6 +34,10 @@ export * from "./services/devices/custom/custom.device";
34
34
  export * from "./services/bt-manager";
35
35
  export * from "./services/custom/define-custom-device";
36
36
  export * from "./services/devices/standard-gatt/standard-gatt.devices";
37
+ export * from "./services/devices/veroval/veroval.bp-monitors";
38
+ export * from "./services/devices/veroval/veroval.duo-control-device";
39
+ export * from "./services/devices/veroval/veroval.ecg-device";
40
+ export * from "./services/devices/veroval/veroval.ecg-samples";
37
41
  export * from "./services/devices/lepu/lepu.transports";
38
42
  export * from "./services/devices/aoj/aoj.thermometers";
39
43
  export * from "./services/devices/viatom/viatom.bp-monitors";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/bt-management/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uCAAuC,CAAC;AAEtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,wDAAwD,CAAC;AACvE,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4CAA4C,CAAC;AAE3D,cAAc,uCAAuC,CAAC;AAEtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/bt-management/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uCAAuC,CAAC;AAEtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,wDAAwD,CAAC;AACvE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,uDAAuD,CAAC;AACtE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wCAAwC,CAAC;AACvD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yCAAyC,CAAC;AACxD,cAAc,uCAAuC,CAAC;AACtD,cAAc,0CAA0C,CAAC;AACzD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4CAA4C,CAAC;AAE3D,cAAc,uCAAuC,CAAC;AAEtD,cAAc,0BAA0B,CAAC;AACzC,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC"}
@@ -13,7 +13,6 @@ export declare class BTManager<T extends readonly AcceptedDevice[]> {
13
13
  private stateChangeListener;
14
14
  private eventSubscriptions;
15
15
  private deviceCreator;
16
- private lastScanTimestamp;
17
16
  constructor(bleManager: BleManager, acceptedDevices: T);
18
17
  destroy: () => void;
19
18
  startScan: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"bt-manager.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/services/bt-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,UAAU,EAKX,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,qBAAa,SAAS,CAAC,CAAC,SAAS,SAAS,cAAc,EAAE;IAWtD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAXlC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAM;IACzC,OAAO,CAAC,OAAO,CAAsD;IAErE,OAAO,CAAC,mBAAmB,CAA2B;IACtD,OAAO,CAAC,kBAAkB,CAAsB;IAEhD,OAAO,CAAC,aAAa,CAAmB;IACxC,OAAO,CAAC,iBAAiB,CAAa;gBAGnB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,CAAC;IAK9B,OAAO,aAyBZ;IAEK,SAAS,aA0Dd;IAEK,QAAQ,aAmBb;IAEK,aAAa,GAClB,WAAW,CACT,MAAM,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EACvC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,KAClB,OAAO,CAAC,IAAI,CAAC,UAIlB;IAEK,OAAO,GAAI,WAAW,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,UAGxD;IAEK,qBAAqB,GAC1B,WAAW,CAAC,IAAI,EAAE,0BAA0B,KAAK,IAAI,UAIrD;IAEK,QAAQ,GACb,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,UAIzD;IAGF,OAAO,CAAC,gBAAgB,CAAC,CAAiD;IAC1E,OAAO,CAAC,eAAe,CAAC,CAAgC;IACxD,OAAO,CAAC,qBAAqB,CAAC,CAGX;IACnB,OAAO,CAAC,6BAA6B,CAAC,CAE5B;IAEV,OAAO,CAAC,YAAY,CAsElB;IAEF,OAAO,CAAC,8BAA8B,CAUpC;CACH"}
1
+ {"version":3,"file":"bt-manager.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/services/bt-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,UAAU,EAKX,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAG1D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,qBAAa,SAAS,CAAC,CAAC,SAAS,SAAS,cAAc,EAAE;IAUtD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAVlC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAM;IACzC,OAAO,CAAC,OAAO,CAAsD;IAErE,OAAO,CAAC,mBAAmB,CAA2B;IACtD,OAAO,CAAC,kBAAkB,CAAsB;IAEhD,OAAO,CAAC,aAAa,CAAmB;gBAGrB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,CAAC;IAK9B,OAAO,aAuBZ;IAEK,SAAS,aAuDd;IAEK,QAAQ,aAmBb;IAEK,aAAa,GAClB,WAAW,CACT,MAAM,EAAE,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EACvC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,KAClB,OAAO,CAAC,IAAI,CAAC,UAIlB;IAEK,OAAO,GAAI,WAAW,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,UAGxD;IAEK,qBAAqB,GAC1B,WAAW,CAAC,IAAI,EAAE,0BAA0B,KAAK,IAAI,UAIrD;IAEK,QAAQ,GACb,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,UAIzD;IAGF,OAAO,CAAC,gBAAgB,CAAC,CAAiD;IAC1E,OAAO,CAAC,eAAe,CAAC,CAAgC;IACxD,OAAO,CAAC,qBAAqB,CAAC,CAGX;IACnB,OAAO,CAAC,6BAA6B,CAAC,CAE5B;IAEV,OAAO,CAAC,YAAY,CA+ElB;IAEF,OAAO,CAAC,8BAA8B,CAUpC;CACH"}
@@ -0,0 +1,19 @@
1
+ import { CustomCaseSpec } from "../../types/custom-case-spec";
2
+ /**
3
+ * How long a frame of this shape is, which may be longer than the shortest the
4
+ * characteristic emits but never shorter: the selector chose this shape, so its own fields
5
+ * are the ones that have to fit.
6
+ */
7
+ declare const assertCaseLength: (id: string, path: string, caseSpec: CustomCaseSpec, frameMinLengthBytes: number) => number;
8
+ /**
9
+ * A frame that is a run of records, and how wide one is.
10
+ *
11
+ * The characteristic has to guarantee at least one whole record, otherwise a declaration
12
+ * whose fields all fit could still never decode anything.
13
+ */
14
+ declare const assertRepeatedRecords: (id: string, path: string, caseSpec: CustomCaseSpec, frameMinLengthBytes: number) => {
15
+ recordBytes: number;
16
+ from: number;
17
+ } | undefined;
18
+ export { assertCaseLength, assertRepeatedRecords };
19
+ //# sourceMappingURL=compile-case-shape.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compile-case-shape.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/compile-case-shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAI9D;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,GACpB,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,UAAU,cAAc,EACxB,qBAAqB,MAAM,KAC1B,MAgBF,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,qBAAqB,GACzB,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,UAAU,cAAc,EACxB,qBAAqB,MAAM,KAC1B;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAkC1C,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"compile-custom-case.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/compile-custom-case.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAI9D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AA4FvD,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,GAC5B,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,UAAU,cAAc,EACxB,gBAAgB,MAAM,EACtB,QAAQ,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,KACvC,WA4FF,CAAC"}
1
+ {"version":3,"file":"compile-custom-case.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/compile-custom-case.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAI9D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAgGvD,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,GAC5B,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,UAAU,cAAc,EACxB,gBAAgB,MAAM,EACtB,QAAQ,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,KACvC,WA+FF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"compile-custom-field.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/compile-custom-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAsGhE,8FAA8F;AAC9F,eAAO,MAAM,kBAAkB,GAC7B,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,OAAO,eAAe,EACtB,oBAAoB,kBAAkB,EACtC,gBAAgB,MAAM,KACrB,mBAyDF,CAAC"}
1
+ {"version":3,"file":"compile-custom-field.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/compile-custom-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AA+GhE,8FAA8F;AAC9F,eAAO,MAAM,kBAAkB,GAC7B,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,OAAO,eAAe,EACtB,oBAAoB,kBAAkB,EACtC,gBAAgB,MAAM,KACrB,mBAyDF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"device-creator.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/services/device-creator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAyD9D,qBAAa,aAAa,CAAC,CAAC,SAAS,SAAS,cAAc,EAAE;IAKhD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IAJhD,OAAO,CAAC,eAAe,CAAuC;IAC9D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAO;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAsC;gBAEvC,mBAAmB,EAAE,CAAC;IAI5C,aAAa,GAAI,WAAW,MAAM,KAAG,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAkBpE;IAEK,YAAY,CAAC,CAAC,SAAS,SAAS,EACrC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC5B,eAAe,CAAC,CAAC,CAAC;IAmCd,OAAO,aAEZ;IAEF;;;OAGG;IACH,OAAO,CAAC,eAAe,CAmBrB;IAEF,OAAO,CAAC,eAAe;CAexB"}
1
+ {"version":3,"file":"device-creator.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/services/device-creator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AA6D9D,qBAAa,aAAa,CAAC,CAAC,SAAS,SAAS,cAAc,EAAE;IAKhD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IAJhD,OAAO,CAAC,eAAe,CAAuC;IAC9D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAO;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAsC;gBAEvC,mBAAmB,EAAE,CAAC;IAI5C,aAAa,GAAI,WAAW,MAAM,KAAG,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAkBpE;IAEK,YAAY,CAAC,CAAC,SAAS,SAAS,EACrC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC5B,eAAe,CAAC,CAAC,CAAC;IAwCd,OAAO,aAEZ;IAEF;;;OAGG;IACH,OAAO,CAAC,eAAe,CAmBrB;IAEF,OAAO,CAAC,eAAe;CAexB"}
@@ -0,0 +1,53 @@
1
+ import { CommandSequencer } from "../../../types/command-sequencer";
2
+ import { DeviceCommand } from "../../../types/device-command";
3
+ interface Bc01SequencerParams {
4
+ /** The write channel every command goes out on. FF01 for a real BC401. */
5
+ write: Omit<DeviceCommand, "frame">;
6
+ /**
7
+ * Called with why the exchange stopped. Optional; a refusal here does not
8
+ * end the connection because the device continues to accept fresh commands
9
+ * even after a bad handshake step. The parent driver decides what to do.
10
+ */
11
+ onRefused?: (reason: string) => void;
12
+ }
13
+ /**
14
+ * Walks the BC401 through its post-reset handshake and pulls every stored
15
+ * record.
16
+ *
17
+ * The device is self-clocking: it answers each command with a single frame,
18
+ * and the first byte of that frame names what it is. So the sequencer keeps
19
+ * no counter of its own — it looks at the reply, decides what belongs next,
20
+ * and returns that. A frame whose opcode is not part of the handshake is left
21
+ * unanswered so the driver's stuck-data watchdog surfaces the stall rather
22
+ * than the sequencer sending a command the device did not ask for.
23
+ *
24
+ * `initialCommands()` returns only the reset. The rest of the handshake -
25
+ * VERSION, SET_TIME, GET_COUNT, GET_RECORDS - is driven entirely by the
26
+ * device's own replies, because sending them any earlier would race the
27
+ * firmware boot the reset triggers.
28
+ */
29
+ export declare class Bc01CommandSequencer implements CommandSequencer {
30
+ private readonly params;
31
+ private isDone;
32
+ /** Injectable for tests; production reads `Date.now()`. */
33
+ private readonly clock;
34
+ constructor(params: Bc01SequencerParams, clock?: () => Date);
35
+ initialCommands: () => readonly DeviceCommand[];
36
+ nextCommand: (frame: readonly string[]) => readonly DeviceCommand[] | undefined;
37
+ /**
38
+ * The device pages every record it holds, one 16-byte frame at a time. Only
39
+ * the frame whose flags byte carries `0x40` needs an acknowledgement; every
40
+ * other page is a status update we let ride while the transfer continues.
41
+ */
42
+ private answerStoredRecord;
43
+ private commandFor;
44
+ }
45
+ export declare const bc01CommandSequencerInternals: {
46
+ bc401Checksum: (bytes: readonly number[]) => number;
47
+ buildCommand: (opcode: number, arg: number) => number[];
48
+ buildResetCommand: () => number[];
49
+ buildRequestVersionCommand: () => number[];
50
+ buildSetTimeCommand: (now: Date) => number[];
51
+ };
52
+ export {};
53
+ //# sourceMappingURL=bc01-command-sequencer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bc01-command-sequencer.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAuC9D,UAAU,mBAAmB;IAE3B,0EAA0E;IAC1E,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAEpC;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAqED;;;;;;;;;;;;;;;GAeG;AAEH,qBAAa,oBAAqB,YAAW,gBAAgB;IAOzD,OAAO,CAAC,QAAQ,CAAC,MAAM;IANzB,OAAO,CAAC,MAAM,CAAS;IAEvB,2DAA2D;IAC3D,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;gBAGhB,MAAM,EAAE,mBAAmB,EAC5C,KAAK,GAAE,MAAM,IAAuB;IAK/B,eAAe,QAAO,SAAS,aAAa,EAAE,CAEnD;IAEK,WAAW,GAChB,OAAO,SAAS,MAAM,EAAE,KACvB,SAAS,aAAa,EAAE,GAAG,SAAS,CAoCrC;IAEF;;;;OAIG;IACH,OAAO,CAAC,kBAAkB,CAUxB;IAEF,OAAO,CAAC,UAAU,CAIf;CACJ;AAGD,eAAO,MAAM,6BAA6B;2BA3JZ,SAAS,MAAM,EAAE,KAAG,MAAM;2BAQ1B,MAAM,OAAO,MAAM,KAAG,MAAM,EAAE;6BAW9B,MAAM,EAAE;sCAQC,MAAM,EAAE;+BAYb,IAAI,KAAG,MAAM,EAAE;CA0HhD,CAAC"}
@@ -0,0 +1,53 @@
1
+ /** BC401 stored-record frame is always sixteen bytes: header, timestamp, analytes, checksum. */
2
+ declare const BC01_RECORD_LENGTH = 16;
3
+ /** The two opcodes the firmware uses for a stored URS-7 record. */
4
+ declare const BC01_URS_OPCODE = 225;
5
+ declare const BC01_PAGED_URS_OPCODE = 226;
6
+ /**
7
+ * The bit `0x40` of the flags byte marks the last record of a paginated set.
8
+ * The sequencer keys off it to send the `[0x92, 0x7E, chk]` acknowledgement.
9
+ */
10
+ declare const BC01_LAST_OF_SET_BIT = 64;
11
+ /**
12
+ * URS-7 pad names, in the exact order they occupy the packed 3-bit slots
13
+ * across bytes 8..14 (see M1/a.java). The eleventh slot is a Contec-firmware
14
+ * field the vendor's own catalog calls "vc" and no other name is documented.
15
+ */
16
+ declare const BC01_ANALYTE_ORDER: readonly ["uro", "bld", "bil", "ket", "glu", "pro", "ph", "nit", "leu", "sg", "vc"];
17
+ /** The result of decoding one 16-byte record. `lastOfSet` is what the sequencer keys on. */
18
+ interface Bc01ParsedRecord {
19
+ /** Local wall-clock time the device recorded, with millisecond precision unavailable. */
20
+ timestamp: Date;
21
+ /** True when the flags byte set bit 0x40 — this is the frame that must be acknowledged. */
22
+ lastOfSet: boolean;
23
+ /** Low nibble of the flags byte; the page counter the firmware writes. */
24
+ pageIndex: number;
25
+ /**
26
+ * Analyte level indices, absent for any pad the strip did not measure.
27
+ * A pad the strip did measure carries a value in [0, 6]; the vendor's own
28
+ * lookup tables translate that to a categorical result per analyte.
29
+ */
30
+ values: Partial<Record<(typeof BC01_ANALYTE_ORDER)[number], number>>;
31
+ }
32
+ /**
33
+ * Decodes a 16-byte E1 or E2 frame into its timestamp and analyte indices.
34
+ *
35
+ * Returns `undefined` for any frame that is not the right length or does not
36
+ * open with an E1/E2 opcode — the caller is not asked to guess whether a
37
+ * frame is a record or a heartbeat, and a frame that fails these checks is
38
+ * skipped rather than parsed into a plausible-looking wrong reading.
39
+ *
40
+ * The checksum byte is not verified here: the SDK's read path already ensures
41
+ * frame integrity before the parser sees the bytes, and a URS-7 pad value can
42
+ * only land in [0, 7] anyway — a corrupt payload would fail the pad-value
43
+ * check before it made it into a measurement.
44
+ */
45
+ declare const parseBc01Record: (frame: readonly string[]) => Bc01ParsedRecord | undefined;
46
+ /**
47
+ * True when the buffer holds a complete BC401 stored record. Used by the
48
+ * driver's `validatePackage` hook so the SDK's read path only advances once
49
+ * the notification carries a whole 16-byte frame.
50
+ */
51
+ declare const isBc01Record: (frame: readonly string[]) => boolean;
52
+ export { BC01_ANALYTE_ORDER, BC01_LAST_OF_SET_BIT, BC01_PAGED_URS_OPCODE, BC01_RECORD_LENGTH, BC01_URS_OPCODE, Bc01ParsedRecord, isBc01Record, parseBc01Record, };
53
+ //# sourceMappingURL=bc01-frame-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bc01-frame-parser.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/bc01/bc01-frame-parser.ts"],"names":[],"mappings":"AAIA,gGAAgG;AAChG,QAAA,MAAM,kBAAkB,KAAK,CAAC;AAE9B,mEAAmE;AACnE,QAAA,MAAM,eAAe,MAAO,CAAC;AAC7B,QAAA,MAAM,qBAAqB,MAAO,CAAC;AAEnC;;;GAGG;AACH,QAAA,MAAM,oBAAoB,KAAO,CAAC;AAelC;;;;GAIG;AACH,QAAA,MAAM,kBAAkB,qFAYuC,CAAC;AAKhE,4FAA4F;AAC5F,UAAU,gBAAgB;IAExB,yFAAyF;IACzF,SAAS,EAAE,IAAI,CAAC;IAEhB,2FAA2F;IAC3F,SAAS,EAAE,OAAO,CAAC;IAEnB,0EAA0E;IAC1E,SAAS,EAAE,MAAM,CAAC;IAElB;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC;CACtE;AAUD;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,eAAe,GACnB,OAAO,SAAS,MAAM,EAAE,KACvB,gBAAgB,GAAG,SA0CrB,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,YAAY,GAAI,OAAO,SAAS,MAAM,EAAE,KAAG,OAQhD,CAAC;AAEF,OAAO,EACL,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,eAAe,GAChB,CAAC"}
@@ -1,33 +1,53 @@
1
+ import { Device } from "react-native-ble-plx";
2
+ import { CreateDeviceParams } from "../../../types/create-device-params";
3
+ import { DependentResultHandlerParams } from "../../../types/dependent-result-handler-params";
1
4
  import { MeasurementTypeForDevices } from "../../../types/device-measurement-map";
2
5
  import { IntegratedDevices } from "../../../types/integrated-devices";
3
- import { MeasurementWithCaseType } from "../../../types/measurement-with-case-type";
4
6
  import { IService } from "../../../types/service.type";
5
7
  import { BTManagedDevice } from "../bt-managed-device";
6
8
  /**
7
9
  * Contec BC401 (BC01) urine analyzer driver.
8
10
  *
9
- * The BC401 is a single-shot device: the patient dips a URS-7 strip, presses
10
- * the button, and the device pushes exactly one result frame on 0xFF01. There
11
- * is no streaming state, no per-tick updates, and no measurement session to
12
- * open — the device auto-starts on button press.
11
+ * The BC401 is a memory device, not a live stream: every measurement the
12
+ * patient takes is written to onboard 500-slot flash the moment the strip
13
+ * finishes reacting, and the app pulls stored records over BLE only after the
14
+ * host walks the reset → version → set-time → count → get-records handshake
15
+ * documented in `bc01-command-sequencer.ts`. Every record arrives as one
16
+ * 16-byte E1/E2 frame on 0xFF02.
13
17
  */
14
18
  export declare class BC01Device extends BTManagedDevice<IntegratedDevices.BC01> {
15
19
  protected onStreamStart: () => void;
16
20
  protected mainServices: IService[];
17
21
  /**
18
22
  * 90 s covers the maximum firmware-side reagent-pad settle time on a URS-7
19
- * strip. If the device does not push a result frame within that window the
20
- * data-processor times out and the driver surfaces "device unreachable".
23
+ * strip and leaves headroom for a bulk memory dump of every stored record.
24
+ * If the device does not push a frame within that window the data processor
25
+ * times out and the driver surfaces "device unreachable".
21
26
  */
22
27
  protected stuckDataTimeout: number;
28
+ constructor(device: Device, params: CreateDeviceParams<IntegratedDevices.BC01>);
29
+ /**
30
+ * Returns true once the notification buffer holds a complete BC401 frame,
31
+ * classified by its opening opcode. Anything else — a heartbeat opcode we
32
+ * do not recognise, or a partial buffer — is held back until enough bytes
33
+ * arrive to make sense of it. There is no aa55 header on this hardware.
34
+ */
23
35
  protected validatePackage: (pkg: string[]) => boolean;
24
- protected handleSuccessResult(successResult: MeasurementWithCaseType<MeasurementTypeForDevices<[IntegratedDevices.BC01]>>): void | boolean;
25
- private handleUrinalysisResult;
26
36
  /**
27
- * A well-formed frame with all analyte fields still undefined means the
28
- * device produced an empty read — typically a strip inserted upside down or
29
- * removed before the reagent-pad timer completed.
37
+ * The parsing model declares every E1/E2 frame as `DEPENDENT`, so this hook
38
+ * runs for each record. We decode the raw bytes here — the packed 3-bits-per
39
+ * -pad layout is not expressible in the declaration parser — and report the
40
+ * reading directly through `onResult`. The frame is then handed back as
41
+ * `OTHER` so the state machine does not report it a second time and does
42
+ * not dedupe consecutive records that happen to share the same opcode.
43
+ */
44
+ protected handleDependentResult: (data: DependentResultHandlerParams<MeasurementTypeForDevices<[IntegratedDevices.BC01]>>) => DependentResultHandlerParams<MeasurementTypeForDevices<[IntegratedDevices.BC01]>>;
45
+ /**
46
+ * Nothing to do here for the BC401. Every reading arrives through the
47
+ * dependent-result path, and the state machine sees only the `OTHER`-typed
48
+ * echo we return from `handleDependentResult`.
30
49
  */
31
- private checkIfHasError;
50
+ protected handleSuccessResult(): void | boolean;
51
+ private reportUrsRecord;
32
52
  }
33
53
  //# sourceMappingURL=bc01.device.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bc01.device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/bc01/bc01.device.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAIvD;;;;;;;GAOG;AACH,qBAAa,UAAW,SAAQ,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC;IACrE,SAAS,CAAC,aAAa,EAAE,MAAM,IAAI,CAAY;IAE/C,SAAS,CAAC,YAAY,EAAE,QAAQ,EAAE,CAAoB;IAEtD;;;;OAIG;IACH,SAAS,CAAC,gBAAgB,SAAU;IAEpC,SAAS,CAAC,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,OAAO,CAgCnD;IAEF,SAAS,CAAC,mBAAmB,CAC3B,aAAa,EAAE,uBAAuB,CACpC,yBAAyB,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CACpD,GACA,IAAI,GAAG,OAAO;IAkBjB,OAAO,CAAC,sBAAsB;IAc9B;;;;OAIG;IACH,OAAO,CAAC,eAAe;CA2BxB"}
1
+ {"version":3,"file":"bc01.device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/bc01/bc01.device.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAI9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAmBvD;;;;;;;;;GASG;AACH,qBAAa,UAAW,SAAQ,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC;IACrE,SAAS,CAAC,aAAa,EAAE,MAAM,IAAI,CAAY;IAE/C,SAAS,CAAC,YAAY,EAAE,QAAQ,EAAE,CAAoB;IAEtD;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,SAAU;gBAExB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,IAAI,CAAC;IAqB9E;;;;;OAKG;IACH,SAAS,CAAC,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,OAAO,CAanD;IAEF;;;;;;;OAOG;IACH,SAAS,CAAC,qBAAqB,GAC7B,MAAM,4BAA4B,CAChC,yBAAyB,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CACpD,KACA,4BAA4B,CAC7B,yBAAyB,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CACpD,CASC;IAEF;;;;OAIG;IACH,SAAS,CAAC,mBAAmB,IAAI,IAAI,GAAG,OAAO;IAI/C,OAAO,CAAC,eAAe;CAqCxB"}
@@ -2,26 +2,20 @@ import { IService } from "../../../types/service.type";
2
2
  /**
3
3
  * Contec BC401 (a.k.a. BC01) urine analyzer — GATT profile.
4
4
  *
5
- * The BC401 uses Contec's proprietary FF12 service, shared across their consumer
6
- * medical devices. A single result notification carries a 7-parameter URS-7
7
- * strip readout expanded into eleven analyte values on the wire.
5
+ * The BC401 uses Contec's proprietary FF12 service, shared across their
6
+ * consumer medical devices. Every stored URS-7 measurement is pushed as a
7
+ * 16-byte record on 0xFF02 after the host has walked the handshake documented
8
+ * in `bc01-command-sequencer.ts`.
8
9
  *
9
10
  * Service 0xFF12
10
- * Notify (result) 0xFF01 — CCCD 0x2902 must be written 01 00 to enable
11
- * Write (command) 0xFF02 — RESET / SET_UNIT / REQUEST_HISTORY
11
+ * Notify (result) 0xFF02 — CCCD 0x2902 must be written 01 00 to enable
12
+ * Write (command) 0xFF01 — RESET / SET_TIME / GET_COUNT / GET_RECORDS
12
13
  *
13
- * Wire layout of a result frame (Contec URS-7 firmware ≥ 1.2.x):
14
- * [0..1] header "aa 55" — Contec sentinel
15
- * [2] length byte after header
16
- * [3] command "a1" == RESULT_URS7
17
- * [4] strip type "07" == 7-panel
18
- * [5..15] values one byte per analyte, encoding the discrete
19
- * level index into diagnosticResults[key]
20
- * [16] checksum xor over [2..15]
21
- *
22
- * Byte positions calibrated against PHMS 3.0.03 Android app; older firmware
23
- * (< 1.2.x) uses a different command byte and is not supported by this driver
24
- * (the validator will reject those frames).
14
+ * On the wire a stored URS record opens with 0xE1 (single) or 0xE2 (paginated).
15
+ * The remaining fifteen bytes carry the flags nibble, timestamp, seven bytes of
16
+ * packed 3-bit analyte indices, and a checksum. `bc01-frame-parser.ts` decodes
17
+ * them; this file just declares the GATT surface and hands every E1/E2 frame
18
+ * to the driver's dependent-result path so the parser can run.
25
19
  */
26
20
  export declare const bc01MainServices: IService[];
27
21
  //# sourceMappingURL=bc01.main-services.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bc01.main-services.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/bc01/bc01.main-services.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,EAuFtC,CAAC"}
1
+ {"version":3,"file":"bc01.main-services.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/bc01/bc01.main-services.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,EAgDtC,CAAC"}