@ovok/native 1.0.0 → 1.1.0

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 (116) hide show
  1. package/LICENSE +8 -667
  2. package/lib/commonjs/modules/bt-device/components/btdevice-list.js +3 -1
  3. package/lib/commonjs/modules/bt-device/components/btdevice-list.js.map +1 -1
  4. package/lib/commonjs/modules/bt-device/components/item/status.js +17 -5
  5. package/lib/commonjs/modules/bt-device/components/item/status.js.map +1 -1
  6. package/lib/commonjs/modules/bt-device/components/supported-device-list.js +93 -0
  7. package/lib/commonjs/modules/bt-device/components/supported-device-list.js.map +1 -0
  8. package/lib/commonjs/modules/bt-device/constants/supported-devices.js +173 -0
  9. package/lib/commonjs/modules/bt-device/constants/supported-devices.js.map +1 -0
  10. package/lib/commonjs/modules/bt-device/index.js +33 -0
  11. package/lib/commonjs/modules/bt-device/index.js.map +1 -1
  12. package/lib/commonjs/modules/bt-device/types/supported-device-list-props.js +6 -0
  13. package/lib/commonjs/modules/bt-device/types/supported-device-list-props.js.map +1 -0
  14. package/lib/commonjs/modules/bt-management/index.js +11 -0
  15. package/lib/commonjs/modules/bt-management/index.js.map +1 -1
  16. package/lib/commonjs/modules/bt-management/services/bt-manager.js +15 -13
  17. package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
  18. package/lib/commonjs/modules/bt-management/services/device-creator.js +7 -1
  19. package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
  20. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +184 -0
  21. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +1 -0
  22. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-frame-parser.js +114 -0
  23. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-frame-parser.js.map +1 -0
  24. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js +113 -51
  25. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
  26. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.main-services.js +41 -77
  27. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.main-services.js.map +1 -1
  28. package/lib/commonjs/modules/bt-management/services/devices/boso/boso.medicus.js +29 -0
  29. package/lib/commonjs/modules/bt-management/services/devices/boso/boso.medicus.js.map +1 -0
  30. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +24 -12
  31. package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
  32. package/lib/module/modules/bt-device/components/btdevice-list.js +3 -1
  33. package/lib/module/modules/bt-device/components/btdevice-list.js.map +1 -1
  34. package/lib/module/modules/bt-device/components/item/status.js +17 -5
  35. package/lib/module/modules/bt-device/components/item/status.js.map +1 -1
  36. package/lib/module/modules/bt-device/components/supported-device-list.js +87 -0
  37. package/lib/module/modules/bt-device/components/supported-device-list.js.map +1 -0
  38. package/lib/module/modules/bt-device/constants/supported-devices.js +169 -0
  39. package/lib/module/modules/bt-device/constants/supported-devices.js.map +1 -0
  40. package/lib/module/modules/bt-device/index.js +3 -0
  41. package/lib/module/modules/bt-device/index.js.map +1 -1
  42. package/lib/module/modules/bt-device/types/supported-device-list-props.js +4 -0
  43. package/lib/module/modules/bt-device/types/supported-device-list-props.js.map +1 -0
  44. package/lib/module/modules/bt-management/index.js +1 -0
  45. package/lib/module/modules/bt-management/index.js.map +1 -1
  46. package/lib/module/modules/bt-management/services/bt-manager.js +15 -13
  47. package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
  48. package/lib/module/modules/bt-management/services/device-creator.js +7 -1
  49. package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
  50. package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +180 -0
  51. package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +1 -0
  52. package/lib/module/modules/bt-management/services/devices/bc01/bc01-frame-parser.js +110 -0
  53. package/lib/module/modules/bt-management/services/devices/bc01/bc01-frame-parser.js.map +1 -0
  54. package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js +113 -51
  55. package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
  56. package/lib/module/modules/bt-management/services/devices/bc01/bc01.main-services.js +41 -77
  57. package/lib/module/modules/bt-management/services/devices/bc01/bc01.main-services.js.map +1 -1
  58. package/lib/module/modules/bt-management/services/devices/boso/boso.medicus.js +26 -0
  59. package/lib/module/modules/bt-management/services/devices/boso/boso.medicus.js.map +1 -0
  60. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +24 -12
  61. package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
  62. package/lib/typescript/commonjs/src/modules/bt-device/components/btdevice-list.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/src/modules/bt-device/components/item/status.d.ts.map +1 -1
  64. package/lib/typescript/commonjs/src/modules/bt-device/components/supported-device-list.d.ts +4 -0
  65. package/lib/typescript/commonjs/src/modules/bt-device/components/supported-device-list.d.ts.map +1 -0
  66. package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.d.ts +158 -0
  67. package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -0
  68. package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts +3 -0
  69. package/lib/typescript/commonjs/src/modules/bt-device/index.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/src/modules/bt-device/types/supported-device-list-props.d.ts +6 -0
  71. package/lib/typescript/commonjs/src/modules/bt-device/types/supported-device-list-props.d.ts.map +1 -0
  72. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +1 -0
  73. package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +0 -1
  75. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
  77. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts +53 -0
  78. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +1 -0
  79. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts +53 -0
  80. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts.map +1 -0
  81. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts +33 -13
  82. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts.map +1 -1
  83. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts +11 -17
  84. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/boso/boso.medicus.d.ts +26 -0
  86. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/boso/boso.medicus.d.ts.map +1 -0
  87. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +0 -25
  88. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
  89. package/lib/typescript/module/src/modules/bt-device/components/btdevice-list.d.ts.map +1 -1
  90. package/lib/typescript/module/src/modules/bt-device/components/item/status.d.ts.map +1 -1
  91. package/lib/typescript/module/src/modules/bt-device/components/supported-device-list.d.ts +4 -0
  92. package/lib/typescript/module/src/modules/bt-device/components/supported-device-list.d.ts.map +1 -0
  93. package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.d.ts +158 -0
  94. package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -0
  95. package/lib/typescript/module/src/modules/bt-device/index.d.ts +3 -0
  96. package/lib/typescript/module/src/modules/bt-device/index.d.ts.map +1 -1
  97. package/lib/typescript/module/src/modules/bt-device/types/supported-device-list-props.d.ts +6 -0
  98. package/lib/typescript/module/src/modules/bt-device/types/supported-device-list-props.d.ts.map +1 -0
  99. package/lib/typescript/module/src/modules/bt-management/index.d.ts +1 -0
  100. package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
  101. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +0 -1
  102. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  103. package/lib/typescript/module/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
  104. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts +53 -0
  105. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +1 -0
  106. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts +53 -0
  107. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts.map +1 -0
  108. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts +33 -13
  109. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts.map +1 -1
  110. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts +11 -17
  111. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts.map +1 -1
  112. package/lib/typescript/module/src/modules/bt-management/services/devices/boso/boso.medicus.d.ts +26 -0
  113. package/lib/typescript/module/src/modules/bt-management/services/devices/boso/boso.medicus.d.ts.map +1 -0
  114. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +0 -25
  115. package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
  116. package/package.json +1 -1
