@ovok/native 1.16.1-rc.5 → 1.16.1-rc.7

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 (712) hide show
  1. package/lib/commonjs/modules/auth/google-return-page/index.js +24 -0
  2. package/lib/commonjs/modules/auth/google-return-page/index.js.map +1 -0
  3. package/lib/commonjs/modules/auth/hooks/use-social-sign-in.web.js +15 -0
  4. package/lib/commonjs/modules/auth/hooks/use-social-sign-in.web.js.map +1 -0
  5. package/lib/commonjs/modules/auth/index.js +21 -10
  6. package/lib/commonjs/modules/auth/index.js.map +1 -1
  7. package/lib/commonjs/modules/auth/session/logout-session.js +1 -1
  8. package/lib/commonjs/modules/auth/sign-in/components/social-logins/apple-login-button.web.js +73 -0
  9. package/lib/commonjs/modules/auth/sign-in/components/social-logins/apple-login-button.web.js.map +1 -0
  10. package/lib/commonjs/modules/auth/sign-in/components/social-logins/apple-login.js +1 -1
  11. package/lib/commonjs/modules/auth/sign-in/components/social-logins/google-login-button.web.js +73 -0
  12. package/lib/commonjs/modules/auth/sign-in/components/social-logins/google-login-button.web.js.map +1 -0
  13. package/lib/commonjs/modules/auth/sign-in/components/social-logins/google-login.js +1 -1
  14. package/lib/commonjs/modules/auth/sign-in/index.js +24 -0
  15. package/lib/commonjs/modules/auth/sign-in/index.js.map +1 -1
  16. package/lib/commonjs/modules/auth/sign-in/utils/apple-web-sign-in.js +90 -0
  17. package/lib/commonjs/modules/auth/sign-in/utils/apple-web-sign-in.js.map +1 -0
  18. package/lib/commonjs/modules/auth/sign-in/utils/google-redirect-sign-in.js +89 -0
  19. package/lib/commonjs/modules/auth/sign-in/utils/google-redirect-sign-in.js.map +1 -0
  20. package/lib/commonjs/modules/auth/sign-in/utils/jwt-claims.js +21 -0
  21. package/lib/commonjs/modules/auth/sign-in/utils/jwt-claims.js.map +1 -0
  22. package/lib/commonjs/modules/auth/utils/sign-out-google.web.js +10 -0
  23. package/lib/commonjs/modules/auth/utils/sign-out-google.web.js.map +1 -0
  24. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +19 -7
  25. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  26. package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -1
  27. package/lib/commonjs/modules/bt-management/index.js +12 -0
  28. package/lib/commonjs/modules/bt-management/index.js.map +1 -1
  29. package/lib/commonjs/modules/bt-management/services/bt-manager.js +27 -1
  30. package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
  31. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js +42 -2
  32. package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -1
  33. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js +64 -44
  34. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js.map +1 -1
  35. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.js +98 -0
  36. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.js.map +1 -0
  37. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.js +127 -0
  38. package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.js.map +1 -0
  39. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.device.js +48 -17
  40. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.device.js.map +1 -1
  41. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.frame-reader.js +2 -2
  42. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.frame-reader.js.map +1 -1
  43. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js +78 -19
  44. package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js.map +1 -1
  45. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +30 -2
  46. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
  47. package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js +11 -3
  48. package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
  49. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +48 -3
  50. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  51. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.records.js +2 -7
  52. package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.records.js.map +1 -1
  53. package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +6 -2
  54. package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
  55. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +115 -26
  56. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  57. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.advertisement.js +19 -2
  58. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.advertisement.js.map +1 -1
  59. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.connect-retry.js +32 -0
  60. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.connect-retry.js.map +1 -0
  61. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.delivered-files.js +73 -0
  62. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.delivered-files.js.map +1 -0
  63. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.js +130 -30
  64. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.js.map +1 -1
  65. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.js +103 -0
  66. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.js.map +1 -0
  67. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +20 -14
  68. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
  69. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame-reader.js +4 -2
  70. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame-reader.js.map +1 -1
  71. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.identity-gate.js +94 -10
  72. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -1
  73. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.js +75 -0
  74. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.js.map +1 -0
  75. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.js +113 -0
  76. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.js.map +1 -0
  77. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.pulse-wave.js +67 -0
  78. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.pulse-wave.js.map +1 -0
  79. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.recorder.js +55 -0
  80. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.recorder.js.map +1 -0
  81. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.recording-watch.js +57 -0
  82. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.recording-watch.js.map +1 -0
  83. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.session.js +49 -0
  84. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.session.js.map +1 -0
  85. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.stored-files.js +46 -0
  86. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.stored-files.js.map +1 -0
  87. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js +10 -4
  88. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -1
  89. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.waveform.js +27 -0
  90. package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.waveform.js.map +1 -0
  91. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +0 -1
  92. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -1
  93. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-files.js +75 -20
  94. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-files.js.map +1 -1
  95. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +21 -12
  96. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -1
  97. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.js +47 -0
  98. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.js.map +1 -0
  99. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js +58 -32
  100. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -1
  101. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.js +3 -7
  102. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.js.map +1 -1
  103. package/lib/commonjs/modules/bt-management/services/series-recorder.js +27 -5
  104. package/lib/commonjs/modules/bt-management/services/series-recorder.js.map +1 -1
  105. package/lib/commonjs/modules/bt-management/types/device-waveform.js +6 -0
  106. package/lib/commonjs/modules/bt-management/types/device-waveform.js.map +1 -0
  107. package/lib/commonjs/modules/bt-management/utils/calculate-crc-16-modbus.js +23 -0
  108. package/lib/commonjs/modules/bt-management/utils/calculate-crc-16-modbus.js.map +1 -0
  109. package/lib/commonjs/modules/bt-management/utils/i-16-from-hex.js.map +1 -1
  110. package/lib/commonjs/modules/bt-management/utils/le-32-from-hex.js.map +1 -1
  111. package/lib/commonjs/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.js +13 -0
  112. package/lib/commonjs/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.js.map +1 -0
  113. package/lib/commonjs/modules/data-sync/components/apple/apple-health-authorization-provider.js +15 -8
  114. package/lib/commonjs/modules/data-sync/components/apple/apple-health-authorization-provider.js.map +1 -1
  115. package/lib/commonjs/modules/data-sync/components/apple/apple-health-authorization-utils.js +1 -1
  116. package/lib/commonjs/modules/data-sync/components/apple/apple-health-authorization-utils.js.map +1 -1
  117. package/lib/commonjs/modules/data-sync/constants.js +4 -1
  118. package/lib/commonjs/modules/data-sync/constants.js.map +1 -1
  119. package/lib/commonjs/modules/data-sync/hooks/use-listen-changes.js +6 -9
  120. package/lib/commonjs/modules/data-sync/hooks/use-listen-changes.js.map +1 -1
  121. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js +8 -7
  122. package/lib/commonjs/modules/data-sync/services/managers/data-processor.js.map +1 -1
  123. package/lib/commonjs/modules/data-sync/types/health-sync-keys.js +13 -0
  124. package/lib/commonjs/modules/data-sync/types/health-sync-keys.js.map +1 -1
  125. package/lib/commonjs/modules/data-sync/utils/convert-ecg-samples-to-observation.js +47 -0
  126. package/lib/commonjs/modules/data-sync/utils/convert-ecg-samples-to-observation.js.map +1 -0
  127. package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js +14 -6
  128. package/lib/commonjs/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
  129. package/lib/commonjs/modules/data-sync/utils/convert-samples-to-observation.js +7 -15
  130. package/lib/commonjs/modules/data-sync/utils/convert-samples-to-observation.js.map +1 -1
  131. package/lib/commonjs/modules/data-sync/utils/default-health-coding.js +68 -0
  132. package/lib/commonjs/modules/data-sync/utils/default-health-coding.js.map +1 -0
  133. package/lib/commonjs/modules/data-sync/utils/get-records-from-health-connect.js +20 -4
  134. package/lib/commonjs/modules/data-sync/utils/get-records-from-health-connect.js.map +1 -1
  135. package/lib/commonjs/modules/data-sync/utils/get-samples-from-health.js +43 -86
  136. package/lib/commonjs/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
  137. package/lib/commonjs/modules/data-sync/utils/get-total-samples-count.js +6 -5
  138. package/lib/commonjs/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
  139. package/lib/commonjs/modules/data-sync/utils/health-data-catalog.js +15 -15
  140. package/lib/commonjs/modules/data-sync/utils/health-data-catalog.js.map +1 -1
  141. package/lib/commonjs/modules/data-sync/utils/health-units.js +11 -1
  142. package/lib/commonjs/modules/data-sync/utils/health-units.js.map +1 -1
  143. package/lib/commonjs/modules/data-sync/utils/healthkit-daily-statistics.js +64 -0
  144. package/lib/commonjs/modules/data-sync/utils/healthkit-daily-statistics.js.map +1 -0
  145. package/lib/commonjs/modules/data-sync/utils/healthkit-data-types.js.map +1 -1
  146. package/lib/commonjs/modules/data-sync/utils/healthkit-query-options.js +20 -0
  147. package/lib/commonjs/modules/data-sync/utils/healthkit-query-options.js.map +1 -0
  148. package/lib/commonjs/modules/data-sync/utils/healthkit-sample-source.js +21 -0
  149. package/lib/commonjs/modules/data-sync/utils/healthkit-sample-source.js.map +1 -0
  150. package/lib/commonjs/modules/data-sync/utils/healthkit-samples.js +59 -0
  151. package/lib/commonjs/modules/data-sync/utils/healthkit-samples.js.map +1 -0
  152. package/lib/commonjs/modules/data-sync/utils/healthkit-series.js +20 -11
  153. package/lib/commonjs/modules/data-sync/utils/healthkit-series.js.map +1 -1
  154. package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js +12 -2
  155. package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -1
  156. package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js +39 -5
  157. package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -1
  158. package/lib/commonjs/modules/next/bluetooth/connections.js +45 -2
  159. package/lib/commonjs/modules/next/bluetooth/connections.js.map +1 -1
  160. package/lib/commonjs/modules/next/bluetooth/driver.js.map +1 -1
  161. package/lib/commonjs/modules/next/bluetooth/errors.js.map +1 -1
  162. package/lib/commonjs/modules/next/bluetooth/index.js.map +1 -1
  163. package/lib/commonjs/modules/next/bluetooth/readings.js +10 -2
  164. package/lib/commonjs/modules/next/bluetooth/readings.js.map +1 -1
  165. package/lib/commonjs/modules/next/bluetooth/runtime.js +37 -1
  166. package/lib/commonjs/modules/next/bluetooth/runtime.js.map +1 -1
  167. package/lib/commonjs/modules/next/bluetooth/web/index.js.map +1 -1
  168. package/lib/module/modules/auth/google-return-page/index.js +21 -0
  169. package/lib/module/modules/auth/google-return-page/index.js.map +1 -0
  170. package/lib/module/modules/auth/hooks/use-social-sign-in.web.js +10 -0
  171. package/lib/module/modules/auth/hooks/use-social-sign-in.web.js.map +1 -0
  172. package/lib/module/modules/auth/index.js +2 -1
  173. package/lib/module/modules/auth/index.js.map +1 -1
  174. package/lib/module/modules/auth/session/logout-session.js +1 -1
  175. package/lib/module/modules/auth/session/logout-session.js.map +1 -1
  176. package/lib/module/modules/auth/sign-in/components/social-logins/apple-login-button.web.js +67 -0
  177. package/lib/module/modules/auth/sign-in/components/social-logins/apple-login-button.web.js.map +1 -0
  178. package/lib/module/modules/auth/sign-in/components/social-logins/apple-login.js +1 -1
  179. package/lib/module/modules/auth/sign-in/components/social-logins/apple-login.js.map +1 -1
  180. package/lib/module/modules/auth/sign-in/components/social-logins/google-login-button.web.js +68 -0
  181. package/lib/module/modules/auth/sign-in/components/social-logins/google-login-button.web.js.map +1 -0
  182. package/lib/module/modules/auth/sign-in/components/social-logins/google-login.js +1 -1
  183. package/lib/module/modules/auth/sign-in/components/social-logins/google-login.js.map +1 -1
  184. package/lib/module/modules/auth/sign-in/index.js +2 -0
  185. package/lib/module/modules/auth/sign-in/index.js.map +1 -1
  186. package/lib/module/modules/auth/sign-in/utils/apple-web-sign-in.js +84 -0
  187. package/lib/module/modules/auth/sign-in/utils/apple-web-sign-in.js.map +1 -0
  188. package/lib/module/modules/auth/sign-in/utils/google-redirect-sign-in.js +84 -0
  189. package/lib/module/modules/auth/sign-in/utils/google-redirect-sign-in.js.map +1 -0
  190. package/lib/module/modules/auth/sign-in/utils/jwt-claims.js +17 -0
  191. package/lib/module/modules/auth/sign-in/utils/jwt-claims.js.map +1 -0
  192. package/lib/module/modules/auth/utils/sign-out-google.web.js +5 -0
  193. package/lib/module/modules/auth/utils/sign-out-google.web.js.map +1 -0
  194. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +19 -7
  195. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  196. package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -1
  197. package/lib/module/modules/bt-management/index.js +1 -0
  198. package/lib/module/modules/bt-management/index.js.map +1 -1
  199. package/lib/module/modules/bt-management/services/bt-manager.js +27 -1
  200. package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
  201. package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js +42 -2
  202. package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -1
  203. package/lib/module/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js +64 -44
  204. package/lib/module/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js.map +1 -1
  205. package/lib/module/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.js +91 -0
  206. package/lib/module/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.js.map +1 -0
  207. package/lib/module/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.js +123 -0
  208. package/lib/module/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.js.map +1 -0
  209. package/lib/module/modules/bt-management/services/devices/bp2/bp2.device.js +48 -17
  210. package/lib/module/modules/bt-management/services/devices/bp2/bp2.device.js.map +1 -1
  211. package/lib/module/modules/bt-management/services/devices/bp2/bp2.frame-reader.js +2 -3
  212. package/lib/module/modules/bt-management/services/devices/bp2/bp2.frame-reader.js.map +1 -1
  213. package/lib/module/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js +77 -19
  214. package/lib/module/modules/bt-management/services/devices/bp2/bp2.history-sequencer.js.map +1 -1
  215. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +30 -2
  216. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
  217. package/lib/module/modules/bt-management/services/devices/bt-data-processor.js +11 -3
  218. package/lib/module/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
  219. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +48 -3
  220. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  221. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.records.js +2 -7
  222. package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.records.js.map +1 -1
  223. package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +6 -2
  224. package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
  225. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +115 -26
  226. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  227. package/lib/module/modules/bt-management/services/devices/lepu/lepu.advertisement.js +17 -1
  228. package/lib/module/modules/bt-management/services/devices/lepu/lepu.advertisement.js.map +1 -1
  229. package/lib/module/modules/bt-management/services/devices/lepu/lepu.connect-retry.js +28 -0
  230. package/lib/module/modules/bt-management/services/devices/lepu/lepu.connect-retry.js.map +1 -0
  231. package/lib/module/modules/bt-management/services/devices/lepu/lepu.delivered-files.js +69 -0
  232. package/lib/module/modules/bt-management/services/devices/lepu/lepu.delivered-files.js.map +1 -0
  233. package/lib/module/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.js +129 -30
  234. package/lib/module/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.js.map +1 -1
  235. package/lib/module/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.js +99 -0
  236. package/lib/module/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.js.map +1 -0
  237. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +20 -14
  238. package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
  239. package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame-reader.js +4 -2
  240. package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame-reader.js.map +1 -1
  241. package/lib/module/modules/bt-management/services/devices/lepu/lepu.identity-gate.js +94 -10
  242. package/lib/module/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -1
  243. package/lib/module/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.js +72 -0
  244. package/lib/module/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.js.map +1 -0
  245. package/lib/module/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.js +109 -0
  246. package/lib/module/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.js.map +1 -0
  247. package/lib/module/modules/bt-management/services/devices/lepu/lepu.pulse-wave.js +64 -0
  248. package/lib/module/modules/bt-management/services/devices/lepu/lepu.pulse-wave.js.map +1 -0
  249. package/lib/module/modules/bt-management/services/devices/lepu/lepu.recorder.js +51 -0
  250. package/lib/module/modules/bt-management/services/devices/lepu/lepu.recorder.js.map +1 -0
  251. package/lib/module/modules/bt-management/services/devices/lepu/lepu.recording-watch.js +53 -0
  252. package/lib/module/modules/bt-management/services/devices/lepu/lepu.recording-watch.js.map +1 -0
  253. package/lib/module/modules/bt-management/services/devices/lepu/lepu.session.js +45 -0
  254. package/lib/module/modules/bt-management/services/devices/lepu/lepu.session.js.map +1 -0
  255. package/lib/module/modules/bt-management/services/devices/lepu/lepu.stored-files.js +42 -0
  256. package/lib/module/modules/bt-management/services/devices/lepu/lepu.stored-files.js.map +1 -0
  257. package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js +10 -4
  258. package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -1
  259. package/lib/module/modules/bt-management/services/devices/lepu/lepu.waveform.js +22 -0
  260. package/lib/module/modules/bt-management/services/devices/lepu/lepu.waveform.js.map +1 -0
  261. package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +0 -1
  262. package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -1
  263. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-files.js +75 -21
  264. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-files.js.map +1 -1
  265. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +21 -12
  266. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -1
  267. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.js +44 -0
  268. package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.js.map +1 -0
  269. package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js +58 -32
  270. package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -1
  271. package/lib/module/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.js +3 -7
  272. package/lib/module/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.js.map +1 -1
  273. package/lib/module/modules/bt-management/services/series-recorder.js +27 -5
  274. package/lib/module/modules/bt-management/services/series-recorder.js.map +1 -1
  275. package/lib/module/modules/bt-management/types/device-waveform.js +4 -0
  276. package/lib/module/modules/bt-management/types/device-waveform.js.map +1 -0
  277. package/lib/module/modules/bt-management/utils/calculate-crc-16-modbus.js +18 -0
  278. package/lib/module/modules/bt-management/utils/calculate-crc-16-modbus.js.map +1 -0
  279. package/lib/module/modules/bt-management/utils/i-16-from-hex.js.map +1 -1
  280. package/lib/module/modules/bt-management/utils/le-32-from-hex.js.map +1 -1
  281. package/lib/module/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.js +8 -0
  282. package/lib/module/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.js.map +1 -0
  283. package/lib/module/modules/data-sync/components/apple/apple-health-authorization-provider.js +16 -9
  284. package/lib/module/modules/data-sync/components/apple/apple-health-authorization-provider.js.map +1 -1
  285. package/lib/module/modules/data-sync/components/apple/apple-health-authorization-utils.js +2 -2
  286. package/lib/module/modules/data-sync/components/apple/apple-health-authorization-utils.js.map +1 -1
  287. package/lib/module/modules/data-sync/constants.js +4 -1
  288. package/lib/module/modules/data-sync/constants.js.map +1 -1
  289. package/lib/module/modules/data-sync/hooks/use-listen-changes.js +7 -10
  290. package/lib/module/modules/data-sync/hooks/use-listen-changes.js.map +1 -1
  291. package/lib/module/modules/data-sync/services/managers/data-processor.js +8 -7
  292. package/lib/module/modules/data-sync/services/managers/data-processor.js.map +1 -1
  293. package/lib/module/modules/data-sync/types/health-sync-keys.js +13 -0
  294. package/lib/module/modules/data-sync/types/health-sync-keys.js.map +1 -1
  295. package/lib/module/modules/data-sync/utils/convert-ecg-samples-to-observation.js +43 -0
  296. package/lib/module/modules/data-sync/utils/convert-ecg-samples-to-observation.js.map +1 -0
  297. package/lib/module/modules/data-sync/utils/convert-generic-health-data.js +14 -6
  298. package/lib/module/modules/data-sync/utils/convert-generic-health-data.js.map +1 -1
  299. package/lib/module/modules/data-sync/utils/convert-samples-to-observation.js +7 -15
  300. package/lib/module/modules/data-sync/utils/convert-samples-to-observation.js.map +1 -1
  301. package/lib/module/modules/data-sync/utils/default-health-coding.js +65 -0
  302. package/lib/module/modules/data-sync/utils/default-health-coding.js.map +1 -0
  303. package/lib/module/modules/data-sync/utils/get-records-from-health-connect.js +20 -4
  304. package/lib/module/modules/data-sync/utils/get-records-from-health-connect.js.map +1 -1
  305. package/lib/module/modules/data-sync/utils/get-samples-from-health.js +44 -87
  306. package/lib/module/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
  307. package/lib/module/modules/data-sync/utils/get-total-samples-count.js +5 -4
  308. package/lib/module/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
  309. package/lib/module/modules/data-sync/utils/health-data-catalog.js +15 -15
  310. package/lib/module/modules/data-sync/utils/health-data-catalog.js.map +1 -1
  311. package/lib/module/modules/data-sync/utils/health-units.js +11 -1
  312. package/lib/module/modules/data-sync/utils/health-units.js.map +1 -1
  313. package/lib/module/modules/data-sync/utils/healthkit-daily-statistics.js +59 -0
  314. package/lib/module/modules/data-sync/utils/healthkit-daily-statistics.js.map +1 -0
  315. package/lib/module/modules/data-sync/utils/healthkit-data-types.js.map +1 -1
  316. package/lib/module/modules/data-sync/utils/healthkit-query-options.js +16 -0
  317. package/lib/module/modules/data-sync/utils/healthkit-query-options.js.map +1 -0
  318. package/lib/module/modules/data-sync/utils/healthkit-sample-source.js +17 -0
  319. package/lib/module/modules/data-sync/utils/healthkit-sample-source.js.map +1 -0
  320. package/lib/module/modules/data-sync/utils/healthkit-samples.js +52 -0
  321. package/lib/module/modules/data-sync/utils/healthkit-samples.js.map +1 -0
  322. package/lib/module/modules/data-sync/utils/healthkit-series.js +19 -10
  323. package/lib/module/modules/data-sync/utils/healthkit-series.js.map +1 -1
  324. package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js +12 -2
  325. package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -1
  326. package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js +39 -5
  327. package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -1
  328. package/lib/module/modules/next/bluetooth/connections.js +45 -2
  329. package/lib/module/modules/next/bluetooth/connections.js.map +1 -1
  330. package/lib/module/modules/next/bluetooth/driver.js.map +1 -1
  331. package/lib/module/modules/next/bluetooth/errors.js.map +1 -1
  332. package/lib/module/modules/next/bluetooth/index.js.map +1 -1
  333. package/lib/module/modules/next/bluetooth/readings.js +10 -2
  334. package/lib/module/modules/next/bluetooth/readings.js.map +1 -1
  335. package/lib/module/modules/next/bluetooth/runtime.js +37 -1
  336. package/lib/module/modules/next/bluetooth/runtime.js.map +1 -1
  337. package/lib/module/modules/next/bluetooth/web/index.js.map +1 -1
  338. package/lib/typescript/commonjs/src/modules/auth/google-return-page/index.d.ts +8 -0
  339. package/lib/typescript/commonjs/src/modules/auth/google-return-page/index.d.ts.map +1 -0
  340. package/lib/typescript/commonjs/src/modules/auth/hooks/use-social-sign-in.web.d.ts +7 -0
  341. package/lib/typescript/commonjs/src/modules/auth/hooks/use-social-sign-in.web.d.ts.map +1 -0
  342. package/lib/typescript/commonjs/src/modules/auth/index.d.ts +1 -0
  343. package/lib/typescript/commonjs/src/modules/auth/index.d.ts.map +1 -1
  344. package/lib/typescript/commonjs/src/modules/auth/register/components/register.d.ts +2 -2
  345. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/sign-in.d.ts +2 -2
  346. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/apple-login-button.web.d.ts +5 -0
  347. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/apple-login-button.web.d.ts.map +1 -0
  348. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/apple-login.d.ts +1 -1
  349. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/google-login-button.web.d.ts +5 -0
  350. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/google-login-button.web.d.ts.map +1 -0
  351. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/google-login.d.ts +1 -1
  352. package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/social-logins.d.ts +2 -2
  353. package/lib/typescript/commonjs/src/modules/auth/sign-in/index.d.ts +2 -0
  354. package/lib/typescript/commonjs/src/modules/auth/sign-in/index.d.ts.map +1 -1
  355. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/apple-login-props.d.ts +13 -0
  356. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/apple-login-props.d.ts.map +1 -1
  357. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/google-login-props.d.ts +13 -0
  358. package/lib/typescript/commonjs/src/modules/auth/sign-in/types/google-login-props.d.ts.map +1 -1
  359. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/apple-web-sign-in.d.ts +17 -0
  360. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/apple-web-sign-in.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/google-redirect-sign-in.d.ts +14 -0
  362. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/google-redirect-sign-in.d.ts.map +1 -0
  363. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/jwt-claims.d.ts +9 -0
  364. package/lib/typescript/commonjs/src/modules/auth/sign-in/utils/jwt-claims.d.ts.map +1 -0
  365. package/lib/typescript/commonjs/src/modules/auth/utils/sign-out-google.web.d.ts +3 -0
  366. package/lib/typescript/commonjs/src/modules/auth/utils/sign-out-google.web.d.ts.map +1 -0
  367. package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  368. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +4 -1
  369. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
  370. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +1 -0
  371. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
  372. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +21 -5
  373. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  374. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -1
  375. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.d.ts.map +1 -1
  376. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.d.ts +34 -0
  377. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.d.ts.map +1 -0
  378. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.d.ts +32 -0
  379. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.d.ts.map +1 -0
  380. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.device.d.ts +4 -0
  381. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.device.d.ts.map +1 -1
  382. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts +2 -1
  383. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts.map +1 -1
  384. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts +29 -3
  385. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts.map +1 -1
  386. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts +6 -1
  387. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
  388. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts +2 -0
  389. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
  390. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +23 -3
  391. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  392. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe.records.d.ts.map +1 -1
  393. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +6 -3
  394. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
  395. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +20 -0
  396. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  397. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.advertisement.d.ts +8 -1
  398. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.advertisement.d.ts.map +1 -1
  399. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.connect-retry.d.ts +12 -0
  400. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.connect-retry.d.ts.map +1 -0
  401. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.delivered-files.d.ts +24 -0
  402. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.delivered-files.d.ts.map +1 -0
  403. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.d.ts +40 -5
  404. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.d.ts.map +1 -1
  405. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.d.ts +20 -0
  406. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.d.ts.map +1 -0
  407. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +6 -3
  408. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
  409. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts +3 -1
  410. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts.map +1 -1
  411. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts +26 -1
  412. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -1
  413. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.d.ts +42 -0
  414. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.d.ts.map +1 -0
  415. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.d.ts +28 -0
  416. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.d.ts.map +1 -0
  417. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave.d.ts +16 -0
  418. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave.d.ts.map +1 -0
  419. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.recorder.d.ts +32 -0
  420. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.recorder.d.ts.map +1 -0
  421. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.recording-watch.d.ts +28 -0
  422. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.recording-watch.d.ts.map +1 -0
  423. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.session.d.ts +17 -0
  424. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.session.d.ts.map +1 -0
  425. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.stored-files.d.ts +33 -0
  426. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.stored-files.d.ts.map +1 -0
  427. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +6 -1
  428. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -1
  429. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.waveform.d.ts +9 -0
  430. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.waveform.d.ts.map +1 -0
  431. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -1
  432. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts +9 -3
  433. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts.map +1 -1
  434. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -1
  435. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.d.ts +8 -0
  436. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.d.ts.map +1 -0
  437. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -1
  438. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.d.ts.map +1 -1
  439. package/lib/typescript/commonjs/src/modules/bt-management/services/series-recorder.d.ts +6 -1
  440. package/lib/typescript/commonjs/src/modules/bt-management/services/series-recorder.d.ts.map +1 -1
  441. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +7 -1
  442. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  443. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts +47 -3
  444. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -1
  445. package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts +17 -1
  446. package/lib/typescript/commonjs/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -1
  447. package/lib/typescript/commonjs/src/modules/bt-management/types/device-waveform.d.ts +15 -0
  448. package/lib/typescript/commonjs/src/modules/bt-management/types/device-waveform.d.ts.map +1 -0
  449. package/lib/typescript/commonjs/src/modules/bt-management/utils/calculate-crc-16-modbus.d.ts +3 -0
  450. package/lib/typescript/commonjs/src/modules/bt-management/utils/calculate-crc-16-modbus.d.ts.map +1 -0
  451. package/lib/typescript/commonjs/src/modules/bt-management/utils/i-16-from-hex.d.ts +1 -1
  452. package/lib/typescript/commonjs/src/modules/bt-management/utils/i-16-from-hex.d.ts.map +1 -1
  453. package/lib/typescript/commonjs/src/modules/bt-management/utils/le-32-from-hex.d.ts +1 -1
  454. package/lib/typescript/commonjs/src/modules/bt-management/utils/le-32-from-hex.d.ts.map +1 -1
  455. package/lib/typescript/commonjs/src/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.d.ts +3 -0
  456. package/lib/typescript/commonjs/src/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.d.ts.map +1 -0
  457. package/lib/typescript/commonjs/src/modules/data-sync/components/apple/apple-health-authorization-provider.d.ts.map +1 -1
  458. package/lib/typescript/commonjs/src/modules/data-sync/components/apple/apple-health-authorization-utils.d.ts +2 -2
  459. package/lib/typescript/commonjs/src/modules/data-sync/components/apple/apple-health-authorization-utils.d.ts.map +1 -1
  460. package/lib/typescript/commonjs/src/modules/data-sync/constants.d.ts +3 -1
  461. package/lib/typescript/commonjs/src/modules/data-sync/constants.d.ts.map +1 -1
  462. package/lib/typescript/commonjs/src/modules/data-sync/hooks/use-listen-changes.d.ts.map +1 -1
  463. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  464. package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts +2 -2
  465. package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts.map +1 -1
  466. package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-sync-props.d.ts +4 -7
  467. package/lib/typescript/commonjs/src/modules/data-sync/types/apple-health-sync-props.d.ts.map +1 -1
  468. package/lib/typescript/commonjs/src/modules/data-sync/types/get-data-from-provider-props.d.ts +3 -1
  469. package/lib/typescript/commonjs/src/modules/data-sync/types/get-data-from-provider-props.d.ts.map +1 -1
  470. package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts +2 -2
  471. package/lib/typescript/commonjs/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
  472. package/lib/typescript/commonjs/src/modules/data-sync/types/health-sync-keys.d.ts +11 -1
  473. package/lib/typescript/commonjs/src/modules/data-sync/types/health-sync-keys.d.ts.map +1 -1
  474. package/lib/typescript/commonjs/src/modules/data-sync/types/health-sync-props.d.ts +1 -1
  475. package/lib/typescript/commonjs/src/modules/data-sync/types/health-sync-props.d.ts.map +1 -1
  476. package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-ecg-samples-to-observation.d.ts +6 -0
  477. package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-ecg-samples-to-observation.d.ts.map +1 -0
  478. package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-generic-health-data.d.ts +1 -1
  479. package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-generic-health-data.d.ts.map +1 -1
  480. package/lib/typescript/commonjs/src/modules/data-sync/utils/convert-samples-to-observation.d.ts.map +1 -1
  481. package/lib/typescript/commonjs/src/modules/data-sync/utils/default-health-coding.d.ts +10 -0
  482. package/lib/typescript/commonjs/src/modules/data-sync/utils/default-health-coding.d.ts.map +1 -0
  483. package/lib/typescript/commonjs/src/modules/data-sync/utils/get-records-from-health-connect.d.ts +1 -1
  484. package/lib/typescript/commonjs/src/modules/data-sync/utils/get-records-from-health-connect.d.ts.map +1 -1
  485. package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts +12 -46
  486. package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
  487. package/lib/typescript/commonjs/src/modules/data-sync/utils/get-total-samples-count.d.ts.map +1 -1
  488. package/lib/typescript/commonjs/src/modules/data-sync/utils/health-data-catalog.d.ts.map +1 -1
  489. package/lib/typescript/commonjs/src/modules/data-sync/utils/health-units.d.ts +2 -2
  490. package/lib/typescript/commonjs/src/modules/data-sync/utils/health-units.d.ts.map +1 -1
  491. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-daily-statistics.d.ts +10 -0
  492. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-daily-statistics.d.ts.map +1 -0
  493. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-data-types.d.ts +5 -5
  494. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-data-types.d.ts.map +1 -1
  495. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-query-options.d.ts +7 -0
  496. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-query-options.d.ts.map +1 -0
  497. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-sample-source.d.ts +8 -0
  498. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-sample-source.d.ts.map +1 -0
  499. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-samples.d.ts +30 -0
  500. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-samples.d.ts.map +1 -0
  501. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-series.d.ts +2 -2
  502. package/lib/typescript/commonjs/src/modules/data-sync/utils/healthkit-series.d.ts.map +1 -1
  503. package/lib/typescript/commonjs/src/modules/data-sync/utils/to-core-health-observations.d.ts +1 -0
  504. package/lib/typescript/commonjs/src/modules/data-sync/utils/to-core-health-observations.d.ts.map +1 -1
  505. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +12 -1
  506. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -1
  507. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +2 -1
  508. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -1
  509. package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts +13 -1
  510. package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts.map +1 -1
  511. package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts +20 -0
  512. package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts.map +1 -1
  513. package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts +1 -1
  514. package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts.map +1 -1
  515. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +2 -1
  516. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -1
  517. package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts +3 -2
  518. package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts.map +1 -1
  519. package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts +19 -1
  520. package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts.map +1 -1
  521. package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts +33 -1
  522. package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts.map +1 -1
  523. package/lib/typescript/commonjs/src/modules/next/bluetooth/web/index.d.ts +1 -0
  524. package/lib/typescript/commonjs/src/modules/next/bluetooth/web/index.d.ts.map +1 -1
  525. package/lib/typescript/module/src/modules/auth/google-return-page/index.d.ts +8 -0
  526. package/lib/typescript/module/src/modules/auth/google-return-page/index.d.ts.map +1 -0
  527. package/lib/typescript/module/src/modules/auth/hooks/use-social-sign-in.web.d.ts +7 -0
  528. package/lib/typescript/module/src/modules/auth/hooks/use-social-sign-in.web.d.ts.map +1 -0
  529. package/lib/typescript/module/src/modules/auth/index.d.ts +1 -0
  530. package/lib/typescript/module/src/modules/auth/index.d.ts.map +1 -1
  531. package/lib/typescript/module/src/modules/auth/register/components/register.d.ts +2 -2
  532. package/lib/typescript/module/src/modules/auth/sign-in/components/sign-in.d.ts +2 -2
  533. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/apple-login-button.web.d.ts +5 -0
  534. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/apple-login-button.web.d.ts.map +1 -0
  535. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/apple-login.d.ts +1 -1
  536. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/google-login-button.web.d.ts +5 -0
  537. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/google-login-button.web.d.ts.map +1 -0
  538. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/google-login.d.ts +1 -1
  539. package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/social-logins.d.ts +2 -2
  540. package/lib/typescript/module/src/modules/auth/sign-in/index.d.ts +2 -0
  541. package/lib/typescript/module/src/modules/auth/sign-in/index.d.ts.map +1 -1
  542. package/lib/typescript/module/src/modules/auth/sign-in/types/apple-login-props.d.ts +13 -0
  543. package/lib/typescript/module/src/modules/auth/sign-in/types/apple-login-props.d.ts.map +1 -1
  544. package/lib/typescript/module/src/modules/auth/sign-in/types/google-login-props.d.ts +13 -0
  545. package/lib/typescript/module/src/modules/auth/sign-in/types/google-login-props.d.ts.map +1 -1
  546. package/lib/typescript/module/src/modules/auth/sign-in/utils/apple-web-sign-in.d.ts +17 -0
  547. package/lib/typescript/module/src/modules/auth/sign-in/utils/apple-web-sign-in.d.ts.map +1 -0
  548. package/lib/typescript/module/src/modules/auth/sign-in/utils/google-redirect-sign-in.d.ts +14 -0
  549. package/lib/typescript/module/src/modules/auth/sign-in/utils/google-redirect-sign-in.d.ts.map +1 -0
  550. package/lib/typescript/module/src/modules/auth/sign-in/utils/jwt-claims.d.ts +9 -0
  551. package/lib/typescript/module/src/modules/auth/sign-in/utils/jwt-claims.d.ts.map +1 -0
  552. package/lib/typescript/module/src/modules/auth/utils/sign-out-google.web.d.ts +3 -0
  553. package/lib/typescript/module/src/modules/auth/utils/sign-out-google.web.d.ts.map +1 -0
  554. package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  555. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +4 -1
  556. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
  557. package/lib/typescript/module/src/modules/bt-management/index.d.ts +1 -0
  558. package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
  559. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +21 -5
  560. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  561. package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -1
  562. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.d.ts.map +1 -1
  563. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.d.ts +34 -0
  564. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/telebgm.protocol.d.ts.map +1 -0
  565. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.d.ts +32 -0
  566. package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.d.ts.map +1 -0
  567. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.device.d.ts +4 -0
  568. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.device.d.ts.map +1 -1
  569. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts +2 -1
  570. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts.map +1 -1
  571. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts +29 -3
  572. package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.history-sequencer.d.ts.map +1 -1
  573. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts +6 -1
  574. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
  575. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts +2 -0
  576. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
  577. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +23 -3
  578. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  579. package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe.records.d.ts.map +1 -1
  580. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +6 -3
  581. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
  582. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +20 -0
  583. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  584. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.advertisement.d.ts +8 -1
  585. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.advertisement.d.ts.map +1 -1
  586. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.connect-retry.d.ts +12 -0
  587. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.connect-retry.d.ts.map +1 -0
  588. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.delivered-files.d.ts +24 -0
  589. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.delivered-files.d.ts.map +1 -0
  590. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.d.ts +40 -5
  591. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.ecg-transfer.d.ts.map +1 -1
  592. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.d.ts +20 -0
  593. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.encryption-handshake.d.ts.map +1 -0
  594. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +6 -3
  595. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
  596. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts +3 -1
  597. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts.map +1 -1
  598. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts +26 -1
  599. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -1
  600. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.d.ts +42 -0
  601. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.live-ecg-chunks.d.ts.map +1 -0
  602. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.d.ts +28 -0
  603. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave-chunks.d.ts.map +1 -0
  604. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave.d.ts +16 -0
  605. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.pulse-wave.d.ts.map +1 -0
  606. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.recorder.d.ts +32 -0
  607. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.recorder.d.ts.map +1 -0
  608. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.recording-watch.d.ts +28 -0
  609. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.recording-watch.d.ts.map +1 -0
  610. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.session.d.ts +17 -0
  611. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.session.d.ts.map +1 -0
  612. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.stored-files.d.ts +33 -0
  613. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.stored-files.d.ts.map +1 -0
  614. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +6 -1
  615. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -1
  616. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.waveform.d.ts +9 -0
  617. package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.waveform.d.ts.map +1 -0
  618. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -1
  619. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts +9 -3
  620. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts.map +1 -1
  621. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -1
  622. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.d.ts +8 -0
  623. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recording-status.d.ts.map +1 -0
  624. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -1
  625. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.wbp02.protocol.d.ts.map +1 -1
  626. package/lib/typescript/module/src/modules/bt-management/services/series-recorder.d.ts +6 -1
  627. package/lib/typescript/module/src/modules/bt-management/services/series-recorder.d.ts.map +1 -1
  628. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +7 -1
  629. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  630. package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts +47 -3
  631. package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -1
  632. package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts +17 -1
  633. package/lib/typescript/module/src/modules/bt-management/types/device-connection-event.d.ts.map +1 -1
  634. package/lib/typescript/module/src/modules/bt-management/types/device-waveform.d.ts +15 -0
  635. package/lib/typescript/module/src/modules/bt-management/types/device-waveform.d.ts.map +1 -0
  636. package/lib/typescript/module/src/modules/bt-management/utils/calculate-crc-16-modbus.d.ts +3 -0
  637. package/lib/typescript/module/src/modules/bt-management/utils/calculate-crc-16-modbus.d.ts.map +1 -0
  638. package/lib/typescript/module/src/modules/bt-management/utils/i-16-from-hex.d.ts +1 -1
  639. package/lib/typescript/module/src/modules/bt-management/utils/i-16-from-hex.d.ts.map +1 -1
  640. package/lib/typescript/module/src/modules/bt-management/utils/le-32-from-hex.d.ts +1 -1
  641. package/lib/typescript/module/src/modules/bt-management/utils/le-32-from-hex.d.ts.map +1 -1
  642. package/lib/typescript/module/src/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.d.ts +3 -0
  643. package/lib/typescript/module/src/modules/bt-management/utils/tenths-mmol-to-mg-per-dl.d.ts.map +1 -0
  644. package/lib/typescript/module/src/modules/data-sync/components/apple/apple-health-authorization-provider.d.ts.map +1 -1
  645. package/lib/typescript/module/src/modules/data-sync/components/apple/apple-health-authorization-utils.d.ts +2 -2
  646. package/lib/typescript/module/src/modules/data-sync/components/apple/apple-health-authorization-utils.d.ts.map +1 -1
  647. package/lib/typescript/module/src/modules/data-sync/constants.d.ts +3 -1
  648. package/lib/typescript/module/src/modules/data-sync/constants.d.ts.map +1 -1
  649. package/lib/typescript/module/src/modules/data-sync/hooks/use-listen-changes.d.ts.map +1 -1
  650. package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
  651. package/lib/typescript/module/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts +2 -2
  652. package/lib/typescript/module/src/modules/data-sync/types/apple-health-authorization-provider-props.d.ts.map +1 -1
  653. package/lib/typescript/module/src/modules/data-sync/types/apple-health-sync-props.d.ts +4 -7
  654. package/lib/typescript/module/src/modules/data-sync/types/apple-health-sync-props.d.ts.map +1 -1
  655. package/lib/typescript/module/src/modules/data-sync/types/get-data-from-provider-props.d.ts +3 -1
  656. package/lib/typescript/module/src/modules/data-sync/types/get-data-from-provider-props.d.ts.map +1 -1
  657. package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts +2 -2
  658. package/lib/typescript/module/src/modules/data-sync/types/health-authorization-status.d.ts.map +1 -1
  659. package/lib/typescript/module/src/modules/data-sync/types/health-sync-keys.d.ts +11 -1
  660. package/lib/typescript/module/src/modules/data-sync/types/health-sync-keys.d.ts.map +1 -1
  661. package/lib/typescript/module/src/modules/data-sync/types/health-sync-props.d.ts +1 -1
  662. package/lib/typescript/module/src/modules/data-sync/types/health-sync-props.d.ts.map +1 -1
  663. package/lib/typescript/module/src/modules/data-sync/utils/convert-ecg-samples-to-observation.d.ts +6 -0
  664. package/lib/typescript/module/src/modules/data-sync/utils/convert-ecg-samples-to-observation.d.ts.map +1 -0
  665. package/lib/typescript/module/src/modules/data-sync/utils/convert-generic-health-data.d.ts +1 -1
  666. package/lib/typescript/module/src/modules/data-sync/utils/convert-generic-health-data.d.ts.map +1 -1
  667. package/lib/typescript/module/src/modules/data-sync/utils/convert-samples-to-observation.d.ts.map +1 -1
  668. package/lib/typescript/module/src/modules/data-sync/utils/default-health-coding.d.ts +10 -0
  669. package/lib/typescript/module/src/modules/data-sync/utils/default-health-coding.d.ts.map +1 -0
  670. package/lib/typescript/module/src/modules/data-sync/utils/get-records-from-health-connect.d.ts +1 -1
  671. package/lib/typescript/module/src/modules/data-sync/utils/get-records-from-health-connect.d.ts.map +1 -1
  672. package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts +12 -46
  673. package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
  674. package/lib/typescript/module/src/modules/data-sync/utils/get-total-samples-count.d.ts.map +1 -1
  675. package/lib/typescript/module/src/modules/data-sync/utils/health-data-catalog.d.ts.map +1 -1
  676. package/lib/typescript/module/src/modules/data-sync/utils/health-units.d.ts +2 -2
  677. package/lib/typescript/module/src/modules/data-sync/utils/health-units.d.ts.map +1 -1
  678. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-daily-statistics.d.ts +10 -0
  679. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-daily-statistics.d.ts.map +1 -0
  680. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-data-types.d.ts +5 -5
  681. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-data-types.d.ts.map +1 -1
  682. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-query-options.d.ts +7 -0
  683. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-query-options.d.ts.map +1 -0
  684. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-sample-source.d.ts +8 -0
  685. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-sample-source.d.ts.map +1 -0
  686. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-samples.d.ts +30 -0
  687. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-samples.d.ts.map +1 -0
  688. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-series.d.ts +2 -2
  689. package/lib/typescript/module/src/modules/data-sync/utils/healthkit-series.d.ts.map +1 -1
  690. package/lib/typescript/module/src/modules/data-sync/utils/to-core-health-observations.d.ts +1 -0
  691. package/lib/typescript/module/src/modules/data-sync/utils/to-core-health-observations.d.ts.map +1 -1
  692. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +12 -1
  693. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -1
  694. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +2 -1
  695. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -1
  696. package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts +13 -1
  697. package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts.map +1 -1
  698. package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts +20 -0
  699. package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts.map +1 -1
  700. package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts +1 -1
  701. package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts.map +1 -1
  702. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +2 -1
  703. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -1
  704. package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts +3 -2
  705. package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts.map +1 -1
  706. package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts +19 -1
  707. package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts.map +1 -1
  708. package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts +33 -1
  709. package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts.map +1 -1
  710. package/lib/typescript/module/src/modules/next/bluetooth/web/index.d.ts +1 -0
  711. package/lib/typescript/module/src/modules/next/bluetooth/web/index.d.ts.map +1 -1
  712. package/package.json +8 -3
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_next","require","_caseType","_clockSync","_tenthsMmolToMgPerDl","_telebgmProtocol","MG_PER_DL_UNITS","CONTROL_SOLUTION","RECORD_BYTES","RESULT_TYPE_INDEX","recordTime","year","month","day","hours","minutes","timezone","fields","time","Date","UTC","parts","getClockParts","undefined","readRecord","payload","reportsMmol","length","value","recordedAt","bloodGlucose","tenthsMmolToMgPerDl","TeleBgmSequencer","withoutResponse","finished","constructor","params","initialCommands","writesWithoutResponse","request","TELEBGM_COMMAND","serial","isHistoryTransfer","isNormalDisconnect","nextCommand","frame","command","unframe","testStatus","acknowledge","softwareVersion","units","setClock","history","setTime","report","transferEnd","historyEnd","reading","clockSync","onResult","caseType","CaseType","RESULT","measurementTypeKey","MeasurementTypeKey","isClockSyncEnabled","seconds","now","telebgmFrame","TELEBGM_PARAMETER","write","ack","serviceUuid","TELEBGM_SERVICE","characteristicUuid","TELEBGM_WRITE","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/blood-glucose/telebgm.sequencer.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAQA,IAAAG,oBAAA,GAAAH,OAAA;AAEA,IAAAI,gBAAA,GAAAJ,OAAA;AASA;AACA,MAAMK,eAAe,GAAG,IAAI;;AAE5B;AACA,MAAMC,gBAAgB,GAAG,IAAI;;AAE7B;A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AO;MAAEoD;IAAQ,CAAC,GAAG,IAAA7C,wBAAa,EACjEqC,SAAS,EAAES,GAAG,GAAG,CAAC,IAAI,IAAIjD,IAAI,CAAC,CAAC,EAChCwC,SAAS,EAAE3C,QACb,CAAC;IAED,OAAO,IAAI,CAAC8B,OAAO,CACjB,IAAAuB,6BAAY,EAAC7B,gCAAe,CAACc,OAAO,EAAEgB,kCAAiB,CAACC,KAAK,EAAE,CAAC5D,IAAI,GAAG,GAAG,EAAEC,KAAK,EAAEC,GAAG,EAAEC,KAAK,EAAEC,OAAO,EAAEoD,OAAO,CAAC,CAClH,CAAC;EACH,CAAC;EAEO5B,OAAO,GAAIO,OAAe,IAChC,IAAI,CAACA,OAAO,CAAC,IAAAuB,6BAAY,EAACvB,OAAO,EAAEwB,kCAAiB,CAAC/B,OAAO,CAAC,CAAC;EAExDU,WAAW,GAAIH,OAAe,IACpC,IAAI,CAACA,OAAO,CAAC,IAAAuB,6BAAY,EAACvB,OAAO,EAAEwB,kCAAiB,CAACE,GAAG,CAAC,CAAC;EAEpD1B,OAAO,GAAID,KAAe,KAAqB;IACrD4B,WAAW,EAAEC,gCAAe;IAC5BC,kBAAkB,EAAEC,8BAAa;IACjC/B,KAAK;IACL,IAAI,IAAI,CAACZ,eAAe,GAAG;MAAEA,eAAe,EAAE;IAAK,CAAC,GAAG,CAAC,CAAC;EAC3D,CAAC,CAAC;AACJ;AAAC4C,OAAA,CAAA7C,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -12,11 +12,15 @@ var _preferredMtu = require("../../../constants/preferred-mtu.js");
12
12
  var _bloodPressureStates = require("../../../types/blood-pressure-states.js");
