@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
@@ -4,6 +4,8 @@
4
4
 
5
5
  import { MeasurementTypeKey } from "@ovok/core/next";
6
6
  import { byteToHex } from "../../../utils/bytes-to-hex.js";
7
+ import { KPA_TO_MMHG } from "../../../utils/kpa-to-mmhg.js";
8
+ import { decorateHeartRateReading, decoratePulseOximeterReading, decorateThermometerReading, decorateWeightReading } from "./standard-gatt.decorators.js";
7
9
  import { standardGlucoseDevice } from "./standard-gatt.glucose.js";
8
10
  import { decorateBloodPressureReading, declareProfile, littleEndian } from "./standard-gatt.profile.js";
9
11
 
@@ -18,12 +20,20 @@ import { decorateBloodPressureReading, declareProfile, littleEndian } from "./st
18
20
  * every vendor names its hardware differently. A product declares the profile and supplies
19
21
  * the name its own hardware advertises.
20
22
  *
21
- * Values are little-endian, as the specification requires. Only the layouts using each
22
- * catalog's canonical unit are declared: a device reporting kPa, Fahrenheit or pounds needs
23
- * a conversion a declaration cannot express, and leaving those flag values undeclared means
24
- * such a device yields no reading rather than one that is quietly wrong.
23
+ * Values are little-endian, as the specification requires. A device may report in kPa,
24
+ * Fahrenheit or pounds; each field is then declared with the scale and offset that convert
25
+ * it to the catalog's canonical unit.
25
26
  */
26
27
 
28
+ const BLOOD_PRESSURE_KPA = 0x01;
29
+ const BLOOD_PRESSURE_TIMESTAMP = 0x02;
30
+ const BLOOD_PRESSURE_PULSE = 0x04;
31
+
32
+ /** Bits 0-4 are defined: kPa, timestamp, pulse, user id and measurement status. */
33
+ const BLOOD_PRESSURE_FLAGS = Array.from({
34
+ length: 32
35
+ }, (_, flags) => flags);
36
+
27
37
  /**
28
38
  * Blood Pressure Service 0x1810, Blood Pressure Measurement 0x2A35.
29
39
  *
@@ -33,8 +43,8 @@ import { decorateBloodPressureReading, declareProfile, littleEndian } from "./st
33
43
  * declares the length it needs. A device that reports no pulse still decodes, because the
34
44
  * flags value it sends selects a case that never looks for one.
35
45
  *
36
- * Bit 3 (user id, 0x08) and bit 4 (measurement status, 0x10) follow the pulse, so neither
37
- * moves it. Each shape is declared again with those bits set. Bit 0 (kPa) stays undeclared.
46
+ * Bit 3 (user id) and bit 4 (measurement status) follow the pulse, so neither moves it.
47
+ * Bit 0 says the pressures are in kPa, which is converted to whole mmHg.
38
48
  */
39
49
  /** Bit 2 set, bit 1 clear: the pulse follows the mean pressure. */
