@ovok/native 1.16.1-rc.3 → 1.16.1-rc.4

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 (597) hide show
  1. package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js +3 -1
  2. package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -1
  3. package/lib/commonjs/modules/bt-management/components/bluetooth-device-picker.js +9 -141
  4. package/lib/commonjs/modules/bt-management/components/bluetooth-device-picker.js.map +1 -1
  5. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +1 -0
  6. package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  7. package/lib/commonjs/modules/bt-management/components/device-picker-sheet.js +160 -0
  8. package/lib/commonjs/modules/bt-management/components/device-picker-sheet.js.map +1 -0
  9. package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -1
  10. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-permission.js +2 -1
  11. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-permission.js.map +1 -1
  12. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js +1 -1
  13. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js.map +1 -1
  14. package/lib/commonjs/modules/bt-management/index.js +12 -0
  15. package/lib/commonjs/modules/bt-management/index.js.map +1 -1
  16. package/lib/commonjs/modules/bt-management/services/bt-manager.js +50 -0
  17. package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
  18. package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js +3 -0
  19. package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
  20. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +4 -2
  21. package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
  22. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js +97 -28
  23. package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  24. package/lib/commonjs/modules/bt-management/services/devices/bt-current-time.js +59 -0
  25. package/lib/commonjs/modules/bt-management/services/devices/bt-current-time.js.map +1 -0
  26. package/lib/commonjs/modules/bt-management/services/devices/bt-device-information.js +18 -37
  27. package/lib/commonjs/modules/bt-management/services/devices/bt-device-information.js.map +1 -1
  28. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +31 -3
  29. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  30. package/lib/commonjs/modules/bt-management/services/devices/bt-notification-readiness.js +68 -0
  31. package/lib/commonjs/modules/bt-management/services/devices/bt-notification-readiness.js.map +1 -0
  32. package/lib/commonjs/modules/bt-management/services/devices/bt-pairing-retry.js +70 -0
  33. package/lib/commonjs/modules/bt-management/services/devices/bt-pairing-retry.js.map +1 -0
  34. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +14 -0
  35. package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  36. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.js +4 -7
  37. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.js.map +1 -1
  38. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.js +106 -0
  39. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.js.map +1 -0
  40. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +38 -31
  41. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
  42. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.js +41 -0
  43. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.js.map +1 -0
  44. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.js +77 -0
  45. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.js.map +1 -0
  46. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.js +49 -0
  47. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.js.map +1 -0
  48. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.js +89 -0
  49. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.js.map +1 -0
  50. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.js +35 -42
  51. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.js.map +1 -1
  52. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +22 -24
  53. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -1
  54. package/lib/commonjs/modules/bt-management/services/record-cursor.js +70 -0
  55. package/lib/commonjs/modules/bt-management/services/record-cursor.js.map +1 -0
  56. package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js +8 -0
  57. package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js.map +1 -1
  58. package/lib/commonjs/modules/bt-management/types/glucose-record-details.js +2 -0
  59. package/lib/commonjs/modules/bt-management/types/glucose-record-details.js.map +1 -0
  60. package/lib/commonjs/modules/bt-management/utils/bluetooth-permission-list.js +19 -0
  61. package/lib/commonjs/modules/bt-management/utils/bluetooth-permission-list.js.map +1 -0
  62. package/lib/commonjs/modules/bt-management/utils/device-user.js +22 -0
  63. package/lib/commonjs/modules/bt-management/utils/device-user.js.map +1 -0
  64. package/lib/commonjs/modules/bt-management/utils/kpa-to-mmhg.js +9 -0
  65. package/lib/commonjs/modules/bt-management/utils/kpa-to-mmhg.js.map +1 -0
  66. package/lib/commonjs/modules/bt-management/utils/result-identity.js +26 -35
  67. package/lib/commonjs/modules/bt-management/utils/result-identity.js.map +1 -1
  68. package/lib/commonjs/modules/bt-management/utils/rr-interval.js +16 -0
  69. package/lib/commonjs/modules/bt-management/utils/rr-interval.js.map +1 -0
  70. package/lib/commonjs/modules/bt-management/utils/temperature-type.js +15 -0
  71. package/lib/commonjs/modules/bt-management/utils/temperature-type.js.map +1 -0
  72. package/lib/commonjs/modules/bt-management/utils/wait.js +10 -0
  73. package/lib/commonjs/modules/bt-management/utils/wait.js.map +1 -0
  74. package/lib/commonjs/modules/next/background-sync/index.js +28 -0
  75. package/lib/commonjs/modules/next/background-sync/index.js.map +1 -0
  76. package/lib/commonjs/modules/next/background-sync/offline-measurement-background-sync.js +63 -0
  77. package/lib/commonjs/modules/next/background-sync/offline-measurement-background-sync.js.map +1 -0
  78. package/lib/commonjs/modules/next/bluetooth/auto-connect.js +32 -0
  79. package/lib/commonjs/modules/next/bluetooth/auto-connect.js.map +1 -0
  80. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-errors.js +33 -0
  81. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-errors.js.map +1 -0
  82. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-link.js +162 -0
  83. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-link.js.map +1 -0
  84. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-scanner.js +75 -0
  85. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-scanner.js.map +1 -0
  86. package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js +34 -0
  87. package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -0
  88. package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js +67 -0
  89. package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -0
  90. package/lib/commonjs/modules/next/bluetooth/connections.js +114 -0
  91. package/lib/commonjs/modules/next/bluetooth/connections.js.map +1 -0
  92. package/lib/commonjs/modules/next/bluetooth/daily-total-day.js.map +1 -0
  93. package/lib/commonjs/modules/next/bluetooth/devices.js +41 -0
  94. package/lib/commonjs/modules/next/bluetooth/devices.js.map +1 -0
  95. package/lib/commonjs/modules/next/bluetooth/driver.js +30 -20
  96. package/lib/commonjs/modules/next/bluetooth/driver.js.map +1 -1
  97. package/lib/commonjs/modules/next/bluetooth/errors.js +26 -0
  98. package/lib/commonjs/modules/next/bluetooth/errors.js.map +1 -0
  99. package/lib/commonjs/modules/next/bluetooth/index.js +122 -11
  100. package/lib/commonjs/modules/next/bluetooth/index.js.map +1 -1
  101. package/lib/commonjs/modules/next/bluetooth/link.js +0 -103
  102. package/lib/commonjs/modules/next/bluetooth/link.js.map +1 -1
  103. package/lib/commonjs/modules/next/bluetooth/paired.js +50 -0
  104. package/lib/commonjs/modules/next/bluetooth/paired.js.map +1 -0
  105. package/lib/commonjs/modules/next/bluetooth/permissions.js +2 -0
  106. package/lib/commonjs/modules/next/bluetooth/permissions.js.map +1 -0
  107. package/lib/commonjs/modules/next/bluetooth/react/bluetooth-device-picker.js +44 -0
  108. package/lib/commonjs/modules/next/bluetooth/react/bluetooth-device-picker.js.map +1 -0
  109. package/lib/commonjs/modules/next/bluetooth/react/context.js +54 -0
  110. package/lib/commonjs/modules/next/bluetooth/react/context.js.map +1 -0
  111. package/lib/commonjs/modules/next/bluetooth/react/hooks.js +86 -0
  112. package/lib/commonjs/modules/next/bluetooth/react/hooks.js.map +1 -0
  113. package/lib/commonjs/modules/next/bluetooth/react-native/create-bluetooth-runtime.js +28 -0
  114. package/lib/commonjs/modules/next/bluetooth/react-native/create-bluetooth-runtime.js.map +1 -0
  115. package/lib/commonjs/modules/next/bluetooth/react-native/os-permissions.js +32 -0
  116. package/lib/commonjs/modules/next/bluetooth/react-native/os-permissions.js.map +1 -0
  117. package/lib/commonjs/modules/next/bluetooth/react-native/ovok-sink.js +43 -0
  118. package/lib/commonjs/modules/next/bluetooth/react-native/ovok-sink.js.map +1 -0
  119. package/lib/commonjs/modules/next/bluetooth/readings.js +93 -0
  120. package/lib/commonjs/modules/next/bluetooth/readings.js.map +1 -0
  121. package/lib/commonjs/modules/next/bluetooth/result-policy.js +15 -2
  122. package/lib/commonjs/modules/next/bluetooth/result-policy.js.map +1 -1
  123. package/lib/commonjs/modules/next/bluetooth/runtime.js +223 -0
  124. package/lib/commonjs/modules/next/bluetooth/runtime.js.map +1 -0
  125. package/lib/commonjs/modules/next/bluetooth/scan-loop.js +82 -0
  126. package/lib/commonjs/modules/next/bluetooth/scan-loop.js.map +1 -0
  127. package/lib/commonjs/modules/next/bluetooth/sig-profiles.js +46 -13
  128. package/lib/commonjs/modules/next/bluetooth/sig-profiles.js.map +1 -1
  129. package/lib/commonjs/modules/next/bluetooth/sink.js +6 -0
  130. package/lib/commonjs/modules/next/bluetooth/sink.js.map +1 -0
  131. package/lib/commonjs/modules/next/bluetooth/snapshot.js +6 -0
  132. package/lib/commonjs/modules/next/bluetooth/snapshot.js.map +1 -0
  133. package/lib/commonjs/modules/next/bluetooth/stable-hash.js +42 -0
  134. package/lib/commonjs/modules/next/bluetooth/stable-hash.js.map +1 -0
  135. package/lib/commonjs/modules/next/bluetooth/store.js +61 -0
  136. package/lib/commonjs/modules/next/bluetooth/store.js.map +1 -0
  137. package/lib/commonjs/modules/next/bluetooth/transport.js +6 -0
  138. package/lib/commonjs/modules/next/bluetooth/transport.js.map +1 -0
  139. package/lib/commonjs/modules/next/data-sync/index.js +17 -0
  140. package/lib/commonjs/modules/next/data-sync/index.js.map +1 -0
  141. package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js +3 -1
  142. package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -1
  143. package/lib/module/modules/bt-management/components/bluetooth-device-picker.js +9 -141
  144. package/lib/module/modules/bt-management/components/bluetooth-device-picker.js.map +1 -1
  145. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +1 -0
  146. package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
  147. package/lib/module/modules/bt-management/components/device-picker-sheet.js +154 -0
  148. package/lib/module/modules/bt-management/components/device-picker-sheet.js.map +1 -0
  149. package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -1
  150. package/lib/module/modules/bt-management/hooks/use-bluetooth-permission.js +4 -3
  151. package/lib/module/modules/bt-management/hooks/use-bluetooth-permission.js.map +1 -1
  152. package/lib/module/modules/bt-management/hooks/use-measurements.js +1 -1
  153. package/lib/module/modules/bt-management/hooks/use-measurements.js.map +1 -1
  154. package/lib/module/modules/bt-management/index.js +1 -0
  155. package/lib/module/modules/bt-management/index.js.map +1 -1
  156. package/lib/module/modules/bt-management/services/bt-manager.js +50 -0
  157. package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
  158. package/lib/module/modules/bt-management/services/custom/define-custom-device.js +3 -0
  159. package/lib/module/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
  160. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +4 -2
  161. package/lib/module/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
  162. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js +97 -28
  163. package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
  164. package/lib/module/modules/bt-management/services/devices/bt-current-time.js +55 -0
  165. package/lib/module/modules/bt-management/services/devices/bt-current-time.js.map +1 -0
  166. package/lib/module/modules/bt-management/services/devices/bt-device-information.js +18 -37
  167. package/lib/module/modules/bt-management/services/devices/bt-device-information.js.map +1 -1
  168. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +33 -5
  169. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  170. package/lib/module/modules/bt-management/services/devices/bt-notification-readiness.js +65 -0
  171. package/lib/module/modules/bt-management/services/devices/bt-notification-readiness.js.map +1 -0
  172. package/lib/module/modules/bt-management/services/devices/bt-pairing-retry.js +65 -0
  173. package/lib/module/modules/bt-management/services/devices/bt-pairing-retry.js.map +1 -0
  174. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +14 -0
  175. package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
  176. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.js +1 -4
  177. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.js.map +1 -1
  178. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.js +99 -0
  179. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.js.map +1 -0
  180. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +38 -31
  181. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
  182. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.js +35 -0
  183. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.js.map +1 -0
  184. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.js +72 -0
  185. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.js.map +1 -0
  186. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.js +40 -0
  187. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.js.map +1 -0
  188. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.js +85 -0
  189. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.js.map +1 -0
  190. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.js +25 -32
  191. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.js.map +1 -1
  192. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +18 -20
  193. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -1
  194. package/lib/module/modules/bt-management/services/record-cursor.js +66 -0
  195. package/lib/module/modules/bt-management/services/record-cursor.js.map +1 -0
  196. package/lib/module/modules/bt-management/testing/fake-ble-manager.js +8 -0
  197. package/lib/module/modules/bt-management/testing/fake-ble-manager.js.map +1 -1
  198. package/lib/module/modules/bt-management/types/custom-device-definition.js +4 -0
  199. package/lib/module/modules/bt-management/types/custom-device-definition.js.map +1 -1
  200. package/lib/module/modules/bt-management/types/glucose-record-details.js +2 -0
  201. package/lib/module/modules/bt-management/types/glucose-record-details.js.map +1 -0
  202. package/lib/module/modules/bt-management/utils/bluetooth-permission-list.js +14 -0
  203. package/lib/module/modules/bt-management/utils/bluetooth-permission-list.js.map +1 -0
  204. package/lib/module/modules/bt-management/utils/device-user.js +17 -0
  205. package/lib/module/modules/bt-management/utils/device-user.js.map +1 -0
  206. package/lib/module/modules/bt-management/utils/kpa-to-mmhg.js +6 -0
  207. package/lib/module/modules/bt-management/utils/kpa-to-mmhg.js.map +1 -0
  208. package/lib/module/modules/bt-management/utils/result-identity.js +23 -33
  209. package/lib/module/modules/bt-management/utils/result-identity.js.map +1 -1
  210. package/lib/module/modules/bt-management/utils/rr-interval.js +12 -0
  211. package/lib/module/modules/bt-management/utils/rr-interval.js.map +1 -0
  212. package/lib/module/modules/bt-management/utils/temperature-type.js +11 -0
  213. package/lib/module/modules/bt-management/utils/temperature-type.js.map +1 -0
  214. package/lib/module/modules/bt-management/utils/wait.js +5 -0
  215. package/lib/module/modules/bt-management/utils/wait.js.map +1 -0
  216. package/lib/module/modules/next/background-sync/index.js +12 -0
  217. package/lib/module/modules/next/background-sync/index.js.map +1 -0
  218. package/lib/module/modules/next/background-sync/offline-measurement-background-sync.js +55 -0
  219. package/lib/module/modules/next/background-sync/offline-measurement-background-sync.js.map +1 -0
  220. package/lib/module/modules/next/bluetooth/auto-connect.js +28 -0
  221. package/lib/module/modules/next/bluetooth/auto-connect.js.map +1 -0
  222. package/lib/module/modules/next/bluetooth/ble-plx/ble-errors.js +28 -0
  223. package/lib/module/modules/next/bluetooth/ble-plx/ble-errors.js.map +1 -0
  224. package/lib/module/modules/next/bluetooth/ble-plx/ble-link.js +159 -0
  225. package/lib/module/modules/next/bluetooth/ble-plx/ble-link.js.map +1 -0
  226. package/lib/module/modules/next/bluetooth/ble-plx/ble-scanner.js +69 -0
  227. package/lib/module/modules/next/bluetooth/ble-plx/ble-scanner.js.map +1 -0
  228. package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js +31 -0
  229. package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -0
  230. package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js +63 -0
  231. package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -0
  232. package/lib/module/modules/next/bluetooth/connections.js +110 -0
  233. package/lib/module/modules/next/bluetooth/connections.js.map +1 -0
  234. package/lib/module/modules/next/bluetooth/daily-total-day.js.map +1 -0
  235. package/lib/module/modules/next/bluetooth/devices.js +37 -0
  236. package/lib/module/modules/next/bluetooth/devices.js.map +1 -0
  237. package/lib/module/modules/next/bluetooth/driver.js +29 -20
  238. package/lib/module/modules/next/bluetooth/driver.js.map +1 -1
  239. package/lib/module/modules/next/bluetooth/errors.js +21 -0
  240. package/lib/module/modules/next/bluetooth/errors.js.map +1 -0
  241. package/lib/module/modules/next/bluetooth/index.js +22 -4
  242. package/lib/module/modules/next/bluetooth/index.js.map +1 -1
  243. package/lib/module/modules/next/bluetooth/link.js +0 -101
  244. package/lib/module/modules/next/bluetooth/link.js.map +1 -1
  245. package/lib/module/modules/next/bluetooth/paired.js +46 -0
  246. package/lib/module/modules/next/bluetooth/paired.js.map +1 -0
  247. package/lib/module/modules/next/bluetooth/permissions.js +2 -0
  248. package/lib/module/modules/next/bluetooth/permissions.js.map +1 -0
  249. package/lib/module/modules/next/bluetooth/react/bluetooth-device-picker.js +39 -0
  250. package/lib/module/modules/next/bluetooth/react/bluetooth-device-picker.js.map +1 -0
  251. package/lib/module/modules/next/bluetooth/react/context.js +48 -0
  252. package/lib/module/modules/next/bluetooth/react/context.js.map +1 -0
  253. package/lib/module/modules/next/bluetooth/react/hooks.js +76 -0
  254. package/lib/module/modules/next/bluetooth/react/hooks.js.map +1 -0
  255. package/lib/module/modules/next/bluetooth/react-native/create-bluetooth-runtime.js +25 -0
  256. package/lib/module/modules/next/bluetooth/react-native/create-bluetooth-runtime.js.map +1 -0
  257. package/lib/module/modules/next/bluetooth/react-native/os-permissions.js +28 -0
  258. package/lib/module/modules/next/bluetooth/react-native/os-permissions.js.map +1 -0
  259. package/lib/module/modules/next/bluetooth/react-native/ovok-sink.js +39 -0
  260. package/lib/module/modules/next/bluetooth/react-native/ovok-sink.js.map +1 -0
  261. package/lib/module/modules/next/bluetooth/readings.js +89 -0
  262. package/lib/module/modules/next/bluetooth/readings.js.map +1 -0
  263. package/lib/module/modules/next/bluetooth/result-policy.js +14 -2
  264. package/lib/module/modules/next/bluetooth/result-policy.js.map +1 -1
  265. package/lib/module/modules/next/bluetooth/runtime.js +220 -0
  266. package/lib/module/modules/next/bluetooth/runtime.js.map +1 -0
  267. package/lib/module/modules/next/bluetooth/scan-loop.js +78 -0
  268. package/lib/module/modules/next/bluetooth/scan-loop.js.map +1 -0
  269. package/lib/module/modules/next/bluetooth/sig-profiles.js +44 -11
  270. package/lib/module/modules/next/bluetooth/sig-profiles.js.map +1 -1
  271. package/lib/module/modules/next/bluetooth/sink.js +4 -0
  272. package/lib/module/modules/next/bluetooth/sink.js.map +1 -0
  273. package/lib/module/modules/next/bluetooth/snapshot.js +4 -0
  274. package/lib/module/modules/next/bluetooth/snapshot.js.map +1 -0
  275. package/lib/module/modules/next/bluetooth/stable-hash.js +37 -0
  276. package/lib/module/modules/next/bluetooth/stable-hash.js.map +1 -0
  277. package/lib/module/modules/next/bluetooth/store.js +57 -0
  278. package/lib/module/modules/next/bluetooth/store.js.map +1 -0
  279. package/lib/module/modules/next/bluetooth/transport.js +4 -0
  280. package/lib/module/modules/next/bluetooth/transport.js.map +1 -0
  281. package/lib/module/modules/next/data-sync/index.js +11 -0
  282. package/lib/module/modules/next/data-sync/index.js.map +1 -0
  283. package/lib/typescript/commonjs/src/modules/auth/hooks/use-sign-in.d.ts +1 -1
  284. package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -1
  285. package/lib/typescript/commonjs/src/modules/bt-management/components/bluetooth-device-picker.d.ts +1 -1
  286. package/lib/typescript/commonjs/src/modules/bt-management/components/bluetooth-device-picker.d.ts.map +1 -1
  287. package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  288. package/lib/typescript/commonjs/src/modules/bt-management/components/device-picker-sheet.d.ts +25 -0
  289. package/lib/typescript/commonjs/src/modules/bt-management/components/device-picker-sheet.d.ts.map +1 -0
  290. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +1 -1
  291. package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
  292. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-permission.d.ts.map +1 -1
  293. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -1
  294. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +1 -0
  295. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
  296. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +20 -0
  297. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  298. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/define-custom-device.d.ts +2 -1
  299. package/lib/typescript/commonjs/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -1
  300. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts +3 -1
  301. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
  302. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +14 -1
  303. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  304. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-current-time.d.ts +11 -0
  305. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-current-time.d.ts.map +1 -0
  306. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-device-information.d.ts +2 -1
  307. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-device-information.d.ts.map +1 -1
  308. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +11 -1
  309. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  310. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-notification-readiness.d.ts +15 -0
  311. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-notification-readiness.d.ts.map +1 -0
  312. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-pairing-retry.d.ts +21 -0
  313. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-pairing-retry.d.ts.map +1 -0
  314. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +2 -0
  315. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  316. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.d.ts.map +1 -1
  317. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.d.ts +11 -0
  318. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.d.ts.map +1 -0
  319. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +5 -2
  320. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
  321. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.d.ts +10 -0
  322. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.d.ts.map +1 -0
  323. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.d.ts +7 -0
  324. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.d.ts.map +1 -0
  325. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.d.ts +16 -0
  326. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.d.ts.map +1 -0
  327. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.d.ts +8 -0
  328. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.d.ts.map +1 -0
  329. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.d.ts.map +1 -1
  330. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +2 -0
  331. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -1
  332. package/lib/typescript/commonjs/src/modules/bt-management/services/record-cursor.d.ts +21 -0
  333. package/lib/typescript/commonjs/src/modules/bt-management/services/record-cursor.d.ts.map +1 -0
  334. package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -1
  335. package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts +6 -2
  336. package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
  337. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +3 -0
  338. package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  339. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts +14 -1
  340. package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -1
  341. package/lib/typescript/commonjs/src/modules/bt-management/types/glucose-record-details.d.ts +33 -0
  342. package/lib/typescript/commonjs/src/modules/bt-management/types/glucose-record-details.d.ts.map +1 -0
  343. package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts +2 -0
  344. package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
  345. package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts +6 -0
  346. package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts.map +1 -1
  347. package/lib/typescript/commonjs/src/modules/bt-management/utils/bluetooth-permission-list.d.ts +4 -0
  348. package/lib/typescript/commonjs/src/modules/bt-management/utils/bluetooth-permission-list.d.ts.map +1 -0
  349. package/lib/typescript/commonjs/src/modules/bt-management/utils/device-user.d.ts +6 -0
  350. package/lib/typescript/commonjs/src/modules/bt-management/utils/device-user.d.ts.map +1 -0
  351. package/lib/typescript/commonjs/src/modules/bt-management/utils/kpa-to-mmhg.d.ts +4 -0
  352. package/lib/typescript/commonjs/src/modules/bt-management/utils/kpa-to-mmhg.d.ts.map +1 -0
  353. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts +5 -4
  354. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts.map +1 -1
  355. package/lib/typescript/commonjs/src/modules/bt-management/utils/rr-interval.d.ts +4 -0
  356. package/lib/typescript/commonjs/src/modules/bt-management/utils/rr-interval.d.ts.map +1 -0
  357. package/lib/typescript/commonjs/src/modules/bt-management/utils/temperature-type.d.ts +7 -0
  358. package/lib/typescript/commonjs/src/modules/bt-management/utils/temperature-type.d.ts.map +1 -0
  359. package/lib/typescript/commonjs/src/modules/bt-management/utils/wait.d.ts +3 -0
  360. package/lib/typescript/commonjs/src/modules/bt-management/utils/wait.d.ts.map +1 -0
  361. package/lib/typescript/commonjs/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
  362. package/lib/typescript/commonjs/src/modules/next/background-sync/index.d.ts +10 -0
  363. package/lib/typescript/commonjs/src/modules/next/background-sync/index.d.ts.map +1 -0
  364. package/lib/typescript/commonjs/src/modules/next/background-sync/offline-measurement-background-sync.d.ts +22 -0
  365. package/lib/typescript/commonjs/src/modules/next/background-sync/offline-measurement-background-sync.d.ts.map +1 -0
  366. package/lib/typescript/commonjs/src/modules/next/bluetooth/auto-connect.d.ts +10 -0
  367. package/lib/typescript/commonjs/src/modules/next/bluetooth/auto-connect.d.ts.map +1 -0
  368. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts +4 -0
  369. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts.map +1 -0
  370. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-link.d.ts +6 -0
  371. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-link.d.ts.map +1 -0
  372. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts +10 -0
  373. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts.map +1 -0
  374. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +6 -0
  375. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -0
  376. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +8 -0
  377. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -0
  378. package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts +25 -0
  379. package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts.map +1 -0
  380. package/lib/typescript/commonjs/src/modules/next/bluetooth/daily-total-day.d.ts.map +1 -0
  381. package/lib/typescript/commonjs/src/modules/next/bluetooth/devices.d.ts +30 -0
  382. package/lib/typescript/commonjs/src/modules/next/bluetooth/devices.d.ts.map +1 -0
  383. package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts +27 -20
  384. package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts.map +1 -1
  385. package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts +17 -0
  386. package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts.map +1 -0
  387. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +34 -5
  388. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -1
  389. package/lib/typescript/commonjs/src/modules/next/bluetooth/link.d.ts +14 -5
  390. package/lib/typescript/commonjs/src/modules/next/bluetooth/link.d.ts.map +1 -1
  391. package/lib/typescript/commonjs/src/modules/next/bluetooth/paired.d.ts +18 -0
  392. package/lib/typescript/commonjs/src/modules/next/bluetooth/paired.d.ts.map +1 -0
  393. package/lib/typescript/commonjs/src/modules/next/bluetooth/permissions.d.ts +13 -0
  394. package/lib/typescript/commonjs/src/modules/next/bluetooth/permissions.d.ts.map +1 -0
  395. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts +35 -0
  396. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts.map +1 -0
  397. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/context.d.ts +30 -0
  398. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/context.d.ts.map +1 -0
  399. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/hooks.d.ts +47 -0
  400. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/hooks.d.ts.map +1 -0
  401. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts +21 -0
  402. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts.map +1 -0
  403. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/os-permissions.d.ts +5 -0
  404. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/os-permissions.d.ts.map +1 -0
  405. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/ovok-sink.d.ts +6 -0
  406. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/ovok-sink.d.ts.map +1 -0
  407. package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts +21 -0
  408. package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts.map +1 -0
  409. package/lib/typescript/commonjs/src/modules/next/bluetooth/result-policy.d.ts +9 -1
  410. package/lib/typescript/commonjs/src/modules/next/bluetooth/result-policy.d.ts.map +1 -1
  411. package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts +87 -0
  412. package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts.map +1 -0
  413. package/lib/typescript/commonjs/src/modules/next/bluetooth/scan-loop.d.ts +23 -0
  414. package/lib/typescript/commonjs/src/modules/next/bluetooth/scan-loop.d.ts.map +1 -0
  415. package/lib/typescript/commonjs/src/modules/next/bluetooth/sig-profiles.d.ts.map +1 -1
  416. package/lib/typescript/commonjs/src/modules/next/bluetooth/sink.d.ts +20 -0
  417. package/lib/typescript/commonjs/src/modules/next/bluetooth/sink.d.ts.map +1 -0
  418. package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts +72 -0
  419. package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts.map +1 -0
  420. package/lib/typescript/commonjs/src/modules/next/bluetooth/stable-hash.d.ts +6 -0
  421. package/lib/typescript/commonjs/src/modules/next/bluetooth/stable-hash.d.ts.map +1 -0
  422. package/lib/typescript/commonjs/src/modules/next/bluetooth/store.d.ts +16 -0
  423. package/lib/typescript/commonjs/src/modules/next/bluetooth/store.d.ts.map +1 -0
  424. package/lib/typescript/commonjs/src/modules/next/bluetooth/transport.d.ts +31 -0
  425. package/lib/typescript/commonjs/src/modules/next/bluetooth/transport.d.ts.map +1 -0
  426. package/lib/typescript/commonjs/src/modules/next/data-sync/index.d.ts +9 -0
  427. package/lib/typescript/commonjs/src/modules/next/data-sync/index.d.ts.map +1 -0
  428. package/lib/typescript/module/src/modules/auth/hooks/use-sign-in.d.ts +1 -1
  429. package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -1
  430. package/lib/typescript/module/src/modules/bt-management/components/bluetooth-device-picker.d.ts +1 -1
  431. package/lib/typescript/module/src/modules/bt-management/components/bluetooth-device-picker.d.ts.map +1 -1
  432. package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
  433. package/lib/typescript/module/src/modules/bt-management/components/device-picker-sheet.d.ts +25 -0
  434. package/lib/typescript/module/src/modules/bt-management/components/device-picker-sheet.d.ts.map +1 -0
  435. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +1 -1
  436. package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
  437. package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-permission.d.ts.map +1 -1
  438. package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -1
  439. package/lib/typescript/module/src/modules/bt-management/index.d.ts +1 -0
  440. package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
  441. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +20 -0
  442. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  443. package/lib/typescript/module/src/modules/bt-management/services/custom/define-custom-device.d.ts +2 -1
  444. package/lib/typescript/module/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -1
  445. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts +3 -1
  446. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
  447. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +14 -1
  448. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
  449. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-current-time.d.ts +11 -0
  450. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-current-time.d.ts.map +1 -0
  451. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-device-information.d.ts +2 -1
  452. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-device-information.d.ts.map +1 -1
  453. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +11 -1
  454. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  455. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-notification-readiness.d.ts +15 -0
  456. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-notification-readiness.d.ts.map +1 -0
  457. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-pairing-retry.d.ts +21 -0
  458. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-pairing-retry.d.ts.map +1 -0
  459. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +2 -0
  460. package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
  461. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.d.ts.map +1 -1
  462. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.d.ts +11 -0
  463. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.d.ts.map +1 -0
  464. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +5 -2
  465. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
  466. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.d.ts +10 -0
  467. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.d.ts.map +1 -0
  468. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.d.ts +7 -0
  469. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.d.ts.map +1 -0
  470. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.d.ts +16 -0
  471. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.d.ts.map +1 -0
  472. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.d.ts +8 -0
  473. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.d.ts.map +1 -0
  474. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.d.ts.map +1 -1
  475. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +2 -0
  476. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -1
  477. package/lib/typescript/module/src/modules/bt-management/services/record-cursor.d.ts +21 -0
  478. package/lib/typescript/module/src/modules/bt-management/services/record-cursor.d.ts.map +1 -0
  479. package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -1
  480. package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts +6 -2
  481. package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
  482. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +3 -0
  483. package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
  484. package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts +14 -1
  485. package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -1
  486. package/lib/typescript/module/src/modules/bt-management/types/glucose-record-details.d.ts +33 -0
  487. package/lib/typescript/module/src/modules/bt-management/types/glucose-record-details.d.ts.map +1 -0
  488. package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts +2 -0
  489. package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
  490. package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts +6 -0
  491. package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts.map +1 -1
  492. package/lib/typescript/module/src/modules/bt-management/utils/bluetooth-permission-list.d.ts +4 -0
  493. package/lib/typescript/module/src/modules/bt-management/utils/bluetooth-permission-list.d.ts.map +1 -0
  494. package/lib/typescript/module/src/modules/bt-management/utils/device-user.d.ts +6 -0
  495. package/lib/typescript/module/src/modules/bt-management/utils/device-user.d.ts.map +1 -0
  496. package/lib/typescript/module/src/modules/bt-management/utils/kpa-to-mmhg.d.ts +4 -0
  497. package/lib/typescript/module/src/modules/bt-management/utils/kpa-to-mmhg.d.ts.map +1 -0
  498. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts +5 -4
  499. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts.map +1 -1
  500. package/lib/typescript/module/src/modules/bt-management/utils/rr-interval.d.ts +4 -0
  501. package/lib/typescript/module/src/modules/bt-management/utils/rr-interval.d.ts.map +1 -0
  502. package/lib/typescript/module/src/modules/bt-management/utils/temperature-type.d.ts +7 -0
  503. package/lib/typescript/module/src/modules/bt-management/utils/temperature-type.d.ts.map +1 -0
  504. package/lib/typescript/module/src/modules/bt-management/utils/wait.d.ts +3 -0
  505. package/lib/typescript/module/src/modules/bt-management/utils/wait.d.ts.map +1 -0
  506. package/lib/typescript/module/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
  507. package/lib/typescript/module/src/modules/next/background-sync/index.d.ts +10 -0
  508. package/lib/typescript/module/src/modules/next/background-sync/index.d.ts.map +1 -0
  509. package/lib/typescript/module/src/modules/next/background-sync/offline-measurement-background-sync.d.ts +22 -0
  510. package/lib/typescript/module/src/modules/next/background-sync/offline-measurement-background-sync.d.ts.map +1 -0
  511. package/lib/typescript/module/src/modules/next/bluetooth/auto-connect.d.ts +10 -0
  512. package/lib/typescript/module/src/modules/next/bluetooth/auto-connect.d.ts.map +1 -0
  513. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts +4 -0
  514. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts.map +1 -0
  515. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-link.d.ts +6 -0
  516. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-link.d.ts.map +1 -0
  517. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts +10 -0
  518. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts.map +1 -0
  519. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +6 -0
  520. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -0
  521. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +8 -0
  522. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -0
  523. package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts +25 -0
  524. package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts.map +1 -0
  525. package/lib/typescript/module/src/modules/next/bluetooth/daily-total-day.d.ts.map +1 -0
  526. package/lib/typescript/module/src/modules/next/bluetooth/devices.d.ts +30 -0
  527. package/lib/typescript/module/src/modules/next/bluetooth/devices.d.ts.map +1 -0
  528. package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts +27 -20
  529. package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts.map +1 -1
  530. package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts +17 -0
  531. package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts.map +1 -0
  532. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +34 -5
  533. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -1
  534. package/lib/typescript/module/src/modules/next/bluetooth/link.d.ts +14 -5
  535. package/lib/typescript/module/src/modules/next/bluetooth/link.d.ts.map +1 -1
  536. package/lib/typescript/module/src/modules/next/bluetooth/paired.d.ts +18 -0
  537. package/lib/typescript/module/src/modules/next/bluetooth/paired.d.ts.map +1 -0
  538. package/lib/typescript/module/src/modules/next/bluetooth/permissions.d.ts +13 -0
  539. package/lib/typescript/module/src/modules/next/bluetooth/permissions.d.ts.map +1 -0
  540. package/lib/typescript/module/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts +35 -0
  541. package/lib/typescript/module/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts.map +1 -0
  542. package/lib/typescript/module/src/modules/next/bluetooth/react/context.d.ts +30 -0
  543. package/lib/typescript/module/src/modules/next/bluetooth/react/context.d.ts.map +1 -0
  544. package/lib/typescript/module/src/modules/next/bluetooth/react/hooks.d.ts +47 -0
  545. package/lib/typescript/module/src/modules/next/bluetooth/react/hooks.d.ts.map +1 -0
  546. package/lib/typescript/module/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts +21 -0
  547. package/lib/typescript/module/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts.map +1 -0
  548. package/lib/typescript/module/src/modules/next/bluetooth/react-native/os-permissions.d.ts +5 -0
  549. package/lib/typescript/module/src/modules/next/bluetooth/react-native/os-permissions.d.ts.map +1 -0
  550. package/lib/typescript/module/src/modules/next/bluetooth/react-native/ovok-sink.d.ts +6 -0
  551. package/lib/typescript/module/src/modules/next/bluetooth/react-native/ovok-sink.d.ts.map +1 -0
  552. package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts +21 -0
  553. package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts.map +1 -0
  554. package/lib/typescript/module/src/modules/next/bluetooth/result-policy.d.ts +9 -1
  555. package/lib/typescript/module/src/modules/next/bluetooth/result-policy.d.ts.map +1 -1
  556. package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts +87 -0
  557. package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts.map +1 -0
  558. package/lib/typescript/module/src/modules/next/bluetooth/scan-loop.d.ts +23 -0
  559. package/lib/typescript/module/src/modules/next/bluetooth/scan-loop.d.ts.map +1 -0
  560. package/lib/typescript/module/src/modules/next/bluetooth/sig-profiles.d.ts.map +1 -1
  561. package/lib/typescript/module/src/modules/next/bluetooth/sink.d.ts +20 -0
  562. package/lib/typescript/module/src/modules/next/bluetooth/sink.d.ts.map +1 -0
  563. package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts +72 -0
  564. package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts.map +1 -0
  565. package/lib/typescript/module/src/modules/next/bluetooth/stable-hash.d.ts +6 -0
  566. package/lib/typescript/module/src/modules/next/bluetooth/stable-hash.d.ts.map +1 -0
  567. package/lib/typescript/module/src/modules/next/bluetooth/store.d.ts +16 -0
  568. package/lib/typescript/module/src/modules/next/bluetooth/store.d.ts.map +1 -0
  569. package/lib/typescript/module/src/modules/next/bluetooth/transport.d.ts +31 -0
  570. package/lib/typescript/module/src/modules/next/bluetooth/transport.d.ts.map +1 -0
  571. package/lib/typescript/module/src/modules/next/data-sync/index.d.ts +9 -0
  572. package/lib/typescript/module/src/modules/next/data-sync/index.d.ts.map +1 -0
  573. package/package.json +12 -2
  574. package/lib/commonjs/modules/bt-management/utils/daily-total-day.js.map +0 -1
  575. package/lib/commonjs/modules/next/bluetooth/drivers.js +0 -20
  576. package/lib/commonjs/modules/next/bluetooth/drivers.js.map +0 -1
  577. package/lib/commonjs/modules/next/bluetooth/legacy-driver.js +0 -55
  578. package/lib/commonjs/modules/next/bluetooth/legacy-driver.js.map +0 -1
  579. package/lib/module/modules/bt-management/utils/daily-total-day.js.map +0 -1
  580. package/lib/module/modules/next/bluetooth/drivers.js +0 -17
  581. package/lib/module/modules/next/bluetooth/drivers.js.map +0 -1
  582. package/lib/module/modules/next/bluetooth/legacy-driver.js +0 -51
  583. package/lib/module/modules/next/bluetooth/legacy-driver.js.map +0 -1
  584. package/lib/typescript/commonjs/src/modules/bt-management/utils/daily-total-day.d.ts.map +0 -1
  585. package/lib/typescript/commonjs/src/modules/next/bluetooth/drivers.d.ts +0 -7
  586. package/lib/typescript/commonjs/src/modules/next/bluetooth/drivers.d.ts.map +0 -1
  587. package/lib/typescript/commonjs/src/modules/next/bluetooth/legacy-driver.d.ts +0 -8
  588. package/lib/typescript/commonjs/src/modules/next/bluetooth/legacy-driver.d.ts.map +0 -1
  589. package/lib/typescript/module/src/modules/bt-management/utils/daily-total-day.d.ts.map +0 -1
  590. package/lib/typescript/module/src/modules/next/bluetooth/drivers.d.ts +0 -7
  591. package/lib/typescript/module/src/modules/next/bluetooth/drivers.d.ts.map +0 -1
  592. package/lib/typescript/module/src/modules/next/bluetooth/legacy-driver.d.ts +0 -8
  593. package/lib/typescript/module/src/modules/next/bluetooth/legacy-driver.d.ts.map +0 -1
  594. /package/lib/commonjs/modules/{bt-management/utils → next/bluetooth}/daily-total-day.js +0 -0
  595. /package/lib/module/modules/{bt-management/utils → next/bluetooth}/daily-total-day.js +0 -0
  596. /package/lib/typescript/commonjs/src/modules/{bt-management/utils → next/bluetooth}/daily-total-day.d.ts +0 -0
  597. /package/lib/typescript/module/src/modules/{bt-management/utils → next/bluetooth}/daily-total-day.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_sentryLogger","require","_bluetoothError","_hexToBase","MAX_WRITE_ATTEMPTS","DEFAULT_ATT_MTU","ATT_WRITE_HEADER_BYTES","BTCommandWriter","pendingWrites","Promise","resolve","mtu","constructor","device","onError","isNormalDisconnect","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/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IACF;IAEA,OAAO,KAAK;EACd,CAAC;AACH;AAACC,OAAA,CAAAtD,eAAA,GAAAA,eAAA","ignoreList":[]}
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;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAe,CAAC;EACnBC,aAAa,GAAkBC,OAAO,CAACC,OAAO,CAAC,CAAC;EAChDC,GAAG,GAAGN,eAAe;EAEtBO,WAAWA,CACCC,MAAc,EACdC,OAA2C,EAC3CC,kBAAkC,EAClCC,iBAA+B,GAAGC,uBAAO,EAC1D;IAAA,KAJiBJ,MAAc,GAAdA,MAAc;IAAA,KACdC,OAA2C,GAA3CA,OAA2C;IAAA,KAC3CC,kBAAkC,GAAlCA,kBAAkC;IAAA,KAClCC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AAG,MAAM,IAAI,CAACxC,MAAM,CAACwC,WAAW,CAAC,CAAC;QAEnD,IAAI,CAACA,WAAW,EAAE;UAChB,IAAAC,0BAAY,EAAC,MAAM,EAAE,yCAAyC,CAAC;UAE/D,OAAO,KAAK;QACd;QAEA,MAAM,IAAI,CAACtC,iBAAiB,CAAC,MAC3B,IAAI,CAACqB,OAAO,CAACT,OAAO,EAAE,IAAA2B,sBAAW,EAACvB,KAAK,CAACwB,IAAI,CAAC,EAAE,CAAC,CAAC,CACnD,CAAC;QAED,OAAO,IAAI;MACb,CAAC,CAAC,OAAO7B,KAAK,EAAE;QACd,MAAM8B,OAAO,GAAG,IAAAC,gCAAgB,EAAC/B,KAAK,CAAC,CAAC8B,OAAO;QAE/C,MAAME,WAAW,GACf,IAAI,CAAC5C,kBAAkB,GAAG,CAAC,KAAK,IAAI,IACpC,6BAA6B,CAAC6C,IAAI,CAACH,OAAO,CAAC;QAE7C,IAAAH,0BAAY,EAACK,WAAW,GAAG,MAAM,GAAG,OAAO,EAAE,+BAA+B,EAAE;UAC5EE,SAAS,EAAE,IAAAH,gCAAgB,EAAC/B,KAAK,CAAC,CAACmC;QACrC,CAAC,CAAC;MAEJ;IACF;IAEA,OAAO,KAAK;EACd,CAAC;AACH;AAACC,OAAA,CAAAxD,eAAA,GAAAA,eAAA","ignoreList":[]}
@@ -10,29 +10,36 @@ var _bluetoothError = require("../../types/bluetooth-error.js");
10
10
  var _deviceStatus = require("../../types/device-status.js");