13
13
  var _caseType = require("../../../types/case-type.js");
14
14
  var _deviceStatus = require("../../../types/device-status.js");
15
+ var _bytesToHex = require("../../../utils/bytes-to-hex.js");
15
16
  var _hexToByte = require("../../../utils/hex-to-byte.js");
16
17
  var _i16FromHex = require("../../../utils/i-16-from-hex.js");
17
18
  var _le16FromHex = require("../../../utils/le-16-from-hex.js");
18
19
  var _le32FromHex = require("../../../utils/le-32-from-hex.js");
19
20
  var _btManagedDevice = require("../bt-managed-device.js");
21
+ var _lepuDeliveredFiles = require("../lepu/lepu.delivered-files.js");
22
+ var _lepuEncryptionHandshake = require("../lepu/lepu.encryption-handshake.js");
23
+ var _lepuSession = require("../lepu/lepu.session.js");
20
24
  var _bp2Files = require("./bp2.files.js");
21
25
  var _bp2FrameReader = require("./bp2.frame-reader.js");
22
26
  var _bp2HistorySequencer = require("./bp2.history-sequencer.js");
@@ -29,8 +33,12 @@ var _bp2MainServices = require("./bp2.main-services.js");
29
33
  */
30
34
  /** BP2 ECG waveform resolution from the device protocol. */
