@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,184 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.bc01CommandSequencerInternals = exports.Bc01CommandSequencer = void 0;
7
+ var _hexToByte = require("../../../utils/hex-to-byte.js");
8
+ /**
9
+ * The FF01/FF02 opcodes the BC401 firmware speaks, as reverse-engineered from
10
+ * PHMS 3.0.03 (`I1/b.java` for the switch, `B3/B5.java` for the builders and
11
+ * checksum, `L1/f.java` for the reset write).
12
+ */
13
+ const OP_RESET = 0x80;
14
+ const OP_REQUEST_VERSION = 0x82;
15
+ const OP_SET_TIME = 0x83;
16
+ const OP_REQUEST_COUNT = 0x90;
17
+ const OP_REQUEST_RECORDS = 0x92;
18
+
19
+ /** Payload byte for `OP_REQUEST_RECORDS` that acknowledges the last record of the set. */
20
+ const ACK_LAST_OF_SET = 0x7e;
21
+
22
+ /** Payload byte for `OP_REQUEST_COUNT` and the initial `OP_REQUEST_RECORDS`. */
23
+ const REQUEST_ALL = 0x00;
24
+
25
+ /**
26
+ * Device-to-host frame prefixes the FSM keys on. Values are decimal opcodes as
27
+ * they appear in the decompiled Java (`switch(bArr[0])`), rendered here as
28
+ * their real hex opcodes.
29
+ */
30
+ const RX = {
31
+ ACK: 0xf0,
32
+ VERSION_REPLY: 0xf2,
33
+ TIME_SYNC_ACK: 0xf3,
34
+ COUNT_REPLY: 0xe0,
35
+ STORED_RECORD_URS: 0xe1,
36
+ STORED_RECORD_PAGED: 0xe2,
37
+ FINISH: 0xe3
38
+ };
39
+
40
+ /** Position in a 16-byte URS record where the flags byte sits; bit 0x40 marks the last of a set. */
41
+ const RECORD_FLAGS_INDEX = 1;
42
+ const RECORD_LAST_OF_SET_BIT = 0x40;
43
+ /**
44
+ * Formats one byte as a two-digit lowercase hex string, matching the way the
45
+ * SDK's transport already spells raw bytes.
46
+ */
47
+ const asHex = byte => (byte & 0xff).toString(16).padStart(2, "0");
48
+
49
+ /**
50
+ * BC401 checksum: sum of the low 7 bits of every byte, folded back into 7 bits.
51
+ * Matches `B5.a` in the decompiled Java exactly.
52
+ */
53
+ const bc401Checksum = bytes => bytes.reduce((acc, byte) => acc + (byte & 0x7f), 0) & 0x7f;
54
+
55
+ /**
56
+ * Builds a "one payload byte plus checksum" command frame. This is the shape
57
+ * of every BC401 host-to-device command that carries an argument: opcode,
58
+ * argument, checksum-over-both.
59
+ */
60
+ const buildCommand = (opcode, arg) => {
61
+ const chk = bc401Checksum([opcode, arg]);
62
+ return [opcode, arg, chk];
63
+ };
64
+
65
+ /**
66
+ * Builds the two-byte reset frame. It is the one command that does not carry
67
+ * an argument or a checksum — PHMS writes it as `[0x80, 0x00]` verbatim
68
+ * (`L1/f.java:694`).
69
+ */
70
+ const buildResetCommand = () => [OP_RESET, 0x00];
71
+
72
+ /**
73
+ * Builds the request-version reply. The Java sends it as `[0x82, 0x02]` where
74
+ * `0x02` doubles as the checksum of `0x82` under the BC401 rule
75
+ * (`0x82 & 0x7f = 0x02`), so the same formula that guards every other command
76
+ * produces the right byte here.
77
+ */
78
+ const buildRequestVersionCommand = () => {
79
+ const chk = bc401Checksum([OP_REQUEST_VERSION]);
80
+ return [OP_REQUEST_VERSION, chk];
81
+ };
82
+
83
+ /**
84
+ * Builds the `SET_TIME` frame for the moment the sequencer receives it. The
85
+ * device does not run its own clock across power cycles, so timestamps on
86
+ * stored records only make sense once the app tells it what "now" is.
87
+ * Millisecond field is written little-endian, matching `I1/b.java`.
88
+ */
89
+ const buildSetTimeCommand = now => {
90
+ const yy = now.getFullYear() - 2000;
91
+ const mo = now.getMonth() + 1;
92
+ const dd = now.getDate();
93
+ const hh = now.getHours();
94
+ const mi = now.getMinutes();
95
+ const ss = now.getSeconds();
96
+ const ms = now.getMilliseconds();
97
+ const msLo = ms & 0xff;
98
+ const msHi = ms >> 8 & 0xff;
99
+ const payload = [OP_SET_TIME, yy, mo, dd, hh, mi, ss, msLo, msHi];
100
+ const chk = bc401Checksum(payload);
101
+ return [...payload, chk];
102
+ };
103
+
104
+ /**
105
+ * Walks the BC401 through its post-reset handshake and pulls every stored
106
+ * record.
107
+ *
108
+ * The device is self-clocking: it answers each command with a single frame,
109
+ * and the first byte of that frame names what it is. So the sequencer keeps
110
+ * no counter of its own — it looks at the reply, decides what belongs next,
111
+ * and returns that. A frame whose opcode is not part of the handshake is left
112
+ * unanswered so the driver's stuck-data watchdog surfaces the stall rather
113
+ * than the sequencer sending a command the device did not ask for.
114
+ *
115
+ * `initialCommands()` returns only the reset. The rest of the handshake -
116
+ * VERSION, SET_TIME, GET_COUNT, GET_RECORDS - is driven entirely by the
117
+ * device's own replies, because sending them any earlier would race the
118
+ * firmware boot the reset triggers.
119
+ */
120
+ // eslint-disable-next-line import/group-exports
121
+ class Bc01CommandSequencer {
122
+ isDone = false;
123
+
124
+ /** Injectable for tests; production reads `Date.now()`. */
125
+
126
+ constructor(params, clock = () => new Date()) {
127
+ this.params = params;
128
+ this.clock = clock;
129
+ }
130
+ initialCommands = () => [this.commandFor(buildResetCommand())];
131
+ nextCommand = frame => {
132
+ if (this.isDone || frame.length === 0) {
133
+ return undefined;
134
+ }
135
+ const opcode = (0, _hexToByte.hexToByte)(frame[0] ?? "0");
136
+ switch (opcode) {
137
+ case RX.ACK:
138
+ return [this.commandFor(buildRequestVersionCommand())];
139
+ case RX.VERSION_REPLY:
140
+ return [this.commandFor(buildSetTimeCommand(this.clock()))];
141
+ case RX.TIME_SYNC_ACK:
142
+ return [this.commandFor(buildCommand(OP_REQUEST_COUNT, REQUEST_ALL))];
143
+ case RX.COUNT_REPLY:
144
+ return [this.commandFor(buildCommand(OP_REQUEST_RECORDS, REQUEST_ALL))];
145
+ case RX.STORED_RECORD_URS:
146
+ case RX.STORED_RECORD_PAGED:
147
+ return this.answerStoredRecord(frame);
148
+ case RX.FINISH:
149
+ this.isDone = true;
150
+ return undefined;
151
+ default:
152
+ return undefined;
153
+ }
154
+ };
155
+
156
+ /**
157
+ * The device pages every record it holds, one 16-byte frame at a time. Only
158
+ * the frame whose flags byte carries `0x40` needs an acknowledgement; every
159
+ * other page is a status update we let ride while the transfer continues.
160
+ */
161
+ answerStoredRecord = frame => {
162
+ const flags = (0, _hexToByte.hexToByte)(frame[RECORD_FLAGS_INDEX] ?? "0");
163
+ if ((flags & RECORD_LAST_OF_SET_BIT) === 0) {
164
+ return undefined;
165
+ }
166
+ return [this.commandFor(buildCommand(OP_REQUEST_RECORDS, ACK_LAST_OF_SET))];
167
+ };
168
+ commandFor = bytes => ({
169
+ ...this.params.write,
170
+ frame: bytes.map(asHex),
171
+ withoutResponse: true
172
+ });
173
+ }
174
+
175
+ // eslint-disable-next-line import/group-exports
176
+ exports.Bc01CommandSequencer = Bc01CommandSequencer;
177
+ const bc01CommandSequencerInternals = exports.bc01CommandSequencerInternals = {
178
+ bc401Checksum,
179
+ buildCommand,
180
+ buildResetCommand,
181
+ buildRequestVersionCommand,
182
+ buildSetTimeCommand
183
+ };
184
+ //# sourceMappingURL=bc01-command-sequencer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_hexToByte","require","OP_RESET","OP_REQUEST_VERSION","OP_SET_TIME","OP_REQUEST_COUNT","OP_REQUEST_RECORDS","ACK_LAST_OF_SET","REQUEST_ALL","RX","ACK","VERSION_REPLY","TIME_SYNC_ACK","COUNT_REPLY","STORED_RECORD_URS","STORED_RECORD_PAGED","FINISH","RECORD_FLAGS_INDEX","RECORD_LAST_OF_SET_BIT","asHex","byte","toString","padStart","bc401Checksum","bytes","reduce","acc","buildCommand","opcode","arg","chk","buildResetCommand","buildRequestVersionCommand","buildSetTimeCommand","now","yy","getFullYear","mo","getMonth","dd","getDate","hh","getHours","mi","getMinutes","ss","getSeconds","ms","getMilliseconds","msLo","msHi","payload","Bc01CommandSequencer","isDone","constructor","params","clock","Date","initialCommands","commandFor","nextCommand","frame","length","undefined","hexToByte","answerStoredRecord","flags","write","map","withoutResponse","exports","bc01CommandSequencerInternals"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bc01/bc01-command-sequencer.ts"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,QAAQ,GAAG,IAAI;AACrB,MAAMC,kBAAkB,GAAG,IAAI;AAC/B,MAAMC,WAAW,GAAG,IAAI;AACxB,MAAMC,gBAAgB,GAAG,IAAI;AAC7B,MAAMC,kBAAkB,GAAG,IAAI;;AAE/B;AACA,MAAMC,eAAe,GAAG,IAAI;;AAE5B;AACA,MAAMC,WAAW,GAAG,IAAI;;AAExB;AACA;AACA;AACA;AACA;AACA,MAAMC,EAAE,GAAG;EACTC,GAAG,EAAE,IAAI;EACTC,aAAa,EAAE,IAAI;EACnBC,aAAa,EAAE,IAAI;EACnBC,WAAW,EAAE,IAAI;EACjBC,iBAAiB,EAAE,IAAI;EACvBC,mBAAmB,EAAE,IAAI;EACzBC,MAAM,EAAE;AACV,CAAU;;AAEV;AACA,MAAMC,kBAAkB,GAAG,CAAC;AAC5B,MAAMC,sBAAsB,GAAG,IAAI;AAenC;AACA;AACA;AACA;AACA,MAAMC,KAAK,GAAIC,IAAY,IACzB,CAACA,IAAI,GAAG,IAAI,EAAEC,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;;AAE7C;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAIC,KAAwB,IAC7CA,KAAK,CAACC,MAAM,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+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.parseBc01Record = exports.isBc01Record = exports.BC01_URS_OPCODE = exports.BC01_RECORD_LENGTH = exports.BC01_PAGED_URS_OPCODE = exports.BC01_LAST_OF_SET_BIT = exports.BC01_ANALYTE_ORDER = void 0;
7
+ var _hexToByte = require("../../../utils/hex-to-byte.js");
8
+ /** BC401 stored-record frame is always sixteen bytes: header, timestamp, analytes, checksum. */
9
+ const BC01_RECORD_LENGTH = exports.BC01_RECORD_LENGTH = 16;
10
+
11
+ /** The two opcodes the firmware uses for a stored URS-7 record. */
12
+ const BC01_URS_OPCODE = exports.BC01_URS_OPCODE = 0xe1;
13
+ const BC01_PAGED_URS_OPCODE = exports.BC01_PAGED_URS_OPCODE = 0xe2;
14
+
15
+ /**
16
+ * The bit `0x40` of the flags byte marks the last record of a paginated set.
17
+ * The sequencer keys off it to send the `[0x92, 0x7E, chk]` acknowledgement.
18
+ */
19
+ const BC01_LAST_OF_SET_BIT = exports.BC01_LAST_OF_SET_BIT = 0x40;
20
+
21
+ /**
22
+ * A pad reading of `7` means the strip was not measured on that reagent.
23
+ * We drop those pads from the output rather than reporting them as level "7".
24
+ */
25
+ const UNMEASURED = 7;
26
+ const YEAR_BASE = 2000;
27
+ const MONTH_MASK = 0x0f;
28
+ const DAY_MASK = 0x1f;
29
+ const HOUR_MASK = 0x1f;
30
+ const MINUTE_MASK = 0x3f;
31
+ const SECOND_MASK = 0x3f;
32
+
33
+ /**
34
+ * URS-7 pad names, in the exact order they occupy the packed 3-bit slots
35
+ * across bytes 8..14 (see M1/a.java). The eleventh slot is a Contec-firmware
36
+ * field the vendor's own catalog calls "vc" and no other name is documented.
37
+ */
38
+ const BC01_ANALYTE_ORDER = exports.BC01_ANALYTE_ORDER = ["uro", "bld", "bil", "ket", "glu", "pro", "ph", "nit", "leu", "sg", "vc"];
39
+
40
+ /** Where the packed analyte pairs start in a 16-byte E1/E2 frame. */
41
+ const ANALYTES_START = 8;
42
+
43
+ /** The result of decoding one 16-byte record. `lastOfSet` is what the sequencer keys on. */
44
+
45
+ /**
46
+ * Extracts one pad's level index from the packed byte. Two pads share a byte:
47
+ * the first uses the low 3 bits, the second uses bits 3..5. Bit 6 and 7 are
48
+ * unused reserved space per the vendor's own decoding in M1/a.java.
49
+ */
50
+ const readPad = (packed, slot) => slot === 0 ? packed & 0x07 : packed >> 3 & 0x07;
51
+
52
+ /**
53
+ * Decodes a 16-byte E1 or E2 frame into its timestamp and analyte indices.
54
+ *
55
+ * Returns `undefined` for any frame that is not the right length or does not
56
+ * open with an E1/E2 opcode — the caller is not asked to guess whether a
57
+ * frame is a record or a heartbeat, and a frame that fails these checks is
58
+ * skipped rather than parsed into a plausible-looking wrong reading.
59
+ *
60
+ * The checksum byte is not verified here: the SDK's read path already ensures
61
+ * frame integrity before the parser sees the bytes, and a URS-7 pad value can
62
+ * only land in [0, 7] anyway — a corrupt payload would fail the pad-value
63
+ * check before it made it into a measurement.
64
+ */
65
+ const parseBc01Record = frame => {
66
+ if (frame.length < BC01_RECORD_LENGTH) {
67
+ return undefined;
68
+ }
69
+ const opcode = (0, _hexToByte.hexToByte)(frame[0] ?? "");
70
+ if (opcode !== BC01_URS_OPCODE && opcode !== BC01_PAGED_URS_OPCODE) {
71
+ return undefined;
72
+ }
73
+ const flags = (0, _hexToByte.hexToByte)(frame[1] ?? "");
74
+ const yy = (0, _hexToByte.hexToByte)(frame[2] ?? "") + YEAR_BASE;
75
+ const mm = (0, _hexToByte.hexToByte)(frame[3] ?? "") & MONTH_MASK;
76
+ const dd = (0, _hexToByte.hexToByte)(frame[4] ?? "") & DAY_MASK;
77
+ const hh = (0, _hexToByte.hexToByte)(frame[5] ?? "") & HOUR_MASK;
78
+ const mi = (0, _hexToByte.hexToByte)(frame[6] ?? "") & MINUTE_MASK;
79
+ const ss = (0, _hexToByte.hexToByte)(frame[7] ?? "") & SECOND_MASK;
80
+ const timestamp = new Date(yy, mm - 1, dd, hh, mi, ss, 0);
81
+ const values = {};
82
+ BC01_ANALYTE_ORDER.forEach((analyte, position) => {
83
+ const byteIndex = ANALYTES_START + Math.floor(position / 2);
84
+ const slot = position % 2;
85
+ const packed = (0, _hexToByte.hexToByte)(frame[byteIndex] ?? "");
86
+ const level = readPad(packed, slot);
87
+ if (level === UNMEASURED) {
88
+ return;
89
+ }
90
+ values[analyte] = level;
91
+ });
92
+ return {
93
+ timestamp,
94
+ lastOfSet: (flags & BC01_LAST_OF_SET_BIT) !== 0,
95
+ pageIndex: flags & 0x0f,
96
+ values
97
+ };
98
+ };
99
+
100
+ /**
101
+ * True when the buffer holds a complete BC401 stored record. Used by the
102
+ * driver's `validatePackage` hook so the SDK's read path only advances once
103
+ * the notification carries a whole 16-byte frame.
104
+ */
105
+ exports.parseBc01Record = parseBc01Record;
106
+ const isBc01Record = frame => {
107
+ if (frame.length < BC01_RECORD_LENGTH) {
108
+ return false;
109
+ }
110
+ const opcode = (0, _hexToByte.hexToByte)(frame[0] ?? "");
111
+ return opcode === BC01_URS_OPCODE || opcode === BC01_PAGED_URS_OPCODE;
112
+ };
113
+ exports.isBc01Record = isBc01Record;
114
+ //# sourceMappingURL=bc01-frame-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_hexToByte","require","BC01_RECORD_LENGTH","exports","BC01_URS_OPCODE","BC01_PAGED_URS_OPCODE","BC01_LAST_OF_SET_BIT","UNMEASURED","YEAR_BASE","MONTH_MASK","DAY_MASK","HOUR_MASK","MINUTE_MASK","SECOND_MASK","BC01_ANALYTE_ORDER","ANALYTES_START","readPad","packed","slot","parseBc01Record","frame","length","undefined","opcode","hexToByte","flags","yy","mm","dd","hh","mi","ss","timestamp","Date","values","forEach","analyte","position","byteIndex","Math","floor","level","lastOfSet","pageIndex","isBc01Record"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bc01/bc01-frame-parser.ts"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AA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KAAK,CAACkB,SAAS,CAAC,IAAI,EAAE,CAAC;IAChD,MAAMG,KAAK,GAAGzB,OAAO,CAACC,MAAM,EAAEC,IAAI,CAAC;IAEnC,IAAIuB,KAAK,KAAKlC,UAAU,EAAE;MACxB;IACF;IAEA2B,MAAM,CAACE,OAAO,CAAC,GAAGK,KAAK;EACzB,CAAC,CAAC;EAEF,OAAO;IACLT,SAAS;IACTU,SAAS,EAAE,CAACjB,KAAK,GAAGnB,oBAAoB,MAAM,CAAC;IAC/CqC,SAAS,EAAElB,KAAK,GAAG,IAAI;IACvBS;EACF,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJA/B,OAAA,CAAAgB,eAAA,GAAAA,eAAA;AAKA,MAAMyB,YAAY,GAAIxB,KAAwB,IAAc;EAC1D,IAAIA,KAAK,CAACC,MAAM,GAAGnB,kBAAkB,EAAE;IACrC,OAAO,KAAK;EACd;EAEA,MAAMqB,MAAM,GAAG,IAAAC,oBAAS,EAACJ,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;EAExC,OAAOG,MAAM,KAAKnB,eAAe,IAAImB,MAAM,KAAKlB,qBAAqB;AACvE,CAAC;AAACF,OAAA,CAAAyC,YAAA,GAAAA,YAAA","ignoreList":[]}
@@ -4,16 +4,43 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.BC01Device = void 0;
7
+ var _core = require("@ovok/core");
7
8
  var _caseType = require("../../../types/case-type.js");