@@ -4,16 +4,43 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.BC01Device = void 0;
7
+ var _core = require("@ovok/core");
7
8
  var _caseType = require("../../../types/case-type.js");
9
+ var _hexToByte = require("../../../utils/hex-to-byte.js");
8
10
  var _btManagedDevice = require("../bt-managed-device.js");
11
+ var _bc01CommandSequencer = require("./bc01-command-sequencer.js");
12
+ var _bc01FrameParser = require("./bc01-frame-parser.js");
9
13
  var _bc01MainServices = require("./bc01.main-services.js");
14
+ /** Minimum bytes a complete frame carries, keyed by its opening opcode. */
15
+ const BC01_FRAME_MIN_LENGTH = {
16
+ 0xf0: 2,
17
+ // ACK
18
+ 0xf2: 8,
19
+ // Version reply (variable — 8 is the minimum PHMS reads before answering)
20
+ 0xf3: 3,
21
+ // Time-sync ack
22
+ 0xe0: 7,
23
+ // Record-count reply
24
+ 0xe1: 16,
25
+ // Stored URS record
26
+ 0xe2: 16,
27
+ // Paginated URS record
28
+ 0xe3: 3,
29
+ // Finish
30
+ 0xe4: 36,
31
+ // Quantitative record (optional path)
32
+ 0xe5: 36 // Quantitative record (optional path)
33
+ };
34
+
10
35
  /**
11
36
  * Contec BC401 (BC01) urine analyzer driver.
12
37
  *
13
- * The BC401 is a single-shot device: the patient dips a URS-7 strip, presses
14
- * the button, and the device pushes exactly one result frame on 0xFF01. There
15
- * is no streaming state, no per-tick updates, and no measurement session to
16
- * open — the device auto-starts on button press.
38
+ * The BC401 is a memory device, not a live stream: every measurement the
39
+ * patient takes is written to onboard 500-slot flash the moment the strip
40
+ * finishes reacting, and the app pulls stored records over BLE only after the
41
+ * host walks the reset → version → set-time → count → get-records handshake
42
+ * documented in `bc01-command-sequencer.ts`. Every record arrives as one
43
+ * 16-byte E1/E2 frame on 0xFF02.
17
44
  */
