@ovok/native 1.17.0-dev.2252 → 1.17.0-dev.2254

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/families/trasense/history.js +19 -2
  2. package/lib/commonjs/modules/next/bluetooth/families/trasense/history.js.map +1 -1
  3. package/lib/commonjs/modules/next/bluetooth/families/trasense/models.js +15 -2
  4. package/lib/commonjs/modules/next/bluetooth/families/trasense/models.js.map +1 -1
  5. package/lib/commonjs/modules/next/bluetooth/families/trasense/protocol.js +15 -11
  6. package/lib/commonjs/modules/next/bluetooth/families/trasense/protocol.js.map +1 -1
  7. package/lib/commonjs/modules/next/bluetooth/families/trasense/replies.js +26 -1
  8. package/lib/commonjs/modules/next/bluetooth/families/trasense/replies.js.map +1 -1
  9. package/lib/commonjs/modules/next/bluetooth/families/trasense/requests.js +22 -3
  10. package/lib/commonjs/modules/next/bluetooth/families/trasense/requests.js.map +1 -1
  11. package/lib/commonjs/modules/next/bluetooth/families/trasense/s9.js +102 -0
  12. package/lib/commonjs/modules/next/bluetooth/families/trasense/s9.js.map +1 -0
  13. package/lib/commonjs/modules/next/bluetooth/families/trasense/session.js +32 -19
  14. package/lib/commonjs/modules/next/bluetooth/families/trasense/session.js.map +1 -1
  15. package/lib/commonjs/modules/next/bluetooth/families/trasense/trasense.js +3 -2
  16. package/lib/commonjs/modules/next/bluetooth/families/trasense/trasense.js.map +1 -1
  17. package/lib/commonjs/modules/next/bluetooth/families/trasense/variants.js +2 -2
  18. package/lib/commonjs/modules/next/bluetooth/families/trasense/variants.js.map +1 -1
  19. package/lib/module/modules/next/bluetooth/families/trasense/history.js +19 -3
  20. package/lib/module/modules/next/bluetooth/families/trasense/history.js.map +1 -1
  21. package/lib/module/modules/next/bluetooth/families/trasense/models.js +15 -2
  22. package/lib/module/modules/next/bluetooth/families/trasense/models.js.map +1 -1
  23. package/lib/module/modules/next/bluetooth/families/trasense/protocol.js +15 -12
  24. package/lib/module/modules/next/bluetooth/families/trasense/protocol.js.map +1 -1
  25. package/lib/module/modules/next/bluetooth/families/trasense/replies.js +25 -2
  26. package/lib/module/modules/next/bluetooth/families/trasense/replies.js.map +1 -1
  27. package/lib/module/modules/next/bluetooth/families/trasense/requests.js +17 -1
  28. package/lib/module/modules/next/bluetooth/families/trasense/requests.js.map +1 -1
  29. package/lib/module/modules/next/bluetooth/families/trasense/s9.js +100 -0
  30. package/lib/module/modules/next/bluetooth/families/trasense/s9.js.map +1 -0
  31. package/lib/module/modules/next/bluetooth/families/trasense/session.js +30 -19
  32. package/lib/module/modules/next/bluetooth/families/trasense/session.js.map +1 -1
  33. package/lib/module/modules/next/bluetooth/families/trasense/trasense.js +3 -2
  34. package/lib/module/modules/next/bluetooth/families/trasense/trasense.js.map +1 -1
  35. package/lib/module/modules/next/bluetooth/families/trasense/variants.js +1 -1
  36. package/lib/module/modules/next/bluetooth/families/trasense/variants.js.map +1 -1
  37. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/history.d.ts +4 -2
  38. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/history.d.ts.map +1 -1
  39. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/models.d.ts +1 -1
  40. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/models.d.ts.map +1 -1
  41. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/protocol.d.ts +4 -1
  42. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/protocol.d.ts.map +1 -1
  43. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/replies.d.ts +5 -1
  44. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/replies.d.ts.map +1 -1
  45. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/requests.d.ts +9 -3
  46. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/requests.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/s9.d.ts +10 -0
  48. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/s9.d.ts.map +1 -0
  49. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/session.d.ts +12 -5
  50. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/session.d.ts.map +1 -1
  51. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/trasense.d.ts +1 -1
  52. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/trasense.d.ts.map +1 -1
  53. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/variants.d.ts +2 -1
  54. package/lib/typescript/commonjs/src/modules/next/bluetooth/families/trasense/variants.d.ts.map +1 -1
  55. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/history.d.ts +4 -2
  56. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/history.d.ts.map +1 -1
  57. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/models.d.ts +1 -1
  58. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/models.d.ts.map +1 -1
  59. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/protocol.d.ts +4 -1
  60. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/protocol.d.ts.map +1 -1
  61. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/replies.d.ts +5 -1
  62. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/replies.d.ts.map +1 -1
  63. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/requests.d.ts +9 -3
  64. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/requests.d.ts.map +1 -1
  65. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/s9.d.ts +10 -0
  66. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/s9.d.ts.map +1 -0
  67. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/session.d.ts +12 -5
  68. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/session.d.ts.map +1 -1
  69. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/trasense.d.ts +1 -1
  70. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/trasense.d.ts.map +1 -1
  71. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/variants.d.ts +2 -1
  72. package/lib/typescript/module/src/modules/next/bluetooth/families/trasense/variants.d.ts.map +1 -1
  73. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMrD,OAAO,EAAqC,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,4HAA4H;AAC5H,QAAA,MAAM,iBAAiB,GAAI,SAAS,gBAAgB,KAAG,cAAc,CAAC,mBAAmB,CAiBvF,CAAC;AAEH,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMrD,OAAO,EAAqC,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,gEAAgE;AAChE,QAAA,MAAM,UAAU,GAAU,cAAc,mBAAmB,KAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAM9F,CAAC;AAEH,4HAA4H;AAC5H,QAAA,MAAM,iBAAiB,GAAI,SAAS,gBAAgB,KAAG,cAAc,CAAC,mBAAmB,CAWvF,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC"}
@@ -23,8 +23,12 @@ declare const firmwareOfReply: (frame: Uint8Array) => Firmware;
23
23
  declare const activityCountOf: (frame: Uint8Array) => ActivityCount;
