@ovok/native 1.6.20 → 1.6.22
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.
- package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js +4 -1
- package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +4 -1
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +34 -1
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +2 -1
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +18 -3
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/types/custom-device-definition.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/define-custom-device.js +4 -1
- package/lib/module/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +5 -2
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +32 -1
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +2 -1
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +18 -3
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -1
- package/lib/module/modules/bt-management/types/custom-device-definition.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/define-custom-device.d.ts +4 -2
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +7 -2
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +4 -3
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts +7 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/define-custom-device.d.ts +4 -2
- package/lib/typescript/module/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +7 -2
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +4 -3
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +2 -2
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts +7 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -1
- package/package.json +2 -2
package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js
CHANGED
|
@@ -41,6 +41,8 @@ const declareProfile = (params, profile) => defineCustomDevice({
|
|
|
41
41
|
})
|
|
42
42
|
}]
|
|
43
43
|
}]
|
|
44
|
+
}, {
|
|
45
|
+
decorateReading: params.decorateReading
|
|
44
46
|
});
|
|
45
47
|
const littleEndian = (name, byteIndexes, unit, encoding) => ({
|
|
46
48
|
name,
|
|
@@ -49,5 +51,34 @@ const littleEndian = (name, byteIndexes, unit, encoding) => ({
|
|
|
49
51
|
encoding,
|
|
50
52
|
unit
|
|
51
53
|
});
|
|
52
|
-
|
|
54
|
+
const byteAt = (frame, index, offset) => {
|
|
55
|
+
const value = Number.parseInt(frame[index + offset] ?? "", 16);
|
|
56
|
+
return Number.isInteger(value) && value >= 0 && value <= 0xff ? value : undefined;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/** Reads the SIG blood-pressure timestamp as a phone-local date. */
|
|
60
|
+
const recordedAtFromBloodPressureFrame = (frame, offset = 0) => {
|
|
61
|
+
const flags = byteAt(frame, 0, offset);
|
|
62
|
+
const yearLow = byteAt(frame, 7, offset);
|
|
63
|
+
const yearHigh = byteAt(frame, 8, offset);
|
|
64
|
+
const month = byteAt(frame, 9, offset);
|
|
65
|
+
const day = byteAt(frame, 10, offset);
|
|
66
|
+
const hour = byteAt(frame, 11, offset);
|
|
67
|
+
const minute = byteAt(frame, 12, offset);
|
|
68
|
+
const second = byteAt(frame, 13, offset);
|
|
69
|
+
if (flags === undefined || (flags & 0x02) === 0 || yearLow === undefined || yearHigh === undefined || month === undefined || day === undefined || hour === undefined || minute === undefined || second === undefined) {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
const year = yearLow | yearHigh << 8;
|
|
73
|
+
const recordedAt = new Date(year, month - 1, day, hour, minute, second);
|
|
74
|
+
return recordedAt.getFullYear() === year && recordedAt.getMonth() === month - 1 && recordedAt.getDate() === day && recordedAt.getHours() === hour && recordedAt.getMinutes() === minute && recordedAt.getSeconds() === second ? recordedAt : undefined;
|
|
75
|
+
};
|
|
76
|
+
const decorateBloodPressureReading = (reading, frame, recordOffset) => {
|
|
77
|
+
const recordedAt = frame ? recordedAtFromBloodPressureFrame(frame, recordOffset) : undefined;
|
|
78
|
+
return recordedAt ? {
|
|
79
|
+
...reading,
|
|
80
|
+
recordedAt
|
|
81
|
+
} : reading;
|
|
82
|
+
};
|
|
83
|
+
export { decorateBloodPressureReading, declareProfile, littleEndian, recordedAtFromBloodPressureFrame, sigUuid };
|
|
53
84
|
//# sourceMappingURL=standard-gatt.profile.js.map
|
package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["defineCustomDevice","SPOT_CHECK_TIMEOUT_MS","sigUuid","assigned","declareProfile","params","profile","id","measurementTypeKey","nameMatch","matchByService","undefined","oneReadingPerConnection","stuckDataTimeoutMs","services","uuid","service","monitor","characteristic","frame","minLengthBytes","caseSelectorBytes","cases","selectors","map","selector","optional","optionalFields","fields","fieldsBySelector","kind","littleEndian","name","byteIndexes","unit","encoding","byteOrder"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["defineCustomDevice","SPOT_CHECK_TIMEOUT_MS","sigUuid","assigned","declareProfile","params","profile","id","measurementTypeKey","nameMatch","matchByService","undefined","oneReadingPerConnection","stuckDataTimeoutMs","services","uuid","service","monitor","characteristic","frame","minLengthBytes","caseSelectorBytes","cases","selectors","map","selector","optional","optionalFields","fields","fieldsBySelector","kind","decorateReading","littleEndian","name","byteIndexes","unit","encoding","byteOrder","byteAt","index","offset","value","Number","parseInt","isInteger","recordedAtFromBloodPressureFrame","flags","yearLow","yearHigh","month","day","hour","minute","second","year","recordedAt","Date","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","decorateBloodPressureReading","reading","recordOffset"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.ts"],"mappings":";;AAOA,SAASA,kBAAkB,QAAQ,sCAAmC;;AAEtE;AACA,MAAMC,qBAAqB,GAAG,MAAM;AAkDpC,MAAMC,OAAO,GAAIC,QAAgB,IAC/B,OAAOA,QAAQ,8BAA8B;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAGA,CACrBC,MAA4B,EAC5BC,OAAoB,KAEpBN,kBAAkB,CAChB;EACEO,EAAE,EAAEF,MAAM,CAACE,EAAE,IAAI,YAAYD,OAAO,CAACE,kBAAkB,EAAE;EACzDC,SAAS,EAAEJ,MAAM,CAACI,SAAS;EAC3BC,cAAc,EAAEL,MAAM,CAACI,SAAS,KAAKE,SAAS;EAC9CC,uBAAuB,EAAEP,MAAM,CAACO,uBAAuB;EACvDC,kBAAkB,EAAER,MAAM,CAACQ,kBAAkB,IAAIZ,q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OAAO,GAAIC,QAAQ,IAAI,CAAE;EACtC,MAAMO,UAAU,GAAG,IAAIC,IAAI,CAACF,IAAI,EAAEL,KAAK,GAAG,CAAC,EAAEC,GAAG,EAAEC,IAAI,EAAEC,MAAM,EAAEC,MAAM,CAAC;EAEvE,OAAOE,UAAU,CAACE,WAAW,CAAC,CAAC,KAAKH,IAAI,IACtCC,UAAU,CAACG,QAAQ,CAAC,CAAC,KAAKT,KAAK,GAAG,CAAC,IACnCM,UAAU,CAACI,OAAO,CAAC,CAAC,KAAKT,GAAG,IAC5BK,UAAU,CAACK,QAAQ,CAAC,CAAC,KAAKT,IAAI,IAC9BI,UAAU,CAACM,UAAU,CAAC,CAAC,KAAKT,MAAM,IAClCG,UAAU,CAACO,UAAU,CAAC,CAAC,KAAKT,MAAM,GAChCE,UAAU,GACV5C,SAAS;AACf,CAAC;AAED,MAAMoD,4BAAoD,GAAGA,CAC3DC,OAAO,EACP7C,KAAK,EACL8C,YAAY,KACT;EACH,MAAMV,UAAU,GAAGpC,KAAK,GACpB0B,gCAAgC,CAAC1B,KAAK,EAAE8C,YAAY,CAAC,GACrDtD,SAAS;EAEb,OAAO4C,UAAU,GAAG;IAAE,GAAGS,OAAO;IAAET;EAAW,CAAC,GAAGS,OAAO;AAC1D,CAAC;AAED,SACED,4BAA4B,EAC5B3D,cAAc,EACd4B,YAAY,EACZa,gCAAgC,EAChC3C,OAAO","ignoreList":[]}
|
package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js
CHANGED
|
@@ -43,7 +43,8 @@ const parseVerovalDuoControlRecordMetadata = (frame, recordOffset) => {
|
|
|
43
43
|
return undefined;
|
|
44
44
|
}
|
|
45
45
|
return {
|
|
46
|
-
recordedAt
|
|
46
|
+
recordedAt,
|
|
47
|
+
irregularHeartbeat: asciiFromFrame(frame, recordOffset + RECORD_TIMESTAMP_BYTES, 1) !== "0"
|
|
47
48
|
};
|
|
48
49
|
};
|
|
49
50
|
const asciiField = (name, from, unit) => ({
|
package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MeasurementTypeKey","defineCustomDevice","CustomDevice","SentinelFrameReader","VerovalDuoControlSequencer","SERVICE","NOTIFY","WRITE","STX","ETX","ACK","NAK","RECORD_BYTES","TAG_BYTES","DATA_REPLY","COUNT_REPLY","MAX_REPLY_BYTES","STUCK_TIMEOUT_MS","RECORD_TIMESTAMP_BYTES","asciiFromFrame","frame","from","count","slice","map","byte","String","fromCharCode","Number","parseInt","join","parseVerovalDuoControlRecordMetadata","recordOffset","timestamp","year","month","day","hour","minute","test","every","isFinite","undefined","recordedAt","Date","getFullYear","getMonth","getDate","getHours","getMinutes","asciiField","name","unit","byteIndexes","encoding","duoControlDefinition","id","nameMatch","stuckDataTimeoutMs","services","uuid","monitor","minLengthBytes","caseSelectorBytes","cases","selector","kind","measurementTypeKey","bloodPressure","description","repeatedRecords","recordBytes","fields","VerovalDuoControlDevice","memorySlot","constructor","device","params","frameReader","start","terminator","maxFrameBytes","standaloneBytes","createCommandSequencer","write","serviceUuid","characteristicUuid","onMemorySlot","onRefused","reason","onError","Error","decorateReading","reading","metadata"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.duo-control-device.ts"],"mappings":";;AAAA,SAAmCA,kBAAkB,QAAQ,YAAY;AAKzE,SAASC,kBAAkB,QAAQ,sCAAmC;AACtE,SAASC,YAAY,QAAQ,4BAAyB;AACtD,SAASC,mBAAmB,QAAQ,6BAA0B;AAE9D,SAASC,0BAA0B,QAAQ,oCAAiC;AAE5E,MAAMC,OAAO,GAAG,sCAAsC;AACtD,MAAMC,MAAM,GAAG,sCAAsC;AACrD,MAAMC,KAAK,GAAG,sCAAsC;AAEpD,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;;AAEhB;AACA,MAAMC,YAAY,GAAG,EAAE;;AAEvB;AACA,MAAMC,SAAS,GAAG,CAAC;;AAEnB;AACA,MAAMC,UAAU,GAAG,UAAU;;AAE7B;AACA,MAAMC,WAAW,GAAG,UAAU;;AAE9B;AACA,MAAMC,eAAe,GAAG,KAAK;;AAE7B;AACA,MAAMC,gBAAgB,GAAG,OAAO;AAEhC,MAAMC,sBAAsB,GAAG,EAAE;
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","defineCustomDevice","CustomDevice","SentinelFrameReader","VerovalDuoControlSequencer","SERVICE","NOTIFY","WRITE","STX","ETX","ACK","NAK","RECORD_BYTES","TAG_BYTES","DATA_REPLY","COUNT_REPLY","MAX_REPLY_BYTES","STUCK_TIMEOUT_MS","RECORD_TIMESTAMP_BYTES","asciiFromFrame","frame","from","count","slice","map","byte","String","fromCharCode","Number","parseInt","join","parseVerovalDuoControlRecordMetadata","recordOffset","timestamp","year","month","day","hour","minute","test","every","isFinite","undefined","recordedAt","Date","getFullYear","getMonth","getDate","getHours","getMinutes","irregularHeartbeat","asciiField","name","unit","byteIndexes","encoding","duoControlDefinition","id","nameMatch","stuckDataTimeoutMs","services","uuid","monitor","minLengthBytes","caseSelectorBytes","cases","selector","kind","measurementTypeKey","bloodPressure","description","repeatedRecords","recordBytes","fields","VerovalDuoControlDevice","memorySlot","constructor","device","params","frameReader","start","terminator","maxFrameBytes","standaloneBytes","createCommandSequencer","write","serviceUuid","characteristicUuid","onMemorySlot","onRefused","reason","onError","Error","decorateReading","reading","metadata"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.duo-control-device.ts"],"mappings":";;AAAA,SAAmCA,kBAAkB,QAAQ,YAAY;AAKzE,SAASC,kBAAkB,QAAQ,sCAAmC;AACtE,SAASC,YAAY,QAAQ,4BAAyB;AACtD,SAASC,mBAAmB,QAAQ,6BAA0B;AAE9D,SAASC,0BAA0B,QAAQ,oCAAiC;AAE5E,MAAMC,O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E,GAAG;MACVyE,UAAU,EAAExE,GAAG;MACfyE,aAAa,EAAElE,eAAe;MAC9BmE,eAAe,EAAE,CAACzE,GAAG,EAAEC,GAAG;IAC5B,CAAC,CAAC;IAEF,IAAI,CAACyE,sBAAsB,GAAG,MAC5B,IAAIhF,0BAA0B,CAAC;MAC7BiF,KAAK,EAAE;QAAEC,WAAW,EAAEjF,OAAO;QAAEkF,kBAAkB,EAAEhF;MAAM,CAAC;MAC1DiF,YAAY,EAAGb,UAAU,IAAK;QAC5B,IAAI,CAACA,UAAU,GAAGA,UAAU;MAC9B,CAAC;MACDc,SAAS,EAAGC,MAAM,IAChB,IAAI,CAACC,OAAO,GAAG,IAAIC,KAAK,CAAC,wBAAwBF,MAAM,GAAG,CAAC;IAC/D,CAAC,CAAC;EACN;EAEUG,eAAe,GAAGA,CAC1BC,OAAuD,EACvD1E,KAAyB,EACzBY,YAAqB,KAClB;IACH,MAAM+D,QAAQ,GACZ3E,KAAK,IAAIY,YAAY,KAAKU,SAAS,GAC/BX,oCAAoC,CAACX,KAAK,EAAEY,YAAY,CAAC,GACzDU,SAAS;IAEf,OAAOqD,QAAQ,GACV;MACC,GAAGD,OAAO;MACV,GAAGC,QAAQ;MACXpB,UAAU,EAAE,IAAI,CAACA;IACnB,CAAC,GACDmB,OAAO;EACb,CAAC;AACH;AAEA,SAAS/D,oCAAoC,EAAE2C,uBAAuB","ignoreList":[]}
|
|
@@ -9,6 +9,9 @@ const DOWNLOAD_GROUP = 4;
|
|
|
9
9
|
const DOWNLOAD_MODE = 1;
|
|
10
10
|
const DOWNLOAD_HEADER = 2;
|
|
11
11
|
const DOWNLOAD_RAW = 3;
|
|
12
|
+
const FRAME_GROUP_INDEX = 1;
|
|
13
|
+
const FRAME_COMMAND_INDEX = 2;
|
|
14
|
+
const FRAME_PACKET_INDEX = 3;
|
|
12
15
|
|
|
13
16
|
/** The transfer's shape, from the vendor's own device table. */
|
|
14
17
|
const PAYLOAD_FROM = 4;
|
|
@@ -19,6 +22,8 @@ const SEGMENTS = 34;
|
|
|
19
22
|
const BYTE_MASK = 0xff;
|
|
20
23
|
const BYTE_BITS = 8;
|
|
21
24
|
const toHex = byte => (byte & BYTE_MASK).toString(16).padStart(2, "0");
|
|
25
|
+
const isDownloadFrame = (frame, command) => frame[FRAME_GROUP_INDEX]?.toLowerCase() === toHex(DOWNLOAD_GROUP) && frame[FRAME_COMMAND_INDEX]?.toLowerCase() === toHex(command);
|
|
26
|
+
const isExpectedRawPacket = (frame, packetIndex) => isDownloadFrame(frame, DOWNLOAD_RAW) && frame[FRAME_PACKET_INDEX]?.toLowerCase() === toHex(packetIndex);
|
|
22
27
|
const packet = (write, command, parameters = []) => {
|
|
23
28
|
const bytes = new Array(PACKET_BYTES).fill(0);
|
|
24
29
|
bytes[GROUP_INDEX] = DOWNLOAD_GROUP;
|
|
@@ -39,8 +44,8 @@ const segmentParameters = segment => [segment & BYTE_MASK, segment >> BYTE_BITS
|
|
|
39
44
|
* The exchange is a fixed walk rather than a conversation: ask for the download mode, then
|
|
40
45
|
* the header, then each second of the recording in turn. The device answers each request
|
|
41
46
|
* with a known number of twenty-byte packets, sixteen payload bytes each, so the transfer is
|
|
42
|
-
* paced by counting them
|
|
43
|
-
*
|
|
47
|
+
* paced by counting them. Notifications for live measurements, standby and device settings
|
|
48
|
+
* share the characteristic, so only the download group and command advance the transfer.
|
|
44
49
|
*
|
|
45
50
|
* A recording is thirty-four seconds at 128 Hz. Nothing is reported until all of it has
|
|
46
51
|
* arrived: a partial ECG that looked whole would be worse than none, and the count is what
|
|
@@ -60,14 +65,24 @@ export class VerovalEcgTransfer {
|
|
|
60
65
|
return undefined;
|
|
61
66
|
}
|
|
62
67
|
if (this.phase === "mode") {
|
|
68
|
+
if (!isDownloadFrame(frame, DOWNLOAD_MODE)) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
63
71
|
this.phase = "header";
|
|
64
72
|
this.packets = 0;
|
|
65
73
|
return [packet(this.params.write, DOWNLOAD_HEADER)];
|
|
66
74
|
}
|
|
67
|
-
this.packets += 1;
|
|
68
75
|
if (this.phase === "header") {
|
|
76
|
+
if (!isDownloadFrame(frame, DOWNLOAD_HEADER)) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
this.packets += 1;
|
|
69
80
|
return this.packets < HEADER_PACKETS ? undefined : this.requestSegment(0);
|
|
70
81
|
}
|
|
82
|
+
if (!isExpectedRawPacket(frame, this.packets)) {
|
|
83
|
+
return undefined;
|
|
84
|
+
}
|
|
85
|
+
this.packets += 1;
|
|
71
86
|
this.recording.push(...frame.slice(PAYLOAD_FROM, PAYLOAD_FROM + PAYLOAD_BYTES));
|
|
72
87
|
return this.packets < PACKETS_PER_SEGMENT ? undefined : this.finishSegment();
|
|
73
88
|
};
|
package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PACKET_BYTES","GROUP_INDEX","COMMAND_INDEX","PARAMETER_INDEX","DOWNLOAD_GROUP","DOWNLOAD_MODE","DOWNLOAD_HEADER","DOWNLOAD_RAW","PAYLOAD_FROM","PAYLOAD_BYTES","HEADER_PACKETS","PACKETS_PER_SEGMENT","SEGMENTS","BYTE_MASK","BYTE_BITS","toHex","byte","toString","padStart","
|
|
1
|
+
{"version":3,"names":["PACKET_BYTES","GROUP_INDEX","COMMAND_INDEX","PARAMETER_INDEX","DOWNLOAD_GROUP","DOWNLOAD_MODE","DOWNLOAD_HEADER","DOWNLOAD_RAW","FRAME_GROUP_INDEX","FRAME_COMMAND_INDEX","FRAME_PACKET_INDEX","PAYLOAD_FROM","PAYLOAD_BYTES","HEADER_PACKETS","PACKETS_PER_SEGMENT","SEGMENTS","BYTE_MASK","BYTE_BITS","toHex","byte","toString","padStart","isDownloadFrame","frame","command","toLowerCase","isExpectedRawPacket","packetIndex","packet","write","parameters","bytes","Array","fill","forEach","value","index","map","withoutResponse","segmentParameters","segment","VerovalEcgTransfer","phase","packets","recording","constructor","params","initialCommands","nextCommand","undefined","requestSegment","push","slice","finishSegment","onRecording"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-transfer.ts"],"mappings":";;AAGA;AACA,MAAMA,YAAY,GAAG,EAAE;AACvB,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,eAAe,GAAG,CAAC;AAEzB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,eAAe,GAAG,CAAC;AACzB,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,iBAAiB,GAAG,CAAC;AAC3B,MAAMC,mBAAmB,GAAG,CAAC;AAC7B,MAAMC,kBAAkB,GAAG,CAAC;;AAE5B;AACA,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,aAAa,GAAG,EAAE;AACxB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,mBAAmB,GAAG,EAAE;AAC9B,MAAMC,QAAQ,GAAG,EAAE;AAEnB,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,SAAS,GAAG,CAAC;AAEnB,MAAMC,KAAK,GAAIC,IAAY,IACzB,CAACA,IAAI,GAAGH,SAAS,EAAEI,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAElD,MAAMC,eAAe,GAAGA,CACtBC,KAAwB,EACxBC,OAAe,KAEfD,KAAK,CAACf,iBAAiB,CAAC,EAAEiB,WAAW,CAAC,CAAC,KAAKP,KAAK,CAACd,cAAc,CAAC,IACjEmB,KAAK,CAACd,mBAAmB,CAAC,EAAEgB,WAAW,CAAC,CAAC,KAAKP,KAAK,CAACM,OAAO,CAAC;AAE9D,MAAME,mBAAmB,GAAGA,CAC1BH,KAAwB,EACxBI,WAAmB,KAEnBL,eAAe,CAACC,KAAK,EAAEhB,YAAY,CAAC,IACpCgB,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;IAEA,IAAI,CAACE,KAAK,GAAG,MAAM;IACnB,IAAI,CAACI,MAAM,CAACQ,WAAW,CAAC,IAAI,CAACV,SAAS,CAAC;IAEvC,OAAOK,SAAS;EAClB,CAAC;EAEOC,cAAc,GAAIV,OAAe,IAA+B;IACtE,IAAI,CAACE,KAAK,GAAG,KAAK;IAClB,IAAI,CAACC,OAAO,GAAG,CAAC;IAChB,IAAI,CAACH,OAAO,GAAGA,OAAO;IAEtB,OAAO,CACLZ,MAAM,CAAC,IAAI,CAACkB,MAAM,CAACjB,KAAK,EAAEtB,YAAY,EAAEgC,iBAAiB,CAACC,OAAO,CAAC,CAAC,CACpE;EACH,CAAC;AACH","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CUSTOM_DEVICE_BRAND"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-device-definition.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["CUSTOM_DEVICE_BRAND"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-device-definition.ts"],"mappings":";;AAEA,SAASA,mBAAmB,QAAQ,qCAAkC;;AAiBtE;AACA;AACA","ignoreList":[]}
|
package/lib/typescript/commonjs/src/modules/bt-management/services/custom/define-custom-device.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CustomDeviceDefinition } from "../../types/custom-device-definition";
|
|
1
|
+
import { CustomDeviceDefinition, CustomReadingDecorator } from "../../types/custom-device-definition";
|
|
2
2
|
import { CustomDeviceSpec } from "../../types/custom-device-spec";
|
|
3
3
|
/**
|
|
4
4
|
* Validates a declaration and compiles it into a runnable device.
|
|
@@ -8,5 +8,7 @@ import { CustomDeviceSpec } from "../../types/custom-device-spec";
|
|
|
8
8
|
* throws, naming the exact position in the declaration - and a device that fails to compile
|
|
9
9
|
* is never scanned for.
|
|
10
10
|
*/
|
|
11
|
-
export declare const defineCustomDevice: (spec: CustomDeviceSpec
|
|
11
|
+
export declare const defineCustomDevice: (spec: CustomDeviceSpec, options?: {
|
|
12
|
+
decorateReading?: CustomReadingDecorator;
|
|
13
|
+
}) => CustomDeviceDefinition;
|
|
12
14
|
//# sourceMappingURL=define-custom-device.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-custom-device.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/define-custom-device.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"define-custom-device.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/define-custom-device.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AA8IlE;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM,gBAAgB,EACtB,UAAS;IAAE,eAAe,CAAC,EAAE,sBAAsB,CAAA;CAAO,KACzD,sBAsFF,CAAC"}
|
package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export declare class CustomDevice extends BTManagedDevice<CustomDeviceId> {
|
|
|
52
52
|
*/
|
|
53
53
|
protected handleSuccessResult(): void | boolean;
|
|
54
54
|
/** Adds protocol-specific metadata to a validated reading before it is emitted. */
|
|
55
|
-
protected decorateReading: (reading: CustomResult,
|
|
55
|
+
protected decorateReading: (reading: CustomResult, frame?: readonly string[], recordOffset?: number) => CustomResult;
|
|
56
56
|
/**
|
|
57
57
|
* Reports what the frame carried, which may be more than one reading.
|
|
58
58
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/custom/custom.device.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AA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MAAM,MAAM,KAAG,OAAO,CAQhE;IAEF;;;;OAIG;IACH,SAAS,CAAC,qBAAqB,GAC7B,MAAM,4BAA4B,CAAC,mBAAmB,CAAC,KACtD,4BAA4B,CAAC,mBAAmB,CAAC,CAalD;IAEF,4FAA4F;IAC5F,SAAS,CAAC,2BAA2B,GACnC,OAAO,4BAA4B,CAAC,mBAAmB,CAAC,KACvD,OAAO,CAAS;IAEnB;;;OAGG;IACH,SAAS,CAAC,mBAAmB,IAAI,IAAI,GAAG,OAAO;IAI/C,mFAAmF;IACnF,SAAS,CAAC,eAAe,GACvB,SAAS,YAAY,EACrB,
|
|
1
|
+
{"version":3,"file":"custom.device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/custom/custom.device.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAElF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAEpF,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAOvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAevD,KAAK,mBAAmB,GAAG,yBAAyB,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;AACvE,KAAK,YAAY,GAAG,uBAAuB,CAAC,mBAAmB,CAAC,CAAC;AAEjE;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,eAAe,CAAC,cAAc,CAAC;IAC/D,SAAS,CAAC,YAAY,EAAE,QAAQ,EAAE,CAAC;IACnC,SAAS,C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../../../../../../src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,OAAO,
|
|
1
|
+
{"version":3,"file":"standard-gatt.devices.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,OAAO,EAIL,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AA2CjC,QAAA,MAAM,2BAA2B,GAC/B,QAAQ,oBAAoB,KAC3B,sBA2CA,CAAC;AAEJ,yEAAyE;AACzE,QAAA,MAAM,yBAAyB,GAC7B,QAAQ,oBAAoB,KAC3B,sBA4CC,CAAC;AAKL;;;;GAIG;AACH,QAAA,MAAM,yBAAyB,GAC7B,QAAQ,oBAAoB,KAC3B,sBAkCC,CAAC;AAEL;;;;;GAKG;AACH,QAAA,MAAM,2BAA2B,GAC/B,QAAQ,oBAAoB,KAC3B,sBAWC,CAAC;AAEL;;;;;GAKG;AACH,QAAA,MAAM,uBAAuB,GAC3B,QAAQ,oBAAoB,KAC3B,sBAsCC,CAAC;AAEL,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,GAC1B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MeasurementTypeKey } from "@ovok/core";
|
|
2
|
-
import { CustomDeviceDefinition } from "../../../types/custom-device-definition";
|
|
2
|
+
import { CustomDeviceDefinition, CustomReadingDecorator } from "../../../types/custom-device-definition";
|
|
3
3
|
import { CustomFieldSpec } from "../../../types/custom-field-spec";
|
|
4
4
|
interface StandardDeviceParams {
|
|
5
5
|
/** Reported back as deviceData.name, and must not collide with a built-in device. */
|
|
@@ -10,6 +10,8 @@ interface StandardDeviceParams {
|
|
|
10
10
|
stuckDataTimeoutMs?: number;
|
|
11
11
|
/** Report one result, then stay quiet until the next connection. */
|
|
12
12
|
oneReadingPerConnection?: boolean;
|
|
13
|
+
/** Adds profile metadata such as a device-provided timestamp to each reading. */
|
|
14
|
+
decorateReading?: CustomReadingDecorator;
|
|
13
15
|
}
|
|
14
16
|
interface ProfileSpec {
|
|
15
17
|
service: string;
|
|
@@ -44,6 +46,9 @@ declare const sigUuid: (assigned: string) => string;
|
|
|
44
46
|
*/
|
|
45
47
|
declare const declareProfile: (params: StandardDeviceParams, profile: ProfileSpec) => CustomDeviceDefinition;
|
|
46
48
|
declare const littleEndian: (name: string, byteIndexes: number[], unit: string, encoding: CustomFieldSpec["encoding"]) => CustomFieldSpec;
|
|
47
|
-
|
|
49
|
+
/** Reads the SIG blood-pressure timestamp as a phone-local date. */
|
|
50
|
+
declare const recordedAtFromBloodPressureFrame: (frame: readonly string[], offset?: number) => Date | undefined;
|
|
51
|
+
declare const decorateBloodPressureReading: CustomReadingDecorator;
|
|
52
|
+
export { decorateBloodPressureReading, declareProfile, littleEndian, recordedAtFromBloodPressureFrame, sigUuid, };
|
|
48
53
|
export type { ProfileSpec, StandardDeviceParams };
|
|
49
54
|
//# sourceMappingURL=standard-gatt.profile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-gatt.profile.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,
|
|
1
|
+
{"version":3,"file":"standard-gatt.profile.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,yCAAyC,CAAC;AAC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;AACpE,QAAA,MAAM,gCAAgC,GACpC,OAAO,SAAS,MAAM,EAAE,EACxB,eAAU,KACT,IAAI,GAAG,SAmCT,CAAC;AAEF,QAAA,MAAM,4BAA4B,EAAE,sBAUnC,CAAC;AAEF,OAAO,EACL,4BAA4B,EAC5B,cAAc,EACd,YAAY,EACZ,gCAAgC,EAChC,OAAO,GACR,CAAC;AACF,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -4,12 +4,13 @@ import { CreateDeviceParams } from "../../../types/create-device-params";
|
|
|
4
4
|
import { CustomDeviceId } from "../../../types/custom-device-id";
|
|
5
5
|
import { CustomDevice } from "../custom/custom.device";
|
|
6
6
|
type VerovalDuoControlMeasurement = BloodPressureMeasurement & {
|
|
7
|
-
/** The monitor memory that produced the reading. */
|
|
8
7
|
memorySlot: 1 | 2;
|
|
9
8
|
/** The timestamp stored in the monitor, rather than the download time. */
|
|
10
9
|
recordedAt: Date;
|
|
10
|
+
/** Whether the monitor marked the reading as an irregular heartbeat. */
|
|
11
|
+
irregularHeartbeat?: boolean;
|
|
11
12
|
};
|
|
12
|
-
declare const parseVerovalDuoControlRecordMetadata: (frame: readonly string[], recordOffset: number) => Pick<VerovalDuoControlMeasurement, "recordedAt"> | undefined;
|
|
13
|
+
declare const parseVerovalDuoControlRecordMetadata: (frame: readonly string[], recordOffset: number) => Pick<VerovalDuoControlMeasurement, "recordedAt" | "irregularHeartbeat"> | undefined;
|
|
13
14
|
/**
|
|
14
15
|
* The Veroval duo control.
|
|
15
16
|
*
|
|
@@ -30,6 +31,6 @@ declare class VerovalDuoControlDevice extends CustomDevice {
|
|
|
30
31
|
caseType: import("../../../types/case-type").CaseType;
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
|
-
export { parseVerovalDuoControlRecordMetadata, VerovalDuoControlDevice
|
|
34
|
+
export { parseVerovalDuoControlRecordMetadata, VerovalDuoControlDevice };
|
|
34
35
|
export type { VerovalDuoControlMeasurement };
|
|
35
36
|
//# sourceMappingURL=veroval.duo-control-device.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"veroval.duo-control-device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAsB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAkCvD,KAAK,4BAA4B,GAAG,wBAAwB,GAAG;
|
|
1
|
+
{"version":3,"file":"veroval.duo-control-device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAsB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAkCvD,KAAK,4BAA4B,GAAG,wBAAwB,GAAG;IAC7D,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC;IAElB,0EAA0E;IAC1E,UAAU,EAAE,IAAI,CAAC;IAEjB,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAYF,QAAA,MAAM,oCAAoC,GACxC,OAAO,SAAS,MAAM,EAAE,EACxB,cAAc,MAAM,KAElB,IAAI,CAAC,4BAA4B,EAAE,YAAY,GAAG,oBAAoB,CAAC,GACvE,SAmCH,CAAC;AAqDF;;;;;;;;;;GAUG;AACH,cAAM,uBAAwB,SAAQ,YAAY;IAChD,OAAO,CAAC,UAAU,CAAY;gBAG5B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,kBAAkB,CAAC,cAAc,CAAC;IAsB5C,SAAS,CAAC,eAAe,GACvB,SAAS,UAAU,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,EACvD,QAAQ,SAAS,MAAM,EAAE,EACzB,eAAe,MAAM;;;;MAcrB;CACH;AAED,OAAO,EAAE,oCAAoC,EAAE,uBAAuB,EAAE,CAAC;AACzE,YAAY,EAAE,4BAA4B,EAAE,CAAC"}
|
|
@@ -12,8 +12,8 @@ interface EcgTransferParams {
|
|
|
12
12
|
* The exchange is a fixed walk rather than a conversation: ask for the download mode, then
|
|
13
13
|
* the header, then each second of the recording in turn. The device answers each request
|
|
14
14
|
* with a known number of twenty-byte packets, sixteen payload bytes each, so the transfer is
|
|
15
|
-
* paced by counting them
|
|
16
|
-
*
|
|
15
|
+
* paced by counting them. Notifications for live measurements, standby and device settings
|
|
16
|
+
* share the characteristic, so only the download group and command advance the transfer.
|
|
17
17
|
*
|
|
18
18
|
* A recording is thirty-four seconds at 128 Hz. Nothing is reported until all of it has
|
|
19
19
|
* arrived: a partial ECG that looked whole would be worse than none, and the count is what
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"veroval.ecg-transfer.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"veroval.ecg-transfer.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAiE9D,UAAU,iBAAiB;IAEzB,kDAAkD;IAClD,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAEpC,+EAA+E;IAC/E,WAAW,EAAE,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;CACjD;AAID;;;;;;;;;;;;GAYG;AACH,qBAAa,kBAAmB,YAAW,gBAAgB;IAMtC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAL1C,OAAO,CAAC,KAAK,CAAiB;IAC9B,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,SAAS,CAAgB;gBAEG,MAAM,EAAE,iBAAiB;IAEtD,eAAe,QAAO,SAAS,aAAa,EAAE,CAEnD;IAEK,WAAW,GAChB,OAAO,SAAS,MAAM,EAAE,KACvB,SAAS,aAAa,EAAE,GAAG,SAAS,CAuCrC;IAEF,OAAO,CAAC,aAAa,CAWnB;IAEF,OAAO,CAAC,cAAc,CAQpB;CACH"}
|
package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Measurement } from "@ovok/core";
|
|
1
2
|
import { CUSTOM_DEVICE_BRAND } from "../constants/custom-device-brand";
|
|
2
3
|
import { ClockSyncCapability } from "./clock-sync";
|
|
3
4
|
import { CompiledCustomField } from "./compiled-custom-field";
|
|
@@ -5,11 +6,13 @@ import { CustomDeviceId } from "./custom-device-id";
|
|
|
5
6
|
import { CustomDeviceSpec } from "./custom-device-spec";
|
|
6
7
|
import { CustomFrameSpec } from "./custom-frame-spec";
|
|
7
8
|
import { CustomLepuSpec } from "./custom-lepu-spec";
|
|
9
|
+
import { MeasurementWithCaseType } from "./measurement-with-case-type";
|
|
8
10
|
import { IService } from "./service.type";
|
|
11
|
+
type CustomReadingDecorator = (reading: MeasurementWithCaseType<Measurement>, frame?: readonly string[], recordOffset?: number) => MeasurementWithCaseType<Measurement>;
|
|
9
12
|
/**
|
|
10
13
|
* A validated, ready-to-run custom device. Only defineCustomDevice produces one.
|
|
11
14
|
*/
|
|
12
|
-
|
|
15
|
+
interface CustomDeviceDefinition {
|
|
13
16
|
readonly [CUSTOM_DEVICE_BRAND]: true;
|
|
14
17
|
readonly id: CustomDeviceId;
|
|
15
18
|
readonly spec: CustomDeviceSpec;
|
|
@@ -29,5 +32,8 @@ export interface CustomDeviceDefinition {
|
|
|
29
32
|
readonly preferredMtu?: number;
|
|
30
33
|
/** Validated Lepu protocol declaration, with its UUIDs normalised. */
|
|
31
34
|
readonly lepu?: CustomLepuSpec;
|
|
35
|
+
/** Adds protocol metadata that is not a numeric measurement field. */
|
|
36
|
+
readonly decorateReading?: CustomReadingDecorator;
|
|
32
37
|
}
|
|
38
|
+
export type { CustomDeviceDefinition, CustomReadingDecorator };
|
|
33
39
|
//# sourceMappingURL=custom-device-definition.d.ts.map
|
package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-device-definition.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/types/custom-device-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"custom-device-definition.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/types/custom-device-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,KAAK,sBAAsB,GAAG,CAC5B,OAAO,EAAE,uBAAuB,CAAC,WAAW,CAAC,EAC7C,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,EACzB,YAAY,CAAC,EAAE,MAAM,KAClB,uBAAuB,CAAC,WAAW,CAAC,CAAC;AAE1C;;GAEG;AACH,UAAU,sBAAsB;IAC9B,QAAQ,CAAC,CAAC,mBAAmB,CAAC,EAAE,IAAI,CAAC;IAErC,QAAQ,CAAC,EAAE,EAAE,cAAc,CAAC;IAE5B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAEhC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IAEjC,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAE1C,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC;IAExC,sEAAsE;IACtE,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAEtC,QAAQ,CAAC,YAAY,EAAE,QAAQ,EAAE,CAAC;IAElC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAElC,yFAAyF;IACzF,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAE1D,oFAAoF;IACpF,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAEtD,yEAAyE;IACzE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B,sEAAsE;IACtE,QAAQ,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC;IAE/B,sEAAsE;IACtE,QAAQ,CAAC,eAAe,CAAC,EAAE,sBAAsB,CAAC;CACnD;AAED,YAAY,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,CAAC"}
|
package/lib/typescript/module/src/modules/bt-management/services/custom/define-custom-device.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CustomDeviceDefinition } from "../../types/custom-device-definition";
|
|
1
|
+
import { CustomDeviceDefinition, CustomReadingDecorator } from "../../types/custom-device-definition";
|
|
2
2
|
import { CustomDeviceSpec } from "../../types/custom-device-spec";
|
|
3
3
|
/**
|
|
4
4
|
* Validates a declaration and compiles it into a runnable device.
|
|
@@ -8,5 +8,7 @@ import { CustomDeviceSpec } from "../../types/custom-device-spec";
|
|
|
8
8
|
* throws, naming the exact position in the declaration - and a device that fails to compile
|
|
9
9
|
* is never scanned for.
|
|
10
10
|
*/
|
|
11
|
-
export declare const defineCustomDevice: (spec: CustomDeviceSpec
|
|
11
|
+
export declare const defineCustomDevice: (spec: CustomDeviceSpec, options?: {
|
|
12
|
+
decorateReading?: CustomReadingDecorator;
|
|
13
|
+
}) => CustomDeviceDefinition;
|
|
12
14
|
//# sourceMappingURL=define-custom-device.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-custom-device.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/define-custom-device.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"define-custom-device.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/define-custom-device.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AA8IlE;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAC7B,MAAM,gBAAgB,EACtB,UAAS;IAAE,eAAe,CAAC,EAAE,sBAAsB,CAAA;CAAO,KACzD,sBAsFF,CAAC"}
|
package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export declare class CustomDevice extends BTManagedDevice<CustomDeviceId> {
|
|
|
52
52
|
*/
|
|
53
53
|
protected handleSuccessResult(): void | boolean;
|
|
54
54
|
/** Adds protocol-specific metadata to a validated reading before it is emitted. */
|
|
55
|
-
protected decorateReading: (reading: CustomResult,
|
|
55
|
+
protected decorateReading: (reading: CustomResult, frame?: readonly string[], recordOffset?: number) => CustomResult;
|
|
56
56
|
/**
|
|
57
57
|
* Reports what the frame carried, which may be more than one reading.
|
|
58
58
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/custom/custom.device.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,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4FAA4F;IAC5F,SAAS,CAAC,2BAA2B,GACnC,OAAO,4BAA4B,CAAC,mBAAmB,CAAC,KACvD,OAAO,CAAS;IAEnB;;;OAGG;IACH,SAAS,CAAC,mBAAmB,IAAI,IAAI,GAAG,OAAO;IAI/C,mFAAmF;IACnF,SAAS,CAAC,eAAe,GACvB,SAAS,YAAY,EACrB,
|
|
1
|
+
{"version":3,"file":"custom.device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/custom/custom.device.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAElF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AAEpF,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAOvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAevD,KAAK,mBAAmB,GAAG,yBAAyB,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;AACvE,KAAK,YAAY,GAAG,uBAAuB,CAAC,mBAAmB,CAAC,CAAC;AAEjE;;;;;;;;GAQG;AACH,qBAAa,YAAa,SAAQ,eAAe,CAAC,cAAc,CAAC;IAC/D,SAAS,CAAC,YAAY,EAAE,QAAQ,EAAE,CAAC;IACnC,SAAS,CAAC,gBAAgB,EAAE,MAAM,CAAC;IACnC,SAAS,CAAC,aAAa,CAAC,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAAC;IAEnD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyB;IACpD,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAsB;IAC5D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAkD;gBAG3E,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,kBAAkB,CAAC,cAAc,CAAC,EAC1C,UAAU,EAAE,sBAAsB;IA0BpC;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;IAsD3B,OAAO,CAAC,mBAAmB,CAiBzB;IAEF,OAAO,CAAC,YAAY,CACwB;IAE5C,OAAO,CAAC,iBAAiB,CAMvB;IAEF,SAAS,CAAC,eAAe,GAAI,KAAK,MAAM,EAAE,EAAE,MAAM,MAAM,KAAG,OAAO,CAQhE;IAEF;;;;OAIG;IACH,SAAS,CAAC,qBAAqB,GAC7B,MAAM,4BAA4B,CAAC,mBAAmB,CAAC,KACtD,4BAA4B,CAAC,mBAAmB,CAAC,CAalD;IAEF,4FAA4F;IAC5F,SAAS,CAAC,2BAA2B,GACnC,OAAO,4BAA4B,CAAC,mBAAmB,CAAC,KACvD,OAAO,CAAS;IAEnB;;;OAGG;IACH,SAAS,CAAC,mBAAmB,IAAI,IAAI,GAAG,OAAO;IAI/C,mFAAmF;IACnF,SAAS,CAAC,eAAe,GACvB,SAAS,YAAY,EACrB,QAAQ,SAAS,MAAM,EAAE,EACzB,eAAe,MAAM,KACpB,YAAY,CAK6B;IAE5C;;;;;;;OAOG;IACH,OAAO,CAAC,WAAW;IA2BnB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,MAAM;IAmBd,OAAO,CAAC,OAAO;IAIf,OAAO,CAAC,iBAAiB;CAmC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-gatt.devices.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,OAAO,
|
|
1
|
+
{"version":3,"file":"standard-gatt.devices.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,OAAO,EAIL,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AA2CjC,QAAA,MAAM,2BAA2B,GAC/B,QAAQ,oBAAoB,KAC3B,sBA2CA,CAAC;AAEJ,yEAAyE;AACzE,QAAA,MAAM,yBAAyB,GAC7B,QAAQ,oBAAoB,KAC3B,sBA4CC,CAAC;AAKL;;;;GAIG;AACH,QAAA,MAAM,yBAAyB,GAC7B,QAAQ,oBAAoB,KAC3B,sBAkCC,CAAC;AAEL;;;;;GAKG;AACH,QAAA,MAAM,2BAA2B,GAC/B,QAAQ,oBAAoB,KAC3B,sBAWC,CAAC;AAEL;;;;;GAKG;AACH,QAAA,MAAM,uBAAuB,GAC3B,QAAQ,oBAAoB,KAC3B,sBAsCC,CAAC;AAEL,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,yBAAyB,GAC1B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MeasurementTypeKey } from "@ovok/core";
|
|
2
|
-
import { CustomDeviceDefinition } from "../../../types/custom-device-definition";
|
|
2
|
+
import { CustomDeviceDefinition, CustomReadingDecorator } from "../../../types/custom-device-definition";
|
|
3
3
|
import { CustomFieldSpec } from "../../../types/custom-field-spec";
|
|
4
4
|
interface StandardDeviceParams {
|
|
5
5
|
/** Reported back as deviceData.name, and must not collide with a built-in device. */
|
|
@@ -10,6 +10,8 @@ interface StandardDeviceParams {
|
|
|
10
10
|
stuckDataTimeoutMs?: number;
|
|
11
11
|
/** Report one result, then stay quiet until the next connection. */
|
|
12
12
|
oneReadingPerConnection?: boolean;
|
|
13
|
+
/** Adds profile metadata such as a device-provided timestamp to each reading. */
|
|
14
|
+
decorateReading?: CustomReadingDecorator;
|
|
13
15
|
}
|
|
14
16
|
interface ProfileSpec {
|
|
15
17
|
service: string;
|
|
@@ -44,6 +46,9 @@ declare const sigUuid: (assigned: string) => string;
|
|
|
44
46
|
*/
|
|
45
47
|
declare const declareProfile: (params: StandardDeviceParams, profile: ProfileSpec) => CustomDeviceDefinition;
|
|
46
48
|
declare const littleEndian: (name: string, byteIndexes: number[], unit: string, encoding: CustomFieldSpec["encoding"]) => CustomFieldSpec;
|
|
47
|
-
|
|
49
|
+
/** Reads the SIG blood-pressure timestamp as a phone-local date. */
|
|
50
|
+
declare const recordedAtFromBloodPressureFrame: (frame: readonly string[], offset?: number) => Date | undefined;
|
|
51
|
+
declare const decorateBloodPressureReading: CustomReadingDecorator;
|
|
52
|
+
export { decorateBloodPressureReading, declareProfile, littleEndian, recordedAtFromBloodPressureFrame, sigUuid, };
|
|
48
53
|
export type { ProfileSpec, StandardDeviceParams };
|
|
49
54
|
//# sourceMappingURL=standard-gatt.profile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard-gatt.profile.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,
|
|
1
|
+
{"version":3,"file":"standard-gatt.profile.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAMnE,UAAU,oBAAoB;IAE5B,qFAAqF;IACrF,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,wCAAwC;IACxC,SAAS,CAAC,EAAE,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L,4BAA4B,EAC5B,cAAc,EACd,YAAY,EACZ,gCAAgC,EAChC,OAAO,GACR,CAAC;AACF,YAAY,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -4,12 +4,13 @@ import { CreateDeviceParams } from "../../../types/create-device-params";
|
|
|
4
4
|
import { CustomDeviceId } from "../../../types/custom-device-id";
|
|
5
5
|
import { CustomDevice } from "../custom/custom.device";
|
|
6
6
|
type VerovalDuoControlMeasurement = BloodPressureMeasurement & {
|
|
7
|
-
/** The monitor memory that produced the reading. */
|
|
8
7
|
memorySlot: 1 | 2;
|
|
9
8
|
/** The timestamp stored in the monitor, rather than the download time. */
|
|
10
9
|
recordedAt: Date;
|
|
10
|
+
/** Whether the monitor marked the reading as an irregular heartbeat. */
|
|
11
|
+
irregularHeartbeat?: boolean;
|
|
11
12
|
};
|
|
12
|
-
declare const parseVerovalDuoControlRecordMetadata: (frame: readonly string[], recordOffset: number) => Pick<VerovalDuoControlMeasurement, "recordedAt"> | undefined;
|
|
13
|
+
declare const parseVerovalDuoControlRecordMetadata: (frame: readonly string[], recordOffset: number) => Pick<VerovalDuoControlMeasurement, "recordedAt" | "irregularHeartbeat"> | undefined;
|
|
13
14
|
/**
|
|
14
15
|
* The Veroval duo control.
|
|
15
16
|
*
|
|
@@ -30,6 +31,6 @@ declare class VerovalDuoControlDevice extends CustomDevice {
|
|
|
30
31
|
caseType: import("../../../types/case-type").CaseType;
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
|
-
export { parseVerovalDuoControlRecordMetadata, VerovalDuoControlDevice
|
|
34
|
+
export { parseVerovalDuoControlRecordMetadata, VerovalDuoControlDevice };
|
|
34
35
|
export type { VerovalDuoControlMeasurement };
|
|
35
36
|
//# sourceMappingURL=veroval.duo-control-device.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"veroval.duo-control-device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAsB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAkCvD,KAAK,4BAA4B,GAAG,wBAAwB,GAAG;
|
|
1
|
+
{"version":3,"file":"veroval.duo-control-device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAsB,MAAM,YAAY,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAkCvD,KAAK,4BAA4B,GAAG,wBAAwB,GAAG;IAC7D,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC;IAElB,0EAA0E;IAC1E,UAAU,EAAE,IAAI,CAAC;IAEjB,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAYF,QAAA,MAAM,oCAAoC,GACxC,OAAO,SAAS,MAAM,EAAE,EACxB,cAAc,MAAM,KAElB,IAAI,CAAC,4BAA4B,EAAE,YAAY,GAAG,oBAAoB,CAAC,GACvE,SAmCH,CAAC;AAqDF;;;;;;;;;;GAUG;AACH,cAAM,uBAAwB,SAAQ,YAAY;IAChD,OAAO,CAAC,UAAU,CAAY;gBAG5B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,kBAAkB,CAAC,cAAc,CAAC;IAsB5C,SAAS,CAAC,eAAe,GACvB,SAAS,UAAU,CAAC,YAAY,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,EACvD,QAAQ,SAAS,MAAM,EAAE,EACzB,eAAe,MAAM;;;;MAcrB;CACH;AAED,OAAO,EAAE,oCAAoC,EAAE,uBAAuB,EAAE,CAAC;AACzE,YAAY,EAAE,4BAA4B,EAAE,CAAC"}
|
|
@@ -12,8 +12,8 @@ interface EcgTransferParams {
|
|
|
12
12
|
* The exchange is a fixed walk rather than a conversation: ask for the download mode, then
|
|
13
13
|
* the header, then each second of the recording in turn. The device answers each request
|
|
14
14
|
* with a known number of twenty-byte packets, sixteen payload bytes each, so the transfer is
|
|
15
|
-
* paced by counting them
|
|
16
|
-
*
|
|
15
|
+
* paced by counting them. Notifications for live measurements, standby and device settings
|
|
16
|
+
* share the characteristic, so only the download group and command advance the transfer.
|
|
17
17
|
*
|
|
18
18
|
* A recording is thirty-four seconds at 128 Hz. Nothing is reported until all of it has
|
|
19
19
|
* arrived: a partial ECG that looked whole would be worse than none, and the count is what
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"veroval.ecg-transfer.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"veroval.ecg-transfer.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAiE9D,UAAU,iBAAiB;IAEzB,kDAAkD;IAClD,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAEpC,+EAA+E;IAC/E,WAAW,EAAE,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;CACjD;AAID;;;;;;;;;;;;GAYG;AACH,qBAAa,kBAAmB,YAAW,gBAAgB;IAMtC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAL1C,OAAO,CAAC,KAAK,CAAiB;IAC9B,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,SAAS,CAAgB;gBAEG,MAAM,EAAE,iBAAiB;IAEtD,eAAe,QAAO,SAAS,aAAa,EAAE,CAEnD;IAEK,WAAW,GAChB,OAAO,SAAS,MAAM,EAAE,KACvB,SAAS,aAAa,EAAE,GAAG,SAAS,CAuCrC;IAEF,OAAO,CAAC,aAAa,CAWnB;IAEF,OAAO,CAAC,cAAc,CAQpB;CACH"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Measurement } from "@ovok/core";
|
|
1
2
|
import { CUSTOM_DEVICE_BRAND } from "../constants/custom-device-brand";
|
|
2
3
|
import { ClockSyncCapability } from "./clock-sync";
|
|
3
4
|
import { CompiledCustomField } from "./compiled-custom-field";
|
|
@@ -5,11 +6,13 @@ import { CustomDeviceId } from "./custom-device-id";
|
|
|
5
6
|
import { CustomDeviceSpec } from "./custom-device-spec";
|
|
6
7
|
import { CustomFrameSpec } from "./custom-frame-spec";
|
|
7
8
|
import { CustomLepuSpec } from "./custom-lepu-spec";
|
|
9
|
+
import { MeasurementWithCaseType } from "./measurement-with-case-type";
|
|
8
10
|
import { IService } from "./service.type";
|
|
11
|
+
type CustomReadingDecorator = (reading: MeasurementWithCaseType<Measurement>, frame?: readonly string[], recordOffset?: number) => MeasurementWithCaseType<Measurement>;
|
|
9
12
|
/**
|
|
10
13
|
* A validated, ready-to-run custom device. Only defineCustomDevice produces one.
|
|
11
14
|
*/
|
|
12
|
-
|
|
15
|
+
interface CustomDeviceDefinition {
|
|
13
16
|
readonly [CUSTOM_DEVICE_BRAND]: true;
|
|
14
17
|
readonly id: CustomDeviceId;
|
|
15
18
|
readonly spec: CustomDeviceSpec;
|
|
@@ -29,5 +32,8 @@ export interface CustomDeviceDefinition {
|
|
|
29
32
|
readonly preferredMtu?: number;
|
|
30
33
|
/** Validated Lepu protocol declaration, with its UUIDs normalised. */
|
|
31
34
|
readonly lepu?: CustomLepuSpec;
|
|
35
|
+
/** Adds protocol metadata that is not a numeric measurement field. */
|
|
36
|
+
readonly decorateReading?: CustomReadingDecorator;
|
|
32
37
|
}
|
|
38
|
+
export type { CustomDeviceDefinition, CustomReadingDecorator };
|
|
33
39
|
//# sourceMappingURL=custom-device-definition.d.ts.map
|
package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-device-definition.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/types/custom-device-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"custom-device-definition.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/types/custom-device-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,mBAAm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AmB,CAAC,CAAC;IAE1D,oFAAoF;IACpF,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAEtD,yEAAyE;IACzE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAE/B,sEAAsE;IACtE,QAAQ,CAAC,IAAI,CAAC,EAAE,cAAc,CAAC;IAE/B,sEAAsE;IACtE,QAAQ,CAAC,eAAe,CAAC,EAAE,sBAAsB,CAAC;CACnD;AAED,YAAY,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ovok/native",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.22",
|
|
4
4
|
"description": "React native component sdk for OVOK",
|
|
5
5
|
"source": "./src/index.tsx",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"@medplum/react-hooks": "3.2.23",
|
|
88
88
|
"@opentelemetry/api": "^1.9.1",
|
|
89
89
|
"@opentelemetry/api-logs": "^0.222.0",
|
|
90
|
-
"@ovok/core": "^0.3.
|
|
90
|
+
"@ovok/core": "^0.3.21",
|
|
91
91
|
"@react-native-community/datetimepicker": "^9.1.0",
|
|
92
92
|
"@react-native-community/netinfo": "^12.0.1",
|
|
93
93
|
"@react-native-google-signin/google-signin": "^16.1.2",
|