11
11
  var _base64ToHex = require("../../utils/base-64-to-hex.js");
12
12
  var _btCommandWriter = require("./bt-command-writer.js");
13
+ var _btCurrentTime = require("./bt-current-time.js");
13
14
  var _btDeviceInformation = require("./bt-device-information.js");
15
+ var _btNotificationReadiness = require("./bt-notification-readiness.js");
16
+ var _btPairingRetry = require("./bt-pairing-retry.js");
14
17
  /* eslint-disable max-lines */
15
18
 
16
19
  class BTConnectionHandler {
17
20
  characteristicSubscriptions = [];
18
21
  disconnectObserved = false;
22
+ pairingReported = false;
19
23
  constructor(device, mainServices, callbacks, preferredMtu) {
20
24
  this.device = device;
21
25
  this.mainServices = mainServices;
22
26
  this.callbacks = callbacks;
23
27
  this.preferredMtu = preferredMtu;
24
- this.writer = new _btCommandWriter.BTCommandWriter(device, callbacks.onError, callbacks.isNormalDisconnect);
28
+ this.pairing = new _btPairingRetry.BTPairingRetry(device, this.reportPairingRequired);
29
+ this.writer = new _btCommandWriter.BTCommandWriter(device, callbacks.onError, callbacks.isNormalDisconnect, this.pairing.run);
25
30
  }
26
31
  connect = async () => {
27
32
  const startedAt = Date.now();
28
33
  this.disconnectObserved = false;
34
+ this.pairingReported = false;
29
35
  const span = (0, _telemetry.startOvokSpan)("bluetooth.connect");
30
36
  try {
31
37
  await this.connectWithRetries();
32
38
  await this.requestPreferredMtu();
33
39
  await this.device.discoverAllServicesAndCharacteristics();
34
- await (0, _btDeviceInformation.readDeviceInformation)(this.device, this.callbacks.onDeviceInfo);
40
+ await (0, _btDeviceInformation.readDeviceInformation)(this.device, this.callbacks.onDeviceInfo, this.pairing.run);
35
41
  await this.readBatteryLevel();
42
+ await this.syncCurrentTime();
36
43
  if (this.disconnectObserved || !(await this.device.isConnected())) {
37
44
  throw new Error("Device disconnected during connection setup");
38
45
  }
@@ -54,10 +61,7 @@ class BTConnectionHandler {
54
61
  (0, _telemetry.addOvokSpanEvent)("pairing.failed", {
55
62
  errorCode
56
63
  }, span);
57
- this.callbacks.onConnectionEvent?.({
58
- kind: "pairing",
59
- pairingCodeRequired: true
60
- });
64
+ this.reportPairingRequired();
61
65
  }
62
66
  if (!this.disconnectObserved) {
63
67
  this.callbacks.onStatusChanged?.(_deviceStatus.DeviceStatus.DISCONNECTED);
@@ -73,8 +77,7 @@ class BTConnectionHandler {
73
77
  }
74
78
  };
75
79
  destroy = () => {
76
- this.characteristicSubscriptions.forEach(sub => sub?.remove());
77
- this.characteristicSubscriptions = [];
80
+ this.removeSubscriptions();
78
81
  this.writer.reset();
79
82
  this.onDisconnectSubscription?.remove();
80
83
  this.onDisconnectSubscription = undefined;
@@ -210,26 +213,8 @@ class BTConnectionHandler {
210
213
  this.callbacks.onServicesDiscovered?.(services.map(({
211
214
  uuid
212
215
  }) => uuid));
213
- for (const mainService of services) {
214
- for (const monitorUuid of mainService.monitorUuids) {
215
- const subscription = this.device.monitorCharacteristicForService(mainService.uuid, monitorUuid.uuid, (error, result) => {
216
- if (error) {
217
- this.callbacks.onError?.(error);
218
- return;
219
- }
220
- if (!result || !result.value) {
221
- this.callbacks.onError?.(new Error("Received empty data from device"));
222
- return;
223
- }
224
- if (monitorUuid.processData !== false) {
225
- const hexValue = (0, _base64ToHex.base64ToHex)(result.value);
226
- this.callbacks.onDataReceived?.(result.uuid, hexValue);
227
- }
228
- });
229
- this.characteristicSubscriptions.push(subscription);
230
- }
231
- }
232
- const initialCommands = this.callbacks.initialCommands?.() ?? [];
216
+ await this.pairing.run(() => this.startMonitors(services));
217
+ const initialCommands = (await this.callbacks.initialCommands?.()) ?? [];
233
218
  if (initialCommands.length > 0) {
234
219
  await this.sendCommands(initialCommands);
235
220
  this.callbacks.onCommandSent?.();
@@ -242,6 +227,90 @@ class BTConnectionHandler {
242
227
  this.callbacks.onError?.(error);
243
228
  }
244
229
  };
230
+
231
+ /** A monitor failing for pairing while starting is thrown here, for the pairing retry, not reported. */
232
+ startMonitors = async services => {
233
+ this.removeSubscriptions();
234
+ let starting = true;
235
+ let pairingError;
236
+ const onMonitorError = error => {
237
+ if (starting && (0, _btPairingRetry.isPairingRequired)(error)) {
238
+ pairingError ??= error;
239
+ return;
240
+ }
241
+ this.callbacks.onError?.(error);
242
+ };
243
+ try {
244
+ const monitored = [];
245
+ for (const service of services) {
246
+ for (const monitorUuid of service.monitorUuids) {
247
+ this.characteristicSubscriptions.push(this.monitor(service.uuid, monitorUuid, onMonitorError));
248
+ monitored.push({
249
+ serviceUuid: service.uuid,
250
+ characteristicUuid: monitorUuid.uuid
251
+ });
252
+ }
253
+ }
254
+ await (0, _btNotificationReadiness.awaitNotificationsEnabled)(this.device, monitored);
255
+ if (pairingError) {
256
+ throw pairingError;
257
+ }
258
+ } finally {
259
+ starting = false;
260
+ }
261
+ };
262
+ monitor = (serviceUuid, monitorUuid, onMonitorError) => this.device.monitorCharacteristicForService(serviceUuid, monitorUuid.uuid, (error, result) => {
263
+ if (error) {
264
+ onMonitorError(error);
265
+ return;
266
+ }
267
+ if (!result || !result.value) {
268
+ this.callbacks.onError?.(new Error("Received empty data from device"));
269
+ return;
270
+ }
271
+ if (monitorUuid.processData !== false) {
272
+ const hexValue = (0, _base64ToHex.base64ToHex)(result.value);
273
+ this.callbacks.onDataReceived?.(result.uuid, hexValue);
274
+ }
275
+ });
276
+ removeSubscriptions = () => {
277
+ this.characteristicSubscriptions.forEach(sub => sub?.remove());
278
+ this.characteristicSubscriptions = [];
279
+ };
280
+
281
+ /** Tells the app once per connection that the platform is asking the user to pair. */
282
+ reportPairingRequired = () => {
283
+ if (this.pairingReported) {
284
+ return;
285
+ }
286
+ this.pairingReported = true;
287
+ this.callbacks.onConnectionEvent?.({
288
+ kind: "pairing",
289
+ pairingCodeRequired: true
290
+ });
291
+ };
292
+
293
+ /** Sets the device clock when the declaration asked for it; a device that refuses keeps its own time. */
294
+ syncCurrentTime = async () => {
295
+ const clock = this.callbacks.currentTimeSync;
296
+ if (!clock) {
297
+ return;
298
+ }
299
+ try {
300
+ const clockAt = await (0, _btCurrentTime.writeCurrentTime)(this.device, clock);
301
+ if (clockAt) {
302
+ this.callbacks.onConnectionEvent?.({
303
+ kind: "clock-synchronized",
304
+ clockAt,
305
+ phoneUtcOffsetMinutes: -clockAt.getTimezoneOffset()
306
+ });
307
+ }
308
+ } catch (error) {
309
+ (0, _sentryLogger.sentryLogger)("info", "DEVICE: Current Time was not written", {
310
+ errorCode: (0, _bluetoothError.toBluetoothError)(error).code
311
+ });
312
+ }
313
+ };
245
314
  }
246
315
  exports.BTConnectionHandler = BTConnectionHandler;
247
316
  //# sourceMappingURL=bt-connection-handler.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_sentryLogger","require","_telemetry","_bluetoothError","_deviceStatus","_base64ToHex","_btCommandWriter","_btDeviceInformation","BTConnectionHandler","characteristicSubscriptions","disconnectObserved","constructor","device","mainServices","callbacks","preferredMtu","writer","BTCommandWriter","onError","isNormalDisconnect","connect","startedAt","Date","now","span","startOvokSpan","connectWithRetries","requestPreferredMtu","discoverAllServicesAndCharacteristics","readDeviceInformation","onDeviceInfo","readBatteryLevel","isConnected","Error","onStatusChanged","DeviceStatus","CONNECTED","subscribeToAllCharacteristics","setStatus","code","error","errorCode","toBluetoothError","sentryLogger","BluetoothErrorCode","PAIRING_REQUIRED","recordOvokMetric","addOvokSpanEvent","onConnectionEvent","kind","pairingCodeRequired","DISCONNECTED","message","recordOvokDuration","end","destroy","forEach","sub","remove","reset","onDisconnectSubscription","undefined","sendCommands","commands","send","negotiated","requestMTU","useNegotiatedMtu","mtu","requestedMtu","characteristic","readCharacteristicForService","value","Number","parseInt","base64ToHex","isFinite","batteryLevel","maxRetries","retryDelay","maxDelay","connected","retryCount","listenForDisconnect","willRetry","Promise","resolve","setTimeout","Math","min","pow","onDisconnected","onDeviceDisconnected","servicesPresent","some","optional","services","discovered","Set","map","uuid","toLowerCase","filter","has","onServicesDiscovered","mainService","monitorUuid","monitorUuids","subscription","monitorCharacteristicForService","result","processData","hexValue","onDataReceived","push","initialCommands","length","onCommandSent","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-connection-handler.ts"],"mappings":";;;;;;AAIA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAMA,IAAAE,eAAA,GAAAF,OAAA;AAGA,IAAAG,aAAA,GAAAH,OAAA;AAGA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,oBAAA,GAAAN,OAAA;AApBA;;AA0CO,MAAMO,mBAAmB,CAAC;EAEvBC,2BAA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AArC,wBAAW,EAACmC,MAAM,CAACtC,KAAK,CAAC;cAE1C,IAAI,CAAC1D,SAAS,CAACmG,cAAc,GAAGH,MAAM,CAACV,IAAI,EAAEY,QAAQ,CAAC;YACxD;UACF,CACF,CAAC;UAED,IAAI,CAACvG,2BAA2B,CAACyG,IAAI,CAACN,YAAY,CAAC;QACrD;MACF;MAEA,MAAMO,eAAe,GAAG,IAAI,CAACrG,SAAS,CAACqG,eAAe,GAAG,CAAC,IAAI,EAAE;MAEhE,IAAIA,eAAe,CAACC,MAAM,GAAG,CAAC,EAAE;QAC9B,MAAM,IAAI,CAACtD,YAAY,CAACqD,eAAe,CAAC;QACxC,IAAI,CAACrG,SAAS,CAACuG,aAAa,GAAG,CAAC;MAClC;IACF,CAAC,CAAC,OAAO7E,KAAK,EAAE;MACd,MAAMC,SAAS,GAAG,IAAAC,gCAAgB,EAACF,KAAK,CAAC,CAACD,IAAI;MAE9C,IAAAI,0BAAY,EACV,OAAO,EACP,kDAAkD,EAClD;QACEF;MACF,CACF,CAAC;MACD,IAAI,CAAC3B,SAAS,CAACI,OAAO,GAAGsB,KAAyB,CAAC;IACrD;EACF,CAAC;AACH;AAAC8E,OAAA,CAAA9G,mBAAA,GAAAA,mBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_sentryLogger","require","_telemetry","_bluetoothError","_deviceStatus","_base64ToHex","_btCommandWriter","_btCurrentTime","_btDeviceInformation","_btNotificationReadiness","_btPairingRetry","BTConnectionHandler","characteristicSubscriptions","disconnectObserved","pairingReported","constructor","device","mainServices","callbacks","preferredMtu","pairing","BTPairingRetry","reportPairingRequired","writer","BTCommandWriter","onError","isNormalDisconnect","run","connect","startedAt","Date","now","span","startOvokSpan","connectWithRetries","requestPreferredMtu","discoverAllServicesAndCharacteristics","readDeviceInformation","onDeviceInfo","readBatteryLevel","syncCurrentTime","isConnected","Error","onStatusChanged","DeviceStatus","CONNECTED","subscribeToAllCharacteristics","setStatus","code","error","errorCode","toBluetoothError","sentryLogger","BluetoothErrorCode","PAIRING_REQUIRED","recordOvokMetric","addOvokSpanEvent","DISCONNECTED","message","recordOvokDuration","end","destroy","removeSubscriptions","reset","onDisconnectSubscription","remove","undefined","sendCommands","commands","send","negotiated","requestMTU","useNegotiatedMtu","mtu","requestedMtu","characteristic","readCharacteristicForService","value","Number","parseInt","base64ToHex","isFinite","onConnectionEvent","kind","batteryLevel","maxRetries","retryDelay","maxDelay","connected","retryCount","listenForDisconnect","willRetry","Promise","resolve","setTimeout","Math","min","pow","onDisconnected","onDeviceDisconnected","servicesPresent","some","optional","services","discovered","Set","map","uuid","toLowerCase","filter","has","onServicesDiscovered","startMonitors","initialCommands","length","onCommandSent","starting","pairingError","onMonitorError","isPairingRequired","monitored","service","monitorUuid","monitorUuids","push","monitor","serviceUuid","characteristicUuid","awaitNotificationsEnabled","monitorCharacteristicForService","result","processData","hexValue","onDataReceived","forEach","sub","pairingCodeRequired","clock","currentTimeSync","clockAt","writeCurrentTime","phoneUtcOffsetMinutes","getTimezoneOffset","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-connection-handler.ts"],"mappings":";;;;;;AAIA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAMA,IAAAE,eAAA,GAAAF,OAAA;AAIA,IAAAG,aAAA,GAAAH,OAAA;AAIA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AACA,IAAAQ,wBAAA,GAAAR,OAAA;AAIA,IAAAS,eAAA,GAAAT,OAAA;AA5BA;;AAsDO,MAAMU,mBAAmB,CAAC;EAEvBC,2BAA2B,GAAmB,EAAE;EAChDC,kBAAkB,GAAG,KAAK;EAC1BC,eAAe,GAAG,KAAK;EAI/BC,WAAWA,CACQC,MAAc,EACdC,YAA2C,EAC3CC,SAAqC,EACrCC,YAAqB,EACtC;IA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;IACF,CAAC,CAAC,OAAO7F,KAAK,EAAE;MACd,IAAAG,0BAAY,EAAC,MAAM,EAAE,sCAAsC,EAAE;QAC3DF,SAAS,EAAE,IAAAC,gCAAgB,EAACF,KAAK,CAAC,CAACD;MACrC,CAAC,CAAC;IACJ;EACF,CAAC;AACH;AAAC+F,OAAA,CAAApI,mBAAA,GAAAA,mBAAA","ignoreList":[]}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.writeCurrentTime = void 0;
7
+ var _buffer = require("buffer");
8
+ var _clockSync = require("../../types/clock-sync.js");
9
+ var _sigUuid = require("../../utils/sig-uuid.js");
10
+ const CURRENT_TIME_SERVICE = (0, _sigUuid.sigUuid)("1805");
11
+ const CURRENT_TIME = (0, _sigUuid.sigUuid)("2a2b");
12
+ const SUNDAY = 7;
13
+ const BYTE_MASK = 0xff;
14
+ const BITS_PER_BYTE = 8;
15
+ const NO_FRACTION = 0;
16
+
17
+ /** Adjust Reason bit 0: the time was set by hand, which is what a phone writing it is. */
18
+ const MANUAL_TIME_UPDATE = 0x01;
19
+ /** 1 for Monday to 7 for Sunday, as Day of Week is encoded. */
20
+ const dayOfWeek = ({
21
+ year,
22
+ month,
23
+ day
24
+ }) => new Date(Date.UTC(year, month - 1, day)).getUTCDay() || SUNDAY;
25
+
26
+ /** Current Time 0x2A2B: Date Time, Day of Week, Fractions256 and Adjust Reason. */
27
+ const currentTimeBytes = parts => [parts.year & BYTE_MASK, parts.year >> BITS_PER_BYTE, parts.month, parts.day, parts.hours, parts.minutes, parts.seconds, dayOfWeek(parts), NO_FRACTION, MANUAL_TIME_UPDATE];
28
+ const isWritableCurrentTime = ({
29
+ uuid,
30
+ isWritableWithResponse,
31
+ isWritableWithoutResponse
32
+ }) => uuid.toLowerCase() === CURRENT_TIME && (isWritableWithResponse || isWritableWithoutResponse);
33
+
34
+ /**
35
+ * Sets the device clock through the Current Time Service.
36
+ *
37
+ * Resolves to the time written, or `undefined` when the device has no writable Current Time
38
+ * characteristic. A device that refuses the write rejects.
39
+ */
40
+ const writeCurrentTime = async (device, {
41
+ now,
42
+ timezone
43
+ }) => {
44
+ const characteristics = await device.characteristicsForService(CURRENT_TIME_SERVICE).catch(() => []);
45
+ const characteristic = characteristics.find(isWritableCurrentTime);
46
+ if (!characteristic) {
47
+ return undefined;
48
+ }
49
+ const time = now?.() ?? new Date();
50
+ const value = _buffer.Buffer.from(currentTimeBytes((0, _clockSync.getClockParts)(time, timezone))).toString("base64");
51
+ if (characteristic.isWritableWithResponse) {
52
+ await device.writeCharacteristicWithResponseForService(CURRENT_TIME_SERVICE, CURRENT_TIME, value);
53
+ } else {
54
+ await device.writeCharacteristicWithoutResponseForService(CURRENT_TIME_SERVICE, CURRENT_TIME, value);
55
+ }
56
+ return time;
57
+ };
58
+ exports.writeCurrentTime = writeCurrentTime;
59
+ //# sourceMappingURL=bt-current-time.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_buffer","require","_clockSync","_sigUuid","CURRENT_TIME_SERVICE","sigUuid","CURRENT_TIME","SUNDAY","BYTE_MASK","BITS_PER_BYTE","NO_FRACTION","MANUAL_TIME_UPDATE","dayOfWeek","year","month","day","Date","UTC","getUTCDay","currentTimeBytes","parts","hours","minutes","seconds","isWritableCurrentTime","uuid","isWritableWithResponse","isWritableWithoutResponse","toLowerCase","writeCurrentTime","device","now","timezone","characteristics","characteristicsForService","catch","characteristic","find","undefined","time","value","Buffer","from","getClockParts","toString","writeCharacteristicWithResponseForService","writeCharacteristicWithoutResponseForService","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-current-time.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAIA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,MAAMG,oBAAoB,GAAG,IAAAC,gBAAO,EAAC,MAAM,CAAC;AAC5C,MAAMC,Y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IAAI,CAACY,cAAc,EAAE;IACnB,OAAOE,SAAS;EAClB;EAEA,MAAMC,IAAI,GAAGR,GAAG,GAAG,CAAC,IAAI,IAAIf,IAAI,CAAC,CAAC;EAClC,MAAMwB,KAAK,GAAGC,cAAM,CAACC,IAAI,CAACvB,gBAAgB,CAAC,IAAAwB,wBAAa,EAACJ,IAAI,EAAEP,QAAQ,CAAC,CAAC,CAAC,CAACY,QAAQ,CAAC,QAAQ,CAAC;EAE7F,IAAIR,cAAc,CAACV,sBAAsB,EAAE;IACzC,MAAMI,MAAM,CAACe,yCAAyC,CAACzC,oBAAoB,EAAEE,YAAY,EAAEkC,KAAK,CAAC;EACnG,CAAC,MAAM;IACL,MAAMV,MAAM,CAACgB,4CAA4C,CAAC1C,oBAAoB,EAAEE,YAAY,EAAEkC,KAAK,CAAC;EACtG;EAEA,OAAOD,IAAI;AACb,CAAC;AAACQ,OAAA,CAAAlB,gBAAA,GAAAA,gBAAA","ignoreList":[]}
@@ -7,50 +7,31 @@ exports.readDeviceInformation = void 0;
7
7
  var _buffer = require("buffer");
8
8
  var _sentryLogger = require("../../../helpers/utils/sentry-logger.js");
9
9
  var _bluetoothError = require("../../types/bluetooth-error.js");
10
- const MAX_PAIRING_RETRIES = 2;
11
- const PAIRING_RETRY_DELAY_MS = 1_000;
12
- const isPairingAuthenticationError = error => {
13
- const text = error instanceof Error ? error.message : String(error);
14
- return /(?:GATT_)?(?:INSUFFICIENT_AUTHENTICATION|AUTH_FAIL)|authentication|pairing|bond/i.test(text);
15
- };
16
- const wait = milliseconds => new Promise(resolve => setTimeout(resolve, milliseconds));
17
- const readDeviceInformation = async (device, onDeviceInfo) => {
10
+ var _btPairingRetry = require("./bt-pairing-retry.js");
11
+ const GENERIC_ACCESS_SERVICE = "00001800-0000-1000-8000-00805f9b34fb";
12
+ const DEVICE_INFORMATION_SERVICE = "0000180a-0000-1000-8000-00805f9b34fb";
13
+ const INFORMATION_CHARACTERISTICS = [["name", GENERIC_ACCESS_SERVICE, "00002a00-0000-1000-8000-00805f9b34fb"], ["manufacturerName", DEVICE_INFORMATION_SERVICE, "00002a29-0000-1000-8000-00805f9b34fb"], ["model", DEVICE_INFORMATION_SERVICE, "00002a24-0000-1000-8000-00805f9b34fb"], ["serialNumber", DEVICE_INFORMATION_SERVICE, "00002a25-0000-1000-8000-00805f9b34fb"]];
14
+ const textOf = base64 => _buffer.Buffer.from(base64, "base64").toString("utf8").replace(/\0+$/, "").trim();
15
+ const readDeviceInformation = async (device, onDeviceInfo, retryAfterPairing = _btPairingRetry.runOnce) => {
18
16
  const read = device.readCharacteristicForService;
19
17
  if (typeof read !== "function") {
20
18
  return;
21
19
  }
22
20
  const info = {};
23
- const values = [["name", "00001800-0000-1000-8000-00805f9b34fb", "00002a00-0000-1000-8000-00805f9b34fb"], ["manufacturerName", "0000180a-0000-1000-8000-00805f9b34fb", "00002a29-0000-1000-8000-00805f9b34fb"], ["model", "0000180a-0000-1000-8000-00805f9b34fb", "00002a24-0000-1000-8000-00805f9b34fb"], ["serialNumber", "0000180a-0000-1000-8000-00805f9b34fb", "00002a25-0000-1000-8000-00805f9b34fb"]];
24
- let pending = values;
25
- for (let attempt = 0; attempt <= MAX_PAIRING_RETRIES; attempt += 1) {
26
- const retry = [];
27
- for (const [key, serviceUuid, characteristicUuid] of pending) {
28
- try {
29
- const characteristic = await read.call(device, serviceUuid, characteristicUuid);
30
- const value = characteristic?.value;
31
- if (!value) {
32
- continue;
33
- }
34
- const text = _buffer.Buffer.from(value, "base64").toString("utf8").replace(/\0+$/, "").trim();
35
- if (text) {
36
- info[key] = text;
37
- }
38
- } catch (error) {
39
- // Optional GAP/Device Information characteristics are not present on every device.
40
- (0, _sentryLogger.sentryLogger)("info", "DEVICE: Optional device information unavailable", {
41
- characteristicUuid,
42
- errorCode: (0, _bluetoothError.toBluetoothError)(error).code
43
- });
44
- if (attempt < MAX_PAIRING_RETRIES && isPairingAuthenticationError(error)) {
45
- retry.push([key, serviceUuid, characteristicUuid]);
46
- }
21
+ for (const [key, serviceUuid, characteristicUuid] of INFORMATION_CHARACTERISTICS) {
22
+ try {
23
+ const characteristic = await retryAfterPairing(() => read.call(device, serviceUuid, characteristicUuid));
24
+ const text = characteristic?.value ? textOf(characteristic.value) : "";
25
+ if (text) {
26
+ info[key] = text;
47
27
  }
28
+ } catch (error) {
29
+ // Optional GAP/Device Information characteristics are not present on every device.
30
+ (0, _sentryLogger.sentryLogger)("info", "DEVICE: Optional device information unavailable", {
31
+ characteristicUuid,
32
+ errorCode: (0, _bluetoothError.toBluetoothError)(error).code
33
+ });
48
34
  }
49
- if (!retry.length) {
50
- break;
51
- }
52
- await wait(PAIRING_RETRY_DELAY_MS * (attempt + 1));
53
- pending = retry;
54
35
  }
55
36
  if (Object.keys(info).length > 0) {
56
37
  onDeviceInfo?.(info);
@@ -1 +1 @@
1
- {"version":3,"names":["_buffer","require","_sentryLogger","_bluetoothError","MAX_PAIRING_RETRIES","PAIRING_RETRY_DELAY_MS","isPairingAuthenticationError","error","text","Error","message","String","test","wait","milliseconds","Promise","resolve","setTimeout","readDeviceInformation","device","onDeviceInfo","read","readCharacteristicForService","info","values","pending","attempt","retry","key","serviceUuid","characteristicUuid","characteristic","call","value","Buffer","from","toString","replace","trim","sentryLogger","errorCode","toBluetoothError","code","push","length","Object","keys","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-device-information.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAIA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AASA,MAAMG,mBAAmB,GAAG,CAAC;AAC7B,MAAMC,sBAAsB,GAAG,KAAK;AAEpC,MAAMC,4BAA4B,GAAIC,KAAc,IAAc;EAChE,MAAMC,IAAI,GAAGD,KAAK,YAAYE,KAAK,GAAGF,KAAK,CAACG,OAAO,GAAGC,MAAM,CAACJ,KAAK,CAAC;EAEnE,OAAO,kFAAkF,CAACK,IAAI,CAC5FJ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AI,EAAE;UACRe,IAAI,CAACK,GAAG,CAAC,GAAGpB,IAAI;QAClB;MACF,CAAC,CAAC,OAAOD,KAAK,EAAE;QACd;QACA,IAAAgC,0BAAY,EAAC,MAAM,EAAE,iDAAiD,EAAE;UACtET,kBAAkB;UAClBU,SAAS,EAAE,IAAAC,gCAAgB,EAAClC,KAAK,CAAC,CAACmC;QACrC,CAAC,CAAC;QAEF,IAAIhB,OAAO,GAAGtB,mBAAmB,IAAIE,4BAA4B,CAACC,KAAK,CAAC,EAAE;UACxEoB,KAAK,CAACgB,IAAI,CAAC,CAACf,GAAG,EAAEC,WAAW,EAAEC,kBAAkB,CAAC,CAAC;QACpD;MACF;IACF;IAEA,IAAI,CAACH,KAAK,CAACiB,MAAM,EAAE;MACjB;IACF;IAEA,MAAM/B,IAAI,CAACR,sBAAsB,IAAIqB,OAAO,GAAG,CAAC,CAAC,CAAC;IAClDD,OAAO,GAAGE,KAAK;EACjB;EAEA,IAAIkB,MAAM,CAACC,IAAI,CAACvB,IAAI,CAAC,CAACqB,MAAM,GAAG,CAAC,EAAE;IAChCxB,YAAY,GAAGG,IAAI,CAAC;EACtB;AACF,CAAC;AAACwB,OAAA,CAAA7B,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_buffer","require","_sentryLogger","_bluetoothError","_btPairingRetry","GENERIC_ACCESS_SERVICE","DEVICE_INFORMATION_SERVICE","INFORMATION_CHARACTERISTICS","textOf","base64","Buffer","from","toString","replace","trim","readDeviceInformation","device","onDeviceInfo","retryAfterPairing","runOnce","read","readCharacteristicForService","info","key","serviceUuid","characteristicUuid","characteristic","call","text","value","error","sentryLogger","errorCode","toBluetoothError","code","Object","keys","length","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-device-information.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAIA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAEA,IA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AAC,0BAAY,EAAC,MAAM,EAAE,iDAAiD,EAAE;QACtEN,kBAAkB;QAClBO,SAAS,EAAE,IAAAC,gCAAgB,EAACH,KAAK,CAAC,CAACI;MACrC,CAAC,CAAC;IACJ;EACF;EAEA,IAAIC,MAAM,CAACC,IAAI,CAACd,IAAI,CAAC,CAACe,MAAM,GAAG,CAAC,EAAE;IAChCpB,YAAY,GAAGK,IAAI,CAAC;EACtB;AACF,CAAC;AAACgB,OAAA,CAAAvB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
@@ -6,12 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.BTManagedDevice = void 0;
7
7
  var _sentryLogger = require("../../../helpers/utils/sentry-logger.js");
8
8
  var _telemetry = require("../../../helpers/utils/telemetry.js");
9
+ var _dailyTotalDay = require("../../../next/bluetooth/daily-total-day.js");
9
10
  var _builtInMeasurementTypes = require("../../constants/built-in-measurement-types.js");
10
11
  var _deviceVariants = require("../../constants/device-variants.js");
11
12
  var _bluetoothError = require("../../types/bluetooth-error.js");
12
13
  var _clockSync = require("../../types/clock-sync.js");
13
14
  var _deviceStatus = require("../../types/device-status.js");
14
- var _dailyTotalDay = require("../../utils/daily-total-day.js");
15
+ var _deviceUser = require("../../utils/device-user.js");
15
16
  var _errorCallbackPayload = require("../../utils/error-callback-payload.js");
16
17
  var _resultIdentity = require("../../utils/result-identity.js");
17
18
  var _supportedMeasurementTypeKeys = require("../../utils/supported-measurement-type-keys.js");
@@ -29,6 +30,9 @@ class BTManagedDevice {
29
30
 
30
31
  connected = false;
31
32
  destroyed = false;
33
+
34
+ /** A policy that picks how results are delivered replaces `oneReadingPerConnection`; a user filter does not. */
35
+
32
36
  resultReportedThisConnection = false;
33
37
  historyTransferActive = false;
34
38
  bondedEventReported = false;
@@ -89,6 +93,13 @@ class BTManagedDevice {
89
93
  /** Only declarations with an actual bonding flow should report this event. */
90
94
  reportsBondedEvent = false;
91
95
 
96
+ /**
97
+ * Writes the phone's time to the device's Current Time characteristic on connect, when it
98
+ * has a writable one. Only for a device whose clock has no protocol of its own, and never
99
+ * once the app turned clock synchronisation off.
100
+ */
101
+ syncsCurrentTime = false;
102
+
92
103
  /**
93
104
  * Decides whether the buffer holds a parseable frame.
94
105
  *
@@ -129,11 +140,14 @@ class BTManagedDevice {
129
140
  onConnectionEvent: onConnectionEventCallback,
130
141
  onDeviceDisconnected: onDeviceDisconnectedCallback,
131
142
  oneReadingPerConnection,
132
- resultPolicy
143
+ resultPolicy,
144
+ clockSync
133
145
  }) {
134
146
  this.device = device;
135
147
  this.oneReadingPerConnection = oneReadingPerConnection === true;
136
148
  this.resultPolicy = resultPolicy;
149
+ this.policyPicksDelivery = resultPolicy?.default !== undefined || resultPolicy?.byMeasurement !== undefined;
150
+ this.clockSyncOptions = clockSync;
137
151
  (0, _sentryLogger.sentryLogger)("info", "BT_MANAGER: Creating BTManagedDevice");
138
152
  this.deviceData = {
139
153
  id: device.id,
@@ -186,13 +200,20 @@ class BTManagedDevice {
186
200
  ...data
187
201
  }) => {
188
202
  const measurementTypeKey = data.measurementTypeKey;
203
+ const acceptedMemorySlots = this.resultPolicy?.acceptedMemorySlots;
204
+ if (acceptedMemorySlots && !(0, _deviceUser.isFromAcceptedMemorySlot)(data, acceptedMemorySlots)) {
205
+ (0, _sentryLogger.sentryLogger)("info", "BT_MANAGER: Dropping a reading of another device user", {
206
+ measurementTypeKey
207
+ });
208
+ return;
209
+ }
189
210
  const policy = this.policyFor(measurementTypeKey);
190
211
 
191
212
  // A live value of a kind kept as a series goes to the series; a stored record is reported as it is.
192
213
  if (policy === "series" && onSeriesValueCallback?.(this.deviceData, data)) {
193
214
  return;
194
215
  }
195
- if (this.oneReadingPerConnection && !this.resultPolicy && this.resultReportedThisConnection) {
216
+ if (this.oneReadingPerConnection && !this.policyPicksDelivery && this.resultReportedThisConnection) {
196
217
  return;
197
218
  }
198
219
  if (policy === "first-reading-per-kind-per-connection") {
@@ -247,6 +268,11 @@ class BTManagedDevice {
247
268
  enumerable: true,
248
269
  writable: false
249
270
  });
271
+ Object.defineProperty(result, "legacyId", {
272
+ value: (0, _resultIdentity.createLegacyResultId)(this.deviceData, data),
273
+ enumerable: true,
274
+ writable: false
275
+ });
250
276
  onResultCallback?.(result);
251
277
  };
252
278
  this.onDeviceDisconnected = onDeviceDisconnectedCallback;
@@ -279,6 +305,7 @@ class BTManagedDevice {
279
305
  });
280
306
  }
281
307
  };
308
+ currentTimeSync = () => this.syncsCurrentTime && (0, _clockSync.isClockSyncEnabled)(this.clockSyncOptions) ? this.clockSyncOptions ?? {} : undefined;
282
309
  connectInternal = async () => {
283
310
  this.resultReportedThisConnection = false;
284
311
  this.reportedMeasurementKinds.clear();
@@ -335,6 +362,7 @@ class BTManagedDevice {
335
362
  },
336
363
  onServicesDiscovered: uuids => sequencer.onServicesDiscovered?.(uuids),
337
364
  initialCommands: () => sequencer.initialCommands(),
365
+ currentTimeSync: this.currentTimeSync(),
338
366
  onCommandSent: () => {
339
367
  this.dataProcessor?.armStuckTimeout();
340
368
  this.dataProcessor?.armCommandTimeout();
@@ -1 +1 @@
1
- {"version":3,"names":["_sentryLogger","require","_telemetry","_builtInMeasurementTypes","_deviceVariants","_bluetoothError","_clockSync","_deviceStatus","_dailyTotalDay","_errorCallbackPayload","_resultIdentity","_supportedMeasurementTypeKeys","_btConnectionHandler","_btDataProcessor","_pollingCommandSequencer","BTManagedDevice","connected","destroyed","resultReportedThisConnection","historyTransferActive","bondedEventReported","reportedMeasurementKinds","Set","reportedDailyTotals","historyResultCount","getSupportedMeasurementTypeKeys","declared","supportedMeasurementTypeKeys","mainServices","length","BUILT_IN_MEASUREMENT_TYPES","deviceData","name","reportsBondedEvent","handleSuccessResult","_successResult","_collectedValues","handleMeasurementEnd","policyFor","measurementTypeKey","resultPolicy","byMeasurement","default","reportResult","result","onResult","constructor","device","deviceName","onError","onErrorCallback","onDeviceStatusChanged","onDeviceStatusChangedCallback","onResultCallback","onSeriesValue","onSeriesValueCallback","onConnectionEvent","onConnectionEventCallback","onDeviceDisconnected","onDeviceDisconnectedCallback","oneReadingPerConnection","sentryLogger","id","localName","manufacturerData","sn","measurementTypes","clockSync","clockSyncCapabilityForDevice","variant","findDeviceVariant","String","manufacturer","model","status","addOvokSpanEvent","error","normalized","toBluetoothError","errorCode","code","errorCallbackPayload","caseType","_","data","policy","has","add","day","dailyTotalDay","Date","now","key","recordOvokMetric","kind","progress","current","Object","defineProperty","value","createStableResultId","enumerable","writable","destroy","connectionHandler","dataProcessor","undefined","disconnect","cancelConnection","connectInternal","clear","sequencer","createCommandSequencer","pollingSequencerFor","isHistoryTransfer","BTConnectionHandler","onStatusChanged","DeviceStatus","CONNECTED","bind","DISCONNECTED","event","onDataReceived","uuid","hexValue","processData","onDeviceInfo","info","manufacturerName","serialNumber","onServicesDiscovered","uuids","initialCommands","onCommandSent","armStuckTimeout","armCommandTimeout","isNormalDisconnect","preferredMtu","BTDataProcessor","stuckDataTimeout","onStreamStart","onMeasurementEnd","validatePackage","parsedData","collectedValues","nextCommand","frame","sendCommands","commands","commandTimeoutMs","onCommandTimeout","commandProgress","handleDependentResult","frameReader","connect","Promise","reject","Error","connectionPromise","resolve","finally","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-managed-device.ts"],"mappings":";;;;;;AAKA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,wBAAA,GAAAF,OAAA;AACA,IAAAG,eAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAQA,IAAAM,aAAA,GAAAN,OAAA;AAQA,IAAAO,cAAA,GAAAP,OAAA;AACA,IAAAQ,qBAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AACA,IAAAU,6BAAA,GAAAV,OAAA;AAEA,IAAAW,oBAAA,GAAAX,OAAA;AACA,IAAAY,gBAAA,GAAAZ,OAAA;AACA,IAA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C;MACrDC,gBAAgB,EAAEA,CAAA,KAAMtC,SAAS,CAACsC,gBAAgB,GAAG,CAAC;MACtDC,gBAAgB,EAAEA,CAAA,KAAMvC,SAAS,CAACuC,gBAAgB,GAAG,CAAC,IAAI,CAAC,CAAC;MAC5DC,eAAe,EAAGL,KAAK,IACrBnC,SAAS,CAACwC,eAAe,GAAGL,KAAK,CAAC,IAAI,UAAU;MAClDjG,OAAO,EAAE,IAAI,CAACA,OAAO,EAAEsE,IAAI,CAAC,IAAI,CAAC;MACjCiC,qBAAqB,EAAE,IAAI,CAACA,qBAAqB,EAAEjC,IAAI,CAAC,IAAI;IAC9D,CAAC,EACD,IAAI,CAACkC,WACP,CAAC;IAED,MAAM,IAAI,CAACjD,iBAAiB,CAACkD,OAAO,CAAC,CAAC;EACxC,CAAC;;EAED;AACF;AACA;AACA;AACA;AACA;AACA;EACSA,OAAO,GAAGA,CAAA,KAAqB;IACpC,IAAI,IAAI,CAACzI,SAAS,EAAE;MAClB,OAAO0I,OAAO,CAACC,MAAM,CAAC,IAAIC,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACjF;IAEA,IAAI,IAAI,CAACC,iBAAiB,EAAE;MAC1B,OAAO,IAAI,CAACA,iBAAiB;IAC/B;IAEA,IAAI,IAAI,CAAC9I,SAAS,EAAE;MAClB,OAAO2I,OAAO,CAACI,OAAO,CAAC,CAAC;IAC1B;IAEA,IAAI,CAACD,iBAAiB,GAAG,IAAI,CAACjD,eAAe,CAAC,CAAC,CAACmD,OAAO,CAAC,MAAM;MAC5D,IAAI,CAACF,iBAAiB,GAAGpD,SAAS;IACpC,CAAC,CAAC;IAEF,OAAO,IAAI,CAACoD,iBAAiB;EAC/B,CAAC;AACH;AAACG,OAAA,CAAAlJ,eAAA,GAAAA,eAAA","ignoreList":[]}
1
+ {"version":3,"names":["_sentryLogger","require","_telemetry","_dailyTotalDay","_builtInMeasurementTypes","_deviceVariants","_bluetoothError","_clockSync","_deviceStatus","_deviceUser","_errorCallbackPayload","_resultIdentity","_supportedMeasurementTypeKeys","_btConnectionHandler","_btDataProcessor","_pollingCommandSequencer","BTManagedDevice","connected","destroyed","resultReportedThisConnection","historyTransferActive","bondedEventReported","reportedMeasurementKinds","Set","reportedDailyTotals","historyResultCount","getSupportedMeasurementTypeKeys","declared","supportedMeasurementTypeKeys","mainServices","length","BUILT_IN_MEASUREMENT_TYPES","deviceData","name","reportsBondedEvent","syncsCurrentTime","handleSuccessResult","_successResult","_collectedValues","handleMeasurementEnd","policyFor","measurementTypeKey","resultPolicy","byMeasurement","default","reportResult","result","onResult","constructor","device","deviceName","onError","onErrorCallback","onDeviceStatusChanged","onDeviceStatusChangedCallback","onResultCallback","onSeriesValue","onSeriesValueCallback","onConnectionEvent","onConnectionEventCallback","onDeviceDisconnected","onDeviceDisconnectedCallback","oneReadingPerConnection","clockSync","policyPicksDelivery","undefined","clockSyncOptions","sentryLogger","id","localName","manufacturerData","sn","measurementTypes","clockSyncCapabilityForDevice","variant","findDeviceVariant","String","manufacturer","model","status","addOvokSpanEvent","error","normalized","toBluetoothError","errorCode","code","errorCallbackPayload","caseType","_","data","acceptedMemorySlots","isFromAcceptedMemorySlot","policy","has","add","day","dailyTotalDay","Date","now","key","recordOvokMetric","kind","progress","current","Object","defineProperty","value","createStableResultId","enumerable","writable","createLegacyResultId","destroy","connectionHandler","dataProcessor","disconnect","cancelConnection","currentTimeSync","isClockSyncEnabled","connectInternal","clear","sequencer","createCommandSequencer","pollingSequencerFor","isHistoryTransfer","BTConnectionHandler","onStatusChanged","DeviceStatus","CONNECTED","bind","DISCONNECTED","event","onDataReceived","uuid","hexValue","processData","onDeviceInfo","info","manufacturerName","serialNumber","onServicesDiscovered","uuids","initialCommands","onCommandSent","armStuckTimeout","armCommandTimeout","isNormalDisconnect","preferredMtu","BTDataProcessor","stuckDataTimeout","onStreamStart","onMeasurementEnd","validatePackage","parsedData","collectedValues","nextCommand","frame","sendCommands","commands","commandTimeoutMs","onCommandTimeout","commandProgress","handleDependentResult","frameReader","connect","Promise","reject","Error","connectionPromise","resolve","finally","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-managed-device.ts"],"mappings":";;;;;;AAKA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AACA,IAAAG,wBAAA,GAAAH,OAAA;AACA,IAAAI,eAAA,GAAAJ,OAAA;AACA,IAAAK,eAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AAYA,IAAAO,aAAA,GAAAP,OAAA;AAQA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,qBAAA,GAAAT,OAAA;AACA,IAAAU,eAAA,GAAAV,OAAA;AACA,IAAAW,6BAAA,GAAAX,OAAA;AAEA,IAAAY,oBAAA,GAAAZ,OAAA;AACA,IAAAa,gBAAA,GAAAb,OAAA;AACA,IAAAc,wBAAA,GAAAd,OAAA;AAtCA;;AAwCA;AACA;AACA;AACA;AACO,MAAee,eAAe,CAErC;EACE;;EAKQC,SAAS,GAAG,KAAK;EACjBC,SAAS,GAAG,KAAK;;EAOzB;;EAGQC,4BAA4B,GAAG,KAAK;EACpCC,qBAAqB,GAAG,KAAK;EAC7BC,mBAAmB,GAAG,KAAK;EAC3BC,wBAAwB,GAAG,IAAIC,GAAG,CAAqB,CAAC;EACxDC,mBAAmB,GAAG,IAAID,GAAG,CAAS,CAAC;EACvCE,kBAAkB,GAAG,CAAC;;EAE9B;;EAGA;AACF;AACA;;EAGE;AACF;AACA;AACA;EACYC,+BAA+BA,CAAA,EAAyB;IAChE,MAAMC,QAAQ,GAAG,IAAAC,0DAA4B,EAAC,IAAI,CAACC,YAAY,CAAC;IAEhE,OAAOF,QAAQ,CAACG,MAAM,GAAG,CAAC,GACtBH,QAAQ,GACR,CAAC,IAAII,mDAA0B,CAAC,IAAI,CAACC,UAAU,CAACC,IAAI,CAAsB,IAAI,EAAE,CAAC,CAAC;EACxF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