24
24
  /** The battery level a reply carries, in the band's own unit. */
25
25
  declare const batteryLevelOf: (frame: Uint8Array) => number;
26
+ /** The heart rate in bpm a heart-rate read reply carries; `null` while the watch has none. */
27
+ declare const heartRateOf: (frame: Uint8Array) => number | null;
28
+ /** The temperature in °C a temperature read reply carries; `null` while the watch has none. */
29
+ declare const temperatureOf: (frame: Uint8Array) => number | null;
26
30
  /** The step counts of an activity reply; `null` for a slot that holds nothing. */
27
31
  declare const stepBlockOf: (frame: Uint8Array) => StepBlock | null;
28
- export { activityCountOf, batteryLevelOf, firmwareOfReply, stepBlockOf };
32
+ export { activityCountOf, batteryLevelOf, firmwareOfReply, heartRateOf, stepBlockOf, temperatureOf };
29
33
  export type { ActivityCount, StepBlock };
30
34
  //# sourceMappingURL=replies.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"replies.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/replies.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAc,MAAM,YAAY,CAAC;AA4BlD,kFAAkF;AAClF,KAAK,SAAS,GAAG;IAEf,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IAEb,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IAEd,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAC;IAEZ,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAElB,2CAA2C;IAC3C,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;CACnC,CAAC;AAEF,yEAAyE;AACzE,KAAK,aAAa,GAAG;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,0CAA0C;AAC1C,QAAA,MAAM,eAAe,GAAI,OAAO,UAAU,KAAG,QAAsF,CAAC;AAEpI,iEAAiE;AACjE,QAAA,MAAM,eAAe,GAAI,OAAO,UAAU,KAAG,aAG3C,CAAC;AAEH,iEAAiE;AACjE,QAAA,MAAM,cAAc,GAAI,OAAO,UAAU,KAAG,MAAsC,CAAC;AAWnF,kFAAkF;AAClF,QAAA,MAAM,WAAW,GAAI,OAAO,UAAU,KAAG,SAAS,GAAG,IAgBpD,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC;AACzE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"replies.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/replies.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAc,MAAM,YAAY,CAAC;AAmClD,kFAAkF;AAClF,KAAK,SAAS,GAAG;IAEf,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IAEb,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IAEd,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAC;IAEZ,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAElB,2CAA2C;IAC3C,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;CACnC,CAAC;AAEF,yEAAyE;AACzE,KAAK,aAAa,GAAG;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,0CAA0C;AAC1C,QAAA,MAAM,eAAe,GAAI,OAAO,UAAU,KAAG,QAAsF,CAAC;AAEpI,iEAAiE;AACjE,QAAA,MAAM,eAAe,GAAI,OAAO,UAAU,KAAG,aAG3C,CAAC;AAEH,iEAAiE;AACjE,QAAA,MAAM,cAAc,GAAI,OAAO,UAAU,KAAG,MAAsC,CAAC;AAKnF,8FAA8F;AAC9F,QAAA,MAAM,WAAW,GAAI,OAAO,UAAU,KAAG,MAAM,GAAG,IAA2D,CAAC;AAE9G,+FAA+F;AAC/F,QAAA,MAAM,aAAa,GAAI,OAAO,UAAU,KAAG,MAAM,GAAG,IAA4E,CAAC;AAWjI,kFAAkF;AAClF,QAAA,MAAM,WAAW,GAAI,OAAO,UAAU,KAAG,SAAS,GAAG,IAgBpD,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;AACrG,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC"}
@@ -1,8 +1,10 @@
1
1
  import { DayWindow } from "./variants";
2
2
  /** Every frame is this long in both directions, zero padded. */
3
3
  declare const FRAME_BYTES = 20;
4
- /** The opcode a reply to this request carries. */
5
- declare const replyOpcodeOf: (request: Uint8Array) => number;
4
+ /** Whether a reply answers this request: its opcode with the reply bit set. */
5
+ declare const answers: (request: Uint8Array) => (reply: Uint8Array) => boolean;
6
+ /** Whether a reply answers this request and repeats its sub-command, as heart-rate and temperature replies do. */
7
+ declare const answersSubcommand: (request: Uint8Array) => (reply: Uint8Array) => boolean;
6
8
  /** Asks for the firmware version string. */
7
9
  declare const versionRequest: () => Uint8Array;
8
10
  /** Asks for the battery level. */
@@ -11,11 +13,15 @@ declare const batteryRequest: () => Uint8Array;
11
13
  declare const activityCountRequest: () => Uint8Array;
12
14
  /** Asks for six hours of step counts of one day slot, from `firstHour`. */
13
15
  declare const activityRequest: (slot: number, firstHour: number) => Uint8Array;
16
+ /** Asks for the heart rate the watch measures right now. */
17
+ declare const heartRateRequest: () => Uint8Array;
18
+ /** Asks for the temperature the watch measures right now. */
19
+ declare const temperatureRequest: () => Uint8Array;
14
20
  /** Marks the end of a sync. */
15
21
  declare const finishSyncRequest: () => Uint8Array;
16
22
  /** Locks the band to this phone. */
17
23
  declare const bindRequest: () => Uint8Array;
18
24
  /** Sets the band's clock to `now` in local time, and its day-time window. */
19
25
  declare const clockRequest: (now: Date, { start, end }: DayWindow) => Uint8Array;
