@ovok/native 1.6.43 → 1.6.44

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 (158) hide show
  1. package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js +6 -1
  2. package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
  3. package/lib/commonjs/modules/bt-device/constants/supported-devices.js +30 -0
  4. package/lib/commonjs/modules/bt-device/constants/supported-devices.js.map +1 -1
  5. package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js +1 -1
  6. package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
  7. package/lib/commonjs/modules/bt-management/services/device-creator.js +11 -1
  8. package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
  9. package/lib/commonjs/modules/bt-management/services/devices/viatom/bioland.bgm.device.js +50 -0
  10. package/lib/commonjs/modules/bt-management/services/devices/viatom/bioland.bgm.device.js.map +1 -0
  11. package/lib/commonjs/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.js +115 -0
  12. package/lib/commonjs/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.js.map +1 -0
  13. package/lib/commonjs/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.js +58 -0
  14. package/lib/commonjs/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.js.map +1 -0
  15. package/lib/commonjs/modules/bt-management/services/devices/viatom/poctor.m3102.device.js +41 -0
  16. package/lib/commonjs/modules/bt-management/services/devices/viatom/poctor.m3102.device.js.map +1 -0
  17. package/lib/commonjs/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.js +61 -0
  18. package/lib/commonjs/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.js.map +1 -0
  19. package/lib/commonjs/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.js +41 -0
  20. package/lib/commonjs/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.js.map +1 -0
  21. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bpm188.device.js +50 -0
  22. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bpm188.device.js.map +1 -0
  23. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.js +141 -0
  24. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.js.map +1 -0
  25. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.js +76 -0
  26. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.js.map +1 -0
  27. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc100.device.js +50 -0
  28. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc100.device.js.map +1 -0
  29. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.js +149 -0
  30. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.js.map +1 -0
  31. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.js +81 -0
  32. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.js.map +1 -0
  33. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc300.device.js +50 -0
  34. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc300.device.js.map +1 -0
  35. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.js +228 -0
  36. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.js.map +1 -0
  37. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.js +122 -0
  38. package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.js.map +1 -0
  39. package/lib/commonjs/modules/bt-management/types/integrated-devices.js +5 -0
  40. package/lib/commonjs/modules/bt-management/types/integrated-devices.js.map +1 -1
  41. package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js +6 -1
  42. package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
  43. package/lib/module/modules/bt-device/constants/supported-devices.js +30 -0
  44. package/lib/module/modules/bt-device/constants/supported-devices.js.map +1 -1
  45. package/lib/module/modules/bt-management/constants/integrated-devices-map.js +1 -1
  46. package/lib/module/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
  47. package/lib/module/modules/bt-management/services/device-creator.js +11 -1
  48. package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
  49. package/lib/module/modules/bt-management/services/devices/viatom/bioland.bgm.device.js +45 -0
  50. package/lib/module/modules/bt-management/services/devices/viatom/bioland.bgm.device.js.map +1 -0
  51. package/lib/module/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.js +106 -0
  52. package/lib/module/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.js.map +1 -0
  53. package/lib/module/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.js +53 -0
  54. package/lib/module/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.js.map +1 -0
  55. package/lib/module/modules/bt-management/services/devices/viatom/poctor.m3102.device.js +36 -0
  56. package/lib/module/modules/bt-management/services/devices/viatom/poctor.m3102.device.js.map +1 -0
  57. package/lib/module/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.js +55 -0
  58. package/lib/module/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.js.map +1 -0
  59. package/lib/module/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.js +36 -0
  60. package/lib/module/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.js.map +1 -0
  61. package/lib/module/modules/bt-management/services/devices/viatom/viatom.bpm188.device.js +45 -0
  62. package/lib/module/modules/bt-management/services/devices/viatom/viatom.bpm188.device.js.map +1 -0
  63. package/lib/module/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.js +130 -0
  64. package/lib/module/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.js.map +1 -0
  65. package/lib/module/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.js +71 -0
  66. package/lib/module/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.js.map +1 -0
  67. package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc100.device.js +45 -0
  68. package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc100.device.js.map +1 -0
  69. package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.js +136 -0
  70. package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.js.map +1 -0
  71. package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.js +76 -0
  72. package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.js.map +1 -0
  73. package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc300.device.js +45 -0
  74. package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc300.device.js.map +1 -0
  75. package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.js +209 -0
  76. package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.js.map +1 -0
  77. package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.js +117 -0
  78. package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.js.map +1 -0
  79. package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
  80. package/lib/module/modules/bt-management/types/integrated-devices.js +5 -0
  81. package/lib/module/modules/bt-management/types/integrated-devices.js.map +1 -1
  82. package/lib/typescript/commonjs/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
  83. package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/bioland.bgm.device.d.ts +16 -0
  87. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/bioland.bgm.device.d.ts.map +1 -0
  88. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.d.ts +26 -0
  89. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.d.ts.map +1 -0
  90. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.d.ts +24 -0
  91. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.d.ts.map +1 -0
  92. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/poctor.m3102.device.d.ts +15 -0
  93. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/poctor.m3102.device.d.ts.map +1 -0
  94. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.d.ts +16 -0
  95. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.d.ts.map +1 -0
  96. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.d.ts +17 -0
  97. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.d.ts.map +1 -0
  98. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bpm188.device.d.ts +16 -0
  99. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bpm188.device.d.ts.map +1 -0
  100. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.d.ts +36 -0
  101. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.d.ts.map +1 -0
  102. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.d.ts +26 -0
  103. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.d.ts.map +1 -0
  104. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc100.device.d.ts +16 -0
  105. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc100.device.d.ts.map +1 -0
  106. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.d.ts +43 -0
  107. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.d.ts.map +1 -0
  108. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.d.ts +26 -0
  109. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.d.ts.map +1 -0
  110. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc300.device.d.ts +16 -0
  111. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc300.device.d.ts.map +1 -0
  112. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.d.ts +73 -0
  113. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.d.ts.map +1 -0
  114. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.d.ts +25 -0
  115. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.d.ts.map +1 -0
  116. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +5 -0
  117. package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  118. package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts +6 -1
  119. package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
  120. package/lib/typescript/module/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
  121. package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -1
  122. package/lib/typescript/module/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
  123. package/lib/typescript/module/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
  124. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/bioland.bgm.device.d.ts +16 -0
  125. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/bioland.bgm.device.d.ts.map +1 -0
  126. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.d.ts +26 -0
  127. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.d.ts.map +1 -0
  128. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.d.ts +24 -0
  129. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.d.ts.map +1 -0
  130. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/poctor.m3102.device.d.ts +15 -0
  131. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/poctor.m3102.device.d.ts.map +1 -0
  132. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.d.ts +16 -0
  133. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.d.ts.map +1 -0
  134. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.d.ts +17 -0
  135. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.d.ts.map +1 -0
  136. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bpm188.device.d.ts +16 -0
  137. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bpm188.device.d.ts.map +1 -0
  138. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.d.ts +36 -0
  139. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.d.ts.map +1 -0
  140. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.d.ts +26 -0
  141. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.d.ts.map +1 -0
  142. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc100.device.d.ts +16 -0
  143. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc100.device.d.ts.map +1 -0
  144. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.d.ts +43 -0
  145. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.d.ts.map +1 -0
  146. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.d.ts +26 -0
  147. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.d.ts.map +1 -0
  148. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc300.device.d.ts +16 -0
  149. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc300.device.d.ts.map +1 -0
  150. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.d.ts +73 -0
  151. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.d.ts.map +1 -0
  152. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.d.ts +25 -0
  153. package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.d.ts.map +1 -0
  154. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +5 -0
  155. package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
  156. package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts +6 -1
  157. package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
  158. package/package.json +1 -1