9
+ var _hexToByte = require("../../../utils/hex-to-byte.js");
8
10
  var _btManagedDevice = require("../bt-managed-device.js");
11
+ var _bc01CommandSequencer = require("./bc01-command-sequencer.js");
12
+ var _bc01FrameParser = require("./bc01-frame-parser.js");
9
13
  var _bc01MainServices = require("./bc01.main-services.js");
14
+ /** Minimum bytes a complete frame carries, keyed by its opening opcode. */
15
+ const BC01_FRAME_MIN_LENGTH = {
16
+ 0xf0: 2,
17
+ // ACK
18
+ 0xf2: 8,
19
+ // Version reply (variable — 8 is the minimum PHMS reads before answering)
20
+ 0xf3: 3,
21
+ // Time-sync ack
22
+ 0xe0: 7,
23
+ // Record-count reply
24
+ 0xe1: 16,
25
+ // Stored URS record
26
+ 0xe2: 16,
27
+ // Paginated URS record
28
+ 0xe3: 3,
29
+ // Finish
30
+ 0xe4: 36,
31
+ // Quantitative record (optional path)
32
+ 0xe5: 36 // Quantitative record (optional path)
33
+ };
34
+
10
35
  /**
11
36
  * Contec BC401 (BC01) urine analyzer driver.
12
37
  *
13
- * The BC401 is a single-shot device: the patient dips a URS-7 strip, presses
14
- * the button, and the device pushes exactly one result frame on 0xFF01. There
15
- * is no streaming state, no per-tick updates, and no measurement session to
16
- * open — the device auto-starts on button press.
38
+ * The BC401 is a memory device, not a live stream: every measurement the
39
+ * patient takes is written to onboard 500-slot flash the moment the strip
40
+ * finishes reacting, and the app pulls stored records over BLE only after the
41
+ * host walks the reset → version → set-time → count → get-records handshake
42
+ * documented in `bc01-command-sequencer.ts`. Every record arrives as one
43
+ * 16-byte E1/E2 frame on 0xFF02.
17
44
  */