20
- export { activityCountRequest, activityRequest, batteryRequest, bindRequest, clockRequest, finishSyncRequest, FRAME_BYTES, replyOpcodeOf, versionRequest, };
26
+ export { activityCountRequest, activityRequest, answers, answersSubcommand, batteryRequest, bindRequest, clockRequest, finishSyncRequest, FRAME_BYTES, heartRateRequest, temperatureRequest, versionRequest, };
21
27
  //# sourceMappingURL=requests.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,gEAAgE;AAChE,QAAA,MAAM,WAAW,KAAK,CAAC;AA2BvB,kDAAkD;AAClD,QAAA,MAAM,aAAa,GAAI,SAAS,UAAU,KAAG,MAAuC,CAAC;AAErF,4CAA4C;AAC5C,QAAA,MAAM,cAAc,QAAO,UAAqC,CAAC;AAEjE,kCAAkC;AAClC,QAAA,MAAM,cAAc,QAAO,UAAqC,CAAC;AAEjE,0EAA0E;AAC1E,QAAA,MAAM,oBAAoB,QAAO,UAA2C,CAAC;AAE7E,2EAA2E;AAC3E,QAAA,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,WAAW,MAAM,KAAG,UAAyD,CAAC;AAErH,+BAA+B;AAC/B,QAAA,MAAM,iBAAiB,QAAO,UAAwC,CAAC;AAEvE,oCAAoC;AACpC,QAAA,MAAM,WAAW,QAAO,UAA4D,CAAC;AAErF,6EAA6E;AAC7E,QAAA,MAAM,YAAY,GAAI,KAAK,IAAI,EAAE,gBAAgB,SAAS,KAAG,UAWzD,CAAC;AAEL,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,cAAc,GACf,CAAC"}