@@ -0,0 +1,209 @@
1
+ "use strict";
2
+
3
+ /* eslint-disable import/group-exports, max-lines */
4
+
5
+ import { FrameReadStatus } from "../../../types/frame-read-status.js";
6
+ import { calculateCrc8Pc } from "../../../utils/calculate-crc-8-pc.js";
7
+ import { hexToByte } from "../../../utils/hex-to-byte.js";
8
+ export const PC300_SERVICE = "0000fff0-0000-1000-8000-00805f9b34fb";
9
+ export const PC300_WRITE = "0000fff2-0000-1000-8000-00805f9b34fb";
10
+ export const PC300_NOTIFY = "0000fff1-0000-1000-8000-00805f9b34fb";
11
+ export const Pc300Command = {
12
+ bloodPressureResult: 0x43,
13
+ temperatureResult: 0x72,
14
+ glucoseResult: 0x73,
15
+ baijieResult: 0xe2,
16
+ oxygenParameters: 0x53,
17
+ ecgWave: 0x32,
18
+ ecgResult: 0x33
19
+ };
20
+ const byte = value => (value & 0xff).toString(16).padStart(2, "0");
21
+
22
+ /** Builds the AA55 frame used by the ViHealth PC-300 family. */
23
+ export const pc300Command = (command, type, payload = []) => {
24
+ const frame = ["aa", "55", byte(command), byte(payload.length + 2), byte(type), ...payload, "00"];
25
+ frame[frame.length - 1] = byte(calculateCrc8Pc(frame));
26
+ return frame;
27
+ };
28
+ export const pc300GetBloodPressureResult = () => pc300Command(Pc300Command.bloodPressureResult, 1);
29
+ export const pc300GetTemperatureResult = () => pc300Command(Pc300Command.temperatureResult, 1);
30
+ export const pc300GetGlucoseResult = () => pc300Command(Pc300Command.glucoseResult, 1);
31
+ export const pc300GetBaijieGlucoseResult = () => pc300Command(Pc300Command.baijieResult, 1);
32
+ export const pc300GetBaijieUricAcidResult = () => pc300Command(Pc300Command.baijieResult, 2);
33
+ export const decodePc300Response = bytes => {
34
+ if (hexToByte(bytes[0] ?? "00") !== 0xaa || hexToByte(bytes[1] ?? "00") !== 0x55) {
35
+ return undefined;
36
+ }
37
+ const payloadLength = hexToByte(bytes[3] ?? "00");
38
+ const expectedLength = payloadLength + 4;
39
+ if (payloadLength < 2 || bytes.length < expectedLength) {
40
+ return undefined;
41
+ }
42
+ const frame = bytes.slice(0, expectedLength);
43
+ if (hexToByte(frame.at(-1) ?? "00") !== calculateCrc8Pc(frame)) {
44
+ return undefined;
45
+ }
46
+ return {
47
+ command: hexToByte(frame[2] ?? "00"),
48
+ type: hexToByte(frame[4] ?? "00"),
49
+ content: frame.slice(5, -1)
50
+ };
51
+ };
52
+ export const parsePc300BloodPressureResult = content => {
53
+ if (content.length < 5) {
54
+ return undefined;
55
+ }
56
+ const first = hexToByte(content[0] ?? "00");
57
+ const systolic = (first & 0x7f) << 8 | hexToByte(content[1] ?? "00");
58
+ const meanArterialPressure = hexToByte(content[2] ?? "00");
59
+ const diastolic = hexToByte(content[3] ?? "00");
60
+ const heartRate = hexToByte(content[4] ?? "00");
61
+ if (systolic < 20 || systolic > 300 || meanArterialPressure < 10 || meanArterialPressure > 250 || diastolic < 10 || diastolic > 200 || heartRate < 20 || heartRate > 300) {
62
+ return undefined;
63
+ }
64
+ return {
65
+ systolic,
66
+ diastolic,
67
+ meanArterialPressure,
68
+ heartRate,
69
+ irregularHeartbeat: (first & 0x80) !== 0
70
+ };
71
+ };
72
+ export const parsePc300TemperatureResult = content => {
73
+ if (content.length < 3) {
74
+ return undefined;
75
+ }
76
+ const first = hexToByte(content[0] ?? "00");
77
+ const bodyTemp = (hexToByte(content[1] ?? "00") << 8 | hexToByte(content[2] ?? "00")) / 100 + 30;
78
+ if (bodyTemp < 20 || bodyTemp > 50) {
79
+ return undefined;
80
+ }
81
+ return {
82
+ bodyTemp,
83
+ probeOff: (first & 0x10) !== 0
84
+ };
85
+ };
86
+ export const parsePc300GlucoseResult = content => {
87
+ if (content.length < 3) {
88
+ return undefined;
89
+ }
90
+ const unit = (hexToByte(content[0] ?? "00") & 0x01) === 1;
91
+ const raw = hexToByte(content[1] ?? "00") << 8 | hexToByte(content[2] ?? "00");
92
+ const bloodGlucose = unit ? raw : Number((raw / 10 * 18).toFixed(2));
93
+ if (bloodGlucose < 1 || bloodGlucose > 1_000) {
94
+ return undefined;
95
+ }
96
+ return {
97
+ bloodGlucose,
98
+ unit: unit ? "mg/dL" : "mmol/L"
99
+ };
100
+ };
101
+ export const parsePc300UricAcidResult = content => {
102
+ if (content.length < 3) {
103
+ return undefined;
104
+ }
105
+ const value = (hexToByte(content[1] ?? "00") << 8 | hexToByte(content[2] ?? "00")) / 10;
106
+ return value > 0 && value < 2_000 ? {
107
+ uricAcid: value
108
+ } : undefined;
109
+ };
110
+ export const parsePc300BloodOxygenResult = content => {
111
+ if (content.length < 5) {
112
+ return undefined;
113
+ }
114
+ const bloodOxygen = hexToByte(content[0] ?? "00");
115
+ const pulseRate = hexToByte(content[1] ?? "00") | hexToByte(content[2] ?? "00") << 8;
116
+ const perfusionIndex = hexToByte(content[3] ?? "00") / 10;
117
+ const state = hexToByte(content[4] ?? "00");
118
+ if (bloodOxygen < 50 || bloodOxygen > 100 || pulseRate < 20 || pulseRate > 300) {
119
+ return undefined;
120
+ }
121
+ return {
122
+ bloodOxygen,
123
+ pulseRate,
124
+ perfusionIndex,
125
+ probeOff: (state & 0x02) !== 0
126
+ };
127
+ };
128
+ export const parsePc300EcgWave = content => {
129
+ if (content.length < 53) {
130
+ return undefined;
131
+ }
132
+ const digit = (hexToByte(content[1] ?? "00") & 0x80) !== 0;
133
+ const diagramPoints = Array.from({
134
+ length: 25
135
+ }, (_, index) => {
136
+ const high = hexToByte(content[index * 2 + 1] ?? "00");
137
+ const low = hexToByte(content[index * 2 + 2] ?? "00");
138
+ const raw = low | (high & 0x0f) << 8;
139
+ return digit ? (raw - 2_048) * 0.002538071 : (raw - 128) * 0.03508772;
140
+ });
141
+ return {
142
+ sequence: hexToByte(content[0] ?? "00"),
143
+ diagramPoints,
144
+ probeOff: (hexToByte(content[52] ?? "00") & 0x80) !== 0
145
+ };
146
+ };
147
+ export const parsePc300EcgResult = content => {
148
+ if (content.length < 3) {
149
+ return undefined;
150
+ }
151
+ const heartRate = hexToByte(content[2] ?? "00");
152
+ return heartRate > 0 && heartRate <= 300 ? {
153
+ heartRate,
154
+ status: hexToByte(content[0] ?? "00")
155
+ } : undefined;
156
+ };
157
+
158
+ /** Reads split and concatenated PC-300 AA55 frames. */
159
+ export class Pc300FrameReader {
160
+ readFrame(buffer) {
161
+ const start = this.findStart(buffer);
162
+ if (start < 0) {
163
+ return {
164
+ status: FrameReadStatus.INCOMPLETE,
165
+ consumedBytes: Math.max(0, buffer.length - 1)
166
+ };
167
+ }
168
+ if (start + 4 > buffer.length) {
169
+ return {
170
+ status: FrameReadStatus.INCOMPLETE,
171
+ consumedBytes: start
172
+ };
173
+ }
174
+ const length = hexToByte(buffer[start + 3] ?? "00") + 4;
175
+ if (length < 6) {
176
+ return {
177
+ status: FrameReadStatus.CORRUPT,
178
+ consumedBytes: start + 1
179
+ };
180
+ }
181
+ if (start + length > buffer.length) {
182
+ return {
183
+ status: FrameReadStatus.INCOMPLETE,
184
+ consumedBytes: start
185
+ };
186
+ }
187
+ const frame = buffer.slice(start, start + length);
188
+ if (hexToByte(frame.at(-1) ?? "00") !== calculateCrc8Pc(frame)) {
189
+ return {
190
+ status: FrameReadStatus.CORRUPT,
191
+ consumedBytes: start + 1
192
+ };
193
+ }
194
+ return {
195
+ status: FrameReadStatus.COMPLETE,
196
+ consumedBytes: start + length,
197
+ frame
198
+ };
199
+ }
200
+ findStart = buffer => {
201
+ for (let index = 0; index + 1 < buffer.length; index += 1) {
202
+ if (hexToByte(buffer[index] ?? "00") === 0xaa && hexToByte(buffer[index + 1] ?? "00") === 0x55) {
203
+ return index;
204
+ }
205
+ }
206
+ return -1;
207
+ };
208
+ }
209
+ //# sourceMappingURL=viatom.pc300.protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["FrameReadStatus","calculateCrc8Pc","hexToByte","PC300_SERVICE","PC300_WRITE","PC300_NOTIFY","Pc300Command","bloodPressureResult","temperatureResult","glucoseResult","baijieResult","oxygenParameters","ecgWave","ecgResult","byte","value","toString","padStart","pc300Command","command","type","payload","frame","length","pc300GetBloodPressureResult","pc300GetTemperatureResult","pc300GetGlucoseResult","pc300GetBaijieGlucoseResult","pc300GetBaijieUricAcidResult","decodePc300Response","bytes","undefined","payloadLength","expectedLength","slice","at","content","parsePc300BloodPressureResult","first","systolic","meanArterialPressure","diastolic","heartRate","irregularHeartbeat","parsePc300TemperatureResult","bodyTemp","probeOff","parsePc300GlucoseResult","unit","raw","bloodGlucose","Number","toFixed","parsePc300UricAcidResult","uricAcid","parsePc300BloodOxygenResult","bloodOxygen","pulseRate","perfusionIndex","state","parsePc300EcgWave","digit","diagramPoints","Array","from","_","index","high","low","sequence","parsePc300EcgResult","status","Pc300FrameReader","readFrame","buffer","start","findStart","INCOMPLETE","consumedBytes","Math","max","CORRUPT","COMPLETE"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.pc300.protocol.ts"],"mappings":";;AAAA;;AAGA,SAASA,eAAe,QAAQ,qCAAkC;AAElE,SAASC,eAAe,QAAQ,sCAAmC;AACnE,SAASC,SAAS,QAAQ,+BAA4B;AAEtD,OAAO,MAAMC,aAAa,GAAG,sCAAsC;AACnE,OAAO,MAAMC,WAAW,GAAG,sCAAsC;AACjE,OAAO,MAAMC,YAAY,GAAG,sCAAsC;AAElE,OAAO,MAAMC,YAAY,GAAG;EAC1BC,mBAAmB,EAAE,IAAI;EACzBC,iBAAiB,EAAE,IAAI;EACvBC,aAAa,EAAE,IAAI;EACnBC,YAAY,EAAE,IAAI;EAClBC,gBAAgB,EAAE,IAAI;EACtBC,OAAO,EAAE,IAAI;EACbC,SAAS,EAAE;AACb,CAAU;AAEV,MAAMC,IAAI,GAAIC,KAAa,IACzB,CAACA,KAAK,GAAG,IAAI,EAAEC,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;;AAE9C;AACA,OAAO,MAAMC,YAAY,GAAGA,CAC1BC,OAAe,EACfC,IAAY,EACZC,OAA0B,GAAG,EAAE,KAClB;EACb,MAAMC,KAAK,GAAG,CACZ,IAAI,EACJ,IAAI,EACJR,IAAI,CAACK,OAAO,CAAC,EACbL,IAAI,CAACO,OAAO,CAACE,MAAM,GAAG,CAAC,CAAC,EACxBT,IAAI,CAACM,IAAI,CAAC,EACV,GAAGC,OAAO,EACV,IAAI,CACL;EAEDC,KAAK,CAACA,KAAK,CAACC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M,CAAC;IACrE;IAEA,MAAMrD,KAAK,GAAGoD,MAAM,CAACxC,KAAK,CAACyC,KAAK,EAAEA,KAAK,GAAGpD,MAAM,CAAC;IAEjD,IAAIrB,SAAS,CAACoB,KAAK,CAACa,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAKlC,eAAe,CAACqB,KAAK,CAAC,EAAE;MAC9D,OAAO;QAAEiD,MAAM,EAAEvE,eAAe,CAACiF,OAAO;QAAEH,aAAa,EAAEH,KAAK,GAAG;MAAE,CAAC;IACtE;IAEA,OAAO;MACLJ,MAAM,EAAEvE,eAAe,CAACkF,QAAQ;MAChCJ,aAAa,EAAEH,KAAK,GAAGpD,MAAM;MAC7BD;IACF,CAAC;EACH;EAEQsD,SAAS,GAAIF,MAAyB,IAAa;IACzD,KAAK,IAAIR,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAG,CAAC,GAAGQ,MAAM,CAACnD,MAAM,EAAE2C,KAAK,IAAI,CAAC,EAAE;MACzD,IACEhE,SAAS,CAACwE,MAAM,CAACR,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI,IACzChE,SAAS,CAACwE,MAAM,CAACR,KAAK,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI,EAC7C;QACA,OAAOA,KAAK;MACd;IACF;IAEA,OAAO,CAAC,CAAC;EACX,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+
3
+ import { EcgDiagnosticFlag, MeasurementTypeKey } from "@ovok/core";
4
+ import { CaseType } from "../../../types/case-type.js";
5
+ import { decodePc300Response, parsePc300BloodOxygenResult, parsePc300BloodPressureResult, parsePc300EcgResult, parsePc300EcgWave, parsePc300GlucoseResult, parsePc300TemperatureResult, pc300GetBloodPressureResult, pc300GetGlucoseResult, pc300GetTemperatureResult, Pc300Command } from "./viatom.pc300.protocol.js";
6
+ const command = (write, frame) => ({
7
+ ...write,
8
+ frame,
9
+ withoutResponse: true
10
+ });
11
+
12
+ /** Reads the last PC-300 family readings and accepts live oxygen/ECG frames. */
13
+ export class Pc300Sequencer {
14
+ phase = "blood-pressure";
15
+ ecgPoints = [];
16
+ constructor(params) {
17
+ this.params = params;
18
+ }
19
+ initialCommands = () => [this.write(pc300GetBloodPressureResult())];
20
+ isNormalDisconnect = () => this.phase === "done";
21
+ commandTimeoutMs = () => this.phase === "done" ? undefined : 5_000;
22
+ onCommandTimeout = () => {
23
+ this.phase = "done";
24
+ return {
25
+ terminal: true
26
+ };
27
+ };
28
+ nextCommand = frame => {
29
+ const response = decodePc300Response(frame);
30
+ if (!response) {
31
+ return undefined;
32
+ }
33
+ const recordedAt = this.params.now?.() ?? new Date();
34
+ if (response.command === Pc300Command.oxygenParameters) {
35
+ const result = parsePc300BloodOxygenResult(response.content);
36
+ if (result) {
37
+ this.params.onResult({
38
+ caseType: CaseType.RESULT,
39
+ measurementTypeKey: MeasurementTypeKey.bloodOxygenPulseRate,
40
+ bloodOxygen: result.bloodOxygen,
41
+ pulseRate: result.pulseRate,
42
+ perfusionIndex: result.perfusionIndex,
43
+ recordedAt
44
+ });
45
+ }
46
+ return undefined;
47
+ }
48
+ if (response.command === Pc300Command.ecgWave) {
49
+ const result = parsePc300EcgWave(response.content);
50
+ if (result) {
51
+ this.ecgPoints.push(...result.diagramPoints);
52
+ }
53
+ return undefined;
54
+ }
55
+ if (response.command === Pc300Command.ecgResult) {
56
+ const result = parsePc300EcgResult(response.content);
57
+ if (result && this.ecgPoints.length > 0) {
58
+ this.params.onResult({
59
+ caseType: CaseType.RESULT,
60
+ measurementTypeKey: MeasurementTypeKey.ecg,
61
+ heartRate: result.heartRate,
62
+ diagramPoints: [...this.ecgPoints],
63
+ duration: this.ecgPoints.length / 250,
64
+ diagnosticResult: result.status === 0 ? EcgDiagnosticFlag.REGULAR : result.status === 0xff ? EcgDiagnosticFlag.POOR_WAVEFORM : EcgDiagnosticFlag.ERROR,
65
+ recordedAt
66
+ });
67
+ }
68
+ this.ecgPoints = [];
69
+ return undefined;
70
+ }
71
+ if (this.phase === "blood-pressure" && response.command === Pc300Command.bloodPressureResult && response.type === 1) {
72
+ const result = parsePc300BloodPressureResult(response.content);
73
+ if (result) {
74
+ this.params.onResult({
75
+ caseType: CaseType.RESULT,
76
+ measurementTypeKey: MeasurementTypeKey.bloodPressure,
77
+ systolic: result.systolic,
78
+ diastolic: result.diastolic,
79
+ meanArterialPressure: result.meanArterialPressure,
80
+ heartRate: result.heartRate,
81
+ irregularHeartbeat: result.irregularHeartbeat,
82
+ recordedAt
83
+ });
84
+ }
85
+ this.phase = "temperature";
86
+ return [this.write(pc300GetTemperatureResult())];
87
+ }
88
+ if (this.phase === "temperature" && response.command === Pc300Command.temperatureResult && response.type === 1) {
89
+ const result = parsePc300TemperatureResult(response.content);
90
+ if (result && !result.probeOff) {
91
+ this.params.onResult({
92
+ caseType: CaseType.RESULT,
93
+ measurementTypeKey: MeasurementTypeKey.temperature,
94
+ bodyTemp: result.bodyTemp,
95
+ recordedAt
96
+ });
97
+ }
98
+ this.phase = "glucose";
99
+ return [this.write(pc300GetGlucoseResult())];
100
+ }
101
+ if (this.phase === "glucose" && response.command === Pc300Command.glucoseResult && response.type === 1) {
102
+ const result = parsePc300GlucoseResult(response.content);
103
+ if (result) {
104
+ this.params.onResult({
105
+ caseType: CaseType.RESULT,
106
+ measurementTypeKey: MeasurementTypeKey.bloodGlucose,
107
+ bloodGlucose: result.bloodGlucose,
108
+ recordedAt
109
+ });
110
+ }
111
+ this.phase = "done";
112
+ }
113
+ return undefined;
114
+ };
115
+ write = frame => command(this.params.write, frame);
116
+ }
117
+ //# sourceMappingURL=viatom.pc300.sequencer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["EcgDiagnosticFlag","MeasurementTypeKey","CaseType","decodePc300Response","parsePc300BloodOxygenResult","parsePc300BloodPressureResult","parsePc300EcgResult","parsePc300EcgWave","parsePc300GlucoseResult","parsePc300TemperatureResult","pc300GetBloodPressureResult","pc300GetGlucoseResult","pc300GetTemperatureResult","Pc300Command","command","write","frame","withoutResponse","Pc300Sequencer","phase","ecgPoints","constructor","params","initialCommands","isNormalDisconnect","commandTimeoutMs","undefined","onCommandTimeout","terminal","nextCommand","response","recordedAt","now","Date","oxygenParameters","result","content","onResult","caseType","RESULT","measurementTypeKey","bloodOxygenPulseRate","bloodOxygen","pulseRate","perfusionIndex","ecgWave","push","diagramPoints","ecgResult","length","ecg","heartRate","duration","diagnosticResult","status","REGULAR","POOR_WAVEFORM","ERROR","bloodPressureResult","type","bloodPressure","systolic","diastolic","meanArterialPressure","irregularHeartbeat","temperatureResult","probeOff","temperature","bodyTemp","glucoseResult","bloodGlucose"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.ts"],"mappings":";;AAAA,SAIEA,iBAAiB,EAEjBC,kBAAkB,QAEb,YAAY;AAEnB,SAASC,QAAQ,QAAQ,6BAA0B;AAQnD,SACEC,mBAAmB,EACnBC,2BAA2B,EAC3BC,6BAA6B,EAC7BC,mBAAmB,EACnBC,iBAAiB,EACjBC,uBAAuB,EACvBC,2BAA2B,EAC3BC,2BAA2B,EAC3BC,qBAAqB,EACrBC,yBAAyB,EACzBC,YAAY,QACP,4BAAyB;AAiBhC,MAAMC,OAAO,GAAGA,CACdC,KAAmC,EACnCC,KAAwB,MACL;EAAE,GAAGD,KAAK;EAAEC,KAAK;EAAEC,eAAe,EAAE;AAAK,CAAC,CAAC;;AAEhE;AACA,OAAO,MAAMC,cAAc,CAA6B;EAC9CC,KAAK,GAAe,gBAAgB;EACpCC,SAAS,GAAa,EAAE;EAEzBC,WAAWA,CAAkBC,MAA4B,EAAE;IAAA,KAA9BA,MAA4B,GAA5BA,MAA4B;EAAG;EAE5DC,eAAe,GAAGA,CAAA,KAAgC,CACvD,IAAI,CAACR,KAAK,CAACL,2BAA2B,CAAC,CAAC,CAAC,CAC1C;EAEMc,kBAAkB,GAAGA,CAAA,KAAe,IAAI,CAAC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ACqC,MAAM;UACzBC,kBAAkB,EAAEvC,kBAAkB,CAACqE,YAAY;UACnDA,YAAY,EAAEnC,MAAM,CAACmC,YAAY;UACjCvC;QACF,CAAC,CAAC;MACJ;MAEA,IAAI,CAACZ,KAAK,GAAG,MAAM;IACrB;IAEA,OAAOO,SAAS;EAClB,CAAC;EAEOX,KAAK,GAAIC,KAAwB,IACvCF,OAAO,CAAC,IAAI,CAACQ,MAAM,CAACP,KAAK,EAAEC,KAAK,CAAC;AACrC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/device-measurement-map.ts"],"mappings":";;AAaA,SAASA,iBAAiB,QAAQ,yBAAsB;;AAwExD;AACA;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/device-measurement-map.ts"],"mappings":";;AAaA,SAASA,iBAAiB,QAAQ,yBAAsB;;AAsFxD;AACA;AACA;AACA","ignoreList":[]}
@@ -33,6 +33,11 @@ export let IntegratedDevices = /*#__PURE__*/function (IntegratedDevices) {
33
33
  IntegratedDevices["AP20"] = "AP-20";
34
34
  IntegratedDevices["AP20_WPS"] = "AP-20-WPS";
35
35
  IntegratedDevices["PC68B"] = "PC-68B";
36
+ IntegratedDevices["PC100"] = "PC-100";
37
+ IntegratedDevices["BPM188"] = "BPM-188";
38
+ IntegratedDevices["PC300"] = "PC300";
39
+ IntegratedDevices["POCTOR_M3102"] = "PoctorM3102";
40
+ IntegratedDevices["BIOLAND_BGM"] = "Bioland-BGM";
36
41
  return IntegratedDevices;
37
42
  }({});