18
45
  class BC01Device extends _btManagedDevice.BTManagedDevice {
19
46
  onStreamStart = () => {};
@@ -21,66 +48,101 @@ class BC01Device extends _btManagedDevice.BTManagedDevice {
21
48
 
22
49
  /**
23
50
  * 90 s covers the maximum firmware-side reagent-pad settle time on a URS-7
24
- * strip. If the device does not push a result frame within that window the
25
- * data-processor times out and the driver surfaces "device unreachable".
51
+ * strip and leaves headroom for a bulk memory dump of every stored record.
52
+ * If the device does not push a frame within that window the data processor
53
+ * times out and the driver surfaces "device unreachable".
26
54
  */
27
55
  stuckDataTimeout = 90_000;
56
+ constructor(device, params) {
57
+ super(device, params);
58
+
59
+ /**
60
+ * The BC401 answers one command with one frame and picks the next command
61
+ * by the first byte of that frame. The sequencer walks reset → version →
62
+ * set-time → count → records, and acknowledges the last record of every
63
+ * set. The parent's default `pollingSequencerFor` would only re-send the
64
+ * declared reset forever, which the firmware ignores after the first one.
65
+ */
66
+ this.createCommandSequencer = () => new _bc01CommandSequencer.Bc01CommandSequencer({
67
+ write: {
68
+ serviceUuid: _bc01MainServices.bc01MainServices[0].uuid,
69
+ characteristicUuid: _bc01MainServices.bc01MainServices[0].writeUuid.uuid
70
+ },
71
+ onRefused: reason => this.onError?.(new Error(`BC401 handshake: ${reason}`))
72
+ });
73
+ }
74
+
75
+ /**
76
+ * Returns true once the notification buffer holds a complete BC401 frame,
77
+ * classified by its opening opcode. Anything else — a heartbeat opcode we
78
+ * do not recognise, or a partial buffer — is held back until enough bytes
79
+ * arrive to make sense of it. There is no aa55 header on this hardware.
80
+ */
28
81
  validatePackage = pkg => {
29
- pkg = pkg.map(b => b.toLowerCase());
30
- let headIndex = -1;
31
- for (let i = 0; i < pkg.length - 1; i++) {
32
- if (pkg[i] === "aa" && pkg[i + 1] === "55") {
33
- headIndex = i;
34
- break;
35
- }
36
- }
37
- if (headIndex === -1) {
38
- return false;
39
- }
40
- if (headIndex > 0) {
41
- pkg = pkg.slice(headIndex);
42
- }
43
- if (pkg.length < 5) {
82
+ if (pkg.length === 0) {
44
83
  return false;
45
84
  }
46
- const lengthByte = parseInt(pkg[2] ?? "0", 16) || 0;
47
- const totalLen = 3 + lengthByte;
48
- if (pkg.length < totalLen) {
85
+ const opcode = (0, _hexToByte.hexToByte)(pkg[0] ?? "");
86
+ const minLength = BC01_FRAME_MIN_LENGTH[opcode];
87
+ if (minLength === undefined) {
49
88
  return false;
50
89
  }
51
- return true;
90
+ return pkg.length >= minLength;
52
91
  };
53
- handleSuccessResult(successResult) {
54
- if (successResult.caseType !== _caseType.CaseType.RESULT) {
55
- return;
56
- }
57
- if (!successResult.measurementTypeKey) {
58
- this.onError?.(new Error(`Measurement type is undefined for case ${successResult.caseType}`));
59
- return;
60
- }
61
- this.handleUrinalysisResult(successResult);
62
- }
63
- handleUrinalysisResult(successResult) {
64
- const error = this.checkIfHasError(successResult);
65
- if (error) {
66
- this.onError?.(error);
67
- return;
92
+
93
+ /**
94
+ * The parsing model declares every E1/E2 frame as `DEPENDENT`, so this hook
95
+ * runs for each record. We decode the raw bytes here — the packed 3-bits-per
96
+ * -pad layout is not expressible in the declaration parser — and report the
97
+ * reading directly through `onResult`. The frame is then handed back as
98
+ * `OTHER` so the state machine does not report it a second time and does
99
+ * not dedupe consecutive records that happen to share the same opcode.
100
+ */
101
+ handleDependentResult = data => {
102
+ if (data.frame) {
103
+ this.reportUrsRecord(data.frame);
68
104
  }
69
- this.onResult?.(successResult);
70
- }
105
+ return {
106
+ ...data,
107
+ parsingCase: {
108
+ ...data.parsingCase,
109
+ caseType: _caseType.CaseType.OTHER
110
+ }
111
+ };
112
+ };
71
113
 
72
114
  /**
73
- * A well-formed frame with all analyte fields still undefined means the
74
- * device produced an empty read — typically a strip inserted upside down or
75
- * removed before the reagent-pad timer completed.
115
+ * Nothing to do here for the BC401. Every reading arrives through the
116
+ * dependent-result path, and the state machine sees only the `OTHER`-typed
117
+ * echo we return from `handleDependentResult`.
76
118
  */
77
- checkIfHasError(successResult) {
78
- const analytes = ["uro", "bld", "bil", "ket", "glu", "pro", "ph", "nit", "leu", "sg", "vc"];
79
- const hasAnyReading = analytes.some(key => successResult[key] !== undefined);
80
- if (!hasAnyReading) {
81
- return "feedback-messages.measurement.disturb-detected-error";
119
+ handleSuccessResult() {
120
+ return;
121
+ }
122
+ reportUrsRecord(frame) {
123
+ const parsed = (0, _bc01FrameParser.parseBc01Record)(frame);
124
+ if (!parsed) {
125
+ return;
126
+ }
127
+ const measuredValues = _bc01FrameParser.BC01_ANALYTE_ORDER.reduce((acc, analyte) => {
128
+ const value = parsed.values[analyte];
129
+ if (value !== undefined) {
130
+ acc[analyte] = value;
131
+ }
132
+ return acc;
133
+ }, {});
134
+ if (Object.keys(measuredValues).length === 0) {
135
+ this.onError?.("feedback-messages.measurement.disturb-detected-error");
136
+ return;
82
137
  }
83
- return undefined;
138
+ const reading = {
139
+ caseType: _caseType.CaseType.RESULT,
140
+ measurementTypeKey: _core.MeasurementTypeKey.uricAcid,
141
+ urineValues: [],
142
+ recordedAt: parsed.timestamp,
143
+ ...measuredValues
144
+ };
145
+ this.onResult?.(reading);
84
146
  }
85
147
  }
86
148
  exports.BC01Device = BC01Device;
@@ -1 +1 @@
1
- {"version":3,"names":["_caseType","require","_btManagedDevice","_bc01MainServices","BC01Device","BTManagedDevice","onStreamStart","mainServices","bc01MainServices","stuckDataTimeout","validatePackage","pkg","map","b","toLowerCase","headIndex","i","length","slice","lengthByte","parseInt","totalLen","handleSuccessResult","successResult","caseType","CaseType","RESULT","measurementTypeKey","onError","Error","handleUrinalysisResult","error","checkIfHasError","onResult","analytes","hasAnyReading","some","key","undefined","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bc01/bc01.device.ts"],"mappings":";;;;;;AAEA,IAAAA,SAAA,GAAAC,OAAA;AAKA,IAAAC,gBAAA,GAAAD,OAAA;AAEA,IAAAE,iBAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,UAAU,SAASC,gCAAe,CAAyB;EAC5DC,aAAa,GAAeA,CAAA,KAAM,CAAC,CAAC;EAEpCC,YAAY,GAAeC,kCAAgB;;EAErD;AACF;AACA;AACA;AACA;EACYC,gBAAgB,GAAG,MAAM;EAEzBC,eAAe,GAAgCC,GAAG,IA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P,aAA+D,EACzD;IACN,MAAMQ,KAAK,GAAG,IAAI,CAACC,eAAe,CAACT,aAAa,CAAC;IAEjD,IAAIQ,KAAK,EAAE;MACT,IAAI,CAACH,OAAO,GAAGG,KAAK,CAAC;MAErB;IACF;IAEA,IAAI,CAACE,QAAQ,GAAGV,aAAa,CAAC;EAChC;;EAEA;AACF;AACA;AACA;AACA;EACUS,eAAeA,CACrBT,aAA+D,EAC3C;IACpB,MAAMW,QAA8C,GAAG,CACrD,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,IAAI,EACJ,IAAI,CACL;IAED,MAAMC,aAAa,GAAGD,QAAQ,CAACE,IAAI,CAChCC,GAAG,IAAKd,aAAa,CAACc,GAAG,CAAC,KAAKC,SAClC,CAAC;IAED,IAAI,CAACH,aAAa,EAAE;MAClB,OAAO,sDAAsD;IAC/D;IAEA,OAAOG,SAAS;EAClB;AACF;AAACC,OAAA,CAAAnC,UAAA,GAAAA,UAAA","ignoreList":[]}
1
+ {"version":3,"names":["_core","require","_caseType","_hexToByte","_btManagedDevice","_bc01CommandSequencer","_bc01FrameParser","_bc01MainServices","BC01_FRAME_MIN_LENGTH","BC01Device","BTManagedDevice","onStreamStart","mainServices","bc01MainServices","stuckDataTimeout","constructor","device","params","createCommandSequencer","Bc01CommandSequencer","write","serviceUuid","uuid","characteristicUuid","writeUuid","onRefused","reason","onError","Error","validatePackage","pkg","length","opcode","hexToByte","minLength","undefined","handleDependentResult","data","frame","reportUrsRecord","parsingCase","caseType","CaseType","OTHER","handleSuccessResult","parsed","parseBc01Record","measuredValues","BC01_ANALYTE_ORDER","reduce","acc","analyte","value","values","Object","keys","reading","RESULT","measurementTypeKey","MeasurementTypeKey","uricAcid","urineValues","recordedAt","timestamp","onResult","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bc01/bc01.device.ts"],"mappings":";;;;;;AAAA,IAA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R,cAAc,CAAC,CAAChB,MAAM,KAAK,CAAC,EAAE;MAC5C,IAAI,CAACJ,OAAO,GAAG,sDAAsD,CAAC;MAEtE;IACF;IAEA,MAAM6B,OAAO,GAAG;MACdf,QAAQ,EAAEC,kBAAQ,CAACe,MAAM;MACzBC,kBAAkB,EAAEC,wBAAkB,CAACC,QAAQ;MAC/CC,WAAW,EAAE,EAAE;MACfC,UAAU,EAAEjB,MAAM,CAACkB,SAAS;MAC5B,GAAGhB;IACL,CAEC;IAED,IAAI,CAACiB,QAAQ,GAAGR,OAAO,CAAC;EAC1B;AACF;AAACS,OAAA,CAAAxD,UAAA,GAAAA,UAAA","ignoreList":[]}
@@ -9,93 +9,57 @@ var _caseType = require("../../../types/case-type.js");
9
9
  /**
10
10
  * Contec BC401 (a.k.a. BC01) urine analyzer — GATT profile.
11
11
  *
12
- * The BC401 uses Contec's proprietary FF12 service, shared across their consumer
13
- * medical devices. A single result notification carries a 7-parameter URS-7
14
- * strip readout expanded into eleven analyte values on the wire.
12
+ * The BC401 uses Contec's proprietary FF12 service, shared across their
13
+ * consumer medical devices. Every stored URS-7 measurement is pushed as a
14
+ * 16-byte record on 0xFF02 after the host has walked the handshake documented
15
+ * in `bc01-command-sequencer.ts`.
15
16
  *
16
17
  * Service 0xFF12
17
- * Notify (result) 0xFF01 — CCCD 0x2902 must be written 01 00 to enable
18
- * Write (command) 0xFF02 — RESET / SET_UNIT / REQUEST_HISTORY
18
+ * Notify (result) 0xFF02 — CCCD 0x2902 must be written 01 00 to enable
19
+ * Write (command) 0xFF01 — RESET / SET_TIME / GET_COUNT / GET_RECORDS
19
20
  *
20
- * Wire layout of a result frame (Contec URS-7 firmware ≥ 1.2.x):
21
- * [0..1] header "aa 55" — Contec sentinel
22
- * [2] length byte after header
23
- * [3] command "a1" == RESULT_URS7
24
- * [4] strip type "07" == 7-panel
25
- * [5..15] values one byte per analyte, encoding the discrete
26
- * level index into diagnosticResults[key]
27
- * [16] checksum xor over [2..15]
28
- *
29
- * Byte positions calibrated against PHMS 3.0.03 Android app; older firmware
30
- * (< 1.2.x) uses a different command byte and is not supported by this driver
31
- * (the validator will reject those frames).
21
+ * On the wire a stored URS record opens with 0xE1 (single) or 0xE2 (paginated).
22
+ * The remaining fifteen bytes carry the flags nibble, timestamp, seven bytes of
23
+ * packed 3-bit analyte indices, and a checksum. `bc01-frame-parser.ts` decodes
24
+ * them; this file just declares the GATT surface and hands every E1/E2 frame
25
+ * to the driver's dependent-result path so the parser can run.
32
26
  */
33
27
  const bc01MainServices = exports.bc01MainServices = [{
34
28
  uuid: "0000ff12-0000-1000-8000-00805f9b34fb",
35
- monitorUuids: [{
29
+ /**
30
+ * PHMS 3.0.03 writes `[0x80, 0x00]` to 0xFF01 the moment its GATT
31
+ * subscription is up — decompiled at L1/f.java:694 ("发送复位命令" — "send
32
+ * reset command"). The device answers nothing until this reset lands. The
33
+ * `Bc01CommandSequencer` returns the same reset from `initialCommands()`
34
+ * so the SDK sends it whether or not the polling default is in play.
35
+ */
36
+ writeUuid: {
36
37
  uuid: "0000ff01-0000-1000-8000-00805f9b34fb",
38
+ mainCommandUuid: "8000"
39
+ },
40
+ monitorUuids: [{
41
+ uuid: "0000ff02-0000-1000-8000-00805f9b34fb",
42
+ /**
43
+ * We key on the first byte only. A `DEPENDENT` case fires
44
+ * `handleDependentResult` in the driver, which runs the real decoder
45
+ * (`parseBc01Record`) against the raw frame bytes and calls
46
+ * `onResult` directly. The parsing case itself carries no field
47
+ * definitions — the packed 3-bits-per-pad layout is not expressible
48
+ * with the ordinary declaration parser and would need the vendor's
49
+ * own decoding table pinned in a declaration to be so.
50
+ */
37
51
  parsingModel: {
38
- caseValuePosition: [0, 1, 3, 4],
52
+ caseValuePosition: [0],
39
53
  cases: [{
40
54
  measurementTypeKey: _core.MeasurementTypeKey.uricAcid,
41
- caseType: _caseType.CaseType.RESULT,
42
- caseValue: "aa55a107",
43
- parseDefinitions: [{
44
- name: "uro",
45
- parseType: "number",
46
- byteIndexes: [5],
47
- parseReference: 16
48
- }, {
49
- name: "bld",
50
- parseType: "number",
51
- byteIndexes: [6],
52
- parseReference: 16
53
- }, {
54
- name: "bil",
55
- parseType: "number",
56
- byteIndexes: [7],
57
- parseReference: 16
58
- }, {
59
- name: "ket",
60
- parseType: "number",
61
- byteIndexes: [8],
62
- parseReference: 16
63
- }, {
64
- name: "glu",
65
- parseType: "number",
66
- byteIndexes: [9],
67
- parseReference: 16
68
- }, {
69
- name: "pro",
70
- parseType: "number",
71
- byteIndexes: [10],
72
- parseReference: 16
73
- }, {
74
- name: "ph",
75
- parseType: "number",
76
- byteIndexes: [11],
77
- parseReference: 16
78
- }, {
79
- name: "nit",
80
- parseType: "number",
81
- byteIndexes: [12],
82
- parseReference: 16
83
- }, {
84
- name: "leu",
85
- parseType: "number",
86
- byteIndexes: [13],
87
- parseReference: 16
88
- }, {
89
- name: "sg",
90
- parseType: "number",
91
- byteIndexes: [14],
92
- parseReference: 16
93
- }, {
94
- name: "vc",
95
- parseType: "number",
96
- byteIndexes: [15],
97
- parseReference: 16
98
- }]
55
+ caseType: _caseType.CaseType.DEPENDENT,
56
+ caseValue: "e1",
57
+ parseDefinitions: []
58
+ }, {
59
+ measurementTypeKey: _core.MeasurementTypeKey.uricAcid,
60
+ caseType: _caseType.CaseType.DEPENDENT,
61
+ caseValue: "e2",
62
+ parseDefinitions: []
99
63
  }]
100
64
  }
101
65
  }]
@@ -1 +1 @@
1
- {"version":3,"names":["_core","require","_caseType","bc01MainServices","exports","uuid","monitorUuids","parsingModel","caseValuePosition","cases","measurementTypeKey","MeasurementTypeKey","uricAcid","caseType","CaseType","RESULT","caseValue","parseDefinitions","name","parseType","byteIndexes","parseReference"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bc01/bc01.main-services.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;A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VC,SAAS,EAAE,QAAQ;UACnBC,WAAW,EAAE,CAAC,EAAE,CAAC;UACjBC,cAAc,EAAE;QAClB,CAAC,EACD;UACEH,IAAI,EAAE,KAAK;UACXC,SAAS,EAAE,QAAQ;UACnBC,WAAW,EAAE,CAAC,EAAE,CAAC;UACjBC,cAAc,EAAE;QAClB,CAAC,EACD;UACEH,IAAI,EAAE,KAAK;UACXC,SAAS,EAAE,QAAQ;UACnBC,WAAW,EAAE,CAAC,EAAE,CAAC;UACjBC,cAAc,EAAE;QAClB,CAAC,EACD;UACEH,IAAI,EAAE,IAAI;UACVC,SAAS,EAAE,QAAQ;UACnBC,WAAW,EAAE,CAAC,EAAE,CAAC;UACjBC,cAAc,EAAE;QAClB,CAAC,EACD;UACEH,IAAI,EAAE,IAAI;UACVC,SAAS,EAAE,QAAQ;UACnBC,WAAW,EAAE,CAAC,EAAE,CAAC;UACjBC,cAAc,EAAE;QAClB,CAAC;MAEL,CAAC;IAEL;EACF,CAAC;AAEL,CAAC,CACF","ignoreList":[]}
1
+ {"version":3,"names":["_core","require","_caseType","bc01MainServices","exports","uuid","writeUuid","mainCommandUuid","monitorUuids","parsingModel","caseValuePosition","cases","measurementTypeKey","MeasurementTypeKey","uricAcid","caseType","CaseType","DEPENDENT","caseValue","parseDefinitions"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bc01/bc01.main-services.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,gBAA4B,GAAAC,OAAA,CAAAD,gBAAA,GAAG,CAC1C;EACEE,IAAI,EAAE,sCAAsC;EAE5C;AACJ;AACA;AACA;AACA;AACA;AACA;EACIC,SAAS,EAAE;IACTD,IAAI,EAAE,sCAAsC;IAC5CE,eAAe,EAAE;EACnB,CAAC;EACDC,YAAY,EAAE,CACZ;IACEH,IAAI,EAAE,sCAAsC;IAE5C;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACQI,YAAY,EAAE;MACZC,iBAAiB,EAAE,CAAC,CAAC,CAAC;MACtBC,KAAK,EAAE,CACL;QACEC,kBAAkB,EAAEC,wBAAkB,CAACC,QAAQ;QAC/CC,QAAQ,EAAEC,kBAAQ,CAACC,SAAS;QAC5BC,SAAS,EAAE,IAAI;QACfC,gBAAgB,EAAE;MACpB,CAAC,EACD;QACEP,kBAAkB,EAAEC,wBAAkB,CAACC,QAAQ;QAC/CC,QAAQ,EAAEC,kBAAQ,CAACC,SAAS;QAC5BC,SAAS,EAAE,IAAI;QACfC,gBAAgB,EAAE;MACpB,CAAC;IAEL;EACF,CAAC;AAEL,CAAC,CACF","ignoreList":[]}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.bosoMedicusMonitor = exports.BOSO_MEDICUS_NAME_MATCH = void 0;
7
+ var _standardGattDevices = require("../standard-gatt/standard-gatt.devices.js");
8
+ /**
9
+ * The boso medicus system uses the Bluetooth SIG Blood Pressure Service and Measurement
10
+ * characteristic. Its vendor-specific identity is the advertised name, which carries a
11
+ * six-character hexadecimal suffix, for example `boso medicus 312B5D`.
12
+ */
13
+ const BOSO_MEDICUS_NAME_MATCH = exports.BOSO_MEDICUS_NAME_MATCH = /^boso medicus [0-9a-f]{6}$/i;
14
+ /**
15
+ * Declares a boso medicus system monitor.
16
+ *
17
+ * The monitor stores readings and sends them through the standard 0x1810/0x2A35 profile after
18
+ * pairing. The shared profile declaration handles mmHg, optional timestamps, pulse rate and
19
+ * the profile's user/status bytes without inventing a boso-specific wire format.
20
+ */
21
+ const bosoMedicusMonitor = params => (0, _standardGattDevices.standardBloodPressureDevice)({
22
+ id: params.id,
23
+ nameMatch: params.nameMatch ?? BOSO_MEDICUS_NAME_MATCH,
24
+ ...(params.stuckDataTimeoutMs === undefined ? {} : {
25
+ stuckDataTimeoutMs: params.stuckDataTimeoutMs
26
+ })
27
+ });
28
+ exports.bosoMedicusMonitor = bosoMedicusMonitor;
29
+ //# sourceMappingURL=boso.medicus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_standardGattDevices","require","BOSO_MEDICUS_NAME_MATCH","exports","bosoMedicusMonitor","params","standardBloodPressureDevice","id","nameMatch","stuckDataTimeoutMs","undefined"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/boso/boso.medicus.ts"],"mappings":";;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,6BAA6B;AAc7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,kBAAkB,GACtBC,MAAyB,IAEzB,IAAAC,gDAA2B,EAAC;EAC1BC,EAAE,EAAEF,MAAM,CAACE,EAAE;EACbC,SAAS,EAAEH,MAAM,CAACG,SAAS,IAAIN,uBAAuB;EACtD,IAAIG,MAAM,CAACI,kBAAkB,KAAKC,SAAS,GACvC,CAAC,CAAC,GACF;IAAED,kBAAkB,EAAEJ,MAAM,CAACI;EAAmB,CAAC;AACvD,CAAC,CAAC;AAACN,OAAA,CAAAC,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -31,26 +31,38 @@ var _standardGattProfile = require("./standard-gatt.profile.js");
31
31
  * at all, so it is read at byte 7 in one shape and byte 14 in the other, and each shape
32
32
  * declares the length it needs. A device that reports no pulse still decodes, because the
33
33
  * flags value it sends selects a case that never looks for one.
34
+ *
35
+ * Bit 3 (user id, 0x08) and bit 4 (measurement status, 0x10) follow the pulse, so neither
36
+ * moves it. Each shape is declared again with those bits set. Bit 0 (kPa) stays undeclared.
34
37
  */
38
+ /** Bit 2 set, bit 1 clear: the pulse follows the mean pressure. */
39
+ const pulseAfterMeanPressure = {
40
+ fields: [(0, _standardGattProfile.littleEndian)("heartRate", [7, 8], "bpm", "sfloat")],
41
+ minLengthBytes: 9
42
+ };
43
+
44
+ /** Bit 1 and bit 2 set: the pulse follows the seven-byte timestamp. */
45
+ const pulseAfterTimestamp = {
46
+ fields: [(0, _standardGattProfile.littleEndian)("heartRate", [14, 15], "bpm", "sfloat")],
47
+ minLengthBytes: 16
48
+ };
35
49
  const standardBloodPressureDevice = params => (0, _standardGattProfile.declareProfile)(params, {
36
50
  service: "1810",
37
51
  characteristic: "2a35",
38
52
  minLengthBytes: 7,
39
53
  measurementTypeKey: _core.MeasurementTypeKey.bloodPressure,
40
- /** mmHg, with and without the timestamp and pulse the pressures sit in front of. */
41
- selectors: ["00", "02", "04", "06"],
54
+ /** mmHg. 0x08, 0x10 and 0x18 repeat each shape with bit 3, bit 4, or both. */
55
+ selectors: ["00", "08", "10", "18", "02", "0a", "12", "1a", "04", "0c", "14", "1c", "06", "0e", "16", "1e"],
42
56
  fields: [(0, _standardGattProfile.littleEndian)("systolic", [1, 2], "mmHg", "sfloat"), (0, _standardGattProfile.littleEndian)("diastolic", [3, 4], "mmHg", "sfloat")],
43
57
  optionalFields: {
44
- /** Pulse, no timestamp: it follows the mean pressure. */
45
- "04": {
46
- fields: [(0, _standardGattProfile.littleEndian)("heartRate", [7, 8], "bpm", "sfloat")],
47
- minLengthBytes: 9
48
- },
49
- /** Pulse behind a seven-byte timestamp. */
50
- "06": {
51
- fields: [(0, _standardGattProfile.littleEndian)("heartRate", [14, 15], "bpm", "sfloat")],
52
- minLengthBytes: 16
53
- }
58
+ "04": pulseAfterMeanPressure,
59
+ "0c": pulseAfterMeanPressure,
60
+ "14": pulseAfterMeanPressure,
61
+ "1c": pulseAfterMeanPressure,
62
+ "06": pulseAfterTimestamp,
63
+ "0e": pulseAfterTimestamp,
64
+ "16": pulseAfterTimestamp,
65
+ "1e": pulseAfterTimestamp
54
66
  }
55
67
  });
56
68
 
@@ -1 +1 @@
1
- {"version":3,"names":["_core","require","_standardGattProfile","standardBloodPressureDevice","params","declareProfile","service","characteristic","minLengthBytes","measurementTypeKey","MeasurementTypeKey","bloodPressure","selectors","fields","littleEndian","optionalFields","exports","standardThermometerDevice","temperature","WEIGHT_KG_PER_COUNT","standardWeightScaleDevice","bodyWeight","scale","decimals","standardPulseOximeterDevice","bloodOxygenPulseRate","standardHeartRateDevice","heartRate","name","byteIndexes","encoding","unit"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAIA,IAAAC,oBAAA,GAAAD,OAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,2BAA2B,GAC/BC,MAA4B,IAE5B,IAAAC,mCAAc,EAACD,MAAM,EAAE;EACrBE,OAAO,EAAE,MAAM;EACfC,cAAc,EAAE,MAAM;EACtBC,cAAc,EAAE,CAAC;EACjBC,kBAAkB,EAAEC,wBAAkB,CAACC,aAAa;EAEpD;EACAC,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;EACnCC,MAAM,EAAE,CACN,IAAAC,iCAAY,EAAC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAClD,IAAAA,iCAAY,EAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,CACpD;EACDC,cAAc,EAAE;IACd;IACA,IAAI,EAAE;MACJF,MAAM,EAAE,CAAC,IAAAC,iCAAY,EAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;MAC5DN,cAAc,EAAE;IAClB,CAAC;IAED;IACA,IAAI,EAAE;M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A;AALAP,OAAA,CAAAI,yBAAA,GAAAA,yBAAA;AAMA,MAAMI,2BAA2B,GAC/BpB,MAA4B,IAE5B,IAAAC,mCAAc,EAACD,MAAM,EAAE;EACrBE,OAAO,EAAE,MAAM;EACfC,cAAc,EAAE,MAAM;EACtBC,cAAc,EAAE,CAAC;EACjBC,kBAAkB,EAAEC,wBAAkB,CAACe,oBAAoB;EAC3Db,SAAS,EAAE,CAAC,IAAI,CAAC;EACjBC,MAAM,EAAE,CACN,IAAAC,iCAAY,EAAC,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,EAClD,IAAAA,iCAAY,EAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC;AAEtD,CAAC,CAAC;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AANAE,OAAA,CAAAQ,2BAAA,GAAAA,2BAAA;AAOA,MAAME,uBAAuB,GAC3BtB,MAA4B,IAE5B,IAAAC,mCAAc,EAACD,MAAM,EAAE;EACrBE,OAAO,EAAE,MAAM;EACfC,cAAc,EAAE,MAAM;EACtBC,cAAc,EAAE,CAAC;EACjBC,kBAAkB,EAAEC,wBAAkB,CAACiB,SAAS;EAChDf,SAAS,EAAE,CAAC,IAAI,CAAC;EACjBC,MAAM,EAAE,CACN;IAAEe,IAAI,EAAE,WAAW;IAAEC,WAAW,EAAE,CAAC,CAAC,CAAC;IAAEC,QAAQ,EAAE,MAAM;IAAEC,IAAI,EAAE;EAAM,CAAC;AAE1E,CAAC,CAAC;AAACf,OAAA,CAAAU,uBAAA,GAAAA,uBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_core","require","_standardGattProfile","pulseAfterMeanPressure","fields","littleEndian","minLengthBytes","pulseAfterTimestamp","standardBloodPressureDevice","params","declareProfile","service","characteristic","measurementTypeKey","MeasurementTypeKey","bloodPressure","selectors","optionalFields","exports","standardThermometerDevice","temperature","WEIGHT_KG_PER_COUNT","standardWeightScaleDevice","bodyWeight","scale","decimals","standardPulseOximeterDevice","bloodOxygenPulseRate","standardHeartRateDevice","heartRate","name","byteIndexes","encoding","unit"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAIA,IAAAC,oBAAA,GAAAD,OAAA;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,sBAAsB,GAAG;EAC7BC,MAAM,EAAE,CAAC,IAAAC,iCAAY,EAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;EAC5DC,cAAc,EAAE;AAClB,CAAC;;AAED;AACA,MAAMC,mBAAmB,GAAG;EAC1BH,MAAM,EAAE,CAAC,IAAAC,iCAAY,EAAC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;EAC9DC,cAAc,EAAE;AAClB,CAAC;AAED,MAAME,2BAA2B,GAC/BC,MAA4B,IAE5B,IAAAC,mCAAc,EAACD,MAAM,EAAE;EACrBE,OAAO,EAAE,MAAM;EACfC,cAAc,EAAE,MAAM;EACtBN,cAAc,EAAE,CAAC;EACjBO,kBAAkB,EAAEC,wBAAkB,CAACC,aAAa;EAEpD;EACAC,SAAS,EAAE,CACT,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,IAAI,CACL;EACDZ,MAAM,EAAE,CACN,IAAAC,i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AI,EAAE;EAAM,CAAC;AAE1E,CAAC,CAAC;AAACf,OAAA,CAAAU,uBAAA,GAAAA,uBAAA","ignoreList":[]}
@@ -42,7 +42,9 @@ export const BTDeviceList = ({
42
42
  })]
43
43
  }), /*#__PURE__*/_jsx(BTDeviceItem.Divider, {}), /*#__PURE__*/_jsxs(BTDeviceItem.BottomContainer, {
44
44
  children: [/*#__PURE__*/_jsx(BTDeviceItem.SubTitle, {
45
- children: "Instructions"
45
+ children: t("devices.instructions", {
46
+ defaultValue: "Instructions"
47
+ })
46
48
  }), /*#__PURE__*/_jsx(ArrowRight2, {
47
49
  size: 20,
48
50
  color: theme.colors.onSurfaceDisabled
@@ -1 +1 @@
1
- {"version":3,"names":["FlashList","ArrowRight2","React","useTranslation","View","useAppTheme","useDeviceList","BTDeviceItem","jsx","_jsx","jsxs","_jsxs","BTDeviceList","itemProps","props","t","theme","deviceListItems","renderItem","useCallback","item","index","testID","onPress","children","TopContainer","Content","Title","title","SubTitle","subtitle","Status","status","Image","uri","deviceImageUri","Divider","BottomContainer","size","color","colors","onSurfaceDisabled","ItemSeparatorComponent","style","height","data","contentContainerStyle","padding","spacing"],"sourceRoot":"../../../../../src","sources":["modules/bt-device/components/btdevice-list.tsx"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,qBAAqB;AAC/C,SAASC,WAAW,QAAQ,wBAAwB;AACpD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,IAAI,QAAQ,cAAc;AAEnC,SAASC,WAAW,QAAQ,sBAAa;AAIzC,SAASC,aAAa,QAAQ,4BAAyB;AACvD,SAASC,YAAY,QAAQ,yBAAsB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEpD,OAAO,MAAMC,YAAY,GAAGA,CAAC;EAAEC,SAAS;EAAE,GAAGC;AAAyB,CAAC,KAAK;EAC1E,MAAM;IAAEC;EAAE,CAAC,GAAGZ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AAA,CAACR,WAAW;UAACqC,IAAI,EAAE,EAAG;UAACC,KAAK,EAAEvB,KAAK,CAACwB,MAAM,CAACC;QAAkB,CAAE,CAAC;MAAA,CACpC,CAAC;IAAA,CACnB,CAAC;EAEnB,CAAC,EACD,CAAC1B,CAAC,EAAEC,KAAK,CAACwB,MAAM,CAACC,iBAAiB,EAAE3B,KAAK,CAACQ,MAAM,EAAET,SAAS,CAC7D,CAAC;EAED,oBACEJ,IAAA,CAACT,SAAS;IACR0C,sBAAsB,EAAEA,CAAA,kBAAMjC,IAAA,CAACL,IAAI;MAACuC,KAAK,EAAE;QAAEC,MAAM,EAAE;MAAG;IAAE,CAAE,CAAE;IAAA,GAC1D9B,KAAK;IACT+B,IAAI,EAAE5B,eAAgB;IACtBC,UAAU,EAAEJ,KAAK,CAACI,UAAU,IAAIA,UAAW;IAC3C4B,qBAAqB,EAAE;MACrB,GAAG;QACDC,OAAO,EAAE/B,KAAK,CAACgC,OAAO,CAAC,CAAC;MAC1B,CAAC;MACD,IAAIlC,KAAK,CAACgC,qBAAqB,IAAI,CAAC,CAAC;IACvC;EAAE,CACH,CAAC;AAEN,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["FlashList","ArrowRight2","React","useTranslation","View","useAppTheme","useDeviceList","BTDeviceItem","jsx","_jsx","jsxs","_jsxs","BTDeviceList","itemProps","props","t","theme","deviceListItems","renderItem","useCallback","item","index","testID","onPress","children","TopContainer","Content","Title","title","SubTitle","subtitle","Status","status","Image","uri","deviceImageUri","Divider","BottomContainer","defaultValue","size","color","colors","onSurfaceDisabled","ItemSeparatorComponent","style","height","data","contentContainerStyle","padding","spacing"],"sourceRoot":"../../../../../src","sources":["modules/bt-device/components/btdevice-list.tsx"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,qBAAqB;AAC/C,SAASC,WAAW,QAAQ,wBAAwB;AACpD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,IAA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,IAAA,CAACF,YAAY,CAAC0B,KAAK;UAACC,GAAG,EAAEd,IAAI,CAACe;QAAe,CAAE,CAAC;MAAA,CACvB,CAAC,eAE5B1B,IAAA,CAACF,YAAY,CAAC6B,OAAO,IAAE,CAAC,eAExBzB,KAAA,CAACJ,YAAY,CAAC8B,eAAe;QAAAb,QAAA,gBAC3Bf,IAAA,CAACF,YAAY,CAACsB,QAAQ;UAAAL,QAAA,EACnBT,CAAC,CAAC,sBAAsB,EAAE;YAAEuB,YAAY,EAAE;UAAe,CAAC;QAAC,CACvC,CAAC,eACxB7B,IAAA,CAACR,WAAW;UAACsC,IAAI,EAAE,EAAG;UAACC,KAAK,EAAExB,KAAK,CAACyB,MAAM,CAACC;QAAkB,CAAE,CAAC;MAAA,CACpC,CAAC;IAAA,CACnB,CAAC;EAEnB,CAAC,EACD,CAAC3B,CAAC,EAAEC,KAAK,CAACyB,MAAM,CAACC,iBAAiB,EAAE5B,KAAK,CAACQ,MAAM,EAAET,SAAS,CAC7D,CAAC;EAED,oBACEJ,IAAA,CAACT,SAAS;IACR2C,sBAAsB,EAAEA,CAAA,kBAAMlC,IAAA,CAACL,IAAI;MAACwC,KAAK,EAAE;QAAEC,MAAM,EAAE;MAAG;IAAE,CAAE,CAAE;IAAA,GAC1D/B,KAAK;IACTgC,IAAI,EAAE7B,eAAgB;IACtBC,UAAU,EAAEJ,KAAK,CAACI,UAAU,IAAIA,UAAW;IAC3C6B,qBAAqB,EAAE;MACrB,GAAG;QACDC,OAAO,EAAEhC,KAAK,CAACiC,OAAO,CAAC,CAAC;MAC1B,CAAC;MACD,IAAInC,KAAK,CAACiC,qBAAqB,IAAI,CAAC,CAAC;IACvC;EAAE,CACH,CAAC;AAEN,CAAC","ignoreList":[]}
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  import * as React from "react";
4
+ import { useTranslation } from "react-i18next";
4
5
  import { StyleSheet } from "react-native";
5
6
  import { Text } from "react-native-paper";
6
7
  import { DeviceStatus } from "../../../bt-management/index.js";
@@ -11,26 +12,37 @@ export const Status = ({
11
12
  ...props
12
13
  }) => {
13
14
  const theme = useAppTheme();
15
+ const {
16
+ t
17
+ } = useTranslation();
14
18
  const data = React.useMemo(() => {
15
19
  return {
16
20
  [DeviceStatus.CONNECTED]: {
17
- label: "Connected",
21
+ label: t("devices.status.connected", {
22
+ defaultValue: "Connected"
23
+ }),
18
24
  color: theme.colors.success
19
25
  },
20
26
  [DeviceStatus.DISCONNECTED]: {
21
- label: "Disconnected",
27
+ label: t("devices.status.disconnected", {
28
+ defaultValue: "Disconnected"
29
+ }),
22
30
  color: theme.colors.error
23
31
  },
24
32
  [DeviceStatus.LOW_BATTERY]: {
25
- label: "Low Battery",
33
+ label: t("devices.status.low-battery", {
34
+ defaultValue: "Low Battery"
35
+ }),
26
36
  color: theme.colors.error
27
37
  },
28
38
  [DeviceStatus.MEASURING]: {
29
- label: "Measuring",
39
+ label: t("devices.status.measuring", {
40
+ defaultValue: "Measuring"
41
+ }),
30
42
  color: theme.colors.warning
31
43
  }
32
44
  };
33
- }, [theme.colors.success, theme.colors.error, theme.colors.warning]);
45
+ }, [t, theme.colors.success, theme.colors.error, theme.colors.warning]);
34
46
  return /*#__PURE__*/_jsx(Text, {
35
47
  ...props,
36
48
  style: [styles.status, {
@@ -1 +1 @@
1
- {"version":3,"names":["React","StyleSheet","Text","DeviceStatus","useAppTheme","jsx","_jsx","Status","status","props","theme","data","useMemo","CONNECTED","label","color","colors","success","DISCONNECTED","error","LOW_BATTERY","MEASURING","warning","style","styles","children","create","fontSize","fontFamily"],"sourceRoot":"../../../../../../src","sources":["modules/bt-device/components/item/status.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,QAAQ,cAAc;AACzC,SAA0BC,IAAI,QAAQ,oBAAoB;AAE1D,SAASC,YAAY,QAAQ,iCAAwB;AACrD,SAASC,WAAW,QAAQ,yBAAgB;AAAC,SAAAC,GAAA,IAAA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CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useTranslation","StyleSheet","Text","DeviceStatus","useAppTheme","jsx","_jsx","Status","status","props","theme","t","data","useMemo","CONNECTED","label","defaultValue","color","colors","success","DISCONNECTED","error","LOW_BATTERY","MEASURING","warning","style","styles","children","create","fontSize","fontFamily"],"sourceRoot":"../../../../../../src","sources":["modules/bt-device/components/item/status.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,UAAU,QAAQ,cAAc;AACzC,SAA0BC,IAAI,QAAQ,oBAAoB;AAE1D,SAASC,YAAY,QAAQ,iCAAwB;AACrD,SAASC,WAAW,QAAQ,yBAAgB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG7C,OAAO,MAAMC,MAAM,GAAGA,CAA4B;EAChDC,MAAM;EACN,GAAGC;AACuB,CAAC,KAAK;EAChC,MAAMC,KAAK,GAAGN,WAAW,CAAC,CAAC;EAC3B,MAAM;IAAEO;EAAE,CAAC,GAAGX,cAAc,CAAC,CAAC;EAE9B,MAAMY,IAAI,GAAGb,KAAK,CAACc,OAAO,CAAC,MAAM;IAC/B,OAAO;MACL,CAACV,YAAY,CAACW,SAAS,GAAG;QACxBC,KAAK,EAAEJ,CAAC,CAAC,0BAA0B,EAAE;UAAEK,YAAY,EAAE;QAAY,CAAC,CAAC;QACnEC,KAAK,EAAEP,KAAK,CAACQ,MAAM,CAACC;MACtB,CAAC;MACD,CAAChB,YAAY,CAACiB,YAAY,GAAG;QAC3BL,KAAK,EAAEJ,CAAC,CAAC,6BAA6B,EAAE;UACtCK,YAAY,EAAE;QAChB,CAAC,CAAC;QACFC,KAAK,EAAEP,KAAK,CAACQ,MAAM,CAACG;MACtB,CAAC;MACD,CAAClB,YAAY,CAACmB,WAAW,GAAG;QAC1BP,KAAK,EAAEJ,CAAC,CAAC,4BAA4B,EAAE;UAAEK,YAAY,EAAE;QAAc,CAAC,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