@ovok/native 1.16.1-dev.2099 → 1.16.1-dev.2101

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 (73) hide show
  1. package/lib/commonjs/modules/next/bluetooth/channel.js +89 -0
  2. package/lib/commonjs/modules/next/bluetooth/channel.js.map +1 -0
  3. package/lib/commonjs/modules/next/bluetooth/driver.js +48 -0
  4. package/lib/commonjs/modules/next/bluetooth/driver.js.map +1 -0
  5. package/lib/commonjs/modules/next/bluetooth/drivers.js +20 -0
  6. package/lib/commonjs/modules/next/bluetooth/drivers.js.map +1 -0
  7. package/lib/commonjs/modules/next/bluetooth/index.js +65 -0
  8. package/lib/commonjs/modules/next/bluetooth/index.js.map +1 -0
  9. package/lib/commonjs/modules/next/bluetooth/legacy-driver.js +55 -0
  10. package/lib/commonjs/modules/next/bluetooth/legacy-driver.js.map +1 -0
  11. package/lib/commonjs/modules/next/bluetooth/link.js +105 -0
  12. package/lib/commonjs/modules/next/bluetooth/link.js.map +1 -0
  13. package/lib/commonjs/modules/next/bluetooth/result-policy.js +69 -0
  14. package/lib/commonjs/modules/next/bluetooth/result-policy.js.map +1 -0
  15. package/lib/commonjs/modules/next/bluetooth/sig-profiles.js +164 -0
  16. package/lib/commonjs/modules/next/bluetooth/sig-profiles.js.map +1 -0
  17. package/lib/commonjs/modules/next/bluetooth/sig-values.js +46 -0
  18. package/lib/commonjs/modules/next/bluetooth/sig-values.js.map +1 -0
  19. package/lib/module/modules/next/bluetooth/channel.js +85 -0
  20. package/lib/module/modules/next/bluetooth/channel.js.map +1 -0
  21. package/lib/module/modules/next/bluetooth/driver.js +45 -0
  22. package/lib/module/modules/next/bluetooth/driver.js.map +1 -0
  23. package/lib/module/modules/next/bluetooth/drivers.js +17 -0
  24. package/lib/module/modules/next/bluetooth/drivers.js.map +1 -0
  25. package/lib/module/modules/next/bluetooth/index.js +8 -0
  26. package/lib/module/modules/next/bluetooth/index.js.map +1 -0
  27. package/lib/module/modules/next/bluetooth/legacy-driver.js +51 -0
  28. package/lib/module/modules/next/bluetooth/legacy-driver.js.map +1 -0
  29. package/lib/module/modules/next/bluetooth/link.js +103 -0
  30. package/lib/module/modules/next/bluetooth/link.js.map +1 -0
  31. package/lib/module/modules/next/bluetooth/result-policy.js +61 -0
  32. package/lib/module/modules/next/bluetooth/result-policy.js.map +1 -0
  33. package/lib/module/modules/next/bluetooth/sig-profiles.js +156 -0
  34. package/lib/module/modules/next/bluetooth/sig-profiles.js.map +1 -0
  35. package/lib/module/modules/next/bluetooth/sig-values.js +38 -0
  36. package/lib/module/modules/next/bluetooth/sig-values.js.map +1 -0
  37. package/lib/typescript/commonjs/src/modules/next/bluetooth/channel.d.ts +19 -0
  38. package/lib/typescript/commonjs/src/modules/next/bluetooth/channel.d.ts.map +1 -0
  39. package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts +32 -0
  40. package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts.map +1 -0
  41. package/lib/typescript/commonjs/src/modules/next/bluetooth/drivers.d.ts +7 -0
  42. package/lib/typescript/commonjs/src/modules/next/bluetooth/drivers.d.ts.map +1 -0
  43. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +9 -0
  44. package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -0
  45. package/lib/typescript/commonjs/src/modules/next/bluetooth/legacy-driver.d.ts +8 -0
  46. package/lib/typescript/commonjs/src/modules/next/bluetooth/legacy-driver.d.ts.map +1 -0
  47. package/lib/typescript/commonjs/src/modules/next/bluetooth/link.d.ts +13 -0
  48. package/lib/typescript/commonjs/src/modules/next/bluetooth/link.d.ts.map +1 -0
  49. package/lib/typescript/commonjs/src/modules/next/bluetooth/result-policy.d.ts +14 -0
  50. package/lib/typescript/commonjs/src/modules/next/bluetooth/result-policy.d.ts.map +1 -0
  51. package/lib/typescript/commonjs/src/modules/next/bluetooth/sig-profiles.d.ts +16 -0
  52. package/lib/typescript/commonjs/src/modules/next/bluetooth/sig-profiles.d.ts.map +1 -0
  53. package/lib/typescript/commonjs/src/modules/next/bluetooth/sig-values.d.ts +15 -0
  54. package/lib/typescript/commonjs/src/modules/next/bluetooth/sig-values.d.ts.map +1 -0
  55. package/lib/typescript/module/src/modules/next/bluetooth/channel.d.ts +19 -0
  56. package/lib/typescript/module/src/modules/next/bluetooth/channel.d.ts.map +1 -0
  57. package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts +32 -0
  58. package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts.map +1 -0
  59. package/lib/typescript/module/src/modules/next/bluetooth/drivers.d.ts +7 -0
  60. package/lib/typescript/module/src/modules/next/bluetooth/drivers.d.ts.map +1 -0
  61. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +9 -0
  62. package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -0
  63. package/lib/typescript/module/src/modules/next/bluetooth/legacy-driver.d.ts +8 -0
  64. package/lib/typescript/module/src/modules/next/bluetooth/legacy-driver.d.ts.map +1 -0
  65. package/lib/typescript/module/src/modules/next/bluetooth/link.d.ts +13 -0
  66. package/lib/typescript/module/src/modules/next/bluetooth/link.d.ts.map +1 -0
  67. package/lib/typescript/module/src/modules/next/bluetooth/result-policy.d.ts +14 -0
  68. package/lib/typescript/module/src/modules/next/bluetooth/result-policy.d.ts.map +1 -0
  69. package/lib/typescript/module/src/modules/next/bluetooth/sig-profiles.d.ts +16 -0
  70. package/lib/typescript/module/src/modules/next/bluetooth/sig-profiles.d.ts.map +1 -0
  71. package/lib/typescript/module/src/modules/next/bluetooth/sig-values.d.ts +15 -0
  72. package/lib/typescript/module/src/modules/next/bluetooth/sig-values.d.ts.map +1 -0
  73. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"names":["MeasurementTypeKey","BloodPressureStates","sigUuid","dateTimeAt","decodeFrame","floatAt","roundTo","sfloatAt","withDefined","KPA_TO_MMHG","KG_PER_SI_COUNT","KG_PER_IMPERIAL_COUNT","WEIGHT_UNSUCCESSFUL","DATE_TIME_BYTES","BP_KPA","BP_TIMESTAMP","BP_PULSE","BP_USER","BP_STATUS","BP_BODY_MOVEMENT","BP_LOOSE_CUFF","BP_IRREGULAR_PULSE","TEMPERATURE_FAHRENHEIT","TEMPERATURE_TIMESTAMP","WEIGHT_IMPERIAL","WEIGHT_TIMESTAMP","PLX_TIMESTAMP","HEART_RATE_UINT16","HEART_RATE_CONTACT_BITS","HEART_RATE_NO_CONTACT","bloodPressureStatus","status","DISTURB_DETECTED","LOOSE_SLEEVE","REGULAR","bloodPressureExtras","view","flags","offset","extras","recordedAt","heartRate","user","getUint8","memorySlot","undefined","getUint16","irregularHeartbeat","bloodPressure","pressure","value","systolic","diastolic","mean","map","reading","measurementTypeKey","meanArterialPressure","temperature","bodyTemp","bodyWeight","counts","pulseOximetry","bloodOxygen","pulseRate","bloodOxygenPulseRate","subscribed","service","characteristic","decode","link","frame","subscribe","SIG_PROTOCOLS","Map"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/sig-profiles.ts"],"mappings":";;AAAA,SAKEA,kBAAkB,QAEb,iBAAiB;AAExB,SAASC,mBAAmB,QAAQ,oDAAiD;AACrF,SAASC,OAAO,QAAQ,uCAAoC;AAG5D,SAASC,UAAU,EAAEC,WAAW,EAAWC,OAAO,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,iBAAc;AAExG,MAAMC,WAAW,GAAG,OAAO;AAC3B,MAAMC,eAAe,GAAG,KAAK;AAC7B,MAAMC,qBAAqB,GAAG,IAAI,GAAG,UAAU;AAC/C,MAAMC,mBAAmB,GAAG,MAAM;AAClC,MAAMC,eAAe,GAAG,CAAC;AAEzB,MAAMC,MAAM,GAAG,IAAI;AACnB,MAAMC,YAAY,GAAG,IAAI;AACzB,MAAMC,QAAQ,GAAG,IAAI;AACrB,MAAMC,OAAO,GAAG,IAAI;AACpB,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAM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tE,OAAO,CAACiE,OAAO,CAAC,EAAEjE,OAAO,CAACkE,cAAc,CAAC,CAAC,EAAE;IACnF,MAAMb,OAAO,GAAGnD,WAAW,CAACiE,MAAM,EAAEE,KAAK,CAAC;IAE1C,IAAIhB,OAAO,EAAE;MACX,MAAMA,OAAO;IACf;EACF;AACF,CAAC;;AAEH;AACA,MAAMkB,aAAkD,GAAG,IAAIC,GAAG,CAAC,CACjE,CAAC,yBAAyB,EAAER,UAAU,CAAC,MAAM,EAAE,MAAM,EAAElB,aAAa,CAAC,CAAC,EACtE,CAAC,2BAA2B,EAAEkB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAER,WAAW,CAAC,CAAC,EACtE,CAAC,sBAAsB,EAAEQ,UAAU,CAAC,MAAM,EAAE,MAAM,EAAEN,UAAU,CAAC,CAAC,EAChE,CAAC,kCAAkC,EAAEM,UAAU,CAAC,MAAM,EAAE,MAAM,EAAEJ,aAAa,CAAC,CAAC,EAC/E,CAAC,qBAAqB,EAAEI,UAAU,CAAC,MAAM,EAAE,MAAM,EAAEzB,SAAS,CAAC,CAAC,CAC/D,CAAC;AAEF,SAASO,aAAa,EAAEY,UAAU,EAAEnB,SAAS,EAAEqB,aAAa,EAAEW,aAAa,EAAEf,WAAW","ignoreList":[]}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ import { decodeMedicalFloat } from "../../bt-management/utils/decode-medical-float.js";
4
+
5
+ /** Reads one GATT value; undefined when it holds no reading. */
6
+
7
+ const sfloatAt = (view, offset) => decodeMedicalFloat(view.getUint16(offset, true), 4, 12);
8
+ const floatAt = (view, offset) => decodeMedicalFloat(view.getUint32(offset, true), 8, 24);
9
+
10
+ /** The SIG Date Time characteristic as a phone-local date; undefined for unknown or impossible fields. */
11
+ const dateTimeAt = (view, offset) => {
12
+ const fields = [view.getUint16(offset, true), ...[2, 3, 4, 5, 6].map(index => view.getUint8(offset + index))];
13
+ const [year = 0, month = 0, day = 0, hours = 0, minutes = 0, seconds = 0] = fields;
14
+ const date = new Date(year, month - 1, day, hours, minutes, seconds);
15
+ const stored = [date.getFullYear(), date.getMonth() + 1, date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds()];
16
+ return fields.every((field, index) => field === stored[index]) ? date : undefined;
17
+ };
18
+ const roundTo = (value, decimals) => Number(value.toFixed(decimals));
19
+
20
+ /** `reading` plus each of `fields` that has a value. */
21
+ const withDefined = (reading, fields) => ({
22
+ ...reading,
23
+ ...Object.fromEntries(Object.entries(fields).filter(([, value]) => value !== undefined))
24
+ });
25
+
26
+ /** A frame too short for what its flags announce holds no reading. */
27
+ const decodeFrame = (decode, frame) => {
28
+ try {
29
+ return decode(new DataView(frame.buffer, frame.byteOffset, frame.byteLength));
30
+ } catch (error) {
31
+ if (error instanceof RangeError) {
32
+ return undefined;
33
+ }
34
+ throw error;
35
+ }
36
+ };
37
+ export { dateTimeAt, decodeFrame, floatAt, roundTo, sfloatAt, withDefined };
38
+ //# sourceMappingURL=sig-values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["decodeMedicalFloat","sfloatAt","view","offset","getUint16","floatAt","getUint32","dateTimeAt","fields","map","index","getUint8","year","month","day","hours","minutes","seconds","date","Date","stored","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","every","field","undefined","roundTo","value","decimals","Number","toFixed","withDefined","reading","Object","fromEntries","entries","filter","decodeFrame","decode","frame","DataView","buffer","byteOffset","byteLength","error","RangeError"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/sig-values.ts"],"mappings":";;AAEA,SAASA,kBAAkB,QAAQ,mDAAgD;;AAEnF;;AAGA,MAAMC,QAAQ,GAAGA,CAACC,IAAc,EAAEC,MAAc,KAC9CH,kBAAkB,CAACE,IAAI,CAACE,SAAS,CAACD,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;AAEzD,MAAME,OAAO,GAAGA,CAACH,IAAc,EAAEC,MAAc,KAC7CH,kBAAkB,CAACE,IAAI,CAAC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Q,CAAC,CAAC;;AAE5F;AACA,MAAMG,WAAW,GAAGA,CAAwBC,OAAU,EAAE5B,MAAkB,MAAS;EACjF,GAAG4B,OAAO;EACV,GAAGC,MAAM,CAACC,WAAW,CAACD,MAAM,CAACE,OAAO,CAAC/B,MAAM,CAAC,CAACgC,MAAM,CAAC,CAAC,GAAGT,KAAK,CAAC,KAAKA,KAAK,KAAKF,SAAS,CAAC;AACzF,CAAC,CAAC;;AAEF;AACA,MAAMY,WAAW,GAAGA,CAACC,MAAe,EAAEC,KAAiB,KAA8B;EACnF,IAAI;IACF,OAAOD,MAAM,CAAC,IAAIE,QAAQ,CAACD,KAAK,CAACE,MAAM,EAAEF,KAAK,CAACG,UAAU,EAAEH,KAAK,CAACI,UAAU,CAAC,CAAC;EAC/E,CAAC,CAAC,OAAOC,KAAK,EAAE;IACd,IAAIA,KAAK,YAAYC,UAAU,EAAE;MAC/B,OAAOpB,SAAS;IAClB;IACA,MAAMmB,KAAK;EACb;AACF,CAAC;AAED,SAASzC,UAAU,EAAEkC,WAAW,EAAEpC,OAAO,EAAEyB,OAAO,EAAE7B,QAAQ,EAAEkC,WAAW","ignoreList":[]}
@@ -0,0 +1,19 @@
1
+ /** Callback-pushed values as an async iterator for one consumer; `onClose` runs once, however it ends. */
2
+ declare class Channel<T> implements AsyncIterableIterator<T> {
3
+ private readonly onClose;
4
+ private readonly buffered;
5
+ private waiter;
6
+ private failure;
7
+ private closed;
8
+ constructor(onClose?: () => void);
9
+ push(value: T): void;
10
+ end(): void;
11
+ fail(error: unknown): void;
12
+ next(): Promise<IteratorResult<T>>;
13
+ return(): Promise<IteratorResult<T>>;
14
+ [Symbol.asyncIterator](): AsyncIterableIterator<T>;
15
+ private close;
16
+ private takeWaiter;
17
+ }
18
+ export { Channel };
19
+ //# sourceMappingURL=channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/channel.ts"],"names":[],"mappings":"AAOA,0GAA0G;AAC1G,cAAM,OAAO,CAAC,CAAC,CAAE,YAAW,qBAAqB,CAAC,CAAC,CAAC;IAM/B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAL3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;IACpC,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,MAAM,CAAS;gBAEa,OAAO,GAAE,MAAM,IAAe;IAE3D,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IAcpB,GAAG,IAAI,IAAI;IAMX,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAO1B,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAkBlC,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAOpC,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC;IAIzD,OAAO,CAAC,KAAK;IAWb,OAAO,CAAC,UAAU;CAOnB;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { Measurement } from "@ovok/core/next";
2
+ import { Device } from "react-native-ble-plx";
3
+ import { BluetoothError } from "../../bt-management/types/bluetooth-error";
4
+ import { DeviceConnectionEvent } from "../../bt-management/types/device-connection-event";
5
+ import { DeviceKey } from "../../bt-management/types/device-key";
6
+ import { DeviceStatus } from "../../bt-management/types/device-status";
7
+ import { Link } from "./link";
8
+ type DeviceEvent = {
9
+ kind: "status";
10
+ status: DeviceStatus;
11
+ }
12
+ /** `id` stays the same when a device sends the same stored reading again. */
13
+ | {
14
+ kind: "reading";
15
+ id: string;
16
+ reading: Measurement;
17
+ } | {
18
+ kind: "connection";
19
+ event: Omit<DeviceConnectionEvent, "deviceData">;
20
+ } | {
21
+ kind: "error";
22
+ error: BluetoothError | Error | string;
23
+ };
24
+ /** Connects to a scanned device and reports what happens until it disconnects or `signal` aborts. */
25
+ type Driver = (device: Device, signal: AbortSignal) => AsyncIterable<DeviceEvent>;
26
+ /** One device's conversation over a link, as the readings it produces. */
27
+ type DeviceProtocol = (link: Link) => AsyncIterable<Measurement>;
28
+ /** Runs a protocol over a fresh BLE link. */
29
+ declare const gattDriver: (deviceName: DeviceKey, protocol: DeviceProtocol) => Driver;
30
+ export { gattDriver };
31
+ export type { DeviceEvent, DeviceProtocol, Driver };
32
+ //# sourceMappingURL=driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAGvE,OAAO,EAAE,IAAI,EAAe,MAAM,QAAQ,CAAC;AAE3C,KAAK,WAAW,GACZ;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE;AAE1C,6EAA6E;GAC3E;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,IAAI,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAA;CAAE,GACxE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,cAAc,GAAG,KAAK,GAAG,MAAM,CAAA;CAAE,CAAC;AAE9D,qGAAqG;AACrG,KAAK,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,aAAa,CAAC,WAAW,CAAC,CAAC;AAElF,0EAA0E;AAC1E,KAAK,cAAc,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,aAAa,CAAC,WAAW,CAAC,CAAC;AAWjE,6CAA6C;AAC7C,QAAA,MAAM,UAAU,GAAI,YAAY,SAAS,EAAE,UAAU,cAAc,KAAG,MAcnE,CAAC;AAEJ,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { AcceptedDevice } from "../../bt-management/types/accepted-device";
2
+ import { DeviceKey } from "../../bt-management/types/device-key";
3
+ import { Driver } from "./driver";
4
+ /** The driver for each device key `accepted` can resolve: its native protocol, else its legacy class. */
5
+ declare const createDrivers: (accepted: readonly AcceptedDevice[]) => ((deviceName: DeviceKey) => Driver);
6
+ export { createDrivers };
7
+ //# sourceMappingURL=drivers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drivers.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/drivers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAC;AAI9C,yGAAyG;AACzG,QAAA,MAAM,aAAa,GAAI,UAAU,SAAS,cAAc,EAAE,KAAG,CAAC,CAAC,UAAU,EAAE,SAAS,KAAK,MAAM,CAQ9F,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { gattDriver } from "./driver";
2
+ export type { DeviceEvent, DeviceProtocol, Driver } from "./driver";
3
+ export { createDrivers } from "./drivers";
4
+ export { openBleLink } from "./link";
5
+ export type { Link } from "./link";
6
+ export { dailyTotalsOnly, everyReading, firstReadingPerKind, keepReadings, policyByKind } from "./result-policy";
7
+ export type { ResultPolicy } from "./result-policy";
8
+ export { SIG_PROTOCOLS } from "./sig-profiles";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjH,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { DeviceCreator } from "../../bt-management/services/device-creator";
2
+ import { AcceptedDevice } from "../../bt-management/types/accepted-device";
3
+ import { DeviceKey } from "../../bt-management/types/device-key";
4
+ import { Driver } from "./driver";
5
+ /** Runs a device class from `@ovok/native/bt-management` until its protocol moves to a `DeviceProtocol`. */
6
+ declare const legacyDriver: (creator: DeviceCreator<readonly AcceptedDevice[]>, deviceName: DeviceKey) => Driver;
7
+ export { legacyDriver };
8
+ //# sourceMappingURL=legacy-driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-driver.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/legacy-driver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAIjE,OAAO,EAAe,MAAM,EAAE,MAAM,UAAU,CAAC;AAE/C,4GAA4G;AAC5G,QAAA,MAAM,YAAY,GAAI,SAAS,aAAa,CAAC,SAAS,cAAc,EAAE,CAAC,EAAE,YAAY,SAAS,KAAG,MAsB9F,CAAC;AAEJ,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Device } from "react-native-ble-plx";
2
+ /** An open GATT connection: bytes in, bytes out, no knowledge of any device. */
3
+ type Link = {
4
+ /** Notified or indicated values until the connection drops. */
5
+ subscribe(service: string, characteristic: string): AsyncIterable<Uint8Array>;
6
+ write(service: string, characteristic: string, bytes: Uint8Array): Promise<void>;
7
+ close(): Promise<void>;
8
+ };
9
+ /** Connects (retrying with backoff) and discovers services; aborting `signal` closes the link. */
10
+ declare function openBleLink(device: Device, signal: AbortSignal): Promise<Link>;
11
+ export { openBleLink };
12
+ export type { Link };
13
+ //# sourceMappingURL=link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAgB,MAAM,sBAAsB,CAAC;AAOtE,gFAAgF;AAChF,KAAK,IAAI,GAAG;IAEV,+DAA+D;IAC/D,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;IAC9E,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjF,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB,CAAC;AAsGF,kGAAkG;AAClG,iBAAe,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAc7E;AAED,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,YAAY,EAAE,IAAI,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Measurement, MeasurementTypeKey } from "@ovok/core/next";
2
+ import { DeviceEvent } from "./driver";
3
+ /** Makes, for each connection, the test of which readings to keep. */
4
+ type ResultPolicy = () => (reading: Measurement) => boolean;
5
+ declare const everyReading: ResultPolicy;
6
+ declare const firstReadingPerKind: ResultPolicy;
7
+ /** Activity totals count only once their day has closed, and each day only once. */
8
+ declare const dailyTotalsOnly: ResultPolicy;
9
+ declare const policyByKind: (policies: Partial<Record<MeasurementTypeKey, ResultPolicy>>, fallback?: ResultPolicy) => ResultPolicy;
10
+ /** A driver's events minus the readings `policy` drops. */
11
+ declare function keepReadings(events: AsyncIterable<DeviceEvent>, policy: ResultPolicy): AsyncIterable<DeviceEvent>;
12
+ export { dailyTotalsOnly, everyReading, firstReadingPerKind, keepReadings, policyByKind };
13
+ export type { ResultPolicy };
14
+ //# sourceMappingURL=result-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-policy.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/result-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAIlE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,sEAAsE;AACtE,KAAK,YAAY,GAAG,MAAM,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC;AAE5D,QAAA,MAAM,YAAY,EAAE,YAA+B,CAAC;AAEpD,QAAA,MAAM,mBAAmB,EAAE,YAY1B,CAAC;AAEF,oFAAoF;AACpF,QAAA,MAAM,eAAe,EAAE,YAoBtB,CAAC;AAEF,QAAA,MAAM,YAAY,GAChB,UAAU,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC,EAC3D,WAAU,YAA2B,KACpC,YAkBA,CAAC;AAEJ,2DAA2D;AAC3D,iBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC,CAQjH;AAED,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AAC1F,YAAY,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { DeviceProtocol } from "./driver";
2
+ import { Decoder } from "./sig-values";
3
+ /** Blood Pressure Measurement 0x2A35, in mmHg. */
4
+ declare const bloodPressure: Decoder;
5
+ /** Temperature Measurement 0x2A1C, in Celsius. */
6
+ declare const temperature: Decoder;
7
+ /** Weight Measurement 0x2A9D, in kilograms. */
8
+ declare const bodyWeight: Decoder;
9
+ /** PLX Spot-Check Measurement 0x2A5E. */
10
+ declare const pulseOximetry: Decoder;
11
+ /** Heart Rate Measurement 0x2A37; a strap reporting no skin contact has no reading. */
12
+ declare const heartRate: Decoder;
13
+ /** By the ids the SDK catalog gives the Bluetooth SIG profiles. */
14
+ declare const SIG_PROTOCOLS: ReadonlyMap<string, DeviceProtocol>;
15
+ export { bloodPressure, bodyWeight, heartRate, pulseOximetry, SIG_PROTOCOLS, temperature };
16
+ //# sourceMappingURL=sig-profiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sig-profiles.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/sig-profiles.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAA2B,OAAO,EAA2C,MAAM,cAAc,CAAC;AAkEzG,kDAAkD;AAClD,QAAA,MAAM,aAAa,EAAE,OAmBpB,CAAC;AAEF,kDAAkD;AAClD,QAAA,MAAM,WAAW,EAAE,OAclB,CAAC;AAEF,+CAA+C;AAC/C,QAAA,MAAM,UAAU,EAAE,OAcjB,CAAC;AAEF,yCAAyC;AACzC,QAAA,MAAM,aAAa,EAAE,OAgBpB,CAAC;AAEF,uFAAuF;AACvF,QAAA,MAAM,SAAS,EAAE,OAahB,CAAC;AAaF,mEAAmE;AACnE,QAAA,MAAM,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAMrD,CAAC;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Measurement } from "@ovok/core/next";
2
+ /** Reads one GATT value; undefined when it holds no reading. */
3
+ type Decoder = (view: DataView) => Measurement | undefined;
4
+ declare const sfloatAt: (view: DataView, offset: number) => number | undefined;
5
+ declare const floatAt: (view: DataView, offset: number) => number | undefined;
6
+ /** The SIG Date Time characteristic as a phone-local date; undefined for unknown or impossible fields. */
7
+ declare const dateTimeAt: (view: DataView, offset: number) => Date | undefined;
8
+ declare const roundTo: (value: number, decimals: number) => number;
9
+ /** `reading` plus each of `fields` that has a value. */
10
+ declare const withDefined: <T extends Measurement>(reading: T, fields: Partial<T>) => T;
11
+ /** A frame too short for what its flags announce holds no reading. */
12
+ declare const decodeFrame: (decode: Decoder, frame: Uint8Array) => Measurement | undefined;
13
+ export { dateTimeAt, decodeFrame, floatAt, roundTo, sfloatAt, withDefined };
14
+ export type { Decoder };
15
+ //# sourceMappingURL=sig-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sig-values.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/sig-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9C,gEAAgE;AAChE,KAAK,OAAO,GAAG,CAAC,IAAI,EAAE,QAAQ,KAAK,WAAW,GAAG,SAAS,CAAC;AAE3D,QAAA,MAAM,QAAQ,GAAI,MAAM,QAAQ,EAAE,QAAQ,MAAM,KAAG,MAAM,GAAG,SACH,CAAC;AAE1D,QAAA,MAAM,OAAO,GAAI,MAAM,QAAQ,EAAE,QAAQ,MAAM,KAAG,MAAM,GAAG,SACF,CAAC;AAE1D,0GAA0G;AAC1G,QAAA,MAAM,UAAU,GAAI,MAAM,QAAQ,EAAE,QAAQ,MAAM,KAAG,IAAI,GAAG,SAO3D,CAAC;AAEF,QAAA,MAAM,OAAO,GAAI,OAAO,MAAM,EAAE,UAAU,MAAM,KAAG,MAAyC,CAAC;AAE7F,wDAAwD;AACxD,QAAA,MAAM,WAAW,GAAI,CAAC,SAAS,WAAW,EAAE,SAAS,CAAC,EAAE,QAAQ,OAAO,CAAC,CAAC,CAAC,KAAG,CAG3E,CAAC;AAEH,sEAAsE;AACtE,QAAA,MAAM,WAAW,GAAI,QAAQ,OAAO,EAAE,OAAO,UAAU,KAAG,WAAW,GAAG,SASvE,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;AAC5E,YAAY,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,19 @@
1
+ /** Callback-pushed values as an async iterator for one consumer; `onClose` runs once, however it ends. */
2
+ declare class Channel<T> implements AsyncIterableIterator<T> {
3
+ private readonly onClose;
4
+ private readonly buffered;
5
+ private waiter;
6
+ private failure;
7
+ private closed;
8
+ constructor(onClose?: () => void);
9
+ push(value: T): void;
10
+ end(): void;
11
+ fail(error: unknown): void;
12
+ next(): Promise<IteratorResult<T>>;
13
+ return(): Promise<IteratorResult<T>>;
14
+ [Symbol.asyncIterator](): AsyncIterableIterator<T>;
15
+ private close;
16
+ private takeWaiter;
17
+ }
18
+ export { Channel };
19
+ //# sourceMappingURL=channel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/channel.ts"],"names":[],"mappings":"AAOA,0GAA0G;AAC1G,cAAM,OAAO,CAAC,CAAC,CAAE,YAAW,qBAAqB,CAAC,CAAC,CAAC;IAM/B,OAAO,CAAC,QAAQ,CAAC,OAAO;IAL3C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAW;IACpC,OAAO,CAAC,MAAM,CAAwB;IACtC,OAAO,CAAC,OAAO,CAAiC;IAChD,OAAO,CAAC,MAAM,CAAS;gBAEa,OAAO,GAAE,MAAM,IAAe;IAE3D,IAAI,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IAcpB,GAAG,IAAI,IAAI;IAMX,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAO1B,IAAI,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAkBlC,MAAM,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAOpC,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,qBAAqB,CAAC,CAAC,CAAC;IAIzD,OAAO,CAAC,KAAK;IAWb,OAAO,CAAC,UAAU;CAOnB;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { Measurement } from "@ovok/core/next";
2
+ import { Device } from "react-native-ble-plx";
3
+ import { BluetoothError } from "../../bt-management/types/bluetooth-error";
4
+ import { DeviceConnectionEvent } from "../../bt-management/types/device-connection-event";
5
+ import { DeviceKey } from "../../bt-management/types/device-key";
6
+ import { DeviceStatus } from "../../bt-management/types/device-status";
7
+ import { Link } from "./link";
8
+ type DeviceEvent = {
9
+ kind: "status";
10
+ status: DeviceStatus;
11
+ }
12
+ /** `id` stays the same when a device sends the same stored reading again. */
13
+ | {
14
+ kind: "reading";
15
+ id: string;
16
+ reading: Measurement;
17
+ } | {
18
+ kind: "connection";
19
+ event: Omit<DeviceConnectionEvent, "deviceData">;
20
+ } | {
21
+ kind: "error";
22
+ error: BluetoothError | Error | string;
23
+ };
24
+ /** Connects to a scanned device and reports what happens until it disconnects or `signal` aborts. */
25
+ type Driver = (device: Device, signal: AbortSignal) => AsyncIterable<DeviceEvent>;
26
+ /** One device's conversation over a link, as the readings it produces. */
27
+ type DeviceProtocol = (link: Link) => AsyncIterable<Measurement>;
28
+ /** Runs a protocol over a fresh BLE link. */
29
+ declare const gattDriver: (deviceName: DeviceKey, protocol: DeviceProtocol) => Driver;
30
+ export { gattDriver };
31
+ export type { DeviceEvent, DeviceProtocol, Driver };
32
+ //# sourceMappingURL=driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"driver.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAC;AAGvE,OAAO,EAAE,IAAI,EAAe,MAAM,QAAQ,CAAC;AAE3C,KAAK,WAAW,GACZ;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE;AAE1C,6EAA6E;GAC3E;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,KAAK,EAAE,IAAI,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAA;CAAE,GACxE;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,cAAc,GAAG,KAAK,GAAG,MAAM,CAAA;CAAE,CAAC;AAE9D,qGAAqG;AACrG,KAAK,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,aAAa,CAAC,WAAW,CAAC,CAAC;AAElF,0EAA0E;AAC1E,KAAK,cAAc,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,aAAa,CAAC,WAAW,CAAC,CAAC;AAWjE,6CAA6C;AAC7C,QAAA,MAAM,UAAU,GAAI,YAAY,SAAS,EAAE,UAAU,cAAc,KAAG,MAcnE,CAAC;AAEJ,OAAO,EAAE,UAAU,EAAE,CAAC;AACtB,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { AcceptedDevice } from "../../bt-management/types/accepted-device";
2
+ import { DeviceKey } from "../../bt-management/types/device-key";
3
+ import { Driver } from "./driver";
4
+ /** The driver for each device key `accepted` can resolve: its native protocol, else its legacy class. */
5
+ declare const createDrivers: (accepted: readonly AcceptedDevice[]) => ((deviceName: DeviceKey) => Driver);
6
+ export { createDrivers };
7
+ //# sourceMappingURL=drivers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drivers.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/drivers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAc,MAAM,UAAU,CAAC;AAI9C,yGAAyG;AACzG,QAAA,MAAM,aAAa,GAAI,UAAU,SAAS,cAAc,EAAE,KAAG,CAAC,CAAC,UAAU,EAAE,SAAS,KAAK,MAAM,CAQ9F,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { gattDriver } from "./driver";
2
+ export type { DeviceEvent, DeviceProtocol, Driver } from "./driver";
3
+ export { createDrivers } from "./drivers";
4
+ export { openBleLink } from "./link";
5
+ export type { Link } from "./link";
6
+ export { dailyTotalsOnly, everyReading, firstReadingPerKind, keepReadings, policyByKind } from "./result-policy";
7
+ export type { ResultPolicy } from "./result-policy";
8
+ export { SIG_PROTOCOLS } from "./sig-profiles";
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,YAAY,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjH,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { DeviceCreator } from "../../bt-management/services/device-creator";
2
+ import { AcceptedDevice } from "../../bt-management/types/accepted-device";
3
+ import { DeviceKey } from "../../bt-management/types/device-key";
4
+ import { Driver } from "./driver";
5
+ /** Runs a device class from `@ovok/native/bt-management` until its protocol moves to a `DeviceProtocol`. */
6
+ declare const legacyDriver: (creator: DeviceCreator<readonly AcceptedDevice[]>, deviceName: DeviceKey) => Driver;
7
+ export { legacyDriver };
8
+ //# sourceMappingURL=legacy-driver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"legacy-driver.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/legacy-driver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AAIjE,OAAO,EAAe,MAAM,EAAE,MAAM,UAAU,CAAC;AAE/C,4GAA4G;AAC5G,QAAA,MAAM,YAAY,GAAI,SAAS,aAAa,CAAC,SAAS,cAAc,EAAE,CAAC,EAAE,YAAY,SAAS,KAAG,MAsB9F,CAAC;AAEJ,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { Device } from "react-native-ble-plx";
2
+ /** An open GATT connection: bytes in, bytes out, no knowledge of any device. */
3
+ type Link = {
4
+ /** Notified or indicated values until the connection drops. */
5
+ subscribe(service: string, characteristic: string): AsyncIterable<Uint8Array>;
6
+ write(service: string, characteristic: string, bytes: Uint8Array): Promise<void>;
7
+ close(): Promise<void>;
8
+ };
9
+ /** Connects (retrying with backoff) and discovers services; aborting `signal` closes the link. */
10
+ declare function openBleLink(device: Device, signal: AbortSignal): Promise<Link>;
11
+ export { openBleLink };
12
+ export type { Link };
13
+ //# sourceMappingURL=link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,MAAM,EAAgB,MAAM,sBAAsB,CAAC;AAOtE,gFAAgF;AAChF,KAAK,IAAI,GAAG;IAEV,+DAA+D;IAC/D,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;IAC9E,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjF,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB,CAAC;AAsGF,kGAAkG;AAClG,iBAAe,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAc7E;AAED,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,YAAY,EAAE,IAAI,EAAE,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Measurement, MeasurementTypeKey } from "@ovok/core/next";
2
+ import { DeviceEvent } from "./driver";
3
+ /** Makes, for each connection, the test of which readings to keep. */
4
+ type ResultPolicy = () => (reading: Measurement) => boolean;
5
+ declare const everyReading: ResultPolicy;
6
+ declare const firstReadingPerKind: ResultPolicy;
7
+ /** Activity totals count only once their day has closed, and each day only once. */
8
+ declare const dailyTotalsOnly: ResultPolicy;
9
+ declare const policyByKind: (policies: Partial<Record<MeasurementTypeKey, ResultPolicy>>, fallback?: ResultPolicy) => ResultPolicy;
10
+ /** A driver's events minus the readings `policy` drops. */
11
+ declare function keepReadings(events: AsyncIterable<DeviceEvent>, policy: ResultPolicy): AsyncIterable<DeviceEvent>;
12
+ export { dailyTotalsOnly, everyReading, firstReadingPerKind, keepReadings, policyByKind };
13
+ export type { ResultPolicy };
14
+ //# sourceMappingURL=result-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"result-policy.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/result-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAIlE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,sEAAsE;AACtE,KAAK,YAAY,GAAG,MAAM,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC;AAE5D,QAAA,MAAM,YAAY,EAAE,YAA+B,CAAC;AAEpD,QAAA,MAAM,mBAAmB,EAAE,YAY1B,CAAC;AAEF,oFAAoF;AACpF,QAAA,MAAM,eAAe,EAAE,YAoBtB,CAAC;AAEF,QAAA,MAAM,YAAY,GAChB,UAAU,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC,EAC3D,WAAU,YAA2B,KACpC,YAkBA,CAAC;AAEJ,2DAA2D;AAC3D,iBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC,CAQjH;AAED,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,mBAAmB,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AAC1F,YAAY,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { DeviceProtocol } from "./driver";
2
+ import { Decoder } from "./sig-values";
3
+ /** Blood Pressure Measurement 0x2A35, in mmHg. */
4
+ declare const bloodPressure: Decoder;
5
+ /** Temperature Measurement 0x2A1C, in Celsius. */
6
+ declare const temperature: Decoder;
7
+ /** Weight Measurement 0x2A9D, in kilograms. */
8
+ declare const bodyWeight: Decoder;
9
+ /** PLX Spot-Check Measurement 0x2A5E. */
10
+ declare const pulseOximetry: Decoder;
11
+ /** Heart Rate Measurement 0x2A37; a strap reporting no skin contact has no reading. */
12
+ declare const heartRate: Decoder;
13
+ /** By the ids the SDK catalog gives the Bluetooth SIG profiles. */
14
+ declare const SIG_PROTOCOLS: ReadonlyMap<string, DeviceProtocol>;
15
+ export { bloodPressure, bodyWeight, heartRate, pulseOximetry, SIG_PROTOCOLS, temperature };
16
+ //# sourceMappingURL=sig-profiles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sig-profiles.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/sig-profiles.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAA2B,OAAO,EAA2C,MAAM,cAAc,CAAC;AAkEzG,kDAAkD;AAClD,QAAA,MAAM,aAAa,EAAE,OAmBpB,CAAC;AAEF,kDAAkD;AAClD,QAAA,MAAM,WAAW,EAAE,OAclB,CAAC;AAEF,+CAA+C;AAC/C,QAAA,MAAM,UAAU,EAAE,OAcjB,CAAC;AAEF,yCAAyC;AACzC,QAAA,MAAM,aAAa,EAAE,OAgBpB,CAAC;AAEF,uFAAuF;AACvF,QAAA,MAAM,SAAS,EAAE,OAahB,CAAC;AAaF,mEAAmE;AACnE,QAAA,MAAM,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,cAAc,CAMrD,CAAC;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Measurement } from "@ovok/core/next";
2
+ /** Reads one GATT value; undefined when it holds no reading. */
3
+ type Decoder = (view: DataView) => Measurement | undefined;
4
+ declare const sfloatAt: (view: DataView, offset: number) => number | undefined;
5
+ declare const floatAt: (view: DataView, offset: number) => number | undefined;
6
+ /** The SIG Date Time characteristic as a phone-local date; undefined for unknown or impossible fields. */
7
+ declare const dateTimeAt: (view: DataView, offset: number) => Date | undefined;
8
+ declare const roundTo: (value: number, decimals: number) => number;
9
+ /** `reading` plus each of `fields` that has a value. */
10
+ declare const withDefined: <T extends Measurement>(reading: T, fields: Partial<T>) => T;
11
+ /** A frame too short for what its flags announce holds no reading. */
12
+ declare const decodeFrame: (decode: Decoder, frame: Uint8Array) => Measurement | undefined;
13
+ export { dateTimeAt, decodeFrame, floatAt, roundTo, sfloatAt, withDefined };
14
+ export type { Decoder };
15
+ //# sourceMappingURL=sig-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sig-values.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/sig-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9C,gEAAgE;AAChE,KAAK,OAAO,GAAG,CAAC,IAAI,EAAE,QAAQ,KAAK,WAAW,GAAG,SAAS,CAAC;AAE3D,QAAA,MAAM,QAAQ,GAAI,MAAM,QAAQ,EAAE,QAAQ,MAAM,KAAG,MAAM,GAAG,SACH,CAAC;AAE1D,QAAA,MAAM,OAAO,GAAI,MAAM,QAAQ,EAAE,QAAQ,MAAM,KAAG,MAAM,GAAG,SACF,CAAC;AAE1D,0GAA0G;AAC1G,QAAA,MAAM,UAAU,GAAI,MAAM,QAAQ,EAAE,QAAQ,MAAM,KAAG,IAAI,GAAG,SAO3D,CAAC;AAEF,QAAA,MAAM,OAAO,GAAI,OAAO,MAAM,EAAE,UAAU,MAAM,KAAG,MAAyC,CAAC;AAE7F,wDAAwD;AACxD,QAAA,MAAM,WAAW,GAAI,CAAC,SAAS,WAAW,EAAE,SAAS,CAAC,EAAE,QAAQ,OAAO,CAAC,CAAC,CAAC,KAAG,CAG3E,CAAC;AAEH,sEAAsE;AACtE,QAAA,MAAM,WAAW,GAAI,QAAQ,OAAO,EAAE,OAAO,UAAU,KAAG,WAAW,GAAG,SASvE,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;AAC5E,YAAY,EAAE,OAAO,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ovok/native",
3
- "version": "1.16.1-dev.2099+050b7b2",
3
+ "version": "1.16.1-dev.2101+5edc1ae",
4
4
  "description": "React native component sdk for OVOK",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",