18
45
  class BC01Device extends _btManagedDevice.BTManagedDevice {
19
46
  onStreamStart = () => {};
@@ -21,66 +48,101 @@ class BC01Device extends _btManagedDevice.BTManagedDevice {
21
48
 
22
49
  /**
23
50
  * 90 s covers the maximum firmware-side reagent-pad settle time on a URS-7
24
- * strip. If the device does not push a result frame within that window the
25
- * data-processor times out and the driver surfaces "device unreachable".
51
+ * strip and leaves headroom for a bulk memory dump of every stored record.
52
+ * If the device does not push a frame within that window the data processor
53
+ * times out and the driver surfaces "device unreachable".
26
54
  */
27
55
  stuckDataTimeout = 90_000;
56
+ constructor(device, params) {
57
+ super(device, params);
58
+
59
+ /**
60
+ * The BC401 answers one command with one frame and picks the next command
61
+ * by the first byte of that frame. The sequencer walks reset → version →
62
+ * set-time → count → records, and acknowledges the last record of every
63
+ * set. The parent's default `pollingSequencerFor` would only re-send the
64
+ * declared reset forever, which the firmware ignores after the first one.
65
+ */
66
+ this.createCommandSequencer = () => new _bc01CommandSequencer.Bc01CommandSequencer({
67
+ write: {
68
+ serviceUuid: _bc01MainServices.bc01MainServices[0].uuid,
69
+ characteristicUuid: _bc01MainServices.bc01MainServices[0].writeUuid.uuid
70
+ },
71
+ onRefused: reason => this.onError?.(new Error(`BC401 handshake: ${reason}`))
72
+ });
73
+ }
74
+
75
+ /**
76
+ * Returns true once the notification buffer holds a complete BC401 frame,
77
+ * classified by its opening opcode. Anything else — a heartbeat opcode we
78
+ * do not recognise, or a partial buffer — is held back until enough bytes
79
+ * arrive to make sense of it. There is no aa55 header on this hardware.
80
+ */
28
81
  validatePackage = pkg => {
29
- pkg = pkg.map(b => b.toLowerCase());
30
- let headIndex = -1;
31
- for (let i = 0; i < pkg.length - 1; i++) {
32
- if (pkg[i] === "aa" && pkg[i + 1] === "55") {
33
- headIndex = i;
34
- break;
35
- }
36
- }
37
- if (headIndex === -1) {
38
- return false;
39
- }
40
- if (headIndex > 0) {
41
- pkg = pkg.slice(headIndex);
42
- }
43
- if (pkg.length < 5) {
82
+ if (pkg.length === 0) {
44
83
  return false;
45
84
  }
46
- const lengthByte = parseInt(pkg[2] ?? "0", 16) || 0;
47
- const totalLen = 3 + lengthByte;
48
- if (pkg.length < totalLen) {
85
+ const opcode = (0, _hexToByte.hexToByte)(pkg[0] ?? "");
86
+ const minLength = BC01_FRAME_MIN_LENGTH[opcode];
87
+ if (minLength === undefined) {
49
88
  return false;
50
89
  }
51
- return true;
90
+ return pkg.length >= minLength;
52
91
  };
53
- handleSuccessResult(successResult) {
54
- if (successResult.caseType !== _caseType.CaseType.RESULT) {
55
- return;
56
- }
57
- if (!successResult.measurementTypeKey) {
58
- this.onError?.(new Error(`Measurement type is undefined for case ${successResult.caseType}`));
59
- return;
60
- }
61
- this.handleUrinalysisResult(successResult);
62
- }
63
- handleUrinalysisResult(successResult) {
64
- const error = this.checkIfHasError(successResult);
65
- if (error) {
66
- this.onError?.(error);
67
- return;
92
+
93
+ /**
94
+ * The parsing model declares every E1/E2 frame as `DEPENDENT`, so this hook
95
+ * runs for each record. We decode the raw bytes here — the packed 3-bits-per
96
+ * -pad layout is not expressible in the declaration parser — and report the
97
+ * reading directly through `onResult`. The frame is then handed back as
98
+ * `OTHER` so the state machine does not report it a second time and does
99
+ * not dedupe consecutive records that happen to share the same opcode.
100
+ */
101
+ handleDependentResult = data => {
102
+ if (data.frame) {
103
+ this.reportUrsRecord(data.frame);
68
104
  }
69
- this.onResult?.(successResult);
70
- }
105
+ return {
106
+ ...data,
107
+ parsingCase: {
108
+ ...data.parsingCase,
109
+ caseType: _caseType.CaseType.OTHER
110
+ }
111
+ };
112
+ };
71
113
 
72
114
  /**
73
- * A well-formed frame with all analyte fields still undefined means the
74
- * device produced an empty read — typically a strip inserted upside down or
75
- * removed before the reagent-pad timer completed.
115
+ * Nothing to do here for the BC401. Every reading arrives through the
116
+ * dependent-result path, and the state machine sees only the `OTHER`-typed
117
+ * echo we return from `handleDependentResult`.
76
118
  */
77
- checkIfHasError(successResult) {
78
- const analytes = ["uro", "bld", "bil", "ket", "glu", "pro", "ph", "nit", "leu", "sg", "vc"];
79
- const hasAnyReading = analytes.some(key => successResult[key] !== undefined);
80
- if (!hasAnyReading) {
81
- return "feedback-messages.measurement.disturb-detected-error";
119
+ handleSuccessResult() {
120
+ return;
121
+ }
122
+ reportUrsRecord(frame) {
123
+ const parsed = (0, _bc01FrameParser.parseBc01Record)(frame);
124
+ if (!parsed) {
125
+ return;
126
+ }
127
+ const measuredValues = _bc01FrameParser.BC01_ANALYTE_ORDER.reduce((acc, analyte) => {
128
+ const value = parsed.values[analyte];
129
+ if (value !== undefined) {
130
+ acc[analyte] = value;
131
+ }
132
+ return acc;
133
+ }, {});
134
+ if (Object.keys(measuredValues).length === 0) {
135
+ this.onError?.("feedback-messages.measurement.disturb-detected-error");
136
+ return;
82
137
  }
83
- return undefined;
138
+ const reading = {
139
+ caseType: _caseType.CaseType.RESULT,
140
+ measurementTypeKey: _core.MeasurementTypeKey.uricAcid,
141
+ urineValues: [],
142
+ recordedAt: parsed.timestamp,
143
+ ...measuredValues
144
+ };
145
+ this.onResult?.(reading);
84
146
  }
85
147
  }
86
148
  exports.BC01Device = BC01Device;
@@ -1 +1 @@
1
- {"version":3,"names":["_caseType","require","_btManagedDevice","_bc01MainServices","BC01Device","BTManagedDevice","onStreamStart","mainServices","bc01MainServices","stuckDataTimeout","validatePackage","pkg","map","b","toLowerCase","headIndex","i","length","slice","lengthByte","parseInt","totalLen","handleSuccessResult","successResult","caseType","CaseType","RESULT","measurementTypeKey","onError","Error","handleUrinalysisResult","error","checkIfHasError","onResult","analytes","hasAnyReading","some","key","undefined","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bc01/bc01.device.ts"],"mappings":";;;;;;AAEA,IAAAA,SAAA,GAAAC,OAAA;AAKA,IAAAC,gBAAA,GAAAD,OAAA;AAEA,IAAAE,iBAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,UAAU,SAASC,gCAAe,CAAyB;EAC5DC,aAAa,GAAeA,CAAA,KAAM,CAAC,CAAC;EAEpCC,YAAY,GAAeC,kCAAgB;;EAErD;AACF;AACA;AACA;AACA;EACYC,gBAAgB,GAAG,MAAM;EAEzBC,eAAe,GAAgCC,GAAG,IAAK;IAC/DA,GAAG,GAAGA,GAAG,CAACC,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACC,WAAW,CAAC,CAAC,CAAC;IAErC,IAAIC,SAAS,GAAG,CAAC,CAAC;IAElB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGL,GAAG,CAACM,MAAM,GAAG,CAAC,EAAED,CAAC,EAAE,EAAE;MACvC,IAAIL,GAAG,CAACK,CAAC,CAAC,KAAK,IAAI,IAAIL,GAAG,CAACK,CAAC,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;QAC1CD,SAAS,GAAGC,CAAC;QACb;MACF;IACF;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AAI,EACJ,IAAI,CACL;IAED,MAAMC,aAAa,GAAGD,QAAQ,CAACE,IAAI,CAChCC,GAAG,IAAKd,aAAa,CAACc,GAAG,CAAC,KAAKC,SAClC,CAAC;IAED,IAAI,CAACH,aAAa,EAAE;MAClB,OAAO,sDAAsD;IAC/D;IAEA,OAAOG,SAAS;EAClB;AACF;AAACC,OAAA,CAAAnC,UAAA,GAAAA,UAAA","ignoreList":[]}
1
+ {"version":3,"names":["_core","require","_caseType","_hexToByte","_btManagedDevice","_bc01CommandSequencer","_bc01FrameParser","_bc01MainServices","BC01_FRAME_MIN_LENGTH","BC01Device","BTManagedDevice","onStreamStart","mainServices","bc01MainServices","stuckDataTimeout","constructor","device","params","createCommandSequencer","Bc01CommandSequencer","write","serviceUuid","uuid","characteristicUuid","writeUuid","onRefused","reason","onError","Error","validatePackage","pkg","length","opcode","hexToByte","minLength","undefined","handleDependentResult","data","frame","reportUrsRecord","parsingCase","caseType","CaseType","OTHER","handleSuccessResult","parsed","parseBc01Record","measuredValues","BC01_ANALYTE_ORDER","reduce","acc","analyte","value","values","Object","keys","reading","RESULT","measurementTypeKey","MeasurementTypeKey","uricAcid","urineValues","recordedAt","timestamp","onResult","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bc01/bc01.device.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,SAAA,GAAAD,OAAA;AAQA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAEA,IAAAI,qBAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AAEA;AACA,MAAMO,qBAA6C,GAAG;EACpD,IAAI,EAAE,CAAC;EAAE;EACT,IAAI,EAAE,CAAC;EAAE;EACT,IAAI,EAAE,CAAC;EAAE;EACT,IAAI,EAAE,CAAC;EAAE;EACT,IAAI,EAAE,EAAE;EAAE;EACV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