40
50
  const pulseAfterMeanPressure = {
@@ -47,35 +57,25 @@ const pulseAfterTimestamp = {
47
57
  fields: [littleEndian("heartRate", [14, 15], "bpm", "sfloat")],
48
58
  minLengthBytes: 16
49
59
  };
60
+ const pressureInKpa = (name, byteIndexes) => ({
61
+ ...littleEndian(name, byteIndexes, "mmHg", "sfloat"),
62
+ scale: KPA_TO_MMHG,
63
+ decimals: 0
64
+ });
65
+ const pressuresInKpa = [pressureInKpa("systolic", [1, 2]), pressureInKpa("diastolic", [3, 4])];
50
66
 
51
67
  /** Declares a Bluetooth SIG blood pressure profile device. */
52
- const standardBloodPressureDevice = params => declareProfile({
53
- ...params,
54
- decorateReading: (reading, frame, recordOffset) => {
55
- const decorated = decorateBloodPressureReading(reading, frame, recordOffset);
56
- if (!decorated) {
57
- return null;
58
- }
59
- return params.decorateReading ? params.decorateReading(decorated, frame, recordOffset) : decorated;
60
- }
61
- }, {
68
+ const standardBloodPressureDevice = params => declareProfile(params, {
62
69
  service: "1810",
63
70
  characteristic: "2a35",
64
71
  minLengthBytes: 7,
65
72
  measurementTypeKey: MeasurementTypeKey.bloodPressure,
66
- /** mmHg. 0x08, 0x10 and 0x18 repeat each shape with bit 3, bit 4, or both. */
67
- selectors: ["00", "08", "10", "18", "02", "0a", "12", "1a", "04", "0c", "14", "1c", "06", "0e", "16", "1e"],
73
+ decorateReading: decorateBloodPressureReading,
74
+ selectors: BLOOD_PRESSURE_FLAGS.map(byteToHex),
75
+ /** mmHg; the kPa shapes override it in `fieldsBySelector`. */
68
76
  fields: [littleEndian("systolic", [1, 2], "mmHg", "sfloat"), littleEndian("diastolic", [3, 4], "mmHg", "sfloat")],
69
- optionalFields: {
70
- "04": pulseAfterMeanPressure,
71
- "0c": pulseAfterMeanPressure,
72
- "14": pulseAfterMeanPressure,
73
- "1c": pulseAfterMeanPressure,
74
- "06": pulseAfterTimestamp,
75
- "0e": pulseAfterTimestamp,
76
- "16": pulseAfterTimestamp,
77
- "1e": pulseAfterTimestamp
78
- }
77
+ fieldsBySelector: Object.fromEntries(BLOOD_PRESSURE_FLAGS.filter(flags => flags & BLOOD_PRESSURE_KPA).map(flags => [byteToHex(flags), pressuresInKpa])),
78
+ optionalFields: Object.fromEntries(BLOOD_PRESSURE_FLAGS.filter(flags => flags & BLOOD_PRESSURE_PULSE).map(flags => [byteToHex(flags), flags & BLOOD_PRESSURE_TIMESTAMP ? pulseAfterTimestamp : pulseAfterMeanPressure]))
79
79
  });
80
80
 
81
81
  /** Health Thermometer Service 0x1809, Temperature Measurement 0x2A1C. */
@@ -84,6 +84,7 @@ const standardThermometerDevice = params => declareProfile(params, {
84
84
  characteristic: "2a1c",
85
85
  minLengthBytes: 5,
86
86
  measurementTypeKey: MeasurementTypeKey.temperature,
87
+ decorateReading: decorateThermometerReading,
87
88
  /** All combinations of Fahrenheit, timestamp and temperature type flags. */
88
89
  selectors: ["00", "02", "04", "06", "01", "03", "05", "07"],
89
90
  fields: [littleEndian("bodyTemp", [1, 2, 3, 4], "Cel", "float")],
@@ -122,12 +123,14 @@ const WEIGHT_KG_PER_COUNT = 0.005;
122
123
  * Weight Scale Service 0x181D, Weight Measurement 0x2A9D.
123
124
  *
124
125
  * The reading is a scaled integer rather than a float, so the resolution is applied here.
126
+ * A weight of 0xFFFF means the measurement failed, so it yields no reading.
125
127
  */
126
128
  const standardWeightScaleDevice = params => declareProfile(params, {
127
129
  service: "181d",
128
130
  characteristic: "2a9d",
129
131
  minLengthBytes: 3,
130
132
  measurementTypeKey: MeasurementTypeKey.bodyWeight,
133
+ decorateReading: decorateWeightReading,
131
134
  /** Unit, timestamp, user-id and BMI/height flags may all follow the value. */
132
135
  selectors: Array.from({
133
136
  length: 16
@@ -153,14 +156,16 @@ const standardWeightScaleDevice = params => declareProfile(params, {
153
156
  * Pulse Oximeter Service 0x1822, PLX Spot-Check Measurement 0x2A5E.
154
157
  *
155
158
  * Saturation and pulse rate are both required by the catalog, which matches the
156
- * specification: a spot-check measurement always carries both.
159
+ * specification: a spot-check measurement always carries both, at bytes 1-4 whatever the
160
+ * flags say, so every flags value selects the same fields. The optional ones follow them.
157
161
  */
158
162
  const standardPulseOximeterDevice = params => declareProfile(params, {
159
163
  service: "1822",
160
164
  characteristic: "2a5e",
161
165
  minLengthBytes: 5,
162
166
  measurementTypeKey: MeasurementTypeKey.bloodOxygenPulseRate,
163
- selectors: ["00"],
167
+ decorateReading: decoratePulseOximeterReading,
168
+ selectors: ["*"],
164
169
  fields: [littleEndian("bloodOxygen", [1, 2], "%", "sfloat"), littleEndian("pulseRate", [3, 4], "bpm", "sfloat")]
165
170
  });
166
171
 
@@ -176,13 +181,15 @@ const UINT16_HEART_RATE_FLAGS = HEART_RATE_FLAGS.filter(flags => (flags & 0x01)
176
181
  * Heart Rate Service 0x180D, Heart Rate Measurement 0x2A37.
177
182
  *
178
183
  * Both heart-rate layouts are declared. A contact-not-detected frame is idle, so it cannot
179
- * become a false reading while the strap is off the body.
184
+ * become a false reading while the strap is off the body. RR intervals, a list of any
185
+ * length, are read from the frame by the decorator and reported as `rrIntervals`.
180
186
  */
181
187
  const standardHeartRateDevice = params => declareProfile(params, {
182
188
  service: "180d",
183
189
  characteristic: "2a37",
184
190
  minLengthBytes: 2,
185
191
  measurementTypeKey: MeasurementTypeKey.heartRate,
192
+ decorateReading: decorateHeartRateReading,
186
193
  selectors: HEART_RATE_FLAGS.map(byteToHex),
187
194
  fields: [{
188
195
  name: "heartRate",
@@ -1 +1 @@
1
- {"version":3,"names":["MeasurementTypeKey","byteToHex","standardGlucoseDevice","decorateBloodPressureReading","declareProfile","littleEndian","pulseAfterMeanPressure","fields","minLengthBytes","pulseAfterTimestamp","standardBloodPressureDevice","params","decorateReading","reading","frame","recordOffset","decorated","service","characteristic","measurementTypeKey","bloodPressure","selectors","optionalFields","standardThermometerDevice","temperature","fieldsBySelector","scale","offset","decimals","WEIGHT_KG_PER_COUNT","standardWeightScaleDevice","bodyWeight","Array","from","length","_","flags","Object","fromEntries","selector","standardPulseOximeterDevice","bloodOxygenPulseRate","HEART_RATE_FLAGS","filter","UINT16_HEART_RATE_FLAGS","standardHeartRateDevice","heartRate","map","name","byteIndexes","encoding","unit","byteOrder"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.ts"],"mappings":";;AAAA;;AAEA,SAASA,kBAAkB,QAAQ,iBAAiB;AAGpD,SAASC,SAAS,QAAQ,gCAA6B;AAEvD,SAASC,qBAAqB,QAAQ,4BAAyB;AAC/D,SACE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C,CAAC,CACN;AACF,CAAC,CAAC;AAEJ,SACEE,2BAA2B,EAC3BR,qBAAqB,EACrB2C,uBAAuB,EACvBL,2BAA2B,EAC3BjB,yBAAyB,EACzBO,yBAAyB","ignoreList":[]}
1
+ {"version":3,"names":["MeasurementTypeKey","byteToHex","KPA_TO_MMHG","decorateHeartRateReading","decoratePulseOximeterReading","decorateThermometerReading","decorateWeightReading","standardGlucoseDevice","decorateBloodPressureReading","declareProfile","littleEndian","BLOOD_PRESSURE_KPA","BLOOD_PRESSURE_TIMESTAMP","BLOOD_PRESSURE_PULSE","BLOOD_PRESSURE_FLAGS","Array","from","length","_","flags","pulseAfterMeanPressure","fields","minLengthBytes","pulseAfterTimestamp","pressureInKpa","name","byteIndexes","scale","decimals","pressuresInKpa","standardBloodPressureDevice","params","service","characteristic","measurementTypeKey","bloodPressure","decorateReading","selectors","map","fieldsBySelector","Object","fromEntries","filter","optionalFields","standardThermometerDevice","temperature","offset","WEIGHT_KG_PER_COUNT","standardWeightScaleDevice","bodyWeight","selector","standardPulseOximeterDevice","bloodOxygenPulseRate","HEART_RATE_FLAGS","UINT16_HEART_RATE_FLAGS","standardHeartRateDevice","heartRate","encoding","unit","byteOrder"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.ts"],"mappings":";;AAAA;;AAEA,SAASA,kBAAkB,QAAQ,iBAAiB;AAIpD,SAASC,SAAS,QAAQ,gCAA6B;AACvD,SAASC,WAAW,QAAQ,+BAA4B;AAExD,SACEC,wBAAwB,EACxBC,4BAA4B,EAC5BC,0BAA0B,EAC1BC,qBAAqB,QAChB,+BAA4B;AACnC,SAASC,qBAAqB,QAAQ,4BAAyB;AAC/D,SACEC,4BAA4B,EAC5BC,cAAc,EACdC,YAAY,QAEP,4BAAyB;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,kBAAkB,GAAG,IAAI;AA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IAAK,CACnClB,SAAS,CAACkB,KAAK,CAAC,EAChB,CACE;IACEM,IAAI,EAAE,WAAW;IACjBC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACnBiC,SAAS,EAAE,QAAiB;IAC5BF,QAAQ,EAAE,MAAe;IACzBC,IAAI,EAAE;EACR,CAAC,CACF,CACF,CACL,CAAC;EACDf,cAAc,EAAEH,MAAM,CAACC,WAAW,CAChCa,uBAAuB,CAAChB,GAAG,CAAEnB,KAAK,IAAK,CAAClB,SAAS,CAACkB,KAAK,CAAC,EAAE;IACtDE,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE;EAClB,CAAC,CAAC,CACN;AACF,CAAC,CAAC;AAEJ,SACEQ,2BAA2B,EAC3BvB,qBAAqB,EACrBgD,uBAAuB,EACvBJ,2BAA2B,EAC3BP,yBAAyB,EACzBI,yBAAyB","ignoreList":[]}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ /** The Bluetooth SIG Date Time characteristic is seven bytes long. */
4
+ const DATE_TIME_BYTES = 7;
5
+
6
+ /** The byte at `index` of a record that starts at `offset`; undefined when the frame ends first. */
7
+ const byteAt = (frame, index, offset) => {
8
+ const value = Number.parseInt(frame[index + offset] ?? "", 16);
9
+ return Number.isInteger(value) && value >= 0 && value <= 0xff ? value : undefined;
10
+ };
11
+
12
+ /** Reads a SIG Date Time at `index` as a phone-local date; undefined for missing or impossible fields. */
13
+ const dateTimeAt = (frame, index, offset = 0) => {
14
+ const yearLow = byteAt(frame, index, offset);
15
+ const yearHigh = byteAt(frame, index + 1, offset);
16
+ const month = byteAt(frame, index + 2, offset);
17
+ const day = byteAt(frame, index + 3, offset);
18
+ const hour = byteAt(frame, index + 4, offset);
19
+ const minute = byteAt(frame, index + 5, offset);
20
+ const second = byteAt(frame, index + 6, offset);
21
+ if (yearLow === undefined || yearHigh === undefined || month === undefined || day === undefined || hour === undefined || minute === undefined || second === undefined) {
22
+ return undefined;
23
+ }
24
+ const year = yearLow | yearHigh << 8;
25
+ const date = new Date(year, month - 1, day, hour, minute, second);
26
+ return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day && date.getHours() === hour && date.getMinutes() === minute && date.getSeconds() === second ? date : undefined;
27
+ };
28
+
29
+ /** `reading` plus each of `metadata` that has a value. */
30
+ const withDefinedMetadata = (reading, metadata) => ({
31
+ ...reading,
32
+ ...Object.fromEntries(Object.entries(metadata).filter(([, value]) => value !== undefined))
33
+ });
34
+ export { byteAt, DATE_TIME_BYTES, dateTimeAt, withDefinedMetadata };
35
+ //# sourceMappingURL=standard-gatt.frame.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DATE_TIME_BYTES","byteAt","frame","index","offset","value","Number","parseInt","isInteger","undefined","dateTimeAt","yearLow","yearHigh","month","day","hour","minute","second","year","date","Date","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","withDefinedMetadata","reading","metadata","Object","fromEntries","entries","filter"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.ts"],"mappings":";;AAAA;AACA,MAAMA,eAAe,GAAG,CAAC;;AAEzB;AACA,MAAMC,MAAM,GAAGA,CACbC,KAAwB,EACxBC,KAAa,EACbC,MAAc,KACS;EACvB,MAAMC,KAAK,GAAGC,MAAM,CAACC,QAAQ,CAACL,KAAK,CAACC,KAAK,GAAGC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC;EAE9D,OAAOE,MAAM,CAACE,SAAS,CAACH,KAAK,CAAC,IAAIA,KAAK,IAAI,CAAC,IAAIA,KAAK,IAAI,IAAI,GACzDA,KAAK,GACLI,SAAS;AACf,CAAC;;AAED;AACA,MAAMC,UAAU,GAAGA,CACjBR,KAAwB,EACxBC,KAAa,EACbC,MAAM,GAAG,CAAC,KACW;EACrB,MAAMO,OAAO,GAAGV,MAAM,CAACC,KAAK,EAAEC,KAAK,EAAEC,MAAM,CAAC;EAC5C,MAAMQ,QAAQ,GAAGX,MAA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CAAC,CAAC,KAAKT,MAAM,GAC1BE,IAAI,GACJV,SAAS;AACf,CAAC;;AAED;AACA,MAAMkB,mBAAmB,GAAGA,CAC1BC,OAAU,EACVC,QAA2C,MACpC;EACP,GAAGD,OAAO;EACV,GAAGE,MAAM,CAACC,WAAW,CACnBD,MAAM,CAACE,OAAO,CAACH,QAAQ,CAAC,CAACI,MAAM,CAAC,CAAC,GAAG5B,KAAK,CAAC,KAAKA,KAAK,KAAKI,SAAS,CACpE;AACF,CAAC,CAAC;AAEF,SAASR,MAAM,EAAED,eAAe,EAAEU,UAAU,EAAEiB,mBAAmB","ignoreList":[]}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ import { byte, FLAG_MOL_PER_L, hasFlag, sensorStatusFromGlucoseFrame, sequenceNumberFromGlucoseFrame, typeAndLocationFromGlucoseFrame } from "./standard-gatt.glucose-frame.js";
4
+ const NIBBLE_BITS = 4;
5
+ const NIBBLE_MASK = 0x0f;
6
+
7
+ /** Indexed by the specimen type code; 0, 10 (control solution) and 11-15 are not a patient sample. */
8
+ const SPECIMEN_TYPES = [undefined, "capillaryWholeBlood", "capillaryPlasma", "venousWholeBlood", "venousPlasma", "arterialWholeBlood", "arterialPlasma", "undeterminedWholeBlood", "undeterminedPlasma", "interstitialFluid"];
9
+
10
+ /** Indexed by the sample location code; 0, 4 (control solution), 5-14 and 15 (not available) say nothing. */
11
+ const SAMPLE_LOCATIONS = [undefined, "finger", "alternateSite", "earlobe"];
12
+ const STATUS_BATTERY_LOW = 0x0001;
13
+ const STATUS_SENSOR_MALFUNCTION = 0x0002;
14
+ const STATUS_SAMPLE_TOO_SMALL = 0x0004;
15
+ const STATUS_STRIP_INSERTION_ERROR = 0x0008;
16
+ const STATUS_STRIP_TYPE_INCORRECT = 0x0010;
17
+ const STATUS_RESULT_TOO_HIGH = 0x0020;
18
+ const STATUS_RESULT_TOO_LOW = 0x0040;
19
+ const STATUS_TEMPERATURE_TOO_HIGH = 0x0080;
20
+ const STATUS_TEMPERATURE_TOO_LOW = 0x0100;
21
+ const STATUS_READ_INTERRUPTED = 0x0200;
22
+ const STATUS_DEVICE_FAULT = 0x0400;
23
+ const STATUS_TIME_FAULT = 0x0800;
24
+
25
+ /** The test did not take place properly, so the concentration is not a patient's result. */
26
+ const UNUSABLE_STATUS = STATUS_SENSOR_MALFUNCTION | STATUS_SAMPLE_TOO_SMALL | STATUS_STRIP_INSERTION_ERROR | STATUS_STRIP_TYPE_INCORRECT | STATUS_READ_INTERRUPTED | STATUS_DEVICE_FAULT;
27
+ const SENSOR_WARNINGS = [[STATUS_BATTERY_LOW, "batteryLow"], [STATUS_TEMPERATURE_TOO_HIGH, "temperatureTooHigh"], [STATUS_TEMPERATURE_TOO_LOW, "temperatureTooLow"], [STATUS_TIME_FAULT, "timeFault"]];
28
+ const reportedUnit = frame => hasFlag(byte(frame, 0) ?? 0, FLAG_MOL_PER_L) ? "mmol/L" : "mg/dL";
29
+ const outOfRange = status => {
30
+ if (hasFlag(status, STATUS_RESULT_TOO_HIGH)) {
31
+ return "high";
32
+ }
33
+ return hasFlag(status, STATUS_RESULT_TOO_LOW) ? "low" : undefined;
34
+ };
35
+ const sensorWarnings = status => SENSOR_WARNINGS.filter(([flag]) => hasFlag(status, flag)).map(([, warning]) => warning);
36
+
37
+ /** Whether the meter flagged the record as a test that failed rather than a result. */
38
+ const hasUnusableSensorStatus = frame => {
39
+ const status = sensorStatusFromGlucoseFrame(frame);
40
+ return status !== undefined && hasFlag(status, UNUSABLE_STATUS);
41
+ };
42
+
43
+ /** What the record says about itself, beside its concentration. */
44
+ const glucoseRecordDetails = frame => {
45
+ const sequenceNumber = sequenceNumberFromGlucoseFrame(frame);
46
+ const typeAndLocation = typeAndLocationFromGlucoseFrame(frame);
47
+ const status = sensorStatusFromGlucoseFrame(frame);
48
+ const specimen = typeAndLocation === undefined ? undefined : SPECIMEN_TYPES[typeAndLocation & NIBBLE_MASK];
49
+ const sampleLocation = typeAndLocation === undefined ? undefined : SAMPLE_LOCATIONS[typeAndLocation >> NIBBLE_BITS];
50
+ const range = status === undefined ? undefined : outOfRange(status);
51
+ const warnings = status === undefined ? [] : sensorWarnings(status);
52
+ return {
53
+ reportedUnit: reportedUnit(frame),
54
+ ...(sequenceNumber !== undefined && {
55
+ sequenceNumber
56
+ }),
57
+ ...(specimen && {
58
+ specimen
59
+ }),
60
+ ...(sampleLocation && {
61
+ sampleLocation
62
+ }),
63
+ ...(range && {
64
+ outOfRange: range
65
+ }),
66
+ ...(warnings.length > 0 && {
67
+ sensorStatus: warnings
68
+ })
69
+ };
70
+ };
71
+ export { glucoseRecordDetails, hasUnusableSensorStatus };
72
+ //# sourceMappingURL=standard-gatt.glucose-details.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["byte","FLAG_MOL_PER_L","hasFlag","sensorStatusFromGlucoseFrame","sequenceNumberFromGlucoseFrame","typeAndLocationFromGlucoseFrame","NIBBLE_BITS","NIBBLE_MASK","SPECIMEN_TYPES","undefined","SAMPLE_LOCATIONS","STATUS_BATTERY_LOW","STATUS_SENSOR_MALFUNCTION","STATUS_SAMPLE_TOO_SMALL","STATUS_STRIP_INSERTION_ERROR","STATUS_STRIP_TYPE_INCORRECT","STATUS_RESULT_TOO_HIGH","STATUS_RESULT_TOO_LOW","STATUS_TEMPERATURE_TOO_HIGH","STATUS_TEMPERATURE_TOO_LOW","STATUS_READ_INTERRUPTED","STATUS_DEVICE_FAULT","STATUS_TIME_FAULT","UNUSABLE_STATUS","SENSOR_WARNINGS","reportedUnit","frame","outOfRange","status","sensorWarnings","filter","flag","map","warning","hasUnusableSensorStatus","glucoseRecordDetails","sequenceNumber","typeAndLocation","specimen","sampleLocation","range","warnings","length","sensorStatus"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.ts"],"mappings":";;AAQA,SACEA,IAAI,EACJC,cAAc,EACdC,OAAO,EACPC,4BAA4B,EAC5BC,8BAA8B,EAC9BC,+BAA+B,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,OAAO;IACLH,YAAY,EAAEA,YAAY,CAACC,KAAK,CAAC;IACjC,IAAIU,cAAc,KAAK3B,SAAS,IAAI;MAAE2B;IAAe,CAAC,CAAC;IACvD,IAAIE,QAAQ,IAAI;MAAEA;IAAS,CAAC,CAAC;IAC7B,IAAIC,cAAc,IAAI;MAAEA;IAAe,CAAC,CAAC;IACzC,IAAIC,KAAK,IAAI;MAAEb,UAAU,EAAEa;IAAM,CAAC,CAAC;IACnC,IAAIC,QAAQ,CAACC,MAAM,GAAG,CAAC,IAAI;MAAEC,YAAY,EAAEF;IAAS,CAAC;EACvD,CAAC;AACH,CAAC;AAED,SAASN,oBAAoB,EAAED,uBAAuB","ignoreList":[]}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ const FLAG_TIME_OFFSET = 0x01;
4
+ const FLAG_CONCENTRATION = 0x02;
5
+ const FLAG_MOL_PER_L = 0x04;
6
+ const FLAG_SENSOR_STATUS = 0x08;
7
+ const SEQUENCE_NUMBER_INDEX = 1;
8
+ const BASE_TIME_INDEX = 3;
9
+ const TIME_OFFSET_INDEX = 10;
10
+ const BYTE_BITS = 8;
11
+ const TYPE_AND_LOCATION_OFFSET = 2;
12
+ const SENSOR_STATUS_OFFSET = 3;
13
+ const hasFlag = (flags, flag) => (flags & flag) !== 0;
14
+ const concentrationIndex = flags => hasFlag(flags, FLAG_TIME_OFFSET) ? TIME_OFFSET_INDEX + 2 : TIME_OFFSET_INDEX;
15
+ const byte = (frame, index) => {
16
+ const value = Number.parseInt(frame[index] ?? "", 16);
17
+ return Number.isInteger(value) ? value : undefined;
18
+ };
19
+ const uint16 = (frame, index) => {
20
+ const low = byte(frame, index);
21
+ const high = byte(frame, index + 1);
22
+ return low === undefined || high === undefined ? undefined : low | high << BYTE_BITS;
23
+ };
24
+
25
+ /** The meter's number for the record, in bytes 1-2 of every Glucose Measurement. */
26
+ const sequenceNumberFromGlucoseFrame = frame => uint16(frame, SEQUENCE_NUMBER_INDEX);
27
+
28
+ /** Specimen type in the low nibble and sample location in the high one; only a record with a concentration has it. */
29
+ const typeAndLocationFromGlucoseFrame = frame => {
30
+ const flags = byte(frame, 0) ?? 0;
31
+ return hasFlag(flags, FLAG_CONCENTRATION) ? byte(frame, concentrationIndex(flags) + TYPE_AND_LOCATION_OFFSET) : undefined;
32
+ };
33
+
34
+ /** The Sensor Status Annunciation bits, which only a record that sets flag bit 3 carries. */
35
+ const sensorStatusFromGlucoseFrame = frame => {
36
+ const flags = byte(frame, 0) ?? 0;
37
+ return hasFlag(flags, FLAG_SENSOR_STATUS) && hasFlag(flags, FLAG_CONCENTRATION) ? uint16(frame, concentrationIndex(flags) + SENSOR_STATUS_OFFSET) : undefined;
38
+ };
39
+ export { BASE_TIME_INDEX, byte, concentrationIndex, FLAG_CONCENTRATION, FLAG_MOL_PER_L, FLAG_TIME_OFFSET, hasFlag, sensorStatusFromGlucoseFrame, sequenceNumberFromGlucoseFrame, TIME_OFFSET_INDEX, typeAndLocationFromGlucoseFrame };
40
+ //# sourceMappingURL=standard-gatt.glucose-frame.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["FLAG_TIME_OFFSET","FLAG_CONCENTRATION","FLAG_MOL_PER_L","FLAG_SENSOR_STATUS","SEQUENCE_NUMBER_INDEX","BASE_TIME_INDEX","TIME_OFFSET_INDEX","BYTE_BITS","TYPE_AND_LOCATION_OFFSET","SENSOR_STATUS_OFFSET","hasFlag","flags","flag","concentrationIndex","byte","frame","index","value","Number","parseInt","isInteger","undefined","uint16","low","high","sequenceNumberFromGlucoseFrame","typeAndLocationFromGlucoseFrame","sensorStatusFromGlucoseFrame"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.ts"],"mappings":";;AAAA,MAAMA,gBAAgB,GAAG,IAAI;AAC7B,MAAMC,kBAAkB,GAAG,IAAI;AAC/B,MAAMC,cAAc,GAAG,IAAI;AAC3B,MAAMC,kBAAkB,GAAG,IAAI;AAE/B,M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AAO,CAACC,KAAK,EAAEV,kBAAkB,CAAC,GACrCa,IAAI,CAACC,KAAK,EAAEF,kBAAkB,CAACF,KAAK,CAAC,GAAGH,wBAAwB,CAAC,GACjEa,SAAS;AACf,CAAC;;AAED;AACA,MAAMM,4BAA4B,GAChCZ,KAAwB,IACD;EACvB,MAAMJ,KAAK,GAAGG,IAAI,CAACC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC;EAEjC,OAAOL,OAAO,CAACC,KAAK,EAAER,kBAAkB,CAAC,IAAIO,OAAO,CAACC,KAAK,EAAEV,kBAAkB,CAAC,GAC3EqB,MAAM,CAACP,KAAK,EAAEF,kBAAkB,CAACF,KAAK,CAAC,GAAGF,oBAAoB,CAAC,GAC/DY,SAAS;AACf,CAAC;AAED,SACEhB,eAAe,EACfS,IAAI,EACJD,kBAAkB,EAClBZ,kBAAkB,EAClBC,cAAc,EACdF,gBAAgB,EAChBU,OAAO,EACPiB,4BAA4B,EAC5BF,8BAA8B,EAC9BnB,iBAAiB,EACjBoB,+BAA+B","ignoreList":[]}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+
3
+ import { bytesToHex } from "../../../utils/bytes-to-hex.js";
4
+ import { sigUuid } from "../../../utils/sig-uuid.js";
5
+ import { RecordCursor } from "../../record-cursor.js";
6
+ import { byte, sequenceNumberFromGlucoseFrame } from "./standard-gatt.glucose-frame.js";
7
+ const GLUCOSE_SERVICE_UUID = sigUuid("1808");
8
+ const GLUCOSE_MEASUREMENT_UUID = sigUuid("2a18");
9
+ const RECORD_ACCESS_CONTROL_POINT_UUID = sigUuid("2a52");
10
+ const RACP_REPORT_STORED_RECORDS = 0x01;
11
+ const RACP_RESPONSE_CODE = 0x06;
12
+ const RACP_OPERATOR_ALL_RECORDS = 0x01;
13
+ const RACP_OPERATOR_GREATER_OR_EQUAL = 0x03;
14
+ const RACP_FILTER_SEQUENCE_NUMBER = 0x01;
15
+ const RESPONSE_OPCODE_INDEX = 0;
16
+ const RESPONSE_REQUEST_INDEX = 2;
17
+ const RESPONSE_RESULT_INDEX = 3;
18
+
19
+ /** Invalid operator, operator not supported, invalid operand and operand not supported. */
20
+ const FILTER_REFUSALS = new Set([0x03, 0x04, 0x05, 0x09]);
21
+ const BYTE_BITS = 8;
22
+ const MAX_SEQUENCE_NUMBER = 0xffff;
23
+ const CURSOR_KEY_PREFIX = "@ovok/native/glucose-sequence";
24
+ const reportAllRecords = () => bytesToHex([RACP_REPORT_STORED_RECORDS, RACP_OPERATOR_ALL_RECORDS]);
25
+ const reportRecordsFrom = sequenceNumber => bytesToHex([RACP_REPORT_STORED_RECORDS, RACP_OPERATOR_GREATER_OR_EQUAL, RACP_FILTER_SEQUENCE_NUMBER, sequenceNumber, sequenceNumber >> BYTE_BITS]);
26
+
27
+ /** The first number worth asking for, or nothing when none is known or the one after it cannot be written. */
28
+ const sequenceToAskFrom = newestStored => newestStored === undefined || newestStored >= MAX_SEQUENCE_NUMBER ? undefined : newestStored + 1;
29
+
30
+ /** Whether the meter answered "report stored records" by refusing the filter it was given. */
31
+ const refusesFilter = frame => {
32
+ const result = byte(frame, RESPONSE_RESULT_INDEX);
33
+ return byte(frame, RESPONSE_OPCODE_INDEX) === RACP_RESPONSE_CODE && byte(frame, RESPONSE_REQUEST_INDEX) === RACP_REPORT_STORED_RECORDS && result !== undefined && FILTER_REFUSALS.has(result);
34
+ };
35
+ const racpCommand = frame => ({
36
+ serviceUuid: GLUCOSE_SERVICE_UUID,
37
+ characteristicUuid: RECORD_ACCESS_CONTROL_POINT_UUID,
38
+ frame
39
+ });
40
+
41
+ /**
42
+ * Asks a glucose meter for the records stored after the newest one already read, and keeps
43
+ * count of the sequence numbers it sends. A meter that refuses the sequence-number filter is
44
+ * asked for every record instead, once.
45
+ *
46
+ * Every Glucose Measurement counts, usable or not: a record the SDK withholds is no reason to
47
+ * download it again.
48
+ */
49
+ class GlucoseRecordSequencer {
50
+ filtered = false;
51
+ constructor(cursor) {
52
+ this.cursor = cursor;
53
+ }
54
+ initialCommands = async () => {
55
+ const from = sequenceToAskFrom(await this.cursor.load());
56
+ this.filtered = from !== undefined;
57
+ return [racpCommand(from === undefined ? reportAllRecords() : reportRecordsFrom(from))];
58
+ };
59
+ nextCommand = (frame, characteristicUuid) => {
60
+ const uuid = characteristicUuid?.toLowerCase();
61
+ if (uuid === GLUCOSE_MEASUREMENT_UUID) {
62
+ this.countRecord(frame);
63
+ return undefined;
64
+ }
65
+ if (uuid === RECORD_ACCESS_CONTROL_POINT_UUID && this.filtered && refusesFilter(frame)) {
66
+ this.filtered = false;
67
+ return [racpCommand(reportAllRecords())];
68
+ }
69
+ return undefined;
70
+ };
71
+ countRecord(frame) {
72
+ const sequenceNumber = sequenceNumberFromGlucoseFrame(frame);
73
+ if (sequenceNumber !== undefined) {
74
+ this.cursor.advance(sequenceNumber);
75
+ }
76
+ }
77
+ }
78
+
79
+ /** Gives each connection to a glucose meter its own sequencer over that meter's stored cursor. */
80
+ const createGlucoseSequencer = ({
81
+ deviceId,
82
+ recordCursorStorage
83
+ }) => new GlucoseRecordSequencer(new RecordCursor(recordCursorStorage, `${CURSOR_KEY_PREFIX}/${deviceId}`));
84
+ export { createGlucoseSequencer, GLUCOSE_MEASUREMENT_UUID, GLUCOSE_SERVICE_UUID, RECORD_ACCESS_CONTROL_POINT_UUID };
85
+ //# sourceMappingURL=standard-gatt.glucose-racp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["bytesToHex","sigUuid","RecordCursor","byte","sequenceNumberFromGlucoseFrame","GLUCOSE_SERVICE_UUID","GLUCOSE_MEASUREMENT_UUID","RECORD_ACCESS_CONTROL_POINT_UUID","RACP_REPORT_STORED_RECORDS","RACP_RESPONSE_CODE","RACP_OPERATOR_ALL_RECORDS","RACP_OPERATOR_GREATER_OR_EQUAL","RACP_FILTER_SEQUENCE_NUMBER","RESPONSE_OPCODE_INDEX","RESPONSE_REQUEST_INDEX","RESPONSE_RESULT_INDEX","FILTER_REFUSALS","Set","BYTE_BITS","MAX_SEQUENCE_NUMBER","CURSOR_KEY_PREFIX","reportAllRecords","reportRecordsFrom","sequenceNumber","sequenceToAskFrom","newestStored","undefined","refusesFilter","frame","result","has","racpCommand","serviceUuid","characteristicUuid","GlucoseRecordSequencer","filtered","constructor","cursor","initialCommands","from","load","nextCommand","uuid","toLowerCase","countRecord","advance","createGlucoseSequencer","deviceId","recordCursorStorage"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.ts"],"mappings":";;AAGA,SAASA,UAAU,QAAQ,gCAA6B;AACxD,SAASC,OAAO,QAAQ,4BAAyB;AACjD,SAASC,YAAY,QAAQ,wBAAqB;AAElD,SAASC,IAAI,EAAEC,8BAA8B,QAAQ,kCAA+B;AAEpF,MAAMC,oBAAoB,GAAGJ,OAAO,CAAC,MAAM,CAAC;AAC5C,MAAMK,wBAAwB,GAAGL,OAAO,CAAC,MAAM,CAAC;AAChD,MAAMM,gCAAgC,GAAGN,OAAO,CAAC,MAAM,CAAC;AAExD,MAAMO,0BAA0B,GAAG,IAAI;AACvC,MAAMC,kBAAkB,GAAG,IAAI;AAC/B,MAAMC,yBAAyB,GAAG,IAAI;AACtC,MAAMC,8BAA8B,GAAG,IAAI;AAC3C,MAAMC,2BAA2B,GAAG,IAAI;AAExC,MAAMC,qBAAqB,GAAG,CAAC;AAC/B,MAAMC,sBAAsB,GAAG,CAAC;AAChC,MAAMC,qBAAqB,GAAG,CAAC;;AAE/B;AACA,MAAMC,eAAoC,GAAG,IAAIC,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAE9E,MAAMC,SAAS,GAAG,CAAC;AACnB,MAAMC,mBAAmB,GAAG,MAAM;AAClC,MAAMC,iBAAiB,GAAG,+BAA+B;AAEzD,MAAMC,gBAAgB,GAAGA,CAAA,KACvBrB,UAAU,CAAC,CAACQ,0BAA0B,EAAEE,yBAAyB,CAAC,CAAC;AAErE,MAAMY,iB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EACH,CAAC;EAEME,WAAW,GAAGA,CACnBb,KAAwB,EACxBK,kBAA2B,KACc;IACzC,MAAMS,IAAI,GAAGT,kBAAkB,EAAEU,WAAW,CAAC,CAAC;IAE9C,IAAID,IAAI,KAAKpC,wBAAwB,EAAE;MACrC,IAAI,CAACsC,WAAW,CAAChB,KAAK,CAAC;MAEvB,OAAOF,SAAS;IAClB;IAEA,IAAIgB,IAAI,KAAKnC,gCAAgC,IAAI,IAAI,CAAC4B,QAAQ,IAAIR,aAAa,CAACC,KAAK,CAAC,EAAE;MACtF,IAAI,CAACO,QAAQ,GAAG,KAAK;MAErB,OAAO,CAACJ,WAAW,CAACV,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC1C;IAEA,OAAOK,SAAS;EAClB,CAAC;EAEOkB,WAAWA,CAAChB,KAAwB,EAAQ;IAClD,MAAML,cAAc,GAAGnB,8BAA8B,CAACwB,KAAK,CAAC;IAE5D,IAAIL,cAAc,KAAKG,SAAS,EAAE;MAChC,IAAI,CAACW,MAAM,CAACQ,OAAO,CAACtB,cAAc,CAAC;IACrC;EACF;AACF;;AAEA;AACA,MAAMuB,sBAA8C,GAAGA,CAAC;EACtDC,QAAQ;EACRC;AACF,CAAC,KACC,IAAId,sBAAsB,CACxB,IAAIhC,YAAY,CAAC8C,mBAAmB,EAAE,GAAG5B,iBAAiB,IAAI2B,QAAQ,EAAE,CAC1E,CAAC;AAEH,SACED,sBAAsB,EACtBxC,wBAAwB,EACxBD,oBAAoB,EACpBE,gCAAgC","ignoreList":[]}
@@ -2,8 +2,10 @@
2
2
 
3
3
  import { MeasurementTypeKey } from "@ovok/core/next";
4
4
  import { byteToHex } from "../../../utils/bytes-to-hex.js";
5
- import { sigUuid } from "../../../utils/sig-uuid.js";
6
5
  import { defineCustomDevice } from "../../custom/define-custom-device.js";
6
+ import { glucoseRecordDetails, hasUnusableSensorStatus } from "./standard-gatt.glucose-details.js";
7
+ import { BASE_TIME_INDEX, byte, concentrationIndex, FLAG_CONCENTRATION, FLAG_MOL_PER_L, FLAG_TIME_OFFSET, TIME_OFFSET_INDEX, typeAndLocationFromGlucoseFrame } from "./standard-gatt.glucose-frame.js";
8
+ import { createGlucoseSequencer, GLUCOSE_MEASUREMENT_UUID, GLUCOSE_SERVICE_UUID, RECORD_ACCESS_CONTROL_POINT_UUID } from "./standard-gatt.glucose-racp.js";
7
9
  import { littleEndian } from "./standard-gatt.profile.js";
8
10
 
9
11
  /**
@@ -11,10 +13,11 @@ import { littleEndian } from "./standard-gatt.profile.js";
11
13
  * 0x2A52.
12
14
  *
13
15
  * A glucose meter does not push its readings. The collector enables indications on the
14
- * control point, writes "report all stored records" (`01 01`) once, and the meter answers
15
- * with one Glucose Measurement per stored record followed by a control-point response
16
- * (`06 00 01 xx`). Every record is reported; the SDK's stable result identity keeps a
17
- * record seen on an earlier connection from becoming a second reading.
16
+ * control point and writes a request for the stored records: those after the newest one it
17
+ * has read (`01 03 01 nn nn`) when the manager has a `recordCursorStorage`, otherwise all of
18
+ * them (`01 01`). The meter answers with one Glucose Measurement per record followed by a
19
+ * control-point response (`06 00 01 xx`). The SDK's stable result identity, which covers the
20
+ * record's sequence number, keeps a record seen twice from becoming a second reading.
18
21
  *
19
22
  * Glucose Measurement layout: flags, sequence number (2), base time (7), time offset (2,
20
23
  * flag bit 0), concentration SFLOAT (2) and type/sample-location (1) (bit 1), sensor status
@@ -24,17 +27,13 @@ const MG_PER_DL_PER_KG_PER_L = 100_000;
24
27
 
25
28
  /** One mol/L of glucose (180.16 g/mol) is 18,016 mg/dL. */
26
29
  const MG_PER_DL_PER_MOL_PER_L = 18_016;
27
- const FLAG_TIME_OFFSET = 0x01;
28
- const FLAG_CONCENTRATION = 0x02;
29
- const FLAG_MOL_PER_L = 0x04;
30
- const BASE_TIME_INDEX = 3;
31
- const TIME_OFFSET_INDEX = 10;
30
+
31
+ /** One decimal reads a mmol/L result (0.1 mmol/L is 1.8 mg/dL) back as the meter showed it. */
32
+ const MG_PER_DL_DECIMALS = 1;
32
33
 
33
34
  /** Type 0xA and sample location 0x4 both mean a control-solution test, not a patient sample. */
34
35
  const CONTROL_SOLUTION_TYPE = 0x0a;
35
36
  const CONTROL_SOLUTION_LOCATION = 0x04;
36
- const REPORT_ALL_STORED_RECORDS = "0101";
37
- const concentrationIndex = flags => flags & FLAG_TIME_OFFSET ? TIME_OFFSET_INDEX + 2 : TIME_OFFSET_INDEX;
38
37
 
39
38
  /** Bits 5-7 are reserved; a meter that sets one still sends a readable record. */
40
39
  const ALL_FLAGS = Array.from({
@@ -45,13 +44,9 @@ const glucoseField = flags => {
45
44
  return {
46
45
  ...littleEndian("bloodGlucose", [index, index + 1], "mg/dL", "sfloat"),
47
46
  scale: flags & FLAG_MOL_PER_L ? MG_PER_DL_PER_MOL_PER_L : MG_PER_DL_PER_KG_PER_L,
48
- decimals: 0
47
+ decimals: MG_PER_DL_DECIMALS
49
48
  };
50
49
  };
51
- const byte = (frame, index) => {
52
- const value = Number.parseInt(frame[index] ?? "", 16);
53
- return Number.isInteger(value) ? value : undefined;
54
- };
55
50
 
56
51
  /** The record's own time: the base time plus its offset in minutes, read as phone-local. */
57
52
  const recordedAtFromGlucoseFrame = frame => {
@@ -82,8 +77,7 @@ const recordedAtFromGlucoseFrame = frame => {
82
77
  return recordedAt;
83
78
  };
84
79
  const isControlSolution = frame => {
85
- const flags = byte(frame, 0) ?? 0;
86
- const typeAndLocation = byte(frame, concentrationIndex(flags) + 2);
80
+ const typeAndLocation = typeAndLocationFromGlucoseFrame(frame);
87
81
  return typeAndLocation !== undefined && ((typeAndLocation & 0x0f) === CONTROL_SOLUTION_TYPE || typeAndLocation >> 4 === CONTROL_SOLUTION_LOCATION);
88
82
  };
89
83
 
@@ -95,9 +89,9 @@ const standardGlucoseDevice = params => defineCustomDevice({
95
89
  oneReadingPerConnection: params.oneReadingPerConnection,
96
90
  stuckDataTimeoutMs: params.stuckDataTimeoutMs ?? 60_000,
97
91
  services: [{
98
- uuid: sigUuid("1808"),
92
+ uuid: GLUCOSE_SERVICE_UUID,
99
93
  monitor: [{
100
- uuid: sigUuid("2a18"),
94
+ uuid: GLUCOSE_MEASUREMENT_UUID,
101
95
  frame: {
102
96
  minLengthBytes: TIME_OFFSET_INDEX
103
97
  },
@@ -114,7 +108,7 @@ const standardGlucoseDevice = params => defineCustomDevice({
114
108
  description: "A record without a concentration"
115
109
  })
116
110
  }, {
117
- uuid: sigUuid("2a52"),
111
+ uuid: RECORD_ACCESS_CONTROL_POINT_UUID,
118
112
  frame: {
119
113
  minLengthBytes: 2
120
114
  },
@@ -128,23 +122,22 @@ const standardGlucoseDevice = params => defineCustomDevice({
128
122
  kind: "idle",
129
123
  description: "Record access response"
130
124
  }]
131
- }],
132
- write: {
133
- uuid: sigUuid("2a52"),
134
- commandHex: REPORT_ALL_STORED_RECORDS,
135
- when: "connect"
136
- }
125
+ }]
137
126
  }]
138
127
  }, {
128
+ createCommandSequencer: createGlucoseSequencer,
139
129
  decorateReading: (reading, frame, recordOffset) => {
140
- if (frame && isControlSolution(frame)) {
130
+ if (frame && (isControlSolution(frame) || hasUnusableSensorStatus(frame))) {
141
131
  return null;
142
132
  }
143
133
  const recordedAt = frame ? recordedAtFromGlucoseFrame(frame) : undefined;
144
- const decorated = recordedAt ? {
134
+ const decorated = {
145
135
  ...reading,
146
- recordedAt
147
- } : reading;
136
+ ...(frame && glucoseRecordDetails(frame)),
137
+ ...(recordedAt && {
138
+ recordedAt
139
+ })
140
+ };
148
141
  return params.decorateReading ? params.decorateReading(decorated, frame, recordOffset) : decorated;
149
142
  }
150
143
  });