@ovok/native 1.16.1-dev.2115 → 1.16.1-dev.2129

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 (315) 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/device-picker-sheet.js +160 -0
  6. package/lib/commonjs/modules/bt-management/components/device-picker-sheet.js.map +1 -0
  7. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-permission.js +2 -1
  8. package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-permission.js.map +1 -1
  9. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js +1 -1
  10. package/lib/commonjs/modules/bt-management/hooks/use-measurements.js.map +1 -1
  11. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +1 -1
  12. package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  13. package/lib/commonjs/modules/bt-management/utils/bluetooth-permission-list.js +19 -0
  14. package/lib/commonjs/modules/bt-management/utils/bluetooth-permission-list.js.map +1 -0
  15. package/lib/commonjs/modules/bt-management/utils/result-identity.js +3 -25
  16. package/lib/commonjs/modules/bt-management/utils/result-identity.js.map +1 -1
  17. package/lib/commonjs/modules/next/bluetooth/auto-connect.js +32 -0
  18. package/lib/commonjs/modules/next/bluetooth/auto-connect.js.map +1 -0
  19. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-errors.js +33 -0
  20. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-errors.js.map +1 -0
  21. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-link.js +125 -0
  22. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-link.js.map +1 -0
  23. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-scanner.js +75 -0
  24. package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-scanner.js.map +1 -0
  25. package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js +34 -0
  26. package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -0
  27. package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js +67 -0
  28. package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -0
  29. package/lib/commonjs/modules/next/bluetooth/connections.js +110 -0
  30. package/lib/commonjs/modules/next/bluetooth/connections.js.map +1 -0
  31. package/lib/commonjs/modules/next/bluetooth/daily-total-day.js.map +1 -0
  32. package/lib/commonjs/modules/next/bluetooth/devices.js +41 -0
  33. package/lib/commonjs/modules/next/bluetooth/devices.js.map +1 -0
  34. package/lib/commonjs/modules/next/bluetooth/driver.js +24 -20
  35. package/lib/commonjs/modules/next/bluetooth/driver.js.map +1 -1
  36. package/lib/commonjs/modules/next/bluetooth/errors.js +26 -0
  37. package/lib/commonjs/modules/next/bluetooth/errors.js.map +1 -0
  38. package/lib/commonjs/modules/next/bluetooth/index.js +116 -11
  39. package/lib/commonjs/modules/next/bluetooth/index.js.map +1 -1
  40. package/lib/commonjs/modules/next/bluetooth/link.js +0 -103
  41. package/lib/commonjs/modules/next/bluetooth/link.js.map +1 -1
  42. package/lib/commonjs/modules/next/bluetooth/paired.js +50 -0
  43. package/lib/commonjs/modules/next/bluetooth/paired.js.map +1 -0
  44. package/lib/commonjs/modules/next/bluetooth/permissions.js +2 -0
  45. package/lib/commonjs/modules/next/bluetooth/permissions.js.map +1 -0
  46. package/lib/commonjs/modules/next/bluetooth/react/bluetooth-device-picker.js +44 -0
  47. package/lib/commonjs/modules/next/bluetooth/react/bluetooth-device-picker.js.map +1 -0
  48. package/lib/commonjs/modules/next/bluetooth/react/context.js +54 -0
  49. package/lib/commonjs/modules/next/bluetooth/react/context.js.map +1 -0
  50. package/lib/commonjs/modules/next/bluetooth/react/hooks.js +86 -0
  51. package/lib/commonjs/modules/next/bluetooth/react/hooks.js.map +1 -0
  52. package/lib/commonjs/modules/next/bluetooth/react-native/create-bluetooth-runtime.js +28 -0
  53. package/lib/commonjs/modules/next/bluetooth/react-native/create-bluetooth-runtime.js.map +1 -0
  54. package/lib/commonjs/modules/next/bluetooth/react-native/os-permissions.js +32 -0
  55. package/lib/commonjs/modules/next/bluetooth/react-native/os-permissions.js.map +1 -0
  56. package/lib/commonjs/modules/next/bluetooth/react-native/ovok-sink.js +32 -0
  57. package/lib/commonjs/modules/next/bluetooth/react-native/ovok-sink.js.map +1 -0
  58. package/lib/commonjs/modules/next/bluetooth/readings.js +92 -0
  59. package/lib/commonjs/modules/next/bluetooth/readings.js.map +1 -0
  60. package/lib/commonjs/modules/next/bluetooth/result-policy.js +6 -1
  61. package/lib/commonjs/modules/next/bluetooth/result-policy.js.map +1 -1
  62. package/lib/commonjs/modules/next/bluetooth/runtime.js +223 -0
  63. package/lib/commonjs/modules/next/bluetooth/runtime.js.map +1 -0
  64. package/lib/commonjs/modules/next/bluetooth/scan-loop.js +82 -0
  65. package/lib/commonjs/modules/next/bluetooth/scan-loop.js.map +1 -0
  66. package/lib/commonjs/modules/next/bluetooth/sink.js +6 -0
  67. package/lib/commonjs/modules/next/bluetooth/sink.js.map +1 -0
  68. package/lib/commonjs/modules/next/bluetooth/snapshot.js +6 -0
  69. package/lib/commonjs/modules/next/bluetooth/snapshot.js.map +1 -0
  70. package/lib/commonjs/modules/next/bluetooth/stable-hash.js +33 -0
  71. package/lib/commonjs/modules/next/bluetooth/stable-hash.js.map +1 -0
  72. package/lib/commonjs/modules/next/bluetooth/store.js +61 -0
  73. package/lib/commonjs/modules/next/bluetooth/store.js.map +1 -0
  74. package/lib/commonjs/modules/next/bluetooth/transport.js +6 -0
  75. package/lib/commonjs/modules/next/bluetooth/transport.js.map +1 -0
  76. package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js +3 -1
  77. package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -1
  78. package/lib/module/modules/bt-management/components/bluetooth-device-picker.js +9 -141
  79. package/lib/module/modules/bt-management/components/bluetooth-device-picker.js.map +1 -1
  80. package/lib/module/modules/bt-management/components/device-picker-sheet.js +154 -0
  81. package/lib/module/modules/bt-management/components/device-picker-sheet.js.map +1 -0
  82. package/lib/module/modules/bt-management/hooks/use-bluetooth-permission.js +4 -3
  83. package/lib/module/modules/bt-management/hooks/use-bluetooth-permission.js.map +1 -1
  84. package/lib/module/modules/bt-management/hooks/use-measurements.js +1 -1
  85. package/lib/module/modules/bt-management/hooks/use-measurements.js.map +1 -1
  86. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +1 -1
  87. package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
  88. package/lib/module/modules/bt-management/utils/bluetooth-permission-list.js +14 -0
  89. package/lib/module/modules/bt-management/utils/bluetooth-permission-list.js.map +1 -0
  90. package/lib/module/modules/bt-management/utils/result-identity.js +3 -25
  91. package/lib/module/modules/bt-management/utils/result-identity.js.map +1 -1
  92. package/lib/module/modules/next/bluetooth/auto-connect.js +28 -0
  93. package/lib/module/modules/next/bluetooth/auto-connect.js.map +1 -0
  94. package/lib/module/modules/next/bluetooth/ble-plx/ble-errors.js +28 -0
  95. package/lib/module/modules/next/bluetooth/ble-plx/ble-errors.js.map +1 -0
  96. package/lib/module/modules/next/bluetooth/ble-plx/ble-link.js +122 -0
  97. package/lib/module/modules/next/bluetooth/ble-plx/ble-link.js.map +1 -0
  98. package/lib/module/modules/next/bluetooth/ble-plx/ble-scanner.js +69 -0
  99. package/lib/module/modules/next/bluetooth/ble-plx/ble-scanner.js.map +1 -0
  100. package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js +31 -0
  101. package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -0
  102. package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js +63 -0
  103. package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -0
  104. package/lib/module/modules/next/bluetooth/connections.js +106 -0
  105. package/lib/module/modules/next/bluetooth/connections.js.map +1 -0
  106. package/lib/module/modules/next/bluetooth/daily-total-day.js.map +1 -0
  107. package/lib/module/modules/next/bluetooth/devices.js +37 -0
  108. package/lib/module/modules/next/bluetooth/devices.js.map +1 -0
  109. package/lib/module/modules/next/bluetooth/driver.js +23 -20
  110. package/lib/module/modules/next/bluetooth/driver.js.map +1 -1
  111. package/lib/module/modules/next/bluetooth/errors.js +21 -0
  112. package/lib/module/modules/next/bluetooth/errors.js.map +1 -0
  113. package/lib/module/modules/next/bluetooth/index.js +21 -3
  114. package/lib/module/modules/next/bluetooth/index.js.map +1 -1
  115. package/lib/module/modules/next/bluetooth/link.js +0 -101
  116. package/lib/module/modules/next/bluetooth/link.js.map +1 -1
  117. package/lib/module/modules/next/bluetooth/paired.js +46 -0
  118. package/lib/module/modules/next/bluetooth/paired.js.map +1 -0
  119. package/lib/module/modules/next/bluetooth/permissions.js +2 -0
  120. package/lib/module/modules/next/bluetooth/permissions.js.map +1 -0
  121. package/lib/module/modules/next/bluetooth/react/bluetooth-device-picker.js +39 -0
  122. package/lib/module/modules/next/bluetooth/react/bluetooth-device-picker.js.map +1 -0
  123. package/lib/module/modules/next/bluetooth/react/context.js +48 -0
  124. package/lib/module/modules/next/bluetooth/react/context.js.map +1 -0
  125. package/lib/module/modules/next/bluetooth/react/hooks.js +76 -0
  126. package/lib/module/modules/next/bluetooth/react/hooks.js.map +1 -0
  127. package/lib/module/modules/next/bluetooth/react-native/create-bluetooth-runtime.js +25 -0
  128. package/lib/module/modules/next/bluetooth/react-native/create-bluetooth-runtime.js.map +1 -0
  129. package/lib/module/modules/next/bluetooth/react-native/os-permissions.js +28 -0
  130. package/lib/module/modules/next/bluetooth/react-native/os-permissions.js.map +1 -0
  131. package/lib/module/modules/next/bluetooth/react-native/ovok-sink.js +28 -0
  132. package/lib/module/modules/next/bluetooth/react-native/ovok-sink.js.map +1 -0
  133. package/lib/module/modules/next/bluetooth/readings.js +88 -0
  134. package/lib/module/modules/next/bluetooth/readings.js.map +1 -0
  135. package/lib/module/modules/next/bluetooth/result-policy.js +6 -1
  136. package/lib/module/modules/next/bluetooth/result-policy.js.map +1 -1
  137. package/lib/module/modules/next/bluetooth/runtime.js +220 -0
  138. package/lib/module/modules/next/bluetooth/runtime.js.map +1 -0
  139. package/lib/module/modules/next/bluetooth/scan-loop.js +78 -0
  140. package/lib/module/modules/next/bluetooth/scan-loop.js.map +1 -0
  141. package/lib/module/modules/next/bluetooth/sink.js +4 -0
  142. package/lib/module/modules/next/bluetooth/sink.js.map +1 -0
  143. package/lib/module/modules/next/bluetooth/snapshot.js +4 -0
  144. package/lib/module/modules/next/bluetooth/snapshot.js.map +1 -0
  145. package/lib/module/modules/next/bluetooth/stable-hash.js +28 -0
  146. package/lib/module/modules/next/bluetooth/stable-hash.js.map +1 -0
  147. package/lib/module/modules/next/bluetooth/store.js +57 -0
  148. package/lib/module/modules/next/bluetooth/store.js.map +1 -0
  149. package/lib/module/modules/next/bluetooth/transport.js +4 -0
  150. package/lib/module/modules/next/bluetooth/transport.js.map +1 -0
  151. package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -1
  152. package/lib/typescript/commonjs/src/modules/bt-management/components/bluetooth-device-picker.d.ts +1 -1
  153. package/lib/typescript/commonjs/src/modules/bt-management/components/bluetooth-device-picker.d.ts.map +1 -1
  154. package/lib/typescript/commonjs/src/modules/bt-management/components/device-picker-sheet.d.ts +25 -0
  155. package/lib/typescript/commonjs/src/modules/bt-management/components/device-picker-sheet.d.ts.map +1 -0
  156. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-permission.d.ts.map +1 -1
  157. package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -1
  158. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  159. package/lib/typescript/commonjs/src/modules/bt-management/utils/bluetooth-permission-list.d.ts +4 -0
  160. package/lib/typescript/commonjs/src/modules/bt-management/utils/bluetooth-permission-list.d.ts.map +1 -0
  161. package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts.map +1 -1
  162. package/lib/typescript/commonjs/src/modules/next/bluetooth/auto-connect.d.ts +10 -0
  163. package/lib/typescript/commonjs/src/modules/next/bluetooth/auto-connect.d.ts.map +1 -0
  164. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts +4 -0
  165. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts.map +1 -0
  166. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-link.d.ts +6 -0
  167. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-link.d.ts.map +1 -0
  168. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts +10 -0
  169. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts.map +1 -0
  170. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +6 -0
  171. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -0
  172. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +8 -0
  173. package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -0
  174. package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts +25 -0
  175. package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts.map +1 -0
  176. package/lib/typescript/commonjs/src/modules/next/bluetooth/daily-total-day.d.ts.map +1 -0
  177. package/lib/typescript/commonjs/src/modules/next/bluetooth/devices.d.ts +30 -0
  178. package/lib/typescript/commonjs/src/modules/next/bluetooth/devices.d.ts.map +1 -0
  179. package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts +21 -19
  180. package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts.map +1 -1
  181. package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts +17 -0
  182. package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts.map +1 -0
  183. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +32 -3
  184. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -1
  185. package/lib/typescript/commonjs/src/modules/next/bluetooth/link.d.ts +2 -4
  186. package/lib/typescript/commonjs/src/modules/next/bluetooth/link.d.ts.map +1 -1
  187. package/lib/typescript/commonjs/src/modules/next/bluetooth/paired.d.ts +18 -0
  188. package/lib/typescript/commonjs/src/modules/next/bluetooth/paired.d.ts.map +1 -0
  189. package/lib/typescript/commonjs/src/modules/next/bluetooth/permissions.d.ts +13 -0
  190. package/lib/typescript/commonjs/src/modules/next/bluetooth/permissions.d.ts.map +1 -0
  191. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts +35 -0
  192. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts.map +1 -0
  193. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/context.d.ts +30 -0
  194. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/context.d.ts.map +1 -0
  195. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/hooks.d.ts +47 -0
  196. package/lib/typescript/commonjs/src/modules/next/bluetooth/react/hooks.d.ts.map +1 -0
  197. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts +21 -0
  198. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts.map +1 -0
  199. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/os-permissions.d.ts +5 -0
  200. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/os-permissions.d.ts.map +1 -0
  201. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/ovok-sink.d.ts +6 -0
  202. package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/ovok-sink.d.ts.map +1 -0
  203. package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts +21 -0
  204. package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts.map +1 -0
  205. package/lib/typescript/commonjs/src/modules/next/bluetooth/result-policy.d.ts +3 -0
  206. package/lib/typescript/commonjs/src/modules/next/bluetooth/result-policy.d.ts.map +1 -1
  207. package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts +87 -0
  208. package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts.map +1 -0
  209. package/lib/typescript/commonjs/src/modules/next/bluetooth/scan-loop.d.ts +23 -0
  210. package/lib/typescript/commonjs/src/modules/next/bluetooth/scan-loop.d.ts.map +1 -0
  211. package/lib/typescript/commonjs/src/modules/next/bluetooth/sink.d.ts +20 -0
  212. package/lib/typescript/commonjs/src/modules/next/bluetooth/sink.d.ts.map +1 -0
  213. package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts +69 -0
  214. package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts.map +1 -0
  215. package/lib/typescript/commonjs/src/modules/next/bluetooth/stable-hash.d.ts +3 -0
  216. package/lib/typescript/commonjs/src/modules/next/bluetooth/stable-hash.d.ts.map +1 -0
  217. package/lib/typescript/commonjs/src/modules/next/bluetooth/store.d.ts +16 -0
  218. package/lib/typescript/commonjs/src/modules/next/bluetooth/store.d.ts.map +1 -0
  219. package/lib/typescript/commonjs/src/modules/next/bluetooth/transport.d.ts +31 -0
  220. package/lib/typescript/commonjs/src/modules/next/bluetooth/transport.d.ts.map +1 -0
  221. package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -1
  222. package/lib/typescript/module/src/modules/bt-management/components/bluetooth-device-picker.d.ts +1 -1
  223. package/lib/typescript/module/src/modules/bt-management/components/bluetooth-device-picker.d.ts.map +1 -1
  224. package/lib/typescript/module/src/modules/bt-management/components/device-picker-sheet.d.ts +25 -0
  225. package/lib/typescript/module/src/modules/bt-management/components/device-picker-sheet.d.ts.map +1 -0
  226. package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-permission.d.ts.map +1 -1
  227. package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -1
  228. package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
  229. package/lib/typescript/module/src/modules/bt-management/utils/bluetooth-permission-list.d.ts +4 -0
  230. package/lib/typescript/module/src/modules/bt-management/utils/bluetooth-permission-list.d.ts.map +1 -0
  231. package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts.map +1 -1
  232. package/lib/typescript/module/src/modules/next/bluetooth/auto-connect.d.ts +10 -0
  233. package/lib/typescript/module/src/modules/next/bluetooth/auto-connect.d.ts.map +1 -0
  234. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts +4 -0
  235. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts.map +1 -0
  236. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-link.d.ts +6 -0
  237. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-link.d.ts.map +1 -0
  238. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts +10 -0
  239. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts.map +1 -0
  240. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +6 -0
  241. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -0
  242. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +8 -0
  243. package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -0
  244. package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts +25 -0
  245. package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts.map +1 -0
  246. package/lib/typescript/module/src/modules/next/bluetooth/daily-total-day.d.ts.map +1 -0
  247. package/lib/typescript/module/src/modules/next/bluetooth/devices.d.ts +30 -0
  248. package/lib/typescript/module/src/modules/next/bluetooth/devices.d.ts.map +1 -0
  249. package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts +21 -19
  250. package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts.map +1 -1
  251. package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts +17 -0
  252. package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts.map +1 -0
  253. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +32 -3
  254. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -1
  255. package/lib/typescript/module/src/modules/next/bluetooth/link.d.ts +2 -4
  256. package/lib/typescript/module/src/modules/next/bluetooth/link.d.ts.map +1 -1
  257. package/lib/typescript/module/src/modules/next/bluetooth/paired.d.ts +18 -0
  258. package/lib/typescript/module/src/modules/next/bluetooth/paired.d.ts.map +1 -0
  259. package/lib/typescript/module/src/modules/next/bluetooth/permissions.d.ts +13 -0
  260. package/lib/typescript/module/src/modules/next/bluetooth/permissions.d.ts.map +1 -0
  261. package/lib/typescript/module/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts +35 -0
  262. package/lib/typescript/module/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts.map +1 -0
  263. package/lib/typescript/module/src/modules/next/bluetooth/react/context.d.ts +30 -0
  264. package/lib/typescript/module/src/modules/next/bluetooth/react/context.d.ts.map +1 -0
  265. package/lib/typescript/module/src/modules/next/bluetooth/react/hooks.d.ts +47 -0
  266. package/lib/typescript/module/src/modules/next/bluetooth/react/hooks.d.ts.map +1 -0
  267. package/lib/typescript/module/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts +21 -0
  268. package/lib/typescript/module/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts.map +1 -0
  269. package/lib/typescript/module/src/modules/next/bluetooth/react-native/os-permissions.d.ts +5 -0
  270. package/lib/typescript/module/src/modules/next/bluetooth/react-native/os-permissions.d.ts.map +1 -0
  271. package/lib/typescript/module/src/modules/next/bluetooth/react-native/ovok-sink.d.ts +6 -0
  272. package/lib/typescript/module/src/modules/next/bluetooth/react-native/ovok-sink.d.ts.map +1 -0
  273. package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts +21 -0
  274. package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts.map +1 -0
  275. package/lib/typescript/module/src/modules/next/bluetooth/result-policy.d.ts +3 -0
  276. package/lib/typescript/module/src/modules/next/bluetooth/result-policy.d.ts.map +1 -1
  277. package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts +87 -0
  278. package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts.map +1 -0
  279. package/lib/typescript/module/src/modules/next/bluetooth/scan-loop.d.ts +23 -0
  280. package/lib/typescript/module/src/modules/next/bluetooth/scan-loop.d.ts.map +1 -0
  281. package/lib/typescript/module/src/modules/next/bluetooth/sink.d.ts +20 -0
  282. package/lib/typescript/module/src/modules/next/bluetooth/sink.d.ts.map +1 -0
  283. package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts +69 -0
  284. package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts.map +1 -0
  285. package/lib/typescript/module/src/modules/next/bluetooth/stable-hash.d.ts +3 -0
  286. package/lib/typescript/module/src/modules/next/bluetooth/stable-hash.d.ts.map +1 -0
  287. package/lib/typescript/module/src/modules/next/bluetooth/store.d.ts +16 -0
  288. package/lib/typescript/module/src/modules/next/bluetooth/store.d.ts.map +1 -0
  289. package/lib/typescript/module/src/modules/next/bluetooth/transport.d.ts +31 -0
  290. package/lib/typescript/module/src/modules/next/bluetooth/transport.d.ts.map +1 -0
  291. package/package.json +2 -2
  292. package/lib/commonjs/modules/bt-management/utils/daily-total-day.js.map +0 -1
  293. package/lib/commonjs/modules/next/bluetooth/drivers.js +0 -20
  294. package/lib/commonjs/modules/next/bluetooth/drivers.js.map +0 -1
  295. package/lib/commonjs/modules/next/bluetooth/legacy-driver.js +0 -55
  296. package/lib/commonjs/modules/next/bluetooth/legacy-driver.js.map +0 -1
  297. package/lib/module/modules/bt-management/utils/daily-total-day.js.map +0 -1
  298. package/lib/module/modules/next/bluetooth/drivers.js +0 -17
  299. package/lib/module/modules/next/bluetooth/drivers.js.map +0 -1
  300. package/lib/module/modules/next/bluetooth/legacy-driver.js +0 -51
  301. package/lib/module/modules/next/bluetooth/legacy-driver.js.map +0 -1
  302. package/lib/typescript/commonjs/src/modules/bt-management/utils/daily-total-day.d.ts.map +0 -1
  303. package/lib/typescript/commonjs/src/modules/next/bluetooth/drivers.d.ts +0 -7
  304. package/lib/typescript/commonjs/src/modules/next/bluetooth/drivers.d.ts.map +0 -1
  305. package/lib/typescript/commonjs/src/modules/next/bluetooth/legacy-driver.d.ts +0 -8
  306. package/lib/typescript/commonjs/src/modules/next/bluetooth/legacy-driver.d.ts.map +0 -1
  307. package/lib/typescript/module/src/modules/bt-management/utils/daily-total-day.d.ts.map +0 -1
  308. package/lib/typescript/module/src/modules/next/bluetooth/drivers.d.ts +0 -7
  309. package/lib/typescript/module/src/modules/next/bluetooth/drivers.d.ts.map +0 -1
  310. package/lib/typescript/module/src/modules/next/bluetooth/legacy-driver.d.ts +0 -8
  311. package/lib/typescript/module/src/modules/next/bluetooth/legacy-driver.d.ts.map +0 -1
  312. /package/lib/commonjs/modules/{bt-management/utils → next/bluetooth}/daily-total-day.js +0 -0
  313. /package/lib/module/modules/{bt-management/utils → next/bluetooth}/daily-total-day.js +0 -0
  314. /package/lib/typescript/commonjs/src/modules/{bt-management/utils → next/bluetooth}/daily-total-day.d.ts +0 -0
  315. /package/lib/typescript/module/src/modules/{bt-management/utils → next/bluetooth}/daily-total-day.d.ts +0 -0
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+
3
+ import * as React from "react";
4
+ import { AppState } from "react-native";
5
+ import { useBluetooth } from "./context.js";
6
+
7
+ /** One slice of the runtime snapshot, re-rendering only when that slice changes. */
8
+ const useSnapshot = select => {
9
+ const runtime = useBluetooth();
10
+ const read = () => select(runtime.getSnapshot());
11
+ return React.useSyncExternalStore(runtime.subscribe, read, read);
12
+ };
13
+
14
+ /**
15
+ * The Bluetooth adapter state.
16
+ *
17
+ * @group Hooks
18
+ */
19
+ const useBluetoothState = () => useSnapshot(snapshot => snapshot.adapter);
20
+
21
+ /**
22
+ * The Bluetooth permission, re-checked whenever the app returns to the foreground; `unknown` until first checked.
23
+ *
24
+ * @group Hooks
25
+ */
26
+ const useBluetoothPermission = () => {
27
+ const runtime = useBluetooth();
28
+ React.useEffect(() => {
29
+ const subscription = AppState.addEventListener("change", state => {
30
+ if (state === "active") {
31
+ runtime.checkPermission().catch(() => undefined);
32
+ }
33
+ });
34
+ return () => subscription.remove();
35
+ }, [runtime]);
36
+ return useSnapshot(snapshot => snapshot.permission);
37
+ };
38
+
39
+ /**
40
+ * Whether a scan is requested.
41
+ *
42
+ * @group Hooks
43
+ */
44
+ const useScanning = () => useSnapshot(snapshot => snapshot.scanning);
45
+
46
+ /**
47
+ * The supported devices the scan found, each with its connection state.
48
+ *
49
+ * @group Hooks
50
+ */
51
+ const useNearbyDevices = () => useSnapshot(snapshot => snapshot.devices);
52
+
53
+ /**
54
+ * One found device, or `null` until the scan finds it.
55
+ *
56
+ * @group Hooks
57
+ */
58
+ const useNearbyDevice = deviceId => useSnapshot(snapshot => snapshot.devices.find(({
59
+ id
60
+ }) => id === deviceId) ?? null);
61
+
62
+ /**
63
+ * IDs of the paired devices.
64
+ *
65
+ * @group Hooks
66
+ */
67
+ const usePairedDevices = () => useSnapshot(snapshot => snapshot.paired);
68
+
69
+ /**
70
+ * The recent readings, oldest first, each with its save state.
71
+ *
72
+ * @group Hooks
73
+ */
74
+ const useMeasurements = () => useSnapshot(snapshot => snapshot.readings);
75
+ export { useBluetoothPermission, useBluetoothState, useMeasurements, useNearbyDevice, useNearbyDevices, usePairedDevices, useScanning };
76
+ //# sourceMappingURL=hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","AppState","useBluetooth","useSnapshot","select","runtime","read","getSnapshot","useSyncExternalStore","subscribe","useBluetoothState","snapshot","adapter","useBluetoothPermission","useEffect","subscription","addEventListener","state","checkPermission","catch","undefined","remove","permission","useScanning","scanning","useNearbyDevices","devices","useNearbyDevice","deviceId","find","id","usePairedDevices","paired","useMeasurements","readings"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react/hooks.ts"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,cAAc;AAMvC,SAASC,YAAY,QAAQ,cAAW;;AAExC;AACA,MAAMC,WAAW,GAAWC,MAA8C,IAAY;EACpF,MAAMC,OAAO,GAAGH,YAAY,CAAC,CAAC;EAC9B,MAAMI,IAAI,GAAGA,CAAA,KAAMF,MAAM,CAACC,OAAO,CAACE,WAAW,CAAC,CAAC,CAAC;EAEhD,OAAOP,KAAK,CAACQ,oBAAoB,CAACH,OAAO,CAACI,SAAS,EAAEH,IAAI,EAAEA,IAAI,CAAC;AAClE,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMI,iBAAiB,GAAGA,CAAA,KAAoBP,WAAW,CAAEQ,QAAQ,IAAKA,QAAQ,CAACC,OAAO,CAAC;;AAEzF;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAAGA,CAAA,KAAuC;EACpE,MAAMR,OAAO,GAAGH,YAAY,CAAC,CAAC;EAE9BF,KAAK,CAACc,SAAS,CAAC,MAAM;IACpB,MAAMC,YAAY,GAAGd,QAAQ,CAACe,gBAAgB,CAAC,QAAQ,EAAGC,KAAK,IAAK;MAClE,IAAIA,KAAK,KAAK,QAAQ,EAAE;QACtBZ,OAAO,CAACa,eAAe,CAAC,CAAC,CAACC,KAAK,CAAC,MAAMC,SAAS,CAAC;MAClD;IACF,CAAC,CAAC;IAEF,OAAO,MAAML,YAAY,CAACM,MAAM,CAAC,CAAC;EACpC,CAAC,EAAE,CAAChB,OAAO,CAAC,CAAC;EAEb,OAAOF,WAAW,CAAEQ,QAAQ,IAAKA,QAAQ,CAACW,UAAU,CAAC;AACvD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW,GAAGA,CAAA,KAAepB,WAAW,CAAEQ,QAAQ,IAAKA,QAAQ,CAACa,QAAQ,CAAC;;AAE/E;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAA,KAA+BtB,WAAW,CAAEQ,QAAQ,IAAKA,QAAQ,CAACe,OAAO,CAAC;;AAEnG;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAIC,QAAgB,IACvCzB,WAAW,CAAEQ,QAAQ,IAAKA,QAAQ,CAACe,OAAO,CAACG,IAAI,CAAC,CAAC;EAAEC;AAAG,CAAC,KAAKA,EAAE,KAAKF,QAAQ,CAAC,IAAI,IAAI,CAAC;;AAEvF;AACA;AACA;AACA;AACA;AACA,MAAMG,gBAAgB,GAAGA,CAAA,KAAyB5B,WAAW,CAAEQ,QAAQ,IAAKA,QAAQ,CAACqB,MAAM,CAAC;;AAE5F;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAGA,CAAA,KAAgC9B,WAAW,CAAEQ,QAAQ,IAAKA,QAAQ,CAACuB,QAAQ,CAAC;AAEpG,SACErB,sBAAsB,EACtBH,iBAAiB,EACjBuB,eAAe,EACfN,eAAe,EACfF,gBAAgB,EAChBM,gBAAgB,EAChBR,WAAW","ignoreList":[]}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ import { bleManagerScanner } from "../ble-plx/ble-scanner.js";
4
+ import { BluetoothRuntime } from "../runtime.js";
5
+ import { osBluetoothPermissions } from "./os-permissions.js";
6
+ import { ovokReadingSink } from "./ovok-sink.js";
7
+
8
+ /** What `createBluetoothRuntime` needs. */
9
+
10
+ /** A `BluetoothRuntime` wired for React Native: BLE through `bleManager`, OS permissions, saving through `client`. */
11
+ const createBluetoothRuntime = ({
12
+ client,
13
+ bleManager,
14
+ devices,
15
+ resultPolicy
16
+ }) => new BluetoothRuntime({
17
+ scanner: bleManagerScanner(bleManager),
18
+ permissions: osBluetoothPermissions(),
19
+ sink: ovokReadingSink(client),
20
+ devices,
21
+ resultPolicy,
22
+ pairedStorage: client.storage
23
+ });
24
+ export { createBluetoothRuntime };
25
+ //# sourceMappingURL=create-bluetooth-runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["bleManagerScanner","BluetoothRuntime","osBluetoothPermissions","ovokReadingSink","createBluetoothRuntime","client","bleManager","devices","resultPolicy","scanner","permissions","sink","pairedStorage","storage"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react-native/create-bluetooth-runtime.ts"],"mappings":";;AAIA,SAASA,iBAAiB,QAAQ,2BAAwB;AAG1D,SAASC,gBAAgB,QAAQ,eAAY;AAE7C,SAASC,sBAAsB,QAAQ,qBAAkB;AACzD,SAASC,eAAe,QAAQ,gBAAa;;AAE7C;;AAgBA;AACA,MAAMC,sBAAsB,GAAGA,CAAC;EAC9BC,MAAM;EACNC,UAAU;EACVC,OAAO;EACPC;AAC6B,CAAC,KAC9B,IAAIP,gBAAgB,CAAC;EACnBQ,OAAO,EAAET,iBAAiB,CAACM,UAAU,CAAC;EACtCI,WAAW,EAAER,sBAAsB,CAAC,CAAC;EACrCS,IAAI,EAAER,eAAe,CAACE,MAAM,CAAC;EAC7BE,OAAO;EACPC,YAAY;EACZI,aAAa,EAAEP,MAAM,CAACQ;AACxB,CAAC,CAAC;AAEJ,SAAST,sBAAsB","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ import { Linking } from "react-native";
4
+ import { checkMultiple, requestMultiple } from "react-native-permissions";
5
+ import { bluetoothPermissionList } from "../../../bt-management/utils/bluetooth-permission-list.js";
6
+ const GRANTED = new Set(["granted", "limited"]);
7
+ const permissionOf = (permissions, results) => {
8
+ const statuses = permissions.map(permission => results[permission]);
9
+ if (statuses.length > 0 && statuses.every(status => status !== undefined && GRANTED.has(status))) {
10
+ return "granted";
11
+ }
12
+ return statuses.includes("blocked") ? "blocked" : "denied";
13
+ };
14
+
15
+ /** The platform's Bluetooth permissions through `react-native-permissions`. */
16
+ const osBluetoothPermissions = () => ({
17
+ check: async () => {
18
+ const permissions = bluetoothPermissionList();
19
+ return permissionOf(permissions, await checkMultiple(permissions));
20
+ },
21
+ request: async () => {
22
+ const permissions = bluetoothPermissionList();
23
+ return permissionOf(permissions, await requestMultiple(permissions));
24
+ },
25
+ openSettings: () => Linking.openSettings()
26
+ });
27
+ export { osBluetoothPermissions };
28
+ //# sourceMappingURL=os-permissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Linking","checkMultiple","requestMultiple","bluetoothPermissionList","GRANTED","Set","permissionOf","permissions","results","statuses","map","permission","length","every","status","undefined","has","includes","osBluetoothPermissions","check","request","openSettings"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react-native/os-permissions.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,cAAc;AACtC,SAASC,aAAa,EAAgCC,eAAe,QAAQ,0BAA0B;AAEvG,SAASC,uBAAuB,QAAQ,2DAAwD;AAGhG,MAAMC,OAAsC,GAAG,IAAIC,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAE9E,MAAMC,YAAY,GAAGA,CACnBC,WAAkC,EAClCC,OAAsD,KAC9B;EACxB,MAAMC,QAAQ,GAAGF,WAAW,CAACG,GAAG,CAAEC,UAAU,IAAKH,OAAO,CAACG,UAAU,CAAC,CAAC;EAErE,IAAIF,QAAQ,CAACG,MAAM,GAAG,CAAC,IAAIH,QAAQ,CAACI,KAAK,CAAEC,MAAM,IAAKA,MAAM,KAAKC,SAAS,IAAIX,OAAO,CAACY,GAAG,CAACF,MAAM,CAAC,CAAC,EAAE;IAClG,OAAO,SAAS;EAClB;EAEA,OAAOL,QAAQ,CAACQ,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS,GAAG,QAAQ;AAC5D,CAAC;;AAED;AACA,MAAMC,sBAAsB,GAAGA,CAAA,MAA6B;EAC1DC,KAAK,EAAE,MAAAA,CAAA,KAAY;IACjB,MAAMZ,WAAW,GAAGJ,uBAAuB,CAAC,CAAC;IAE7C,OAAOG,YAAY,CAACC,WAAW,EAAE,MAAMN,aAAa,CAACM,WAAW,CAAC,CAAC;EACpE,CAAC;EACDa,OAAO,EAAE,MAAAA,CAAA,KAAY;IACnB,MAAMb,WAAW,GAAGJ,uBAAuB,CAAC,CAAC;IAE7C,OAAOG,YAAY,CAACC,WAAW,EAAE,MAAML,eAAe,CAACK,WAAW,CAAC,CAAC;EACtE,CAAC;EACDc,YAAY,EAAEA,CAAA,KAAMrB,OAAO,CAACqB,YAAY,CAAC;AAC3C,CAAC,CAAC;AAEF,SAASH,sBAAsB","ignoreList":[]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ /** Saves readings for the signed-in account through the `Ovok` measurements API. */
4
+ const ovokReadingSink = client => ({
5
+ save: async ({
6
+ id,
7
+ device,
8
+ measurement
9
+ }) => {
10
+ const result = await client.measurements.save({
11
+ measurement,
12
+ sourceId: id,
13
+ device: {
14
+ id: device.id,
15
+ name: device.key,
16
+ localName: device.name,
17
+ manufacturerData: "",
18
+ sn: ""
19
+ }
20
+ });
21
+ return result.status === "saved" ? {
22
+ status: "saved"
23
+ } : result;
24
+ },
25
+ flushQueued: async () => Object.keys((await client.measurements.offlineQueue.flush()).responses)
26
+ });
27
+ export { ovokReadingSink };
28
+ //# sourceMappingURL=ovok-sink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ovokReadingSink","client","save","id","device","measurement","result","measurements","sourceId","name","key","localName","manufacturerData","sn","status","flushQueued","Object","keys","offlineQueue","flush","responses"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react-native/ovok-sink.ts"],"mappings":";;AAIA;AACA,MAAMA,eAAe,GAAIC,MAAY,KAAmB;EACtDC,IAAI,EAAE,MAAAA,CAAO;IAAEC,EAAE;IAAEC,MAAM;IAAEC;EAAY,CAAC,KAAK;IAC3C,MAAMC,MAAM,GAAG,MAAML,MAAM,CAACM,YAAY,CAACL,IAAI,CAAC;MAC5CG,WAAW;MACXG,QAAQ,EAAEL,EAAE;MACZC,MAAM,EAAE;QAAED,EAAE,EAAEC,MAAM,CAACD,EAAE;QAAEM,IAAI,EAAEL,MAAM,CAACM,GAAG;QAAEC,SAAS,EAAEP,MAAM,CAACK,IAAI;QAAEG,gBAAgB,EAAE,EAAE;QAAEC,EAAE,EAAE;MAAG;IAClG,CAAC,CAAC;IAEF,OAAOP,MAAM,CAACQ,MAAM,KAAK,OAAO,GAAG;MAAEA,MAAM,EAAE;IAAQ,CAAC,GAAGR,MAAM;EACjE,CAAC;EACDS,WAAW,EAAE,MAAAA,CAAA,KAAYC,MAAM,CAACC,IAAI,CAAC,CAAC,MAAMhB,MAAM,CAACM,YAAY,CAACW,YAAY,CAACC,KAAK,CAAC,CAAC,EAAEC,SAAS;AACjG,CAAC,CAAC;AAEF,SAASpB,eAAe","ignoreList":[]}
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+
3
+ import { BluetoothError } from "./errors.js";
4
+ const KEPT_READINGS = 100;
5
+
6
+ /** How many recent reading IDs a resend is checked against. */
7
+ const RECOGNISED_READINGS = 1_000;
8
+ const saveFailed = error => new BluetoothError("save-failed", error instanceof Error ? error.message : String(error), error);
9
+
10
+ /** Keeps the recent readings, each resend once, and saves every new one through the sink. */
11
+ class ReadingLog {
12
+ recent = new Set();
13
+ sequence = 0;
14
+ constructor(store, sink) {
15
+ this.store = store;
16
+ this.sink = sink;
17
+ }
18
+
19
+ /** `id` is `null` for a reading that cannot be recognised when resent. */
20
+ receive(device, id, measurement) {
21
+ if (id !== null && !this.remember(id)) {
22
+ return;
23
+ }
24
+ const receivedAt = new Date();
25
+ const reading = {
26
+ id: id ?? `${device.id}:${receivedAt.getTime()}:${this.sequence += 1}`,
27
+ device: {
28
+ id: device.id,
29
+ key: device.key,
30
+ name: device.name
31
+ },
32
+ measurement,
33
+ receivedAt,
34
+ save: {
35
+ status: "saving"
36
+ }
37
+ };
38
+ this.store.set({
39
+ readings: [...this.store.get().readings, reading].slice(-KEPT_READINGS)
40
+ });
41
+ void this.save(reading);
42
+ }
43
+
44
+ /** Saves the readings whose save failed again and flushes the sink's offline queue. */
45
+ async retrySaves() {
46
+ const failed = this.store.get().readings.filter(({
47
+ save
48
+ }) => save.status === "failed");
49
+ this.store.updateReadings(reading => failed.includes(reading) ? {
50
+ ...reading,
51
+ save: {
52
+ status: "saving"
53
+ }
54
+ } : reading);
55
+ await Promise.all(failed.map(reading => this.save(reading)));
56
+ const flushed = new Set(await this.sink.flushQueued());
57
+ this.store.updateReadings(reading => reading.save.status === "queued" && flushed.has(reading.save.queueId) ? {
58
+ ...reading,
59
+ save: {
60
+ status: "saved"
61
+ }
62
+ } : reading);
63
+ }
64
+
65
+ /** Records `id`; false when it is a resend of a recent reading. */
66
+ remember(id) {
67
+ if (this.recent.has(id)) {
68
+ return false;
69
+ }
70
+ this.recent.add(id);
71
+ if (this.recent.size > RECOGNISED_READINGS) {
72
+ this.recent.delete(this.recent.values().next().value);
73
+ }
74
+ return true;
75
+ }
76
+ async save(reading) {
77
+ const save = await this.sink.save(reading).then(result => result, error => ({
78
+ status: "failed",
79
+ error: saveFailed(error)
80
+ }));
81
+ this.store.updateReadings(current => current.id === reading.id ? {
82
+ ...current,
83
+ save
84
+ } : current);
85
+ }
86
+ }
87
+ export { ReadingLog };
88
+ //# sourceMappingURL=readings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BluetoothError","KEPT_READINGS","RECOGNISED_READINGS","saveFailed","error","Error","message","String","ReadingLog","recent","Set","sequence","constructor","store","sink","receive","device","id","measurement","remember","receivedAt","Date","reading","getTime","key","name","save","status","set","readings","get","slice","retrySaves","failed","filter","updateReadings","includes","Promise","all","map","flushed","flushQueued","has","queueId","add","size","delete","values","next","value","then","result","current"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/readings.ts"],"mappings":";;AAEA,SAASA,cAAc,QAAQ,aAAU;AAKzC,MAAMC,aAAa,GAAG,GAAG;;AAEzB;AACA,MAAMC,mBAAmB,GAAG,KAAK;AAEjC,MAAMC,UAAU,GAAIC,KAAc,IAChC,IAAIJ,cAAc,CAAC,aAAa,EAAEI,KAAK,YAAYC,KAAK,GAAGD,KAAK,CAACE,OAAO,GAAGC,MAAM,CAACH,KAAK,CAAC,EAAEA,KAAK,CAAC;;AAElG;AACA,MAAMI,UAAU,CAAC;EACEC,MAAM,GAAG,IAAIC,GAAG,CAAS,CAAC;EACnCC,QAAQ,GAAG,CAAC;EAEbC,WAAWA,CAAkBC,KAAoB,EAAmBC,IAAiB,EAAE;IAAA,KAA1DD,KAAoB,GAApBA,KAAoB;IAAA,KAAmBC,IAAiB,GAAjBA,IAAiB;EAAG;;EAE/F;EACOC,OAAOA,CAACC,MAAoB,EAAEC,EAAiB,EAAEC,WAAwB,EAAQ;IACtF,IAAID,EAAE,KAAK,IAAI,IAAI,CAAC,IAAI,CAACE,QAAQ,CAACF,EAAE,CAAC,EAAE;MACrC;IACF;IAEA,MAAMG,UAAU,GAAG,IAAIC,IAAI,CAAC,CAAC;IAE7B,MAAMC,OAAsB,GAAG;MAC7BL,EAAE,EAAEA,EAAE,IAAI,GAAGD,MAAM,CAACC,EAAE,IAAIG,UAAU,CAACG,OAAO,CAAC,CAAC,IAAK,IAAI,CAACZ,QAAQ,IAAI,CAAC,EAAG;MACxEK,MAAM,EAAE;QAAEC,EAAE,EAAED,MAAM,CAACC,EAAE;QAAEO,GAAG,EAAER,MAAM,CAACQ,GAAG;QAAEC,IAAI,EAAET,MAAM,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AAE;MAAQ;IAAE,CAAC,GACzCL,OAAO,CAAC;EAChB;;EAEA;EACQH,QAAQA,CAACF,EAAU,EAAW;IACpC,IAAI,IAAI,CAACR,MAAM,CAACiC,GAAG,CAACzB,EAAE,CAAC,EAAE;MACvB,OAAO,KAAK;IACd;IAEA,IAAI,CAACR,MAAM,CAACmC,GAAG,CAAC3B,EAAE,CAAC;IACnB,IAAI,IAAI,CAACR,MAAM,CAACoC,IAAI,GAAG3C,mBAAmB,EAAE;MAC1C,IAAI,CAACO,MAAM,CAACqC,MAAM,CAAC,IAAI,CAACrC,MAAM,CAACsC,MAAM,CAAC,CAAC,CAACC,IAAI,CAAC,CAAC,CAACC,KAAe,CAAC;IACjE;IAEA,OAAO,IAAI;EACb;EAEA,MAAcvB,IAAIA,CAACJ,OAAsB,EAAiB;IACxD,MAAMI,IAAe,GAAG,MAAM,IAAI,CAACZ,IAAI,CAACY,IAAI,CAACJ,OAAO,CAAC,CAAC4B,IAAI,CACvDC,MAAkB,IAAgBA,MAAM,EACxC/C,KAAc,KAAiB;MAAEuB,MAAM,EAAE,QAAQ;MAAEvB,KAAK,EAAED,UAAU,CAACC,KAAK;IAAE,CAAC,CAChF,CAAC;IAED,IAAI,CAACS,KAAK,CAACsB,cAAc,CAAEiB,OAAO,IAAMA,OAAO,CAACnC,EAAE,KAAKK,OAAO,CAACL,EAAE,GAAG;MAAE,GAAGmC,OAAO;MAAE1B;IAAK,CAAC,GAAG0B,OAAQ,CAAC;EACtG;AACF;AAEA,SAAS5C,UAAU","ignoreList":[]}
@@ -1,10 +1,13 @@
1
1
  "use strict";