1
+ {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,gEAAgE;AAChE,QAAA,MAAM,WAAW,KAAK,CAAC;AAkCvB,+EAA+E;AAC/E,QAAA,MAAM,OAAO,GACV,SAAS,UAAU,MACnB,OAAO,UAAU,KAAG,OACgB,CAAC;AAExC,kHAAkH;AAClH,QAAA,MAAM,iBAAiB,GACpB,SAAS,UAAU,MACnB,OAAO,UAAU,KAAG,OAC+B,CAAC;AAEvD,4CAA4C;AAC5C,QAAA,MAAM,cAAc,QAAO,UAAqC,CAAC;AAEjE,kCAAkC;AAClC,QAAA,MAAM,cAAc,QAAO,UAAqC,CAAC;AAEjE,0EAA0E;AAC1E,QAAA,MAAM,oBAAoB,QAAO,UAA2C,CAAC;AAE7E,2EAA2E;AAC3E,QAAA,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,WAAW,MAAM,KAAG,UAAyD,CAAC;AAErH,4DAA4D;AAC5D,QAAA,MAAM,gBAAgB,QAAO,UAA0D,CAAC;AAExF,6DAA6D;AAC7D,QAAA,MAAM,kBAAkB,QAAO,UAAgE,CAAC;AAEhG,+BAA+B;AAC/B,QAAA,MAAM,iBAAiB,QAAO,UAAwC,CAAC;AAEvE,oCAAoC;AACpC,QAAA,MAAM,WAAW,QAAO,UAA4D,CAAC;AAErF,6EAA6E;AAC7E,QAAA,MAAM,YAAY,GAAI,KAAK,IAAI,EAAE,gBAAgB,SAAS,KAAG,UAWzD,CAAC;AAEL,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { DeviceProtocol } from "../../core/protocol";
2
+ import { WristbandConnection } from "./session";
3
+ /**
4
+ * The Trasense S9 watch (firmware type SH09): the wristbands' frames and step history, a live heart rate and body
5
+ * temperature read about once a second, and a battery in five steps. It never ends a link and does not advertise while
6
+ * one is open, so the link is closed as soon as the work is done.
7
+ */
8
+ declare const S9_PROTOCOL: DeviceProtocol<WristbandConnection>;
9
+ export { S9_PROTOCOL };
10
+ //# sourceMappingURL=s9.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s9.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/s9.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAmB,MAAM,qBAAqB,CAAC;AAStE,OAAO,EAA6C,mBAAmB,EAA2C,MAAM,WAAW,CAAC;AA0CpI;;;;GAIG;AACH,QAAA,MAAM,WAAW,EAAE,cAAc,CAAC,mBAAmB,CAqBpD,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -2,12 +2,15 @@ import { GattLink, Logger } from "../../core/ports";
2
2
  import { ProtocolContext } from "../../core/protocol";
3
3
  import { Firmware } from "./firmware";
4
4
  declare const WRISTBAND_SERVICE: string;
5
+ declare const WRITE_CHARACTERISTIC: string;
6
+ /** Writes one frame to the command characteristic. */
7
+ type Write = (frame: Uint8Array) => Promise<void>;
5
8
  /** One open link: a request that waits for the band's reply, and a write that does not. */
6
9
  type Session = {
7
- /** Sends a frame and resolves with the reply that carries its opcode with the reply bit set. */
8
- request: (frame: Uint8Array) => Promise<Uint8Array>;
10
+ /** Sends a frame and resolves with the first reply `accepts` takes; by default the one carrying its opcode with the reply bit set. */
11
+ request: (frame: Uint8Array, accepts?: (reply: Uint8Array) => boolean) => Promise<Uint8Array>;
9
12
  /** Writes a frame without waiting for a reply. */
10
- send: (frame: Uint8Array) => Promise<void>;
13
+ send: Write;
11
14
  /** Stops listening. */
12
15
  stop: () => void;
13
16
  };
@@ -22,8 +25,12 @@ type WristbandConnection = Session & {
22
25
  /** The firmware the band reported when the link opened. */
23
26
  firmware: Firmware;
24
27
  };
28
+ /** The firmware version the band reports. */
29
+ declare const readFirmware: ({ request }: Session) => Promise<Firmware>;
30
+ /** Opens a session over `send`, then runs `firstSteps`, which end with the firmware; a failure stops listening. */
31
+ declare const openConnectionWith: (context: ProtocolContext, send: Write, firstSteps: (session: Session) => Promise<Firmware>) => Promise<WristbandConnection>;
25
32
  /** Opens the session, locks a band met for the first time to the phone, and reads the firmware version. */
26
33
  declare const openConnection: (context: ProtocolContext) => Promise<WristbandConnection>;
27
- export { openConnection, WRISTBAND_SERVICE };
28
- export type { WristbandConnection };
34
+ export { openConnection, openConnectionWith, readFirmware, WRISTBAND_SERVICE, WRITE_CHARACTERISTIC };
35
+ export type { Session, WristbandConnection };
29
36
  //# sourceMappingURL=session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/session.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAgB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,QAAA,MAAM,iBAAiB,QAAmB,CAAC;AAS3C,2FAA2F;AAC3F,KAAK,OAAO,GAAG;IAEb,gGAAgG;IAChG,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAEpD,kDAAkD;IAClD,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3C,uBAAuB;IACvB,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,uDAAuD;AACvD,KAAK,mBAAmB,GAAG,OAAO,GAAG;IAEnC,kDAAkD;IAClD,IAAI,EAAE,QAAQ,CAAC;IAEf,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IAEf,yBAAyB;IACzB,GAAG,EAAE,MAAM,IAAI,CAAC;IAEhB,2DAA2D;IAC3D,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAsCF,2GAA2G;AAC3G,QAAA,MAAM,cAAc,GAAU,SAAS,eAAe,KAAG,OAAO,CAAC,mBAAmB,CAanF,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC;AAC7C,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/session.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAgB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,QAAA,MAAM,iBAAiB,QAAmB,CAAC;AAC3C,QAAA,MAAM,oBAAoB,QAAmB,CAAC;AAQ9C,sDAAsD;AACtD,KAAK,KAAK,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAElD,2FAA2F;AAC3F,KAAK,OAAO,GAAG;IAEb,sIAAsI;IACtI,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAE9F,kDAAkD;IAClD,IAAI,EAAE,KAAK,CAAC;IAEZ,uBAAuB;IACvB,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,uDAAuD;AACvD,KAAK,mBAAmB,GAAG,OAAO,GAAG;IAEnC,kDAAkD;IAClD,IAAI,EAAE,QAAQ,CAAC;IAEf,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IAEf,yBAAyB;IACzB,GAAG,EAAE,MAAM,IAAI,CAAC;IAEhB,2DAA2D;IAC3D,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AA6BF,6CAA6C;AAC7C,QAAA,MAAM,YAAY,GAAU,aAAa,OAAO,KAAG,OAAO,CAAC,QAAQ,CAAqD,CAAC;AAEzH,mHAAmH;AACnH,QAAA,MAAM,kBAAkB,GACtB,SAAS,eAAe,EACxB,MAAM,KAAK,EACX,YAAY,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,KAClD,OAAO,CAAC,mBAAmB,CAW7B,CAAC;AAUF,2GAA2G;AAC3G,QAAA,MAAM,cAAc,GAAI,SAAS,eAAe,KAAG,OAAO,CAAC,mBAAmB,CAS3E,CAAC;AAEJ,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,CAAC;AACrG,YAAY,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { DeviceProtocol } from "../../core/protocol";
2
2
  import { TRASENSE_MODELS } from "./models";
3
- /** The protocols of the Trasense and Movement wristbands. */
3
+ /** The protocols of the Trasense and Movement wristbands and the Trasense S9 watch. */
4
4
  declare const TRASENSE_PROTOCOLS: readonly DeviceProtocol[];
5
5
  export { TRASENSE_MODELS, TRASENSE_PROTOCOLS };
6
6
  //# sourceMappingURL=trasense.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trasense.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/trasense.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAyE,eAAe,EAAE,MAAM,UAAU,CAAC;AAElH,6DAA6D;AAC7D,QAAA,MAAM,kBAAkB,EAAE,SAAS,cAAc,EAA4E,CAAC;AAE9H,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"trasense.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/trasense.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAyE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGlH,uFAAuF;AACvF,QAAA,MAAM,kBAAkB,EAAE,SAAS,cAAc,EAAyF,CAAC;AAE3I,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC"}
@@ -13,12 +13,13 @@ type WristbandVariant = {
13
13
  /** A firmware from before 20160401 keeps its battery level in the standard Battery Service. */
14
14
  serviceBatteryOnOldFirmware: boolean;
15
15
  };
16
+ declare const WHOLE_DAY: DayWindow;
16
17
  /** The TS-H01, TS-H03 and TS-H03 PRO: no day-time window, and the standard battery on old firmware. */
17
18
  declare const H_SERIES: WristbandVariant;
18
19
  /** The SH05, SH09 and SH09U: the default day-time window of nine to twenty-three. */
19
20
  declare const SH_SERIES: WristbandVariant;
20
21
  /** The SH06 and SH08: the default day-time window once the firmware takes one, none before. */
21
22
  declare const SH_SERIES_BY_FIRMWARE: WristbandVariant;
22
- export { H_SERIES, SH_SERIES, SH_SERIES_BY_FIRMWARE };
23
+ export { H_SERIES, SH_SERIES, SH_SERIES_BY_FIRMWARE, WHOLE_DAY };
23
24
  export type { DayWindow, WristbandVariant };
24
25
  //# sourceMappingURL=variants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,yEAAyE;AACzE,KAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,iIAAiI;AACjI,KAAK,gBAAgB,GAAG;IAEtB,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IAEX,mDAAmD;IACnD,SAAS,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,SAAS,CAAC;IAE7C,+FAA+F;IAC/F,2BAA2B,EAAE,OAAO,CAAC;CACtC,CAAC;AAWF,uGAAuG;AACvG,QAAA,MAAM,QAAQ,EAAE,gBAIf,CAAC;AAEF,qFAAqF;AACrF,QAAA,MAAM,SAAS,EAAE,gBAIhB,CAAC;AAEF,+FAA+F;AAC/F,QAAA,MAAM,qBAAqB,EAAE,gBAI5B,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;AACtD,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,yEAAyE;AACzE,KAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,iIAAiI;AACjI,KAAK,gBAAgB,GAAG;IAEtB,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IAEX,mDAAmD;IACnD,SAAS,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,SAAS,CAAC;IAE7C,+FAA+F;IAC/F,2BAA2B,EAAE,OAAO,CAAC;CACtC,CAAC;AAEF,QAAA,MAAM,SAAS,EAAE,SAAiC,CAAC;AASnD,uGAAuG;AACvG,QAAA,MAAM,QAAQ,EAAE,gBAIf,CAAC;AAEF,qFAAqF;AACrF,QAAA,MAAM,SAAS,EAAE,gBAIhB,CAAC;AAEF,+FAA+F;AAC/F,QAAA,MAAM,qBAAqB,EAAE,gBAI5B,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,qBAAqB,EAAE,SAAS,EAAE,CAAC;AACjE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import { HistoryRecord } from "../../core/protocol";
2
2
  import { WristbandConnection } from "./session";
3
- /** The step counts of every day slot, an hour each, then the end-of-sync marker. */
3
+ /** The step counts of every day slot, an hour each. */
4
4
  declare function storedSteps(connection: WristbandConnection): AsyncGenerator<HistoryRecord>;
5
- export { storedSteps };
5
+ /** The step counts of every day slot, then the end-of-sync marker the wristbands expect. */
6
+ declare function storedStepsThenFinish(connection: WristbandConnection): AsyncGenerator<HistoryRecord>;
7
+ export { storedSteps, storedStepsThenFinish };
6
8
  //# sourceMappingURL=history.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAIpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AA8BhD,oFAAoF;AACpF,iBAAgB,WAAW,CAAC,UAAU,EAAE,mBAAmB,GAAG,cAAc,CAAC,aAAa,CAAC,CAc1F;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAKpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAqChD,uDAAuD;AACvD,iBAAgB,WAAW,CAAC,UAAU,EAAE,mBAAmB,GAAG,cAAc,CAAC,aAAa,CAAC,CAY1F;AAED,4FAA4F;AAC5F,iBAAgB,qBAAqB,CAAC,UAAU,EAAE,mBAAmB,GAAG,cAAc,CAAC,aAAa,CAAC,CAGpG;AAED,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC"}
@@ -2,7 +2,7 @@ import { DeviceModel } from "../../core/catalog";
2
2
  declare const H_SERIES_PROTOCOL: import("../..").DeviceProtocol<import("./session").WristbandConnection>;
3
3
  declare const SH_SERIES_PROTOCOL: import("../..").DeviceProtocol<import("./session").WristbandConnection>;
4
4
  declare const SH_SERIES_BY_FIRMWARE_PROTOCOL: import("../..").DeviceProtocol<import("./session").WristbandConnection>;
5
- /** The wristbands in catalog order: four of them advertise the plain name "Wristband", so the first of those is the default. */
5
+ /** The wristbands in catalog order, then the S9 watch: four wristbands advertise the plain name "Wristband", so the first of those is the default. */
6
6
  declare const TRASENSE_MODELS: readonly DeviceModel[];
7
7
  export { H_SERIES_PROTOCOL, SH_SERIES_BY_FIRMWARE_PROTOCOL, SH_SERIES_PROTOCOL, TRASENSE_MODELS };
8
8
  //# sourceMappingURL=models.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAOjD,QAAA,MAAM,iBAAiB,yEAA8B,CAAC;AACtD,QAAA,MAAM,kBAAkB,yEAA+B,CAAC;AACxD,QAAA,MAAM,8BAA8B,yEAA2C,CAAC;AAQhF,gIAAgI;AAChI,QAAA,MAAM,eAAe,EAAE,SAAS,WAAW,EAS1C,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,kBAAkB,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAQpE,QAAA,MAAM,iBAAiB,yEAA8B,CAAC;AACtD,QAAA,MAAM,kBAAkB,yEAA+B,CAAC;AACxD,QAAA,MAAM,8BAA8B,yEAA2C,CAAC;AAahF,sJAAsJ;AACtJ,QAAA,MAAM,eAAe,EAAE,SAAS,WAAW,EAU1C,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,kBAAkB,EAAE,eAAe,EAAE,CAAC"}
@@ -1,7 +1,10 @@
1
+ import { DeviceIdentity } from "../../core/paired-device";
1
2
  import { DeviceProtocol } from "../../core/protocol";
2
3
  import { WristbandConnection } from "./session";
3
4
  import { WristbandVariant } from "./variants";
5
+ /** What a band says about itself: only its firmware version. */
6
+ declare const identityOf: ({ firmware }: WristbandConnection) => Promise<Omit<DeviceIdentity, "at">>;
4
7
  /** A wristband of one variant: its firmware, a clock, its battery, and the steps it stores an hour at a time as history. */
5
8
  declare const wristbandProtocol: (variant: WristbandVariant) => DeviceProtocol<WristbandConnection>;
6
- export { wristbandProtocol };
9
+ export { identityOf, wristbandProtocol };
7
10
  //# sourceMappingURL=protocol.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMrD,OAAO,EAAqC,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,4HAA4H;AAC5H,QAAA,MAAM,iBAAiB,GAAI,SAAS,gBAAgB,KAAG,cAAc,CAAC,mBAAmB,CAiBvF,CAAC;AAEH,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAMrD,OAAO,EAAqC,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,gEAAgE;AAChE,QAAA,MAAM,UAAU,GAAU,cAAc,mBAAmB,KAAG,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,CAM9F,CAAC;AAEH,4HAA4H;AAC5H,QAAA,MAAM,iBAAiB,GAAI,SAAS,gBAAgB,KAAG,cAAc,CAAC,mBAAmB,CAWvF,CAAC;AAEH,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC"}
@@ -23,8 +23,12 @@ declare const firmwareOfReply: (frame: Uint8Array) => Firmware;
23
23
  declare const activityCountOf: (frame: Uint8Array) => ActivityCount;
24
24
  /** The battery level a reply carries, in the band's own unit. */
25
25
  declare const batteryLevelOf: (frame: Uint8Array) => number;
26
+ /** The heart rate in bpm a heart-rate read reply carries; `null` while the watch has none. */
27
+ declare const heartRateOf: (frame: Uint8Array) => number | null;
28
+ /** The temperature in °C a temperature read reply carries; `null` while the watch has none. */
29
+ declare const temperatureOf: (frame: Uint8Array) => number | null;
26
30
  /** The step counts of an activity reply; `null` for a slot that holds nothing. */
27
31
  declare const stepBlockOf: (frame: Uint8Array) => StepBlock | null;
28
- export { activityCountOf, batteryLevelOf, firmwareOfReply, stepBlockOf };
32
+ export { activityCountOf, batteryLevelOf, firmwareOfReply, heartRateOf, stepBlockOf, temperatureOf };
29
33
  export type { ActivityCount, StepBlock };
30
34
  //# sourceMappingURL=replies.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"replies.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/replies.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAc,MAAM,YAAY,CAAC;AA4BlD,kFAAkF;AAClF,KAAK,SAAS,GAAG;IAEf,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IAEb,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IAEd,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAC;IAEZ,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAElB,2CAA2C;IAC3C,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;CACnC,CAAC;AAEF,yEAAyE;AACzE,KAAK,aAAa,GAAG;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,0CAA0C;AAC1C,QAAA,MAAM,eAAe,GAAI,OAAO,UAAU,KAAG,QAAsF,CAAC;AAEpI,iEAAiE;AACjE,QAAA,MAAM,eAAe,GAAI,OAAO,UAAU,KAAG,aAG3C,CAAC;AAEH,iEAAiE;AACjE,QAAA,MAAM,cAAc,GAAI,OAAO,UAAU,KAAG,MAAsC,CAAC;AAWnF,kFAAkF;AAClF,QAAA,MAAM,WAAW,GAAI,OAAO,UAAU,KAAG,SAAS,GAAG,IAgBpD,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC;AACzE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"replies.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/replies.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAc,MAAM,YAAY,CAAC;AAmClD,kFAAkF;AAClF,KAAK,SAAS,GAAG;IAEf,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IAEb,mCAAmC;IACnC,KAAK,EAAE,MAAM,CAAC;IAEd,qCAAqC;IACrC,GAAG,EAAE,MAAM,CAAC;IAEZ,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;IAElB,2CAA2C;IAC3C,KAAK,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;CACnC,CAAC;AAEF,yEAAyE;AACzE,KAAK,aAAa,GAAG;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,0CAA0C;AAC1C,QAAA,MAAM,eAAe,GAAI,OAAO,UAAU,KAAG,QAAsF,CAAC;AAEpI,iEAAiE;AACjE,QAAA,MAAM,eAAe,GAAI,OAAO,UAAU,KAAG,aAG3C,CAAC;AAEH,iEAAiE;AACjE,QAAA,MAAM,cAAc,GAAI,OAAO,UAAU,KAAG,MAAsC,CAAC;AAKnF,8FAA8F;AAC9F,QAAA,MAAM,WAAW,GAAI,OAAO,UAAU,KAAG,MAAM,GAAG,IAA2D,CAAC;AAE9G,+FAA+F;AAC/F,QAAA,MAAM,aAAa,GAAI,OAAO,UAAU,KAAG,MAAM,GAAG,IAA4E,CAAC;AAWjI,kFAAkF;AAClF,QAAA,MAAM,WAAW,GAAI,OAAO,UAAU,KAAG,SAAS,GAAG,IAgBpD,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;AACrG,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC"}
@@ -1,8 +1,10 @@
1
1
  import { DayWindow } from "./variants";
2
2
  /** Every frame is this long in both directions, zero padded. */
3
3
  declare const FRAME_BYTES = 20;
4
- /** The opcode a reply to this request carries. */
5
- declare const replyOpcodeOf: (request: Uint8Array) => number;
4
+ /** Whether a reply answers this request: its opcode with the reply bit set. */
5
+ declare const answers: (request: Uint8Array) => (reply: Uint8Array) => boolean;
6
+ /** Whether a reply answers this request and repeats its sub-command, as heart-rate and temperature replies do. */
7
+ declare const answersSubcommand: (request: Uint8Array) => (reply: Uint8Array) => boolean;
6
8
  /** Asks for the firmware version string. */
7
9
  declare const versionRequest: () => Uint8Array;
8
10
  /** Asks for the battery level. */
@@ -11,11 +13,15 @@ declare const batteryRequest: () => Uint8Array;
11
13
  declare const activityCountRequest: () => Uint8Array;
12
14
  /** Asks for six hours of step counts of one day slot, from `firstHour`. */
13
15
  declare const activityRequest: (slot: number, firstHour: number) => Uint8Array;
16
+ /** Asks for the heart rate the watch measures right now. */
17
+ declare const heartRateRequest: () => Uint8Array;
18
+ /** Asks for the temperature the watch measures right now. */
19
+ declare const temperatureRequest: () => Uint8Array;
14
20
  /** Marks the end of a sync. */
15
21
  declare const finishSyncRequest: () => Uint8Array;
16
22
  /** Locks the band to this phone. */
17
23
  declare const bindRequest: () => Uint8Array;
18
24
  /** Sets the band's clock to `now` in local time, and its day-time window. */
19
25
  declare const clockRequest: (now: Date, { start, end }: DayWindow) => Uint8Array;
20
- export { activityCountRequest, activityRequest, batteryRequest, bindRequest, clockRequest, finishSyncRequest, FRAME_BYTES, replyOpcodeOf, versionRequest, };
26
+ export { activityCountRequest, activityRequest, answers, answersSubcommand, batteryRequest, bindRequest, clockRequest, finishSyncRequest, FRAME_BYTES, heartRateRequest, temperatureRequest, versionRequest, };
21
27
  //# sourceMappingURL=requests.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,gEAAgE;AAChE,QAAA,MAAM,WAAW,KAAK,CAAC;AA2BvB,kDAAkD;AAClD,QAAA,MAAM,aAAa,GAAI,SAAS,UAAU,KAAG,MAAuC,CAAC;AAErF,4CAA4C;AAC5C,QAAA,MAAM,cAAc,QAAO,UAAqC,CAAC;AAEjE,kCAAkC;AAClC,QAAA,MAAM,cAAc,QAAO,UAAqC,CAAC;AAEjE,0EAA0E;AAC1E,QAAA,MAAM,oBAAoB,QAAO,UAA2C,CAAC;AAE7E,2EAA2E;AAC3E,QAAA,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,WAAW,MAAM,KAAG,UAAyD,CAAC;AAErH,+BAA+B;AAC/B,QAAA,MAAM,iBAAiB,QAAO,UAAwC,CAAC;AAEvE,oCAAoC;AACpC,QAAA,MAAM,WAAW,QAAO,UAA4D,CAAC;AAErF,6EAA6E;AAC7E,QAAA,MAAM,YAAY,GAAI,KAAK,IAAI,EAAE,gBAAgB,SAAS,KAAG,UAWzD,CAAC;AAEL,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,aAAa,EACb,cAAc,GACf,CAAC"}
1
+ {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC,gEAAgE;AAChE,QAAA,MAAM,WAAW,KAAK,CAAC;AAkCvB,+EAA+E;AAC/E,QAAA,MAAM,OAAO,GACV,SAAS,UAAU,MACnB,OAAO,UAAU,KAAG,OACgB,CAAC;AAExC,kHAAkH;AAClH,QAAA,MAAM,iBAAiB,GACpB,SAAS,UAAU,MACnB,OAAO,UAAU,KAAG,OAC+B,CAAC;AAEvD,4CAA4C;AAC5C,QAAA,MAAM,cAAc,QAAO,UAAqC,CAAC;AAEjE,kCAAkC;AAClC,QAAA,MAAM,cAAc,QAAO,UAAqC,CAAC;AAEjE,0EAA0E;AAC1E,QAAA,MAAM,oBAAoB,QAAO,UAA2C,CAAC;AAE7E,2EAA2E;AAC3E,QAAA,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,WAAW,MAAM,KAAG,UAAyD,CAAC;AAErH,4DAA4D;AAC5D,QAAA,MAAM,gBAAgB,QAAO,UAA0D,CAAC;AAExF,6DAA6D;AAC7D,QAAA,MAAM,kBAAkB,QAAO,UAAgE,CAAC;AAEhG,+BAA+B;AAC/B,QAAA,MAAM,iBAAiB,QAAO,UAAwC,CAAC;AAEvE,oCAAoC;AACpC,QAAA,MAAM,WAAW,QAAO,UAA4D,CAAC;AAErF,6EAA6E;AAC7E,QAAA,MAAM,YAAY,GAAI,KAAK,IAAI,EAAE,gBAAgB,SAAS,KAAG,UAWzD,CAAC;AAEL,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,OAAO,EACP,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,GACf,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { DeviceProtocol } from "../../core/protocol";
2
+ import { WristbandConnection } from "./session";
3
+ /**
4
+ * The Trasense S9 watch (firmware type SH09): the wristbands' frames and step history, a live heart rate and body
5
+ * temperature read about once a second, and a battery in five steps. It never ends a link and does not advertise while
6
+ * one is open, so the link is closed as soon as the work is done.
7
+ */
8
+ declare const S9_PROTOCOL: DeviceProtocol<WristbandConnection>;
9
+ export { S9_PROTOCOL };
10
+ //# sourceMappingURL=s9.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"s9.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/s9.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAmB,MAAM,qBAAqB,CAAC;AAStE,OAAO,EAA6C,mBAAmB,EAA2C,MAAM,WAAW,CAAC;AA0CpI;;;;GAIG;AACH,QAAA,MAAM,WAAW,EAAE,cAAc,CAAC,mBAAmB,CAqBpD,CAAC;AAEF,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -2,12 +2,15 @@ import { GattLink, Logger } from "../../core/ports";
2
2
  import { ProtocolContext } from "../../core/protocol";
3
3
  import { Firmware } from "./firmware";
4
4
  declare const WRISTBAND_SERVICE: string;
5
+ declare const WRITE_CHARACTERISTIC: string;
6
+ /** Writes one frame to the command characteristic. */
7
+ type Write = (frame: Uint8Array) => Promise<void>;
5
8
  /** One open link: a request that waits for the band's reply, and a write that does not. */
6
9
  type Session = {
7
- /** Sends a frame and resolves with the reply that carries its opcode with the reply bit set. */
8
- request: (frame: Uint8Array) => Promise<Uint8Array>;
10
+ /** Sends a frame and resolves with the first reply `accepts` takes; by default the one carrying its opcode with the reply bit set. */
11
+ request: (frame: Uint8Array, accepts?: (reply: Uint8Array) => boolean) => Promise<Uint8Array>;
9
12
  /** Writes a frame without waiting for a reply. */
10
- send: (frame: Uint8Array) => Promise<void>;
13
+ send: Write;
11
14
  /** Stops listening. */
12
15
  stop: () => void;
13
16
  };
@@ -22,8 +25,12 @@ type WristbandConnection = Session & {
22
25
  /** The firmware the band reported when the link opened. */
23
26
  firmware: Firmware;
24
27
  };
28
+ /** The firmware version the band reports. */
29
+ declare const readFirmware: ({ request }: Session) => Promise<Firmware>;
30
+ /** Opens a session over `send`, then runs `firstSteps`, which end with the firmware; a failure stops listening. */
31
+ declare const openConnectionWith: (context: ProtocolContext, send: Write, firstSteps: (session: Session) => Promise<Firmware>) => Promise<WristbandConnection>;
25
32
  /** Opens the session, locks a band met for the first time to the phone, and reads the firmware version. */
26
33
  declare const openConnection: (context: ProtocolContext) => Promise<WristbandConnection>;
27
- export { openConnection, WRISTBAND_SERVICE };
28
- export type { WristbandConnection };
34
+ export { openConnection, openConnectionWith, readFirmware, WRISTBAND_SERVICE, WRITE_CHARACTERISTIC };
35
+ export type { Session, WristbandConnection };
29
36
  //# sourceMappingURL=session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/session.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAgB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,QAAA,MAAM,iBAAiB,QAAmB,CAAC;AAS3C,2FAA2F;AAC3F,KAAK,OAAO,GAAG;IAEb,gGAAgG;IAChG,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAEpD,kDAAkD;IAClD,IAAI,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3C,uBAAuB;IACvB,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,uDAAuD;AACvD,KAAK,mBAAmB,GAAG,OAAO,GAAG;IAEnC,kDAAkD;IAClD,IAAI,EAAE,QAAQ,CAAC;IAEf,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IAEf,yBAAyB;IACzB,GAAG,EAAE,MAAM,IAAI,CAAC;IAEhB,2DAA2D;IAC3D,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AAsCF,2GAA2G;AAC3G,QAAA,MAAM,cAAc,GAAU,SAAS,eAAe,KAAG,OAAO,CAAC,mBAAmB,CAanF,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,CAAC;AAC7C,YAAY,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/session.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAgB,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAItC,QAAA,MAAM,iBAAiB,QAAmB,CAAC;AAC3C,QAAA,MAAM,oBAAoB,QAAmB,CAAC;AAQ9C,sDAAsD;AACtD,KAAK,KAAK,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAElD,2FAA2F;AAC3F,KAAK,OAAO,GAAG;IAEb,sIAAsI;IACtI,OAAO,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAE9F,kDAAkD;IAClD,IAAI,EAAE,KAAK,CAAC;IAEZ,uBAAuB;IACvB,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,uDAAuD;AACvD,KAAK,mBAAmB,GAAG,OAAO,GAAG;IAEnC,kDAAkD;IAClD,IAAI,EAAE,QAAQ,CAAC;IAEf,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IAEf,yBAAyB;IACzB,GAAG,EAAE,MAAM,IAAI,CAAC;IAEhB,2DAA2D;IAC3D,QAAQ,EAAE,QAAQ,CAAC;CACpB,CAAC;AA6BF,6CAA6C;AAC7C,QAAA,MAAM,YAAY,GAAU,aAAa,OAAO,KAAG,OAAO,CAAC,QAAQ,CAAqD,CAAC;AAEzH,mHAAmH;AACnH,QAAA,MAAM,kBAAkB,GACtB,SAAS,eAAe,EACxB,MAAM,KAAK,EACX,YAAY,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,KAClD,OAAO,CAAC,mBAAmB,CAW7B,CAAC;AAUF,2GAA2G;AAC3G,QAAA,MAAM,cAAc,GAAI,SAAS,eAAe,KAAG,OAAO,CAAC,mBAAmB,CAS3E,CAAC;AAEJ,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,YAAY,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,CAAC;AACrG,YAAY,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { DeviceProtocol } from "../../core/protocol";
2
2
  import { TRASENSE_MODELS } from "./models";
3
- /** The protocols of the Trasense and Movement wristbands. */
3
+ /** The protocols of the Trasense and Movement wristbands and the Trasense S9 watch. */
4
4
  declare const TRASENSE_PROTOCOLS: readonly DeviceProtocol[];
5
5
  export { TRASENSE_MODELS, TRASENSE_PROTOCOLS };
6
6
  //# sourceMappingURL=trasense.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"trasense.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/trasense.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAyE,eAAe,EAAE,MAAM,UAAU,CAAC;AAElH,6DAA6D;AAC7D,QAAA,MAAM,kBAAkB,EAAE,SAAS,cAAc,EAA4E,CAAC;AAE9H,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"trasense.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/trasense.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAyE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGlH,uFAAuF;AACvF,QAAA,MAAM,kBAAkB,EAAE,SAAS,cAAc,EAAyF,CAAC;AAE3I,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC"}
@@ -13,12 +13,13 @@ type WristbandVariant = {
13
13
  /** A firmware from before 20160401 keeps its battery level in the standard Battery Service. */
14
14
  serviceBatteryOnOldFirmware: boolean;
15
15
  };
16
+ declare const WHOLE_DAY: DayWindow;
16
17
  /** The TS-H01, TS-H03 and TS-H03 PRO: no day-time window, and the standard battery on old firmware. */
17
18
  declare const H_SERIES: WristbandVariant;
18
19
  /** The SH05, SH09 and SH09U: the default day-time window of nine to twenty-three. */
19
20
  declare const SH_SERIES: WristbandVariant;
20
21
  /** The SH06 and SH08: the default day-time window once the firmware takes one, none before. */
21
22
  declare const SH_SERIES_BY_FIRMWARE: WristbandVariant;
22
- export { H_SERIES, SH_SERIES, SH_SERIES_BY_FIRMWARE };
23
+ export { H_SERIES, SH_SERIES, SH_SERIES_BY_FIRMWARE, WHOLE_DAY };
23
24
  export type { DayWindow, WristbandVariant };
24
25
  //# sourceMappingURL=variants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,yEAAyE;AACzE,KAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,iIAAiI;AACjI,KAAK,gBAAgB,GAAG;IAEtB,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IAEX,mDAAmD;IACnD,SAAS,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,SAAS,CAAC;IAE7C,+FAA+F;IAC/F,2BAA2B,EAAE,OAAO,CAAC;CACtC,CAAC;AAWF,uGAAuG;AACvG,QAAA,MAAM,QAAQ,EAAE,gBAIf,CAAC;AAEF,qFAAqF;AACrF,QAAA,MAAM,SAAS,EAAE,gBAIhB,CAAC;AAEF,+FAA+F;AAC/F,QAAA,MAAM,qBAAqB,EAAE,gBAI5B,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;AACtD,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"variants.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/trasense/variants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,yEAAyE;AACzE,KAAK,SAAS,GAAG;IACf,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,iIAAiI;AACjI,KAAK,gBAAgB,GAAG;IAEtB,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAC;IAEX,mDAAmD;IACnD,SAAS,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,SAAS,CAAC;IAE7C,+FAA+F;IAC/F,2BAA2B,EAAE,OAAO,CAAC;CACtC,CAAC;AAEF,QAAA,MAAM,SAAS,EAAE,SAAiC,CAAC;AASnD,uGAAuG;AACvG,QAAA,MAAM,QAAQ,EAAE,gBAIf,CAAC;AAEF,qFAAqF;AACrF,QAAA,MAAM,SAAS,EAAE,gBAIhB,CAAC;AAEF,+FAA+F;AAC/F,QAAA,MAAM,qBAAqB,EAAE,gBAI5B,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,qBAAqB,EAAE,SAAS,EAAE,CAAC;AACjE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ovok/native",
3
- "version": "1.17.0-dev.2252+40732f2",
3
+ "version": "1.17.0-dev.2254+af19e26",
4
4
  "description": "React native component sdk for OVOK",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -190,7 +190,7 @@
190
190
  "@kingstinct/react-native-healthkit": ">=16.2.0",
191
191
  "@opentelemetry/api": "^1.9.1",
192
192
  "@opentelemetry/api-logs": "^0.222.0",
193
- "@ovok/core": ">=0.4.55 || >=0.4.49-0",
193
+ "@ovok/core": ">=0.4.55 || >=0.4.59-0",
194
194
  "@react-native-community/datetimepicker": "*",
195
195
  "@react-native-community/netinfo": "*",
196
196
  "@react-native-google-signin/google-signin": "*",