31
35
  const BP2_ECG_MILLIVOLTS_PER_COUNT = exports.BP2_ECG_MILLIVOLTS_PER_COUNT = 0.003098;
32
- const BP2_ECG_SAMPLES_PER_SECOND = 250;
33
- const BP2_ECG_SAMPLE_TOLERANCE = BP2_ECG_SAMPLES_PER_SECOND;
36
+
37
+ /** The realtime ECG stream's rate. */
38
+ const BP2_LIVE_ECG_SAMPLES_PER_SECOND = 250;
39
+
40
+ /** Stored ECG files hold the waveform at half the realtime rate. */
41
+ const BP2_FILE_ECG_SAMPLES_PER_SECOND = 125;
34
42
  const BP2_ECG_NO_VALUE = 0x7fff;
35
43
  const BP2_BP_NO_VALUE = 0xffff;
36
44
  const BP2_PULSE_NO_VALUES = new Set([0xff, 0x1ff, BP2_BP_NO_VALUE]);
@@ -40,6 +48,7 @@ class BP2Device extends _btManagedDevice.BTManagedDevice {
40
48
  duration = 0;
41
49
  historyMode = false;
42
50
  historyRequested = false;
51
+ measuredThisConnection = false;
43
52
  pendingResults = new Map();
44
53
  reportedFileNames = new Set();
45
54
  mainServices = _bp2MainServices.bp2MainServices;
@@ -47,9 +56,14 @@ class BP2Device extends _btManagedDevice.BTManagedDevice {
47
56
  constructor(device, params) {
48
57
  super(device, params);
49
58
  this.clockSync = params.clockSync;
59
+ this.recordCursorStorage = params.recordCursorStorage;
50
60
  this.deliveredFileNames = new Set([...(params.deliveredEcgFileNames ?? []), ...(params.deliveredFileNames ?? [])]);
51
61
  }
62
+ get readsHistoryOnRequest() {
63
+ return true;
64
+ }
52
65
  onStreamStart = () => {
66
+ this.measuredThisConnection = true;
53
67
  this.collectedValues = [];
54
68
  this.diagramPoints = [];
55
69
  this.duration = 0;
@@ -58,16 +72,18 @@ class BP2Device extends _btManagedDevice.BTManagedDevice {
58
72
  createCommandSequencer = () => {
59
73
  this.historyMode = true;
60
74
  this.historyRequested = false;
75
+ this.measuredThisConnection = false;
61
76
  this.lastLiveResultSignature = undefined;
62
77
  this.pendingResults.clear();
63
78
  this.reportedFileNames.clear();
64
79
  const service = _bp2MainServices.bp2MainServices[0];
65
80
  const write = service.writeUuid;
66
- return new _bp2HistorySequencer.BP2HistorySequencer({
67
- write: {
68
- serviceUuid: service.uuid,
69
- characteristicUuid: write.uuid
70
- },
81
+ const commandTarget = {
82
+ serviceUuid: service.uuid,
83
+ characteristicUuid: write.uuid
84
+ };
85
+ const history = new _bp2HistorySequencer.BP2HistorySequencer({
86
+ write: commandTarget,
71
87
  onFile: this.handleHistoryFile,
72
88
  onError: this.handleHistoryError,
73
89
  onTransferFinished: this.reportPendingResults,
@@ -77,10 +93,19 @@ class BP2Device extends _btManagedDevice.BTManagedDevice {
77
93
  },
78
94
  onOrphanStreamEnd: () => undefined,
79
95
  skipFiles: this.deliveredFileNames,
80
- clockSync: this.clockSync
96
+ deliveredFiles: new _lepuDeliveredFiles.LepuDeliveredFiles(this.recordCursorStorage, this.device.id),
97
+ clockSync: this.clockSync,
98
+ takeHistorySync: this.takeHistorySync
99
+ });
100
+ return (0, _lepuEncryptionHandshake.withLepuEncryption)(history, {
101
+ write: commandTarget,
102
+ session: this.lepuSession,
103
+ manufacturerData: this.device.manufacturerData ?? undefined,
104
+ onRefused: this.handleHistoryError
81
105
  });
82
106
  };
83
- frameReader = new _bp2FrameReader.BP2FrameReader();
107
+ lepuSession = new _lepuSession.LepuSession();
108
+ frameReader = new _bp2FrameReader.BP2FrameReader(this.lepuSession);
84
109
  preferredMtu = _preferredMtu.PREFERRED_MTU;
85
110
  handleSuccessResult(successResult, collectedValues) {
86
111
  this.collectedValues = collectedValues;
@@ -88,6 +113,11 @@ class BP2Device extends _btManagedDevice.BTManagedDevice {
88
113
  this.onError?.(new Error(`Measurement type is undefined for case ${successResult.caseType}`));
89
114
  return;
90
115
  }
116
+
117
+ // A result already on screen when the app connected comes with the history sync, as in the vendor app.
118
+ if (successResult.caseType === _caseType.CaseType.RESULT && !this.measuredThisConnection) {
119
+ return;
120
+ }
91
121
  if (successResult.measurementTypeKey === _next.MeasurementTypeKey.ecg) {
92
122
  return this.handleEcgResult(successResult);
93
123
  }
@@ -101,7 +131,7 @@ class BP2Device extends _btManagedDevice.BTManagedDevice {
101
131
  successResult.diagramPoints = this.diagramPoints;
102
132
  successResult.duration = this.duration;
103
133
  this.addDeviceTimestamp(successResult);
104
- const error = this.checkIfHasErrorForEcg(successResult);
134
+ const error = this.checkIfHasErrorForEcg(successResult, BP2_LIVE_ECG_SAMPLES_PER_SECOND);
105
135
  if (error) {
106
136
  this.onError?.(error);
107
137
  return;
@@ -205,11 +235,11 @@ class BP2Device extends _btManagedDevice.BTManagedDevice {
205
235
  this.historyRequested = true;
206
236
  };
207
237
  signatureFor = result => result.measurementTypeKey === _next.MeasurementTypeKey.bloodPressure ? [result.measurementTypeKey, result.systolic, result.diastolic, result.heartRate, result.status].join("|") : [result.measurementTypeKey, result.heartRate, result.diagnosticResult, result.duration, result.diagramPoints?.join(",")].join("|");
208
- handleHistoryFile = file => {
238
+ handleHistoryFile = (file, delivered) => {
209
239
  if (this.reportedFileNames.has(file.name)) {
210
240
  return;
211
241
  }
212
- const decoded = (0, _bp2Files.decodeBP2File)(file.name, file.content);
242
+ const decoded = (0, _bp2Files.decodeBP2File)(file.name, (0, _bytesToHex.bytesToHex)(Array.from(file.bytes)));
213
243
  if (!decoded) {
214
244
  return;
215
245
  }
@@ -219,7 +249,7 @@ class BP2Device extends _btManagedDevice.BTManagedDevice {
219
249
  ...decoded,
220
250
  caseType: _caseType.CaseType.RESULT
221
251
  };
222
- const error = result.measurementTypeKey === _next.MeasurementTypeKey.bloodPressure ? this.checkIfHasErrorForBloodPressure(result) : this.checkIfHasErrorForEcg(result);
252
+ const error = result.measurementTypeKey === _next.MeasurementTypeKey.bloodPressure ? this.checkIfHasErrorForBloodPressure(result) : this.checkIfHasErrorForEcg(result, BP2_FILE_ECG_SAMPLES_PER_SECOND);
223
253
  if (error) {
224
254
  this.onError?.(error);
225
255
  return;
@@ -227,7 +257,7 @@ class BP2Device extends _btManagedDevice.BTManagedDevice {
227
257
  if (pending && this.matchesPendingResult(pending, decoded)) {
228
258
  this.pendingResults.delete(result.measurementTypeKey);
229
259
  }
230
- this.onResult?.(result);
260
+ this.onResult?.(result, delivered);
231
261
  };
232
262
  matchesPendingResult = (pending, decoded) => {
233
263
  if (decoded.measurementTypeKey === _next.MeasurementTypeKey.bloodPressure) {
@@ -247,7 +277,7 @@ class BP2Device extends _btManagedDevice.BTManagedDevice {
247
277
  this.pendingResults.forEach(result => this.onResult?.(result));
248
278
  this.pendingResults.clear();
249
279
  };
250
- checkIfHasErrorForEcg(successResult) {
280
+ checkIfHasErrorForEcg(successResult, samplesPerSecond) {
251
281
  const ecgMeasurement = successResult;
252
282
  if (ecgMeasurement.diagnosticResult === _next.EcgDiagnosticFlag.POOR_WAVEFORM) {
253
283
  return _measurementFeedback.MeasurementFeedbackKey.POOR_WAVEFORM;
@@ -272,8 +302,9 @@ class BP2Device extends _btManagedDevice.BTManagedDevice {
272
302
  return _measurementFeedback.MeasurementFeedbackKey.INSUFFICIENT_DATA_LENGTH;
273
303
  }
274
304
  if (ecgMeasurement.duration > 0) {
275
- const expectedSamples = ecgMeasurement.duration * BP2_ECG_SAMPLES_PER_SECOND;
276
- if (ecgMeasurement.diagramPoints.length < expectedSamples - BP2_ECG_SAMPLE_TOLERANCE || ecgMeasurement.diagramPoints.length > expectedSamples + BP2_ECG_SAMPLE_TOLERANCE) {
305
+ const expectedSamples = ecgMeasurement.duration * samplesPerSecond;
306
+ const toleranceSamples = samplesPerSecond;
307
+ if (ecgMeasurement.diagramPoints.length < expectedSamples - toleranceSamples || ecgMeasurement.diagramPoints.length > expectedSamples + toleranceSamples) {
277
308
  return _measurementFeedback.MeasurementFeedbackKey.INSUFFICIENT_DATA_LENGTH;
278
309
  }
279
310
  } else if (ecgMeasurement.diagramPoints.length < 3500) {
@@ -1 +1 @@
1
- {"version":3,"names":["_next","require","_sentryLogger","_bloodPressureTranslatedExceptionMap","_measurementFeedback","_preferredMtu","_bloodPressureStates","_caseType","_deviceStatus","_hexToByte","_i16FromHex","_le16FromHex","_le32FromHex","_btManagedDevice","_bp2Files","_bp2FrameReader","_bp2HistorySequencer","_bp2MainServices","BP2_ECG_MILLIVOLTS_PER_COUNT","exports","BP2_ECG_SAMPLES_PER_SECOND","BP2_ECG_SAMPLE_TOLERANCE","BP2_ECG_NO_VALUE","BP2_BP_NO_VALUE","BP2_PULSE_NO_VALUES","Set","BP2Device","BTManagedDevice","collectedValues","diagramPoints","duration","historyMode","historyRequested","pendingResults","Map","reportedFileNames","mainServices","bp2MainServices","stuckDataTimeout","constructor","device","params","clockSync","deliveredFileNames","deliveredEcgFileNames","onStreamStart","lastLiveResultSignature","undefined","createCommandSequencer","clear","service","write","writeUuid","BP2HistorySequencer","serviceUuid","uuid","characteristicUuid","onFile","handleHistoryFile","onError","handleHistoryError","onTransferFinished","reportPendingResults","shouldStartTransfer","onTransferRequested","onOrphanStreamEnd","skipFiles","frameReader","BP2FrameReader","preferredMtu","PREFERRED_MTU","handleSuccessResult","successResult","measurementTypeKey","caseType","Error","MeasurementTypeKey","ecg","handleEcgResult","bloodPressure","handleBloodPressureResult","CaseType","RESULT","addDeviceTimestamp","error","checkIfHasErrorForEcg","queueHistoryResult","onResult","handleEcgStream","lenL","hexToByte","lenH","dataLen","dataStart","dataEnd","data","slice","le32FromHex","sentryLogger","onDeviceStatusChanged","DeviceStatus","MEASURING","samplingNum","le16FromHex","samplesStart","i","byteIndexInData","sampleVal","i16FromHex","push","checkIfHasErrorForBloodPressure","result","recordedAt","length","recordedAtFromLocalSeconds","bpMeasurement","status","diastolic","systolic","heartRate","MeasurementFeedbackKey","DEVICE_ERROR","BloodPressureStates","REGULAR","errorString","bloodPressureTranslatedExceptionMap","get","DEVICE_INTERRUPTED","has","signature","signatureFor","set","join","diagnosticResult","file","name","decoded","decodeBP2File","content","pending","add","matchesPendingResult","delete","pendingBloodPressure","decodedBloodPressure","pendingEcg","decodedEcg","reason","forEach","ecgMeasurement","EcgDiagnosticFlag","POOR_WAVEFORM","LEAD_OFF","INSUFFICIENT_DATA_LENGTH","expectedSamples"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bp2/bp2.device.ts"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AASA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,oCAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AAIA,IAAAO,aAAA,GAAAP,OAAA;AAIA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,YAAA,GAAAV,OAAA;AACA,IAAAW,YAAA,GAAAX,OAAA;AACA,IAAAY,gBAAA,GAAAZ,OAAA;AAEA,IAAAa,SAAA,GAAAb,OAAA;AACA,IAAAc,eAAA,GAAAd,OAAA;AACA,IAAAe,oBAAA,GAAAf,OAAA;AACA,IAAAgB,gBAAA,GAAAhB,OAAA;AAjCA;;AAmCA;AACA;AACA;AACA;AACA;AACA,MAAMiB,4BAA4B,GAAAC,OAAA,CAAAD,4BAAA,GAAG,QAAQ;AAC7C,MAAME,0BAA0B,GAAG,GAAG;AACtC,MA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,QAAQ,GAAG,EAAE,EAAE;MACzE,OAAO0F,2CAAsB,CAACiC,wBAAwB;IACxD;IAEA,IAAIJ,cAAc,CAACxH,aAAa,CAACoF,MAAM,KAAK,CAAC,EAAE;MAC7C,OAAOO,2CAAsB,CAACiC,wBAAwB;IACxD;IAEA,IAAIJ,cAAc,CAACvH,QAAQ,GAAG,CAAC,EAAE;MAC/B,MAAM4H,eAAe,GACnBL,cAAc,CAACvH,QAAQ,GAAGV,0BAA0B;MAEtD,IACEiI,cAAc,CAACxH,aAAa,CAACoF,MAAM,GACjCyC,eAAe,GAAGrI,wBAAwB,IAC5CgI,cAAc,CAACxH,aAAa,CAACoF,MAAM,GACjCyC,eAAe,GAAGrI,wBAAwB,EAC5C;QACA,OAAOmG,2CAAsB,CAACiC,wBAAwB;MACxD;IACF,CAAC,MAAM,IAAIJ,cAAc,CAACxH,aAAa,CAACoF,MAAM,GAAG,IAAI,EAAE;MACrD,OAAOO,2CAAsB,CAACiC,wBAAwB;IACxD;IAEA,OAAO1G,SAAS;EAClB;AACF;AAAC5B,OAAA,CAAAO,SAAA,GAAAA,SAAA","ignoreList":[]}
1
+ {"version":3,"names":["_next","require","_sentryLogger","_bloodPressureTranslatedExceptionMap","_measurementFeedback","_preferredMtu","_bloodPressureStates","_caseType","_deviceStatus","_bytesToHex","_hexToByte","_i16FromHex","_le16FromHex","_le32FromHex","_btManagedDevice","_lepuDeliveredFiles","_lepuEncryptionHandshake","_lepuSession","_bp2Files","_bp2FrameReader","_bp2HistorySequencer","_bp2MainServices","BP2_ECG_MILLIVOLTS_PER_COUNT","exports","BP2_LIVE_ECG_SAMPLES_PER_SECOND","BP2_FILE_ECG_SAMPLES_PER_SECOND","BP2_ECG_NO_VALUE","BP2_BP_NO_VALUE","BP2_PULSE_NO_VALUES","Set","BP2Device","BTManagedDevice","collectedValues","diagramPoints","duration","historyMode","historyRequested","measuredThisConnection","pendingResults","Map","reportedFileNames","mainServices","bp2MainServices","stuckDataTimeout","constructor","device","params","clockSync","recordCursorStorage","deliveredFileNames","deliveredEcgFileNames","readsHistoryOnRequest","onStreamStart","lastLiveResultSignature","undefined","createCommandSequencer","clear","service","write","writeUuid","commandTarget","serviceUuid","uuid","characteristicUuid","history","BP2HistorySequencer","onFile","handleHistoryFile","onError","handleHistoryError","onTransferFinished","reportPendingResults","shouldStartTransfer","onTransferRequested","onOrphanStreamEnd","skipFiles","deliveredFiles","LepuDeliveredFiles","id","takeHistorySync","withLepuEncryption","session","lepuSession","manufacturerData","onRefused","LepuSession","frameReader","BP2FrameReader","preferredMtu","PREFERRED_MTU","handleSuccessResult","successResult","measurementTypeKey","caseType","Error","CaseType","RESULT","MeasurementTypeKey","ecg","handleEcgResult","bloodPressure","handleBloodPressureResult","addDeviceTimestamp","error","checkIfHasErrorForEcg","queueHistoryResult","onResult","handleEcgStream","lenL","hexToByte","lenH","dataLen","dataStart","dataEnd","data","slice","le32FromHex","sentryLogger","onDeviceStatusChanged","DeviceStatus","MEASURING","samplingNum","le16FromHex","samplesStart","i","byteIndexInData","sampleVal","i16FromHex","push","checkIfHasErrorForBloodPressure","result","recordedAt","length","recordedAtFromLocalSeconds","bpMeasurement","status","diastolic","systolic","heartRate","MeasurementFeedbackKey","DEVICE_ERROR","BloodPressureStates","REGULAR","errorString","bloodPressureTranslatedExceptionMap","get","DEVICE_INTERRUPTED","has","signature","signatureFor","set","join","diagnosticResult","file","delivered","name","decoded","decodeBP2File","bytesToHex","Array","from","bytes","pending","add","matchesPendingResult","delete","pendingBloodPressure","decodedBloodPressure","pendingEcg","decodedEcg","reason","forEach","samplesPerSecond","ecgMeasurement","EcgDiagnosticFlag","POOR_WAVEFORM","LEAD_OFF","INSUFFICIENT_DATA_LENGTH","expectedSamples","toleranceSamples"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bp2/bp2.device.ts"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AASA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,oC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A,SAAA","ignoreList":[]}
@@ -15,8 +15,8 @@ const BP2_START_BYTES = ["a5"];
15
15
  * thing that makes it a BP2 is which start byte it accepts.
16
16
  */
17
17
  class BP2FrameReader extends _lepuFrameReader.LepuFrameReader {
18
- constructor() {
19
- super(BP2_START_BYTES);
18
+ constructor(session) {
19
+ super(BP2_START_BYTES, session);
20
20
  }
21
21
  }
22
22
  exports.BP2FrameReader = BP2FrameReader;
@@ -1 +1 @@
1
- {"version":3,"names":["_lepuFrameReader","require","BP2_START_BYTES","BP2FrameReader","LepuFrameReader","constructor","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bp2/bp2.frame-reader.ts"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAEA;AACA,MAAMC,eAAe,GAAG,CAAC,IAAI,CAAC;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,cAAc,SAASC,gCAAe,CAAC;EAC3CC,WAAWA,CAAA,EAAG;IACnB,KAAK,CAACH,eAAe,CAAC;EACxB;AACF;AAACI,OAAA,CAAAH,cAAA,GAAAA,cAAA","ignoreList":[]}
1
+ {"version":3,"names":["_lepuFrameReader","require","BP2_START_BYTES","BP2FrameReader","LepuFrameReader","constructor","session","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bp2/bp2.frame-reader.ts"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAGA;AACA,MAAMC,eAAe,GAAG,CAAC,IAAI,CAAC;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,cAAc,SAASC,gCAAe,CAAC;EAC3CC,WAAWA,CAACC,OAAqB,EAAE;IACxC,KAAK,CAACJ,eAAe,EAAEI,OAAO,CAAC;EACjC;AACF;AAACC,OAAA,CAAAJ,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -9,35 +9,83 @@ var _clockSync = require("../../../types/clock-sync.js");
9
9
  var _hexToByte = require("../../../utils/hex-to-byte.js");
10
10
  var _lepuCommandBuilder = require("../lepu/lepu.command-builder.js");
11
11
  var _lepuCommands = require("../lepu/lepu.commands.js");
12
+ var _lepuConnectRetry = require("../lepu/lepu.connect-retry.js");
12
13
  var _lepuEcgTransfer = require("../lepu/lepu.ecg-transfer.js");
13
- var _lepuFileTransfer = require("../lepu/lepu.file-transfer.js");
14
14
  var _lepuFrame = require("../lepu/lepu.frame.js");
15
15
  var _lepuResponseType = require("../lepu/lepu.response-type.js");
16
+ var _lepuStoredFiles = require("../lepu/lepu.stored-files.js");
17
+ /* eslint-disable max-lines */
18
+
16
19
  const BP2_REALTIME_COMMAND = exports.BP2_REALTIME_COMMAND = 0x08;
17
20
  const BP2_RESULT_STATES = new Set(["05", "07", "11"]);
18
21
  const BP2_ECG_STATE = "06";
19
22
  const BP2_IDLE_STATES = new Set(["00", "01", "03"]);
20
- const BP2_POLL_INTERVAL_MS = 200;
21
- /** Reads unseen BP2 history on connect and after each realtime result. */
23
+ const BP2_MEASURING_STATES = new Set(["04", "06", "0f", "10"]);
24
+
25
+ /** The pace of Viatom's own BP2 client, which the device keeps up with while it measures. */
26
+ const BP2_POLL_INTERVAL_MS = 500;
27
+
28
+ /** How long a queued realtime poll may go unanswered before it is sent again. */
29
+ const BP2_POLL_ANSWER_TIMEOUT_MS = BP2_POLL_INTERVAL_MS + 1_000;
30
+ /**
31
+ * Sets a BP2's clock, then polls it live. Its stored files are only listed on connect: they are
32
+ * read when the app asks (`takeHistorySync`, held while the BP2 measures), and the file of a
33
+ * result taken while connected is read once the BP2 stores it.
34
+ */
22
35
  class BP2HistorySequencer {
23
36
  builder = new _lepuCommandBuilder.LepuCommandBuilder();
24
37
  lastRunStatusFrameCount = 0;
25
38
  realtimeEcgActive = false;
26
39
  phase = "files";
40
+ clockRetry = new _lepuConnectRetry.LepuConnectRetry();
27
41
  constructor(params) {
28
42
  this.params = params;
43
+ this.storedFiles = new _lepuStoredFiles.LepuStoredFiles({
44
+ write: params.write,
45
+ builder: this.builder,
46
+ onFile: params.onFile,
47
+ onError: params.onError,
48
+ skipFiles: params.skipFiles,
49
+ deliveredFiles: params.deliveredFiles
50
+ });
29
51
  }
30
52
  initialCommands = () => {
31
53
  if ((0, _clockSync.isClockSyncEnabled)(this.params.clockSync)) {
32
54
  this.phase = "clock";
33
- return [{
34
- ...this.params.write,
35
- frame: this.builder.build(_lepuCommands.LepuCommand.SET_TIME, (0, _lepuEcgTransfer.clockPayload)(this.params.clockSync))
36
- }];
55
+ this.clockRetry.started();
56
+ return [this.setTimeCommand()];
37
57
  }
38
- return this.startTransfer();
58
+ return this.startFiles();
39
59
  };
40
60
  isHistoryTransfer = () => true;
61
+ commandTimeoutMs = () => {
62
+ if (this.phase === "clock") {
63
+ return _lepuConnectRetry.LEPU_CONNECT_REPLY_TIMEOUT_MS;
64
+ }
65
+ return this.isPolling() ? BP2_POLL_ANSWER_TIMEOUT_MS : undefined;
66
+ };
67
+
68
+ /**
69
+ * A BP2 just switched on can drop its first command, and one starting a measurement can
70
+ * drop a poll, so a missing answer is asked for again. The clock is optional: when it is
71
+ * still unanswered, the BP2 is polled without it.
72
+ */
73
+ onCommandTimeout = () => {
74
+ if (this.phase === "clock") {
75
+ return {
76
+ commands: this.clockRetry.mayRetry() ? [this.setTimeCommand()] : this.startFiles()
77
+ };
78
+ }
79
+ return this.isPolling() ? {
80
+ commands: [this.pollCommand()]
81
+ } : {};
82
+ };
83
+
84
+ /** Only the awaited answer settles a command; any other frame leaves its timeout running. */
85
+ commandProgress = frame => {
86
+ const awaited = this.awaitedCommand();
87
+ return awaited === undefined || (0, _lepuFrame.lepuCommandOf)(frame) === awaited ? "complete" : "ignored";
88
+ };
41
89
  nextCommand = frame => {
42
90
  if (this.phase === "clock") {
43
91
  if ((0, _lepuFrame.lepuCommandOf)(frame) !== _lepuCommands.LepuCommand.SET_TIME) {
@@ -46,7 +94,7 @@ class BP2HistorySequencer {
46
94
  if (!(0, _lepuResponseType.isLepuSuccess)(frame)) {
47
95
  this.params.onError(`the device refused SET_TIME: ${(0, _lepuResponseType.describeLepuResponseType)(frame)}`);
48
96
  }
49
- return this.startTransfer();
97
+ return this.startFiles();
50
98
  }
51
99
  if (this.transfer) {
52
100
  return this.transfer.nextCommand(frame);
@@ -62,22 +110,19 @@ class BP2HistorySequencer {
62
110
  }
63
111
  if (this.params.shouldStartTransfer() || endedWithoutResult) {
64
112
  this.params.onTransferRequested();
65
- return this.startTransfer(isResult ? 3_000 : undefined);
113
+ return this.startTransfer(this.storedFiles.readNew, isResult ? 3_000 : undefined);
114
+ }
115
+ if (this.isRestingFrame(frame) && this.params.takeHistorySync()) {
116
+ return this.startTransfer(this.storedFiles.readAll);
66
117
  }
67
118
 
68
119
  // The BP2 answers each realtime poll once; the answer is another poll, or the next result is never seen.
69
120
  return (0, _lepuFrame.lepuCommandOf)(frame) === BP2_REALTIME_COMMAND ? [this.pollCommand()] : undefined;
70
121
  };
71
- startTransfer = delayBeforeWriteMs => {
122
+ startFiles = () => this.startTransfer(this.params.takeHistorySync() ? this.storedFiles.readAll : this.storedFiles.listExisting);
123
+ startTransfer = (files, delayBeforeWriteMs) => {
72
124
  this.phase = "files";
73
- this.transfer = new _lepuFileTransfer.LepuFileTransfer({
74
- write: this.params.write,
75
- builder: this.builder,
76
- onFile: this.params.onFile,
77
- onError: this.params.onError,
78
- skipFiles: this.params.skipFiles,
79
- afterTransfer: this.finishTransfer
80
- });
125
+ this.transfer = files(this.finishTransfer);
81
126
  return this.transfer.initialCommands(delayBeforeWriteMs);
82
127
  };
83
128
  finishTransfer = () => {
@@ -85,12 +130,26 @@ class BP2HistorySequencer {
85
130
  this.params.onTransferFinished();
86
131
  return [this.pollCommand()];
87
132
  };
133
+ awaitedCommand = () => {
134
+ if (this.phase === "clock") {
135
+ return _lepuCommands.LepuCommand.SET_TIME;
136
+ }
137
+ return this.isPolling() ? BP2_REALTIME_COMMAND : undefined;
138
+ };
139
+ setTimeCommand = () => ({
140
+ ...this.params.write,
141
+ frame: this.builder.build(_lepuCommands.LepuCommand.SET_TIME, (0, _lepuEcgTransfer.clockPayload)(this.params.clockSync))
142
+ });
143
+ isPolling = () => this.phase === "files" && this.transfer === undefined;
88
144
  pollCommand = () => ({
89
145
  ...this.params.write,
90
146
  frame: this.builder.build(BP2_REALTIME_COMMAND),
91
147
  delayBeforeWriteMs: BP2_POLL_INTERVAL_MS
92
148
  });
93
149
  isResultFrame = frame => (0, _hexToByte.hexToByte)(frame[1] ?? "0") === BP2_REALTIME_COMMAND && BP2_RESULT_STATES.has((frame[7] ?? "").toLowerCase());
150
+
151
+ /** A realtime answer from a BP2 not measuring, so reading its files interrupts nothing. */
152
+ isRestingFrame = frame => (0, _hexToByte.hexToByte)(frame[1] ?? "0") === BP2_REALTIME_COMMAND && !BP2_MEASURING_STATES.has((frame[7] ?? "").toLowerCase());
94
153
  isIdleFrame = frame => (0, _hexToByte.hexToByte)(frame[1] ?? "0") === BP2_REALTIME_COMMAND && BP2_IDLE_STATES.has((frame[7] ?? "").toLowerCase());
95
154
  logRunStatus = frame => {
96
155
  if ((0, _hexToByte.hexToByte)(frame[1] ?? "0") !== BP2_REALTIME_COMMAND) {
@@ -1 +1 @@
1
- {"version":3,"names":["_sentryLogger","require","_clockSync","_hexToByte","_lepuCommandBuilder","_lepuCommands","_lepuEcgTransfer","_lepuFileTransfer","_lepuFrame","_lepuResponseType","BP2_REALTIME_COMMAND","exports","BP2_RESULT_STATES","Set","BP2_ECG_STATE","BP2_IDLE_STATES","BP2_POLL_INTERVAL_MS","BP2HistorySequencer","builder","LepuCommandBuilder","lastRunStatusFrameCount","realtimeEcgActive","phase","constructor","params","initialCommands","isClockSyncEnabled","clockSync","write","frame","build","LepuCommand","SET_TIME","clockPayload","startTransfer","isHistoryTransfer","nextCommand","lepuCommandOf","undefined","isLepuSuccess","onError","describeLepuResponseType","transfer","logRunStatus","isResult","isResultFrame","endedWithoutResult","isIdleFrame","onOrphanStreamEnd","shouldStartTransfer","onTransferRequested","pollCommand","delayBeforeWriteMs","LepuFileTransfer","onFile","skipFiles","afterTransfer","finishTransfer","onTransferFinished","hexToByte","has","toLowerCase","runStatus","lastRunStatus","sentryLogger"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bp2/bp2.history-sequencer.ts"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAMA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AACA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AAKA,MAAMS,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,IAAI;AACjC,MAAME,iBAAiB,GAAG,IAAIC,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACrD,MAAMC,aAAa,GAAG,IAAI;AAC1B,MAAMC,eAAe,GAAG,IAAIF,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AACnD,MAAMG,oBAAoB,GAAG,GAAG;AAgBhC;AACA,MAAMC,mBAAmB,CAA6B;EACnCC,OAAO,GAAG,IAAIC,sCAAkB,CAAC,CAAC;EAG3CC,uBAAuB,GAAG,CAAC;EAC3BC,iBAAiB,GAAG,KAAK;EACzBC,KAAK,GAAoB,OAAO;EAEjCC,WAAWA,CAAkBC,MAAiC,EAAE;IAAA,KAAnCA,MAAiC,GAAjCA,MAAiC;EAAG;EAEjEC,eAAe,GAAGA,CAAA,KAAgC;IACvD,IAAI,IAAAC,6BAAkB,EAAC,IAAI,CAACF,MAAM,CAACG,SAAS,CAAC,EAAE;MAC7C,IAAI,CAACL,KAAK,GAAG,OAAO;MAEpB,OAAO,CACL;QACE,GAAG,IAAI,CAACE,MAAM,CAACI,KA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rame","_lepuResponseType","_lepuStoredFiles","BP2_REALTIME_COMMAND","exports","BP2_RESULT_STATES","Set","BP2_ECG_STATE","BP2_IDLE_STATES","BP2_MEASURING_STATES","BP2_POLL_INTERVAL_MS","BP2_POLL_ANSWER_TIMEOUT_MS","BP2HistorySequencer","builder","LepuCommandBuilder","lastRunStatusFrameCount","realtimeEcgActive","phase","clockRetry","LepuConnectRetry","constructor","params","storedFiles","LepuStoredFiles","write","onFile","onError","skipFiles","deliveredFiles","initialCommands","isClockSyncEnabled","clockSync","started","setTimeCommand","startFiles","isHistoryTransfer","commandTimeoutMs","LEPU_CONNECT_REPLY_TIMEOUT_MS","isPolling","undefined","onCommandTimeout","commands","mayRetry","pollCommand","commandProgress","frame","awaited","awaitedCommand","lepuCommandOf","nextCommand","LepuCommand","SET_TIME","isLepuSuccess","describeLepuResponseType","transfer","logRunStatus","isResult","isResultFrame","endedWithoutResult","isIdleFrame","onOrphanStreamEnd","shouldStartTransfer","onTransferRequested","startTransfer","readNew","isRestingFrame","takeHistorySync","readAll","listExisting","files","delayBeforeWriteMs","finishTransfer","onTransferFinished","build","clockPayload","hexToByte","has","toLowerCase","runStatus","lastRunStatus","sentryLogger"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bp2/bp2.history-sequencer.ts"],"mappings":";;;;;;AACA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AASA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAKA,IAAAM,gBAAA,GAAAN,OAAA;AAEA,IAAAO,UAAA,GAAAP,OAAA;AACA,IAAAQ,iBAAA,GAAAR,OAAA;AAIA,IAAAS,gBAAA,GAAAT,OAAA;AA1BA;;AA4BA,MAAMU,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,IAAI;AACjC,MAAME,iBAAi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;IAEA,IAAI8D,SAAS,KAAK,IAAI,CAACC,aAAa,EAAE;MACpC,IAAI,CAAChE,uBAAuB,EAAE;MAE9B;IACF;IAEA,IAAI,IAAI,CAACgE,aAAa,KAAKxC,SAAS,EAAE;MACpC,IAAAyC,0BAAY,EAAC,MAAM,EAAE,oCAAoC,CAAC;IAC5D;IAEA,IAAI,CAACD,aAAa,GAAGD,SAAS;IAC9B,IAAI,CAAC/D,uBAAuB,GAAG,CAAC;EAClC,CAAC;AACH;AAACX,OAAA,CAAAQ,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -28,6 +28,7 @@ const ATT_WRITE_HEADER_BYTES = 3;
28
28
  class BTCommandWriter {
29
29
  pendingWrites = Promise.resolve();
30
30
  mtu = DEFAULT_ATT_MTU;
31
+ writeOnlyWithoutResponse = new Map();
31
32
  constructor(device, onError, isNormalDisconnect, retryAfterPairing = _btPairingRetry.runOnce) {
32
33
  this.device = device;
33
34
  this.onError = onError;
@@ -101,16 +102,43 @@ class BTCommandWriter {
101
102
  * Writes one chunk the way the characteristic accepts writes.
102
103
  *
103
104
  * A with-response write to a characteristic that only supports write-without-response
104
- * fails outright, so the command says which it is rather than the transport guessing.
105
+ * fails outright, and some devices drop the link on it. A command can say which it is;
106
+ * otherwise the characteristic's own properties decide.
105
107
  */
106
108
  writeTo = async (command, value) => {
107
- if (command.withoutResponse) {
109
+ if (command.withoutResponse || (await this.acceptsOnlyWithoutResponse(command))) {
108
110
  await this.device.writeCharacteristicWithoutResponseForService(command.serviceUuid, command.characteristicUuid, value);
109
111
  return;
110
112
  }
111
113
  await this.device.writeCharacteristicWithResponseForService(command.serviceUuid, command.characteristicUuid, value);
112
114
  };
113
115
 
116
+ /** Reads once per characteristic whether it refuses with-response writes. */
117
+ acceptsOnlyWithoutResponse = command => {
118
+ const key = `${command.serviceUuid}|${command.characteristicUuid}`.toLowerCase();
119
+ const known = this.writeOnlyWithoutResponse.get(key);
120
+ if (known) {
121
+ return known;
122
+ }
123
+ const lookup = this.readAcceptsOnlyWithoutResponse(command);
124
+ this.writeOnlyWithoutResponse.set(key, lookup);
125
+ return lookup;
126
+ };
127
+ readAcceptsOnlyWithoutResponse = async ({
128
+ serviceUuid,
129
+ characteristicUuid
130
+ }) => {
131
+ try {
132
+ const characteristics = await this.device.characteristicsForService(serviceUuid);
133
+ const characteristic = characteristics.find(({
134
+ uuid
135
+ }) => uuid.toLowerCase() === characteristicUuid.toLowerCase());
136
+ return Boolean(characteristic?.isWritableWithoutResponse && !characteristic.isWritableWithResponse);
137
+ } catch {
138
+ return false;
139
+ }
140
+ };
141
+
114
142
  /**
115
143
  * Splits a frame into writes the link will carry whole.
116
144
  *
@@ -1 +1 @@
1
- {"version":3,"names":["_sentryLogger","require","_bluetoothError","_hexToBase","_btPairingRetry","MAX_WRITE_ATTEMPTS","DEFAULT_ATT_MTU","ATT_WRITE_HEADER_BYTES","BTCommandWriter","pendingWrites","Promise","resolve","mtu","constructor","device","onError","isNormalDisconnect","retryAfterPairing","runOnce","useNegotiatedMtu","Number","isInteger","reset","send","commands","then","writeInOrder","catch","error","command","writeCommand","delayBeforeWriteMs","setTimeout","chunk","chunksOf","frame","written","writeChunk","writeTo","value","withoutResponse","writeCharacteristicWithoutResponseForService","serviceUuid","characteristicUuid","writeCharacteristicWithResponseForService","size","Math","max","chunks","start","length","push","slice","attempt","isConnected","sentryLogger","hexToBase64","join","message","toBluetoothError","expectedEnd","test","errorCode","code","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-command-writer.ts"],"mappings":";;;;;;AAEA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAAG,eAAA,GAAAH,OAAA;AAEA,MAAMI,kBAAkB,GAAG,CAAC;;AAE5B;AACA,MAAMC,eAAe,GAAG,EAAE;;AAE1B;AACA,MAAMC,sBAAsB,GAAG,CAAC;;AAEhC;AACA;AACA;AACA;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MAX_WRITE_ATTEMPTS","DEFAULT_ATT_MTU","ATT_WRITE_HEADER_BYTES","BTCommandWriter","pendingWrites","Promise","resolve","mtu","writeOnlyWithoutResponse","Map","constructor","device","onError","isNormalDisconnect","retryAfterPairing","runOnce","useNegotiatedMtu","Number","isInteger","reset","send","commands","then","writeInOrder","catch","error","command","writeCommand","delayBeforeWriteMs","setTimeout","chunk","chunksOf","frame","written","writeChunk","writeTo","value","withoutResponse","acceptsOnlyWithoutResponse","writeCharacteristicWithoutResponseForService","serviceUuid","characteristicUuid","writeCharacteristicWithResponseForService","key","toLowerCase","known","get","lookup","readAcceptsOnlyWithoutResponse","set","characteristics","characteristicsForService","characteristic","find","uuid","Boolean","isWritableWithoutResponse","isWritableWithResponse","size","Math","max","chunks","start","length","push","slice","attempt","isConnected","sentryLogger","hexToBase64","join","message","toBluetoothError","expectedEnd","test","errorCode","code","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-command-writer.ts"],"mappings":";;;;;;AAEA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAAG,eAAA,GAAAH,OAAA;AAEA,MAAMI,kBAAkB,GAAG,CAAC;;AAE5B;AACA,MAAMC,eAAe,GAAG,EAAE;;AAE1B;AACA,MAAMC,sBAAsB,GAAG,CAAC;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAe,CAAC;EACnBC,aAAa,GAAkBC,OAAO,CAACC,OAAO,CAAC,CAAC;EAChDC,GAAG,GAAGN,eAAe;EACZO,wBAAwB,GAAG,IAAIC,GAAG,CAA2B,CAAC;EAExEC,WAAWA,CACCC,MAAc,EACdC,OAA2C,EAC3CC,kBAAkC,EAClCC,iBAA+B,GAAGC,uBAAO,EAC1D;IAAA,KAJiBJ,MAAc,GAAdA,MAAc;IAAA,KACdC,OAA2C,GAA3CA,OAA2C;IAAA,KA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C3B,IAAI,CAACqB,OAAO,CAACT,OAAO,EAAE,IAAA2C,sBAAW,EAACvC,KAAK,CAACwC,IAAI,CAAC,EAAE,CAAC,CAAC,CACnD,CAAC;QAED,OAAO,IAAI;MACb,CAAC,CAAC,OAAO7C,KAAK,EAAE;QACd,MAAM8C,OAAO,GAAG,IAAAC,gCAAgB,EAAC/C,KAAK,CAAC,CAAC8C,OAAO;QAE/C,MAAME,WAAW,GACf,IAAI,CAAC5D,kBAAkB,GAAG,CAAC,KAAK,IAAI,IACpC,6BAA6B,CAAC6D,IAAI,CAACH,OAAO,CAAC;QAE7C,IAAAH,0BAAY,EAACK,WAAW,GAAG,MAAM,GAAG,OAAO,EAAE,+BAA+B,EAAE;UAC5EE,SAAS,EAAE,IAAAH,gCAAgB,EAAC/C,KAAK,CAAC,CAACmD;QACrC,CAAC,CAAC;MAEJ;IACF;IAEA,OAAO,KAAK;EACd,CAAC;AACH;AAACC,OAAA,CAAA1E,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -133,7 +133,7 @@ class BTDataProcessor {
133
133
  handleFrame = (uuid, frame) => {
134
134
  const data = this.frameParser.parse(uuid, frame);
135
135
  if (!data) {
136
- (0, _sentryLogger.sentryLogger)("info", "BT_MANAGER: Frame matched no declared case", {
136
+ (0, _sentryLogger.sentryLogger)("debug", "BT_MANAGER: Frame matched no declared case", {
137
137
  uuid,
138
138
  frameLength: frame.length
139
139
  });
@@ -179,7 +179,7 @@ class BTDataProcessor {
179
179
  message: "Device is stuck"
180
180
  }
181
181
  }));
182
- this.device.cancelConnection?.();
182
+ this.cancelConnection(_measurementFeedback.MeasurementFeedbackKey.STUCK);
183
183
  }, this.stuckDataTimeoutDuration);
184
184
  };
185
185
  startCommandTimeout = () => {
@@ -198,10 +198,18 @@ class BTDataProcessor {
198
198
  }
199
199
  if (result?.terminal) {
200
200
  this.callbacks.onError?.(new Error(_measurementFeedback.MeasurementFeedbackKey.COMMAND_TIMEOUT));
201
- void this.device.cancelConnection?.();
201
+ this.cancelConnection(_measurementFeedback.MeasurementFeedbackKey.COMMAND_TIMEOUT);
202
202
  }
203
203
  }, duration);
204
204
  };
205
+
206
+ /** Ends the link from this side, logged so it is never mistaken for the device hanging up. */
207
+ cancelConnection = reason => {
208
+ (0, _sentryLogger.sentryLogger)("warning", "BT_MANAGER: Cancelling the connection", {
209
+ reason
210
+ });
211
+ void this.device.cancelConnection?.();
212
+ };
205
213
  }
206
214
  exports.BTDataProcessor = BTDataProcessor;
207
215
  //# sourceMappingURL=bt-data-processor.js.map