2
2
 
3
- import { dailyTotalDay } from "../../bt-management/utils/daily-total-day.js";
3
+ import { dailyTotalDay } from "./daily-total-day.js";
4
4
 
5
5
  /** Makes, for each connection, the test of which readings to keep. */
6
6
 
7
+ /** Keeps every reading. */
7
8
  const everyReading = () => () => true;
9
+
10
+ /** Keeps the first reading of each measurement type per connection. */
8
11
  const firstReadingPerKind = () => {
9
12
  const reported = new Set();
10
13
  return ({
@@ -34,6 +37,8 @@ const dailyTotalsOnly = () => {
34
37
  return true;
35
38
  };
36
39
  };
40
+
41
+ /** Applies a policy per measurement type, and `fallback` to the other types. */
37
42
  const policyByKind = (policies, fallback = everyReading) => () => {
38
43
  const tests = new Map();
39
44
  const fallbackTest = fallback();
@@ -1 +1 @@
1
- {"version":3,"names":["dailyTotalDay","everyReading","firstReadingPerKind","reported","Set","measurementTypeKey","has","add","dailyTotalsOnly","reading","day","Date","now","undefined","key","policyByKind","policies","fallback","tests","Map","fallbackTest","policy","test","get","set","keepReadings","events","keep","event","kind"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/result-policy.ts"],"mappings":";;AAEA,SAASA,aAAa,QAAQ,8CAA2C;;AAIzE;;AAGA,MAAMC,YAA0B,GAAGA,CAAA,KAAM,MAAM,IAAI;AAEnD,MAAMC,mBAAiC,GAAGA,CAAA,KAAM;EAC9C,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAAqB,CAAC;EAE9C,OAAO,CAAC;IAAEC;EAAmB,CAAC,KAAK;IACjC,IAAIF,QAAQ,CAACG,GAAG,CAACD,kBAAkB,CAAC,EAAE;MACpC,OAAO,KAAK;IACd;IAEAF,QAAQ,CAACI,GAAG,CAACF,kBAAkB,CAAC;IAEhC,OAAO,IAAI;EACb,CAAC;AACH,CAAC;;AAED;AACA,MAAMG,eAA6B,GAAGA,CAAA,KAAM;EAC1C,MAAML,QAAQ,GAAG,IAAIC,GAAG,CAAS,CAAC;EAElC,OAAQK,OAAO,IAAK;IAClB,MAAMC,GAAG,GAAGV,aAAa,CAACS,OAAO,EAAEE,IAAI,CAACC,GAAG,CAAC,CAAC,CAAC;IAE9C,IAAIF,GAAG,KAAKG,SAAS,EAAE;MACrB,OAAO,IAAI;IACb;IAEA,MAAMC,GAAG,GAAG,GAAGL,OAAO,CAACJ,kBAAkB,IAAIK,GAAG,EAAE;IAElD,IAAIA,GAAG,KAAK,QAAQ,IAAIP,QAAQ,CAACG,GAAG,CAACQ,GAAG,CAAC,EAAE;MACzC,OAAO,KAAK;IACd;IAEAX,QAAQ,CAACI,GAAG,CAACO,GAAG,CAAC;IAEjB,OAAO,IAAI;EACb,CAAC;AACH,CAAC;AAED,MAAMC,YAAY,GAAGA,CACnBC,QAA2D,EAC3DC,QAAsB,GAAGhB,YAAY,KAErC,MAAM;EACJ,MAAMiB,KAAK,GAAG,IAAIC,GAAG,CAAwD,CAAC;EAC9E,MAAMC,YAAY,GAAGH,QAAQ,CAAC,CAAC;EAE/B,OAAQR,OAAO,IAAK;IAClB,MAAMY,MAAM,GAAGL,QAAQ,CAACP,OAAO,CAACJ,kBAAkB,CAAC;IAEnD,IAAI,CAACgB,MAAM,EAAE;MACX,OAAOD,YAAY,CAACX,OAAO,CAAC;IAC9B;IAEA,MAAMa,IAAI,GAAGJ,KAAK,CAACK,GAAG,CAACd,OAAO,CAACJ,kBAAkB,CAAC,IAAIgB,MAAM,CAAC,CAAC;IAE9DH,KAAK,CAACM,GAAG,CAACf,OAAO,CAACJ,kBAAkB,EAAEiB,IAAI,CAAC;IAE3C,OAAOA,IAAI,CAACb,OAAO,CAAC;EACtB,CAAC;AACH,CAAC;;AAEH;AACA,gBAAgBgB,YAAYA,CAACC,MAAkC,EAAEL,MAAoB,EAA8B;EACjH,MAAMM,IAAI,GAAGN,MAAM,CAAC,CAAC;EAErB,WAAW,MAAMO,KAAK,IAAIF,MAAM,EAAE;IAChC,IAAIE,KAAK,CAACC,IAAI,KAAK,SAAS,IAAIF,IAAI,CAACC,KAAK,CAACnB,OAAO,CAAC,EAAE;MACnD,MAAMmB,KAAK;IACb;EACF;AACF;AAEA,SAASpB,eAAe,EAAEP,YAAY,EAAEC,mBAAmB,EAAEuB,YAAY,EAAEV,YAAY","ignoreList":[]}
1
+ {"version":3,"names":["dailyTotalDay","everyReading","firstReadingPerKind","reported","Set","measurementTypeKey","has","add","dailyTotalsOnly","reading","day","Date","now","undefined","key","policyByKind","policies","fallback","tests","Map","fallbackTest","policy","test","get","set","keepReadings","events","keep","event","kind"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/result-policy.ts"],"mappings":";;AAEA,SAASA,aAAa,QAAQ,sBAAmB;;AAGjD;;AAGA;AACA,MAAMC,YAA0B,GAAGA,CAAA,KAAM,MAAM,IAAI;;AAEnD;AACA,MAAMC,mBAAiC,GAAGA,CAAA,KAAM;EAC9C,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAAqB,CAAC;EAE9C,OAAO,CAAC;IAAEC;EAAmB,CAAC,KAAK;IACjC,IAAIF,QAAQ,CAACG,GAAG,CAACD,kBAAkB,CAAC,EAAE;MACpC,OAAO,KAAK;IACd;IAEAF,QAAQ,CAACI,GAAG,CAACF,kBAAkB,CAAC;IAEhC,OAAO,IAAI;EACb,CAAC;AACH,CAAC;;AAED;AACA,MAAMG,eAA6B,GAAGA,CAAA,KAAM;EAC1C,MAAML,QAAQ,GAAG,IAAIC,GAAG,CAAS,CAAC;EAElC,OAAQK,OAAO,IAAK;IAClB,MAAMC,GAAG,GAAGV,aAAa,CAACS,OAAO,EAAEE,IAAI,CAACC,GAAG,CAAC,CAAC,CAAC;IAE9C,IAAIF,GAAG,KAAKG,SAAS,EAAE;MACrB,OAAO,IAAI;IACb;IAEA,MAAMC,GAAG,GAAG,GAAGL,OAAO,CAACJ,kBAAkB,IAAIK,GAAG,EAAE;IAElD,IAAIA,GAAG,KAAK,QAAQ,IAAIP,QAAQ,CAACG,GAAG,CAACQ,GAAG,CAAC,EAAE;MACzC,OAAO,KAAK;IACd;IAEAX,QAAQ,CAACI,GAAG,CAACO,GAAG,CAAC;IAEjB,OAAO,IAAI;EACb,CAAC;AACH,CAAC;;AAED;AACA,MAAMC,YAAY,GAAGA,CACnBC,QAA2D,EAC3DC,QAAsB,GAAGhB,YAAY,KAErC,MAAM;EACJ,MAAMiB,KAAK,GAAG,IAAIC,GAAG,CAAwD,CAAC;EAC9E,MAAMC,YAAY,GAAGH,QAAQ,CAAC,CAAC;EAE/B,OAAQR,OAAO,IAAK;IAClB,MAAMY,MAAM,GAAGL,QAAQ,CAACP,OAAO,CAACJ,kBAAkB,CAAC;IAEnD,IAAI,CAACgB,MAAM,EAAE;MACX,OAAOD,YAAY,CAACX,OAAO,CAAC;IAC9B;IAEA,MAAMa,IAAI,GAAGJ,KAAK,CAACK,GAAG,CAACd,OAAO,CAACJ,kBAAkB,CAAC,IAAIgB,MAAM,CAAC,CAAC;IAE9DH,KAAK,CAACM,GAAG,CAACf,OAAO,CAACJ,kBAAkB,EAAEiB,IAAI,CAAC;IAE3C,OAAOA,IAAI,CAACb,OAAO,CAAC;EACtB,CAAC;AACH,CAAC;;AAEH;AACA,gBAAgBgB,YAAYA,CAACC,MAAkC,EAAEL,MAAoB,EAA8B;EACjH,MAAMM,IAAI,GAAGN,MAAM,CAAC,CAAC;EAErB,WAAW,MAAMO,KAAK,IAAIF,MAAM,EAAE;IAChC,IAAIE,KAAK,CAACC,IAAI,KAAK,SAAS,IAAIF,IAAI,CAACC,KAAK,CAACnB,OAAO,CAAC,EAAE;MACnD,MAAMmB,KAAK;IACb;EACF;AACF;AAEA,SAASpB,eAAe,EAAEP,YAAY,EAAEC,mBAAmB,EAAEuB,YAAY,EAAEV,YAAY","ignoreList":[]}
@@ -0,0 +1,220 @@
1
+ "use strict";
2
+
3
+ import { AutoConnectBackoff } from "./auto-connect.js";
4
+ import { Connections } from "./connections.js";
5
+ import { matchDevice } from "./devices.js";
6
+ import { BluetoothError } from "./errors.js";
7
+ import { PairedDevices } from "./paired.js";
8
+ import { ReadingLog } from "./readings.js";
9
+ import { everyReading } from "./result-policy.js";
10
+ import { ScanLoop } from "./scan-loop.js";
11
+ import { SnapshotStore } from "./store.js";
12
+
13
+ /** What a `BluetoothRuntime` is built from. */
14
+
15
+ /**
16
+ * Scans for supported devices, connects to them, collects their readings and saves each one. Framework-free: React
17
+ * hooks and components sit on top of it. Every failure is a `BluetoothError`. Call `dispose()` when done.
18
+ */
19
+ class BluetoothRuntime {
20
+ store = new SnapshotStore();
21
+ known = new Map();
22
+ held = new Set();
23
+ backoff = new AutoConnectBackoff();
24
+ retryTimers = new Set();
25
+ scanRequest = 0;
26
+ disposed = false;
27
+ constructor(options) {
28
+ this.options = options;
29
+ this.readings = new ReadingLog(this.store, options.sink);
30
+ this.connections = new Connections(this.store, this.readings, options.resultPolicy ?? everyReading, id => this.connectionEnded(id));
31
+ this.paired = new PairedDevices(paired => this.store.set({
32
+ paired
33
+ }), options.pairedStorage);
34
+ this.scan = new ScanLoop(options.scanner, this.store, peripheral => this.found(peripheral));
35
+ this.unwatchAdapter = options.scanner.watchState(adapter => {
36
+ this.store.set({
37
+ adapter
38
+ });
39
+ this.scan.sync();
40
+ });
41
+ void this.checkPermission().catch(() => undefined);
42
+ }
43
+
44
+ /** The current state. */
45
+ getSnapshot = () => this.store.get();
46
+
47
+ /** Calls `listener` after every state change; returns the unsubscribe. */
48
+ subscribe = listener => this.store.subscribe(listener);
49
+
50
+ /** Reads the permission without prompting. */
51
+ async checkPermission() {
52
+ return this.recordPermission(await this.options.permissions.check());
53
+ }
54
+
55
+ /** Prompts for the permission when the OS still can. */
56
+ async requestPermission() {
57
+ return this.recordPermission(await this.options.permissions.request());
58
+ }
59
+
60
+ /** Opens the app's system settings, where a blocked permission can be granted. */
61
+ openPermissionSettings() {
62
+ return this.options.permissions.openSettings();
63
+ }
64
+
65
+ /**
66
+ * Asks for permission when needed, then scans whenever the adapter is on, until `stopScan`.
67
+ *
68
+ * @throws BluetoothError `permission-denied` when permission is not granted; `runtime-disposed` after `dispose`.
69
+ */
70
+ async startScan() {
71
+ this.assertLive();
72
+ const request = ++this.scanRequest;
73
+ const permission = this.store.get().permission === "granted" ? "granted" : await this.requestPermission();
74
+ if (permission !== "granted") {
75
+ throw new BluetoothError("permission-denied", "Bluetooth permission is not granted");
76
+ }
77
+ if (request === this.scanRequest && !this.disposed) {
78
+ this.store.set({
79
+ scanning: true
80
+ });
81
+ this.scan.sync();
82
+ }
83
+ }
84
+
85
+ /** Stops scanning; connected devices stay connected. */
86
+ stopScan() {
87
+ this.scanRequest += 1;
88
+ this.store.set({
89
+ scanning: false
90
+ });
91
+ this.scan.sync();
92
+ }
93
+
94
+ /**
95
+ * Connects to a found device for this session; resolves once connected.
96
+ *
97
+ * @throws BluetoothError `device-not-found`, `connection-failed` or the driver's failure.
98
+ */
99
+ async connect(deviceId) {
100
+ this.assertLive();
101
+ const {
102
+ peripheral,
103
+ match
104
+ } = this.require(deviceId);
105
+ this.held.delete(deviceId);
106
+ await this.connections.connect(peripheral, match.driver);
107
+ }
108
+
109
+ /** Disconnects a device; a paired one stays disconnected until `connect` or `pair` is called again. */
110
+ async disconnect(deviceId) {
111
+ this.held.add(deviceId);
112
+ await this.connections.disconnect(deviceId);
113
+ }
114
+
115
+ /** Remembers a device, so it connects whenever the scan finds it, and connects to it now. */
116
+ async pair(deviceId) {
117
+ this.require(deviceId);
118
+ await this.paired.add(deviceId);
119
+ await this.connect(deviceId);
120
+ }
121
+
122
+ /** Forgets a paired device and disconnects it. */
123
+ async forget(deviceId) {
124
+ await this.paired.remove(deviceId);
125
+ await this.disconnect(deviceId);
126
+ }
127
+
128
+ /** Saves the readings whose save failed again, and the readings the sink queued offline. */
129
+ retrySaves() {
130
+ return this.readings.retrySaves();
131
+ }
132
+
133
+ /** Stops scanning and disconnects every device; resolves once they have disconnected, after which nothing changes. */
134
+ async dispose() {
135
+ if (this.disposed) {
136
+ return;
137
+ }
138
+ this.stopScan();
139
+ this.disposed = true;
140
+ this.scan.close();
141
+ this.unwatchAdapter();
142
+ this.retryTimers.forEach(clearTimeout);
143
+ await this.connections.disconnectAll();
144
+ this.store.close();
145
+ }
146
+ recordPermission(permission) {
147
+ this.store.set({
148
+ permission
149
+ });
150
+ return permission;
151
+ }
152
+ found(peripheral) {
153
+ const known = this.known.get(peripheral.id);
154
+ const match = known?.match ?? matchDevice(this.options.devices, peripheral.advertisement);
155
+ if (!match) {
156
+ return;
157
+ }
158
+ this.known.set(peripheral.id, {
159
+ peripheral,
160
+ match
161
+ });
162
+ if (!known) {
163
+ const device = {
164
+ id: peripheral.id,
165
+ key: match.key,
166
+ name: peripheral.advertisement.name
167
+ };
168
+ this.store.set({
169
+ devices: [...this.store.get().devices, {
170
+ ...device,
171
+ connection: "idle",
172
+ error: null
173
+ }]
174
+ });
175
+ }
176
+ this.connectIfPaired(peripheral.id);
177
+ }
178
+ connectIfPaired(id) {
179
+ const waiting = this.held.has(id) || this.connections.isActive(id) || !this.backoff.allows(id);
180
+ if (this.paired.has(id) && !waiting) {
181
+ this.connect(id).catch(() => undefined);
182
+ }
183
+ }
184
+
185
+ /** A scan reports a peripheral once, so a paired device is only found again by a fresh scan. */
186
+ connectionEnded(id) {
187
+ if (!this.paired.has(id) || this.held.has(id) || this.disposed) {
188
+ return;
189
+ }
190
+ if (this.store.device(id)?.connection !== "failed") {
191
+ this.backoff.succeeded(id);
192
+ this.restartScan();
193
+ return;
194
+ }
195
+ const timer = setTimeout(() => {
196
+ this.retryTimers.delete(timer);
197
+ this.restartScan();
198
+ }, this.backoff.failed(id));
199
+ this.retryTimers.add(timer);
200
+ }
201
+ restartScan() {
202
+ if (this.scan.running) {
203
+ this.scan.restart();
204
+ }
205
+ }
206
+ require(deviceId) {
207
+ const device = this.known.get(deviceId);
208
+ if (!device) {
209
+ throw new BluetoothError("device-not-found", `No device ${deviceId} was found by the scan`);
210
+ }
211
+ return device;
212
+ }
213
+ assertLive() {
214
+ if (this.disposed) {
215
+ throw new BluetoothError("runtime-disposed", "This BluetoothRuntime was disposed");
216
+ }
217
+ }
218
+ }
219
+ export { BluetoothRuntime };
220
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AutoConnectBackoff","Connections","matchDevice","BluetoothError","PairedDevices","ReadingLog","everyReading","ScanLoop","SnapshotStore","BluetoothRuntime","store","known","Map","held","Set","backoff","retryTimers","scanRequest","disposed","constructor","options","readings","sink","connections","resultPolicy","id","connectionEnded","paired","set","pairedStorage","scan","scanner","peripheral","found","unwatchAdapter","watchState","adapter","sync","checkPermission","catch","undefined","getSnapshot","get","subscribe","listener","recordPermission","permissions","check","requestPermission","request","openPermissionSettings","openSettings","startScan","assertLive","permission","scanning","stopScan","connect","deviceId","match","require","delete","driver","disconnect","add","pair","forget","remove","retrySaves","dispose","close","forEach","clearTimeout","disconnectAll","devices","advertisement","device","key","name","connection","error","connectIfPaired","waiting","has","isActive","allows","succeeded","restartScan","timer","setTimeout","failed","running","restart"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/runtime.ts"],"mappings":";;AAEA,SAASA,kBAAkB,QAAQ,mBAAgB;AACnD,SAASC,WAAW,QAAQ,kBAAe;AAC3C,SAAqCC,WAAW,QAAQ,cAAW;AACnE,SAASC,cAAc,QAAQ,aAAU;AACzC,SAASC,aAAa,QAAQ,aAAU;AAExC,SAASC,UAAU,QAAQ,eAAY;AACvC,SAASC,YAAY,QAAsB,oBAAiB;AAC5D,SAASC,QAAQ,QAAQ,gBAAa;AAGtC,SAASC,aAAa,QAAQ,YAAS;;AAGvC;;AAwBA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,CAAC;EACJC,KAAK,GAAG,IAAIF,aAAa,CAAC,CAAC;EAC3BG,KAAK,GAAG,IAAIC,GAAG,CAAsB,CAAC;EACtCC,IAAI,GAAG,IAAIC,GAAG,CAAS,CAAC;EACxBC,OAAO,GAAG,IAAIf,kBAAkB,CAAC,CAAC;EAClCgB,WAAW,GAAG,IAAIF,GAAG,CAAgC,CAAC;EAM/DG,WAAW,GAAG,CAAC;EACfC,QAAQ,GAAG,KAAK;EAEjBC,WAAWA,CAAkBC,OAAgC,EAAE;IAAA,KAAlCA,OAAgC,GAAhCA,OAAgC;IAClE,IAAI,CAACC,QAAQ,GAAG,IAAIhB,UAAU,CAAC,IAAI,CAACK,KAAK,EAAEU,OAAO,CAACE,IAAI,CAAC;IACxD,IAAI,CAACC,WAAW,GAAG,IAA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AAc,CAAC,kBAAkB,EAAE,aAAauD,QAAQ,wBAAwB,CAAC;IAC7F;IAEA,OAAOkB,MAAM;EACf;EAEQvB,UAAUA,CAAA,EAAS;IACzB,IAAI,IAAI,CAACnC,QAAQ,EAAE;MACjB,MAAM,IAAIf,cAAc,CAAC,kBAAkB,EAAE,oCAAoC,CAAC;IACpF;EACF;AACF;AAEA,SAASM,gBAAgB","ignoreList":[]}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+
3
+ const SCAN_RETRY_DELAY_MS = 1_000;
4
+
5
+ /** Runs the scanner while a scan is requested and the adapter is on, retrying after a scan error. */
6
+ class ScanLoop {
7
+ closed = false;
8
+ constructor(scanner, store, onFound) {
9
+ this.scanner = scanner;
10
+ this.store = store;
11
+ this.onFound = onFound;
12
+ }
13
+ get running() {
14
+ return this.stop !== undefined;
15
+ }
16
+
17
+ /** Starts or stops the scanner to match the snapshot. */
18
+ sync() {
19
+ const {
20
+ scanning,
21
+ adapter
22
+ } = this.store.get();
23
+ const shouldScan = scanning && adapter === "on" && !this.closed;
24
+ if (shouldScan && !this.stop && !this.retry) {
25
+ this.start();
26
+ } else if (!shouldScan) {
27
+ this.halt();
28
+ }
29
+ }
30
+ restart() {
31
+ this.halt();
32
+ this.sync();
33
+ }
34
+ close() {
35
+ this.closed = true;
36
+ this.halt();
37
+ }
38
+
39
+ /** A scan can fail before `scan` returns its stop, so the stop is only kept for a scan still running. */
40
+ start() {
41
+ const scan = {
42
+ failed: false
43
+ };
44
+ const stop = this.scanner.scan(this.onFound, error => {
45
+ if (scan.stop === this.stop) {
46
+ scan.failed = true;
47
+ this.failed(error);
48
+ }
49
+ });
50
+ if (scan.failed) {
51
+ stop();
52
+ return;
53
+ }
54
+ scan.stop = stop;
55
+ this.stop = stop;
56
+ this.store.set({
57
+ scanError: null
58
+ });
59
+ }
60
+ failed(error) {
61
+ this.store.set({
62
+ scanError: error
63
+ });
64
+ this.halt();
65
+ this.retry = setTimeout(() => {
66
+ this.retry = undefined;
67
+ this.sync();
68
+ }, SCAN_RETRY_DELAY_MS);
69
+ }
70
+ halt() {
71
+ clearTimeout(this.retry);
72
+ this.retry = undefined;
73
+ this.stop?.();
74
+ this.stop = undefined;
75
+ }
76
+ }
77
+ export { ScanLoop };
78
+ //# sourceMappingURL=scan-loop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["SCAN_RETRY_DELAY_MS","ScanLoop","closed","constructor","scanner","store","onFound","running","stop","undefined","sync","scanning","adapter","get","shouldScan","retry","start","halt","restart","close","scan","failed","error","set","scanError","setTimeout","clearTimeout"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/scan-loop.ts"],"mappings":";;AAIA,MAAMA,mBAAmB,GAAG,KAAK;;AAEjC;AACA,MAAMC,QAAQ,CAAC;EAGLC,MAAM,GAAG,KAAK;EAEfC,WAAWA,CACCC,OAAyB,EACzBC,KAAoB,EACpBC,OAAyC,EAC1D;IAAA,KAHiBF,OAAyB,GAAzBA,OAAyB;IAAA,KACzBC,KAAoB,GAApBA,KAAoB;IAAA,KACpBC,OAAyC,GAAzCA,OAAyC;EACzD;EAEH,IAAWC,OAAOA,CAAA,EAAY;IAC5B,OAAO,IAAI,CAACC,IAAI,KAAKC,SAAS;EAChC;;EAEA;EACOC,IAAIA,CAAA,EAAS;IAClB,MAAM;MAAEC,QAAQ;MAAEC;IAAQ,CAAC,GAAG,IAAI,CAACP,KAAK,CAACQ,GAAG,CAAC,CAAC;IAC9C,MAAMC,UAAU,GAAGH,QAAQ,IAAIC,OAAO,KAAK,IAAI,IAAI,CAAC,IAAI,CAACV,MAAM;IAE/D,IAAIY,UAAU,IAAI,CAAC,IAAI,CAACN,IAAI,IAAI,CAAC,IAAI,CAACO,KAAK,EAAE;MAC3C,IAAI,CAACC,KAAK,CAAC,CAAC;IACd,CAAC,MAAM,IAAI,CAACF,UAAU,EAAE;MACtB,IAAI,CAACG,IAAI,CAAC,CAAC;IACb;EACF;EAEOC,OAAOA,CAAA,EAAS;IACr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;IACb,IAAI,CAACA,IAAI,GAAGC,SAAS;EACvB;AACF;AAEA,SAASR,QAAQ","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=sink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/sink.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=snapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/snapshot.ts"],"mappings":"","ignoreList":[]}