38
43
  //# sourceMappingURL=integrated-devices.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/integrated-devices.ts"],"mappings":";;AAAA,WAAYA,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iB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B;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"device-instruction-pdfs.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-device/constants/device-instruction-pdfs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAOjF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAiCrE,CAAC"}
1
+ {"version":3,"file":"device-instruction-pdfs.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-device/constants/device-instruction-pdfs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AAOjF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAsCrE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"supported-devices.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-device/constants/supported-devices.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAyFhF,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,IAAI,CAAC;CACxB,CAAC;AAEF,KAAK,yBAAyB,GAAG,eAAe,GAAG;IAEjD,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,SAAS,cAAc,EAAE,CAAC;IAC3C,gBAAgB,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAeF;;;;;;;GAOG;AACH,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qPA+MkC,CAAC;AAmZhD,+FAA+F;AAC/F,QAAA,MAAM,gBAAgB,EAAE,SAAS,yBAAyB,EAUH,CAAC;AAExD,QAAA,MAAM,iBAAiB,sCAAmB,CAAC;AAK3C,iFAAiF;AACjF,QAAA,MAAM,0BAA0B,EAAE,SAAS,cAAc,EAMxD,CAAC;AAEF,OAAO,EACL,OAAO,EACP,0BAA0B,EAC1B,iBAAiB,EACjB,gBAAgB,GACjB,CAAC;AACF,YAAY,EAAE,eAAe,EAAE,yBAAyB,EAAE,CAAC"}
1
+ {"version":3,"file":"supported-devices.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-device/constants/supported-devices.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAyFhF,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,IAAI,CAAC;CACxB,CAAC;AAEF,KAAK,yBAAyB,GAAG,eAAe,GAAG;IAEjD,4DAA4D;IAC5D,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,SAAS,cAAc,EAAE,CAAC;IAC3C,gBAAgB,EAAE,SAAS,kBAAkB,EAAE,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAeF;;;;;;;GAOG;AACH,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qPA+MkC,CAAC;AAuchD,+FAA+F;AAC/F,QAAA,MAAM,gBAAgB,EAAE,SAAS,yBAAyB,EAUH,CAAC;AAExD,QAAA,MAAM,iBAAiB,sCAAmB,CAAC;AAK3C,iFAAiF;AACjF,QAAA,MAAM,0BAA0B,EAAE,SAAS,cAAc,EAMxD,CAAC;AAEF,OAAO,EACL,OAAO,EACP,0BAA0B,EAC1B,iBAAiB,EACjB,gBAAgB,GACjB,CAAC;AACF,YAAY,EAAE,eAAe,EAAE,yBAAyB,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"integrated-devices-map.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/constants/integrated-devices-map.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,eAAO,MAAM,oBAAoB,gCAgC/B,CAAC"}
1
+ {"version":3,"file":"integrated-devices-map.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/constants/integrated-devices-map.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,eAAO,MAAM,oBAAoB,gCAwC/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"device-creator.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/services/device-creator.ts"],"names":[],"mappings":"AACA,OAAO,EA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AO,CAAC,QAAQ,CAAC,mBAAmB;IAJhD,OAAO,CAAC,eAAe,CAAuC;IAC9D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAO;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAsC;gBAEvC,mBAAmB,EAAE,CAAC;IAI5C,aAAa,GAClB,WAAW,MAAM,EACjB,eAAc,SAAS,MAAM,EAAO,KACnC,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAwB3B;IAEK,YAAY,CAAC,CAAC,SAAS,SAAS,EACrC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC5B,eAAe,CAAC,CAAC,CAAC;IA4Cd,OAAO,aAEZ;IAEF;;;OAGG;IACH,OAAO,CAAC,eAAe,CAMP;IAEhB,OAAO,CAAC,eAAe;CAexB"}
@@ -0,0 +1,16 @@
1
+ import { Device } from "react-native-ble-plx";
2
+ import { CreateDeviceParams } from "../../../types/create-device-params";
3
+ import { IntegratedDevices } from "../../../types/integrated-devices";
4
+ import { IService } from "../../../types/service.type";
5
+ import { BTManagedDevice } from "../bt-managed-device";
6
+ export declare const biolandBgmMainServices: IService[];
7
+ /** Bioland BGM glucose meter using the 5A length-prefixed protocol. */
8
+ export declare class BiolandBgmDevice extends BTManagedDevice<IntegratedDevices.BIOLAND_BGM> {
9
+ protected mainServices: IService[];
10
+ protected stuckDataTimeout: number;
11
+ protected onStreamStart: undefined;
12
+ protected preferredMtu: number;
13
+ constructor(device: Device, params: CreateDeviceParams<IntegratedDevices.BIOLAND_BGM>);
14
+ protected handleSuccessResult(): void;
15
+ }
16
+ //# sourceMappingURL=bioland.bgm.device.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bioland.bgm.device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/viatom/bioland.bgm.device.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAYvD,eAAO,MAAM,sBAAsB,EAAE,QAAQ,EAS5C,CAAC;AAEF,uEAAuE;AACvE,qBAAa,gBAAiB,SAAQ,eAAe,CAAC,iBAAiB,CAAC,WAAW,CAAC;IAClF,SAAS,CAAC,YAAY,aAA0B;IAChD,SAAS,CAAC,gBAAgB,SAAU;IACpC,SAAS,CAAC,aAAa,YAAa;IACpC,UAAmB,YAAY,SAAO;gBAGpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,WAAW,CAAC;IAmB3D,SAAS,CAAC,mBAAmB,IAAI,IAAI;CAGtC"}
@@ -0,0 +1,26 @@
1
+ import { FrameReadResult } from "../../../types/frame-read-result";
2
+ import { FrameReader } from "../../../types/frame-reader";
3
+ export declare const BIOLAND_SERVICE = "00001000-0000-1000-8000-00805f9b34fb";
4
+ export declare const BIOLAND_WRITE = "00001001-0000-1000-8000-00805f9b34fb";
5
+ export declare const BIOLAND_NOTIFY = "00001002-0000-1000-8000-00805f9b34fb";
6
+ export declare const BiolandCommand: {
7
+ readonly info: 0;
8
+ readonly data: 3;
9
+ };
10
+ export declare const biolandGetInfo: (now?: Date) => string[];
11
+ export declare const biolandGetData: (now?: Date) => string[];
12
+ export interface BiolandResponse {
13
+ command: number;
14
+ content: string[];
15
+ }
16
+ export declare const decodeBiolandResponse: (bytes: readonly string[]) => BiolandResponse | undefined;
17
+ export interface BiolandGlucoseResult {
18
+ bloodGlucose: number;
19
+ recordedAt: Date;
20
+ }
21
+ export declare const parseBiolandGlucoseResult: (content: readonly string[]) => BiolandGlucoseResult | undefined;
22
+ /** Reads split and concatenated 5A length-prefixed Bioland frames. */
23
+ export declare class BiolandFrameReader implements FrameReader {
24
+ readFrame(buffer: readonly string[]): FrameReadResult;
25
+ }
26
+ //# sourceMappingURL=bioland.bgm.protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bioland.bgm.protocol.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,eAAO,MAAM,eAAe,yCAAyC,CAAC;AACtE,eAAO,MAAM,aAAa,yCAAyC,CAAC;AACpE,eAAO,MAAM,cAAc,yCAAyC,CAAC;AAErE,eAAO,MAAM,cAAc;;;CAGjB,CAAC;AAgCX,eAAO,MAAM,cAAc,GAAI,MAAM,IAAI,KAAG,MAAM,EACf,CAAC;AAEpC,eAAO,MAAM,cAAc,GAAI,MAAM,IAAI,KAAG,MAAM,EACf,CAAC;AAEpC,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,eAAO,MAAM,qBAAqB,GAChC,OAAO,SAAS,MAAM,EAAE,KACvB,eAAe,GAAG,SAqBpB,CAAC;AAEF,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,IAAI,CAAC;CAClB;AAED,eAAO,MAAM,yBAAyB,GACpC,SAAS,SAAS,MAAM,EAAE,KACzB,oBAAoB,GAAG,SAiCzB,CAAC;AAEF,sEAAsE;AACtE,qBAAa,kBAAmB,YAAW,WAAW;IAC7C,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,eAAe;CAoC7D"}
@@ -0,0 +1,24 @@
1
+ import { BloodGlucoseMeasurement } from "@ovok/core";
2
+ import { CommandSequencer, CommandTimeoutResult } from "../../../types/command-sequencer";
3
+ import { DeviceCommand } from "../../../types/device-command";
4
+ import { MeasurementWithCaseType } from "../../../types/measurement-with-case-type";
5
+ interface BiolandSequencerParams {
6
+ write: Omit<DeviceCommand, "frame">;
7
+ onResult: (result: MeasurementWithCaseType<BloodGlucoseMeasurement>) => void;
8
+ now?: () => Date;
9
+ }
10
+ /** Reads the timestamped glucose result from a Bioland BGM. */
11
+ export declare class BiolandBgmSequencer implements CommandSequencer {
12
+ private readonly params;
13
+ private phase;
14
+ constructor(params: BiolandSequencerParams);
15
+ initialCommands: () => readonly DeviceCommand[];
16
+ isHistoryTransfer: () => boolean;
17
+ isNormalDisconnect: () => boolean;
18
+ commandTimeoutMs: () => number | undefined;
19
+ onCommandTimeout: () => CommandTimeoutResult;
20
+ nextCommand: (frame: readonly string[]) => readonly DeviceCommand[] | undefined;
21
+ private write;
22
+ }
23
+ export type { BiolandSequencerParams };
24
+ //# sourceMappingURL=bioland.bgm.sequencer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bioland.bgm.sequencer.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAsB,MAAM,YAAY,CAAC;AAGzE,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAUpF,UAAU,sBAAsB;IAC9B,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IACpC,QAAQ,EAAE,CACR,MAAM,EAAE,uBAAuB,CAAC,uBAAuB,CAAC,KACrD,IAAI,CAAC;IACV,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAOD,+DAA+D;AAC/D,qBAAa,mBAAoB,YAAW,gBAAgB;IAGvC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAF1C,OAAO,CAAC,KAAK,CAAoC;gBAEb,MAAM,EAAE,sBAAsB;IAE3D,eAAe,QAAO,SAAS,aAAa,EAAE,CAEnD;IAEK,iBAAiB,QAAO,OAAO,CAAS;IAExC,kBAAkB,QAAO,OAAO,CAA0B;IAE1D,gBAAgB,QAAO,MAAM,GAAG,SAAS,CACJ;IAErC,gBAAgB,QAAO,oBAAoB,CAIhD;IAEK,WAAW,GAChB,OAAO,SAAS,MAAM,EAAE,KACvB,SAAS,aAAa,EAAE,GAAG,SAAS,CA6BrC;IAEF,OAAO,CAAC,KAAK,CACuB;CACrC;AAED,YAAY,EAAE,sBAAsB,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Device } from "react-native-ble-plx";
2
+ import { CreateDeviceParams } from "../../../types/create-device-params";
3
+ import { IntegratedDevices } from "../../../types/integrated-devices";
4
+ import { IService } from "../../../types/service.type";
5
+ import { BTManagedDevice } from "../bt-managed-device";
6
+ export declare const poctorM3102MainServices: IService[];
7
+ /** Poctor M3102 unsolicited glucose and uric-acid records. */
8
+ export declare class PoctorM3102Device extends BTManagedDevice<IntegratedDevices.POCTOR_M3102> {
9
+ protected mainServices: IService[];
10
+ protected stuckDataTimeout: number;
11
+ protected onStreamStart: undefined;
12
+ constructor(device: Device, params: CreateDeviceParams<IntegratedDevices.POCTOR_M3102>);
13
+ protected handleSuccessResult(): void;
14
+ }
15
+ //# sourceMappingURL=poctor.m3102.device.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poctor.m3102.device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/viatom/poctor.m3102.device.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAWvD,eAAO,MAAM,uBAAuB,EAAE,QAAQ,EAK7C,CAAC;AAEF,8DAA8D;AAC9D,qBAAa,iBAAkB,SAAQ,eAAe,CAAC,iBAAiB,CAAC,YAAY,CAAC;IACpF,SAAS,CAAC,YAAY,aAA2B;IACjD,SAAS,CAAC,gBAAgB,SAAU;IACpC,SAAS,CAAC,aAAa,YAAa;gBAGlC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,YAAY,CAAC;IAe5D,SAAS,CAAC,mBAAmB,IAAI,IAAI;CAGtC"}
@@ -0,0 +1,16 @@
1
+ import { FrameReadResult } from "../../../types/frame-read-result";
2
+ import { FrameReader } from "../../../types/frame-reader";
3
+ export declare const POCTOR_SERVICE = "00010203-0405-0607-0809-0a0b0c0d1910";
4
+ export declare const POCTOR_WRITE = "00010203-0405-0607-0809-0a0b0c0d2b11";
5
+ export declare const POCTOR_NOTIFY = "00010203-0405-0607-0809-0a0b0c0d2b10";
6
+ export interface PoctorResult {
7
+ type: 0 | 1;
8
+ value: number;
9
+ recordedAt: Date;
10
+ }
11
+ export declare const parsePoctorResult: (frame: readonly string[]) => PoctorResult | undefined;
12
+ /** Reads CRLF-terminated Poctor M3102 ASCII records. */
13
+ export declare class PoctorFrameReader implements FrameReader {
14
+ readFrame(buffer: readonly string[]): FrameReadResult;
15
+ }
16
+ //# sourceMappingURL=poctor.m3102.protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poctor.m3102.protocol.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,eAAO,MAAM,cAAc,yCAAyC,CAAC;AACrE,eAAO,MAAM,YAAY,yCAAyC,CAAC;AACnE,eAAO,MAAM,aAAa,yCAAyC,CAAC;AAEpE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,IAAI,CAAC;CAClB;AAOD,eAAO,MAAM,iBAAiB,GAC5B,OAAO,SAAS,MAAM,EAAE,KACvB,YAAY,GAAG,SAyCjB,CAAC;AAEF,wDAAwD;AACxD,qBAAa,iBAAkB,YAAW,WAAW;IAC5C,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,eAAe;CAkB7D"}
@@ -0,0 +1,17 @@
1
+ import { BloodGlucoseMeasurement, UrineAnalyzeMeasurement } from "@ovok/core";
2
+ import { CommandSequencer } from "../../../types/command-sequencer";
3
+ import { DeviceCommand } from "../../../types/device-command";
4
+ import { MeasurementWithCaseType } from "../../../types/measurement-with-case-type";
5
+ type PoctorMeasurement = BloodGlucoseMeasurement | UrineAnalyzeMeasurement;
6
+ interface PoctorSequencerParams {
7
+ onResult: (result: MeasurementWithCaseType<PoctorMeasurement>) => void;
8
+ }
9
+ /** Listens for Poctor's unsolicited CRLF records; it has no safe poll command. */
10
+ export declare class PoctorSequencer implements CommandSequencer {
11
+ private readonly params;
12
+ constructor(params: PoctorSequencerParams);
13
+ initialCommands: () => readonly DeviceCommand[];
14
+ nextCommand: (frame: readonly string[]) => undefined;
15
+ }
16
+ export type { PoctorMeasurement, PoctorSequencerParams };
17
+ //# sourceMappingURL=poctor.m3102.sequencer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"poctor.m3102.sequencer.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EAEvB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAIpF,KAAK,iBAAiB,GAAG,uBAAuB,GAAG,uBAAuB,CAAC;AAE3E,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,CAAC,MAAM,EAAE,uBAAuB,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;CACxE;AAED,kFAAkF;AAClF,qBAAa,eAAgB,YAAW,gBAAgB;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,qBAAqB;IAE1D,eAAe,QAAO,SAAS,aAAa,EAAE,CAAO;IAErD,WAAW,GAAI,OAAO,SAAS,MAAM,EAAE,KAAG,SAAS,CAyBxD;CACH;AAED,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Device } from "react-native-ble-plx";
2
+ import { CreateDeviceParams } from "../../../types/create-device-params";
3
+ import { IntegratedDevices } from "../../../types/integrated-devices";
4
+ import { IService } from "../../../types/service.type";
5
+ import { BTManagedDevice } from "../bt-managed-device";
6
+ export declare const bpm188MainServices: IService[];
7
+ /** Viatom B02T/B02S blood-pressure history, exposed as BPM-188. */
8
+ export declare class Bpm188Device extends BTManagedDevice<IntegratedDevices.BPM188> {
9
+ protected mainServices: IService[];
10
+ protected stuckDataTimeout: number;
11
+ protected onStreamStart: undefined;
12
+ protected preferredMtu: number;
13
+ constructor(device: Device, params: CreateDeviceParams<IntegratedDevices.BPM188>);
14
+ protected handleSuccessResult(): void;
15
+ }
16
+ //# sourceMappingURL=viatom.bpm188.device.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viatom.bpm188.device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/viatom/viatom.bpm188.device.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAYvD,eAAO,MAAM,kBAAkB,EAAE,QAAQ,EASxC,CAAC;AAEF,mEAAmE;AACnE,qBAAa,YAAa,SAAQ,eAAe,CAAC,iBAAiB,CAAC,MAAM,CAAC;IACzE,SAAS,CAAC,YAAY,aAAsB;IAC5C,SAAS,CAAC,gBAAgB,SAAW;IACrC,SAAS,CAAC,aAAa,YAAa;IACpC,UAAmB,YAAY,SAAO;gBAGpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,MAAM,CAAC;IAmBtD,SAAS,CAAC,mBAAmB,IAAI,IAAI;CAGtC"}
@@ -0,0 +1,36 @@
1
+ import { FrameReadResult } from "../../../types/frame-read-result";
2
+ import { FrameReader } from "../../../types/frame-reader";
3
+ export declare const BPM188_SERVICE = "000018f0-0000-1000-8000-00805f9b34fb";
4
+ export declare const BPM188_WRITE = "00002af1-0000-1000-8000-00805f9b34fb";
5
+ export declare const BPM188_NOTIFY = "00002af0-0000-1000-8000-00805f9b34fb";
6
+ export declare const Bpm188MessageType: {
7
+ readonly info: 171;
8
+ readonly syncTime: 176;
9
+ readonly records: 177;
10
+ readonly recordsEnd: 179;
11
+ };
12
+ /** The B02T/B02S checksum starts with 0x40 and XORs bytes 2 through n-2. */
13
+ export declare const calculateBpm188Checksum: (bytes: readonly string[]) => string;
14
+ export declare const bpm188GetInfo: () => string[];
15
+ export declare const bpm188SyncTime: (now?: Date) => string[];
16
+ export declare const bpm188GetRecords: () => string[];
17
+ export interface Bpm188Response {
18
+ type: number;
19
+ content: string[];
20
+ }
21
+ export declare const decodeBpm188Response: (bytes: readonly string[]) => Bpm188Response | undefined;
22
+ export interface Bpm188Record {
23
+ systolic: number;
24
+ diastolic: number;
25
+ heartRate: number;
26
+ userId: number;
27
+ storeId: number;
28
+ recordedAt: Date;
29
+ }
30
+ export declare const parseBpm188Record: (content: readonly string[]) => Bpm188Record | undefined;
31
+ /** Reads the split and concatenated 02 40 dd history responses. */
32
+ export declare class Bpm188FrameReader implements FrameReader {
33
+ readFrame(buffer: readonly string[]): FrameReadResult;
34
+ private findStart;
35
+ }
36
+ //# sourceMappingURL=viatom.bpm188.protocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viatom.bpm188.protocol.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,eAAO,MAAM,cAAc,yCAAyC,CAAC;AACrE,eAAO,MAAM,YAAY,yCAAyC,CAAC;AACnE,eAAO,MAAM,aAAa,yCAAyC,CAAC;AAEpE,eAAO,MAAM,iBAAiB;;;;;CAKpB,CAAC;AAKX,4EAA4E;AAC5E,eAAO,MAAM,uBAAuB,GAClC,OAAO,SAAS,MAAM,EAAE,KACvB,MAQF,CAAC;AAUF,eAAO,MAAM,aAAa,QAAO,MAAM,EACN,CAAC;AAElC,eAAO,MAAM,cAAc,GAAI,UAAgB,KAAG,MAAM,EAQpD,CAAC;AAEL,eAAO,MAAM,gBAAgB,QAAO,MAAM,EACoB,CAAC;AAE/D,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,eAAO,MAAM,oBAAoB,GAC/B,OAAO,SAAS,MAAM,EAAE,KACvB,cAAc,GAAG,SA0BnB,CAAC;AAEF,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,IAAI,CAAC;CAClB;AA6BD,eAAO,MAAM,iBAAiB,GAC5B,SAAS,SAAS,MAAM,EAAE,KACzB,YAAY,GAAG,SAsBjB,CAAC;AAEF,mEAAmE;AACnE,qBAAa,iBAAkB,YAAW,WAAW;IAC5C,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,eAAe;IAiC5D,OAAO,CAAC,SAAS;CAalB"}