@ovok/native 0.4.7 → 0.4.8
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-device/constants/device-instruction-pdfs.js +3 -1
- package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
- package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js +1 -1
- package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
- package/lib/commonjs/modules/bt-management/index.js +44 -0
- package/lib/commonjs/modules/bt-management/index.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-case-shape.js +52 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-case-shape.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-case.js +8 -2
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-case.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-field.js +3 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-field.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/device-creator.js +5 -1
- package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +15 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +20 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +30 -44
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/frame-parser.js +2 -1
- package/lib/commonjs/modules/bt-management/services/devices/frame-parser.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/sentinel-frame-reader.js +84 -0
- package/lib/commonjs/modules/bt-management/services/devices/sentinel-frame-reader.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +27 -53
- 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 +55 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +43 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +113 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js +120 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-device.js +92 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js +64 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +94 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/integrated-devices.js +2 -0
- package/lib/commonjs/modules/bt-management/types/integrated-devices.js.map +1 -1
- package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js +21 -0
- package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
- package/lib/commonjs/modules/bt-management/utils/parse-measurement.js +10 -7
- package/lib/commonjs/modules/bt-management/utils/parse-measurement.js.map +1 -1
- package/lib/commonjs/modules/bt-management/utils/reject-custom-reading.js +34 -0
- package/lib/commonjs/modules/bt-management/utils/reject-custom-reading.js.map +1 -0
- package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js +3 -1
- package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
- package/lib/module/modules/bt-management/constants/integrated-devices-map.js +1 -1
- package/lib/module/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
- package/lib/module/modules/bt-management/index.js +4 -0
- package/lib/module/modules/bt-management/index.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-case-shape.js +48 -0
- package/lib/module/modules/bt-management/services/custom/compile-case-shape.js.map +1 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-case.js +8 -2
- package/lib/module/modules/bt-management/services/custom/compile-custom-case.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-custom-field.js +3 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-field.js.map +1 -1
- package/lib/module/modules/bt-management/services/device-creator.js +5 -1
- package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +15 -1
- package/lib/module/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +20 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +31 -45
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/frame-parser.js +2 -1
- package/lib/module/modules/bt-management/services/devices/frame-parser.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/sentinel-frame-reader.js +79 -0
- package/lib/module/modules/bt-management/services/devices/sentinel-frame-reader.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +19 -45
- 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 +50 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +38 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +108 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js +116 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-device.js +87 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js +60 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +89 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -0
- package/lib/module/modules/bt-management/types/device-measurement-map.js +3 -3
- package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
- package/lib/module/modules/bt-management/types/integrated-devices.js +2 -0
- package/lib/module/modules/bt-management/types/integrated-devices.js.map +1 -1
- package/lib/module/modules/bt-management/utils/create-custom-field-parser.js +21 -0
- package/lib/module/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
- package/lib/module/modules/bt-management/utils/parse-measurement.js +10 -7
- package/lib/module/modules/bt-management/utils/parse-measurement.js.map +1 -1
- package/lib/module/modules/bt-management/utils/reject-custom-reading.js +29 -0
- package/lib/module/modules/bt-management/utils/reject-custom-reading.js.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-shape.d.ts +19 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-shape.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +11 -2
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +10 -13
- 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/frame-parser.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts +52 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +22 -13
- 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 +45 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +18 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +19 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts +45 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts +30 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts +39 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +35 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts +30 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-encoding.d.ts +7 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/dependent-result-handler-params.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/dependent-result-handler-params.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/parse-measurement.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/parse-measurement.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/reject-custom-reading.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/reject-custom-reading.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/index.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-shape.d.ts +19 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-shape.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +11 -2
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +10 -13
- 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/frame-parser.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts +52 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +22 -13
- 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 +45 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +18 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +19 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts +45 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts +30 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts +39 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +35 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts +30 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-field-encoding.d.ts +7 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/dependent-result-handler-params.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/types/dependent-result-handler-params.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts +3 -1
- package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/parse-measurement.d.ts +4 -1
- package/lib/typescript/module/src/modules/bt-management/utils/parse-measurement.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/reject-custom-reading.d.ts +15 -0
- package/lib/typescript/module/src/modules/bt-management/utils/reject-custom-reading.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","CaseType","BTManagedDevice","decodeVerovalEcgSamples","VEROVAL_ECG_SAMPLE_RATE_HZ","VerovalEcgTransfer","SERVICE","CONTROL_POINT","NOTIFY","STUCK_TIMEOUT_MS","PREFERRED_MTU","acceptEverything","caseValuePosition","cases","caseValue","caseType","OTHER","parseDefinitions","description","VerovalEcgDevice","stuckDataTimeout","preferredMtu","onStreamStart","undefined","mainServices","uuid","monitorUuids","parsingModel","validatePackage","createCommandSequencer","write","serviceUuid","characteristicUuid","onRecording","reportRecording","constructor","device","params","handleSuccessResult","bytes","diagramPoints","length","onError","Error","onResult","measurementTypeKey","ecg","RESULT","duration"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-device.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAG/C,SAASC,QAAQ,QAAQ,6BAA0B;AAInD,SAASC,eAAe,QAAQ,yBAAsB;AAEtD,SACEC,uBAAuB,EACvBC,0BAA0B,QACrB,0BAAuB;AAC9B,SAASC,kBAAkB,QAAQ,2BAAwB;AAE3D,MAAMC,OAAO,GAAG,sCAAsC;;AAEtD;AACA,MAAMC,aAAa,GAAG,sCAAsC;AAC5D,MAAMC,MAAM,GAAG,sCAAsC;;AAErD;AACA,MAAMC,gBAAgB,GAAG,OAAO;AAEhC,MAAMC,aAAa,GAAG,GAAG;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG;EACvBC,iBAAiB,EAAE,EAAE;EACrBC,KAAK,EAAE,CACL;IACEC,SAAS,EAAE,EAAE;IACbC,QAAQ,EAAEd,QAAQ,CAACe,KAAK;IACxBC,gBAAgB,EAAE,EAAE;IACpBC,WAAW,EAAE;EACf,CAAC;AAEL,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAgB,SA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|
+
const BYTE_BITS = 8;
|
|
6
|
+
const SIGN_BIT = 0x8000;
|
|
7
|
+
const SIGNED_16_RANGE = 0x10000;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* How fast the device samples.
|
|
11
|
+
*
|
|
12
|
+
* Not taken on trust: the vendor's own plotting step works out to two two-hundred-and-fifty
|
|
13
|
+
* sixths of a second, and its transfer is thirty-four segments of sixteen packets of sixteen
|
|
14
|
+
* bytes - which is 256 bytes, 128 samples, one second per segment. Both say 128 Hz.
|
|
15
|
+
*/
|
|
16
|
+
const VEROVAL_ECG_SAMPLE_RATE_HZ = 128;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The calibration the recording is read with.
|
|
20
|
+
*
|
|
21
|
+
* This is the EDF convention - a linear map from counts onto a physical range - and the
|
|
22
|
+
* device states its own in the header it sends before the curve. These are the values the
|
|
23
|
+
* vendor's app falls back to, and are what the SDK uses until a header supplies otherwise:
|
|
24
|
+
* the full signed sixteen-bit range spans plus or minus 27.68 mV.
|
|
25
|
+
*/
|
|
26
|
+
const DEFAULT_CALIBRATION = {
|
|
27
|
+
physicalMinimumMicrovolts: -27_680,
|
|
28
|
+
physicalMaximumMicrovolts: 27_680,
|
|
29
|
+
digitalMinimum: -32_768,
|
|
30
|
+
digitalMaximum: 32_767
|
|
31
|
+
};
|
|
32
|
+
const MICROVOLTS_PER_MILLIVOLT = 1000;
|
|
33
|
+
/** Samples are two bytes, most significant first, and signed. */
|
|
34
|
+
const signedSampleAt = (bytes, index) => {
|
|
35
|
+
const raw = hexToByte(bytes[index] ?? "0") << BYTE_BITS | hexToByte(bytes[index + 1] ?? "0");
|
|
36
|
+
return raw & SIGN_BIT ? raw - SIGNED_16_RANGE : raw;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Turns the bytes of a recording into millivolts.
|
|
41
|
+
*
|
|
42
|
+
* A trailing odd byte is ignored: half a sample is not a sample. The conversion is the
|
|
43
|
+
* device's own, applied as it states it rather than reduced to a single factor, so a header
|
|
44
|
+
* that reports a different range still decodes correctly.
|
|
45
|
+
*/
|
|
46
|
+
const decodeVerovalEcgSamples = (bytes, calibration = DEFAULT_CALIBRATION) => {
|
|
47
|
+
const physicalRange = calibration.physicalMaximumMicrovolts - calibration.physicalMinimumMicrovolts;
|
|
48
|
+
const digitalRange = calibration.digitalMaximum - calibration.digitalMinimum;
|
|
49
|
+
const samples = [];
|
|
50
|
+
if (digitalRange === 0) {
|
|
51
|
+
return samples;
|
|
52
|
+
}
|
|
53
|
+
for (let index = 0; index + 1 < bytes.length; index += SAMPLE_BYTES) {
|
|
54
|
+
const counts = signedSampleAt(bytes, index) - calibration.digitalMinimum;
|
|
55
|
+
samples.push((counts * physicalRange / digitalRange + calibration.physicalMinimumMicrovolts) / MICROVOLTS_PER_MILLIVOLT);
|
|
56
|
+
}
|
|
57
|
+
return samples;
|
|
58
|
+
};
|
|
59
|
+
export { decodeVerovalEcgSamples, DEFAULT_CALIBRATION, VEROVAL_ECG_SAMPLE_RATE_HZ };
|
|
60
|
+
//# sourceMappingURL=veroval.ecg-samples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["hexToByte","SAMPLE_BYTES","BYTE_BITS","SIGN_BIT","SIGNED_16_RANGE","VEROVAL_ECG_SAMPLE_RATE_HZ","DEFAULT_CALIBRATION","physicalMinimumMicrovolts","physicalMaximumMicrovolts","digitalMinimum","digitalMaximum","MICROVOLTS_PER_MILLIVOLT","signedSampleAt","bytes","index","raw","decodeVerovalEcgSamples","calibration","physicalRange","digitalRange","samples","length","counts","push"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-samples.ts"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,+BAA4B;AAEtD,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,SAAS,GAAG,CAAC;AACnB,MAAMC,QAAQ,GAAG,MAAM;AACvB,MAAMC,eAAe,GAAG,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,GAAGJ,aAAa,GAAIC,YAAY,GACtCF,WAAW,CAACV,yBAAyB,IACrCI,wBACJ,CAAC;EACH;EAEA,OAAOS,OAAO;AAChB,CAAC;AAED,SACEJ,uBAAuB,EACvBV,mBAAmB,EACnBD,0BAA0B","ignoreList":[]}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** Every request is a fixed twenty-byte packet, zero filled but for its group and command. */
|
|
4
|
+
const PACKET_BYTES = 20;
|
|
5
|
+
const GROUP_INDEX = 1;
|
|
6
|
+
const COMMAND_INDEX = 2;
|
|
7
|
+
const PARAMETER_INDEX = 3;
|
|
8
|
+
const DOWNLOAD_GROUP = 4;
|
|
9
|
+
const DOWNLOAD_MODE = 1;
|
|
10
|
+
const DOWNLOAD_HEADER = 2;
|
|
11
|
+
const DOWNLOAD_RAW = 3;
|
|
12
|
+
|
|
13
|
+
/** The transfer's shape, from the vendor's own device table. */
|
|
14
|
+
const PAYLOAD_FROM = 4;
|
|
15
|
+
const PAYLOAD_BYTES = 16;
|
|
16
|
+
const HEADER_PACKETS = 5;
|
|
17
|
+
const PACKETS_PER_SEGMENT = 16;
|
|
18
|
+
const SEGMENTS = 34;
|
|
19
|
+
const BYTE_MASK = 0xff;
|
|
20
|
+
const BYTE_BITS = 8;
|
|
21
|
+
const toHex = byte => (byte & BYTE_MASK).toString(16).padStart(2, "0");
|
|
22
|
+
const packet = (write, command, parameters = []) => {
|
|
23
|
+
const bytes = new Array(PACKET_BYTES).fill(0);
|
|
24
|
+
bytes[GROUP_INDEX] = DOWNLOAD_GROUP;
|
|
25
|
+
bytes[COMMAND_INDEX] = command;
|
|
26
|
+
parameters.forEach((value, index) => {
|
|
27
|
+
bytes[PARAMETER_INDEX + index] = value;
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
...write,
|
|
31
|
+
frame: bytes.map(toHex)
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
const segmentParameters = segment => [segment & BYTE_MASK, segment >> BYTE_BITS & BYTE_MASK, segment >> BYTE_BITS * 2 & BYTE_MASK];
|
|
35
|
+
/**
|
|
36
|
+
* Downloads a recording from the Veroval ECG.
|
|
37
|
+
*
|
|
38
|
+
* The exchange is a fixed walk rather than a conversation: ask for the download mode, then
|
|
39
|
+
* the header, then each second of the recording in turn. The device answers each request
|
|
40
|
+
* with a known number of twenty-byte packets, sixteen payload bytes each, so the transfer is
|
|
41
|
+
* paced by counting them - which is how the vendor's own app paces it, and is the only thing
|
|
42
|
+
* that distinguishes one phase's packets from another's.
|
|
43
|
+
*
|
|
44
|
+
* A recording is thirty-four seconds at 128 Hz. Nothing is reported until all of it has
|
|
45
|
+
* arrived: a partial ECG that looked whole would be worse than none, and the count is what
|
|
46
|
+
* says it is whole.
|
|
47
|
+
*/
|
|
48
|
+
export class VerovalEcgTransfer {
|
|
49
|
+
phase = "mode";
|
|
50
|
+
packets = 0;
|
|
51
|
+
segment = 0;
|
|
52
|
+
recording = [];
|
|
53
|
+
constructor(params) {
|
|
54
|
+
this.params = params;
|
|
55
|
+
}
|
|
56
|
+
initialCommands = () => [packet(this.params.write, DOWNLOAD_MODE)];
|
|
57
|
+
nextCommand = frame => {
|
|
58
|
+
if (this.phase === "done") {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
if (this.phase === "mode") {
|
|
62
|
+
this.phase = "header";
|
|
63
|
+
this.packets = 0;
|
|
64
|
+
return [packet(this.params.write, DOWNLOAD_HEADER)];
|
|
65
|
+
}
|
|
66
|
+
this.packets += 1;
|
|
67
|
+
if (this.phase === "header") {
|
|
68
|
+
return this.packets < HEADER_PACKETS ? undefined : this.requestSegment(0);
|
|
69
|
+
}
|
|
70
|
+
this.recording.push(...frame.slice(PAYLOAD_FROM, PAYLOAD_FROM + PAYLOAD_BYTES));
|
|
71
|
+
return this.packets < PACKETS_PER_SEGMENT ? undefined : this.finishSegment();
|
|
72
|
+
};
|
|
73
|
+
finishSegment = () => {
|
|
74
|
+
this.segment += 1;
|
|
75
|
+
if (this.segment < SEGMENTS) {
|
|
76
|
+
return this.requestSegment(this.segment);
|
|
77
|
+
}
|
|
78
|
+
this.phase = "done";
|
|
79
|
+
this.params.onRecording(this.recording);
|
|
80
|
+
return undefined;
|
|
81
|
+
};
|
|
82
|
+
requestSegment = segment => {
|
|
83
|
+
this.phase = "raw";
|
|
84
|
+
this.packets = 0;
|
|
85
|
+
this.segment = segment;
|
|
86
|
+
return [packet(this.params.write, DOWNLOAD_RAW, segmentParameters(segment))];
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=veroval.ecg-transfer.js.map
|
|
@@ -0,0 +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","packet","write","command","parameters","bytes","Array","fill","forEach","value","index","frame","map","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;;AAEtB;AACA,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,aAAa,GAAG,EAAE;AACxB,MAAMC,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AAIV,OAAe,IAA+B;IACtE,IAAI,CAACE,KAAK,GAAG,KAAK;IAClB,IAAI,CAACC,OAAO,GAAG,CAAC;IAChB,IAAI,CAACH,OAAO,GAAGA,OAAO;IAEtB,OAAO,CACLb,MAAM,CAAC,IAAI,CAACmB,MAAM,CAAClB,KAAK,EAAEb,YAAY,EAAEwB,iBAAiB,CAACC,OAAO,CAAC,CAAC,CACpE;EACH,CAAC;AACH","ignoreList":[]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { IntegratedDevices } from "./integrated-devices.js";
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* A built-in device has a measurement type the SDK knows statically. A device registered
|
|
7
|
-
* through defineCustomDevice reports the catalog-checked properties its declaration named.
|
|
5
|
+
/**
|
|
6
|
+
* A built-in device has a measurement type the SDK knows statically. A device registered
|
|
7
|
+
* through defineCustomDevice reports the catalog-checked properties its declaration named.
|
|
8
8
|
*/
|
|
9
9
|
//# sourceMappingURL=device-measurement-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/device-measurement-map.ts"],"mappings":";;AAWA,SAASA,iBAAiB,QAAQ,yBAAsB;;
|
|
1
|
+
{"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/device-measurement-map.ts"],"mappings":";;AAWA,SAASA,iBAAiB,QAAQ,yBAAsB;;AA0BxD;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -20,6 +20,8 @@ export let IntegratedDevices = /*#__PURE__*/function (IntegratedDevices) {
|
|
|
20
20
|
IntegratedDevices["S5"] = "Le S5";
|
|
21
21
|
IntegratedDevices["ALIVE_COR"] = "alivecor";
|
|
22
22
|
IntegratedDevices["BGM"] = "BGM";
|
|
23
|
+
IntegratedDevices["VEROVAL_DUO_CONTROL"] = "Veroval duo control";
|
|
24
|
+
IntegratedDevices["VEROVAL_ECG"] = "Veroval ECG";
|
|
23
25
|
return IntegratedDevices;
|
|
24
26
|
}({});
|
|
25
27
|
//# sourceMappingURL=integrated-devices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/integrated-devices.ts"],"mappings":";;AAAA,WAAYA,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["IntegratedDevices"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/integrated-devices.ts"],"mappings":";;AAAA,WAAYA,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
|
|
@@ -2,7 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
import { decodeMedicalFloat } from "./decode-medical-float.js";
|
|
4
4
|
const HEX_ONLY = /^[0-9a-f]+$/;
|
|
5
|
+
const ASCII_ZERO = 0x30;
|
|
6
|
+
const ASCII_NINE = 0x39;
|
|
7
|
+
const HEX_BYTE = /../g;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Reads bytes that are decimal digits written as characters, not a number.
|
|
11
|
+
*
|
|
12
|
+
* A byte outside "0"-"9" makes the whole field undefined rather than being skipped: these
|
|
13
|
+
* records are fixed width and a non-digit means the field was not what the declaration
|
|
14
|
+
* says it is, so decoding the rest of it would report a number built from part of a value.
|
|
15
|
+
*/
|
|
16
|
+
const fromAsciiDigits = hex => {
|
|
17
|
+
const codes = (hex.match(HEX_BYTE) ?? []).map(byte => parseInt(byte, 16));
|
|
18
|
+
if (codes.length === 0 || codes.some(code => code < ASCII_ZERO || code > ASCII_NINE)) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
return Number(codes.map(code => code - ASCII_ZERO).join(""));
|
|
22
|
+
};
|
|
5
23
|
const toRaw = (hex, field) => {
|
|
24
|
+
if (field.encoding === "ascii") {
|
|
25
|
+
return fromAsciiDigits(hex);
|
|
26
|
+
}
|
|
6
27
|
const raw = parseInt(hex, 16);
|
|
7
28
|
const bits = hex.length * 4;
|
|
8
29
|
if (field.encoding === "int") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["decodeMedicalFloat","HEX_ONLY","
|
|
1
|
+
{"version":3,"names":["decodeMedicalFloat","HEX_ONLY","ASCII_ZERO","ASCII_NINE","HEX_BYTE","fromAsciiDigits","hex","codes","match","map","byte","parseInt","length","some","code","undefined","Number","join","toRaw","field","encoding","raw","bits","sign","createCustomFieldParser","assembledHex","toLowerCase","byteIndexes","test","isFinite","value","scale","offset","decimals","factor","Math","round"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/create-custom-field-parser.ts"],"mappings":";;AAEA,SAASA,kBAAkB,QAAQ,2BAAwB;AAE3D,MAAMC,QAAQ,GAA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Offset added to every declared index, for a frame that repeats one record.
|
|
5
|
+
*/
|
|
6
|
+
export const parseMeasurement = (measurementInHex, parsingCase, byteOffset = 0) => {
|
|
4
7
|
const parserDefinitions = parsingCase.parseDefinitions;
|
|
5
8
|
const result = parserDefinitions.reduce((acc, parserDefinition) => {
|
|
6
|
-
const parsingValue = getFullValueForMeasurementProperty(measurementInHex, parserDefinition);
|
|
9
|
+
const parsingValue = getFullValueForMeasurementProperty(measurementInHex, parserDefinition, byteOffset);
|
|
7
10
|
if (parserDefinition.customParserDefinition) {
|
|
8
11
|
acc[parserDefinition.name] = parserDefinition.customParserDefinition(parsingValue);
|
|
9
12
|
} else {
|
|
@@ -19,14 +22,14 @@ export const parseMeasurement = (measurementInHex, parsingCase) => {
|
|
|
19
22
|
return measurement;
|
|
20
23
|
};
|
|
21
24
|
|
|
22
|
-
/** Example: We received message ["1A","02", "00", "50"]. Value for weight is on indexes 2,3. Which means we need to combine 2nd and 3rd indexes to get result
|
|
23
|
-
* This method will combine them and return string "0050".
|
|
24
|
-
* Indexes should be written in ParseDeinition
|
|
25
|
+
/** Example: We received message ["1A","02", "00", "50"]. Value for weight is on indexes 2,3. Which means we need to combine 2nd and 3rd indexes to get result
|
|
26
|
+
* This method will combine them and return string "0050".
|
|
27
|
+
* Indexes should be written in ParseDeinition
|
|
25
28
|
*/
|
|
26
|
-
const getFullValueForMeasurementProperty = (messageInHex, parseDefinition) => {
|
|
29
|
+
const getFullValueForMeasurementProperty = (messageInHex, parseDefinition, byteOffset) => {
|
|
27
30
|
let valuesInString = "";
|
|
28
31
|
for (let i = 0; i < parseDefinition.byteIndexes.length; i++) {
|
|
29
|
-
valuesInString += messageInHex[parseDefinition.byteIndexes[i]
|
|
32
|
+
valuesInString += messageInHex[(parseDefinition.byteIndexes[i] ?? 0) + byteOffset];
|
|
30
33
|
}
|
|
31
34
|
return valuesInString;
|
|
32
35
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["parseMeasurement","measurementInHex","parsingCase","parserDefinitions","parseDefinitions","result","reduce","acc","parserDefinition","parsingValue","getFullValueForMeasurementProperty","customParserDefinition","name","parseInt","measurement","measurementTypeKey","caseType","messageInHex","parseDefinition","valuesInString","i","byteIndexes","length"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/parse-measurement.ts"],"mappings":";;AAMA,OAAO,MAAMA,gBAAgB,GAAGA,CAC9BC,gBAA0B,EAC1BC,WAAwB,
|
|
1
|
+
{"version":3,"names":["parseMeasurement","measurementInHex","parsingCase","byteOffset","parserDefinitions","parseDefinitions","result","reduce","acc","parserDefinition","parsingValue","getFullValueForMeasurementProperty","customParserDefinition","name","parseInt","measurement","measurementTypeKey","caseType","messageInHex","parseDefinition","valuesInString","i","byteIndexes","length"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/parse-measurement.ts"],"mappings":";;AAMA;AACA;AACA;AACA,OAAO,MAAMA,gBAAgB,GAAGA,CAC9BC,gBAA0B,EAC1BC,WAAwB,EACxBC,UAAU,GAAG,CAAC,KAC2B;EACzC,MAAMC,iBAAiB,GAAGF,WAAW,CAACG,gBAAgB;EAEtD,MAAMC,MAAM,GAAGF,iBAAiB,CAACG,MAAM,CACrC,CAACC,GAAG,EAAEC,gBAAgB,KAAK;IACzB,MAAMC,YAAY,GAAGC,kCAAkC,CACrDV,gBAAgB,EAChBQ,gBAAgB,EAChBN,UACF,CAAC;IAED,IAAIM,gBAAgB,CAACG,sBAAsB,EAAE;MAC3CJ,GAAG,CAACC,gBAAgB,CAACI,IAAI,CAAC,GACxBJ,gBAAgB,CAACG,sBAAsB,CAACF,YAAY,CAAC;IACzD,CAAC,MAAM;MACLF,GAAG,CAACC,gBAAgB,CAACI,IAAI,CAAC,GAAGC,QAAQ,CAACJ,YAAY,EAAE,EAAE,CAAC;IACzD;IAEA,OAAOF,GAAG;EACZ,CAAC;EACD;EACA,CAAC,CACH,CAAC;EAED,MAAMO,WAAW,GAAGT,MAA8C;EAElES,WAAW,CAACC,kBAAkB,GAAGd,WAAW,CAACc,kBAAmB;EAChED,WAAW,CAACE,QAAQ,GAAGf,WAAW,CAACe,QAAQ;EAE3C,OAAOF,WAAW;AACpB,CAAC;;AAED;AACA;AACA;AACA;AACA,MAAMJ,kCAAkC,GAAGA,CACzCO,YAAsB,EACtBC,eAAiC,EACjChB,UAAkB,KACP;EACX,IAAIiB,cAAc,GAAG,EAAE;EAEvB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,eAAe,CAACG,WAAW,CAACC,MAAM,EAAEF,CAAC,EAAE,EAAE;IAC3DD,cAAc,IACZF,YAAY,CAAC,CAACC,eAAe,CAACG,WAAW,CAACD,CAAC,CAAC,IAAI,CAAC,IAAIlB,UAAU,CAAC;EACpE;EAEA,OAAOiB,cAAc;AACvB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** The reading that was thrown away, and why, so a decoding fault can be diagnosed. */
|
|
4
|
+
const discardedReadingError = (deviceId, reason, parsedData) => new Error(`Custom device "${deviceId}": ${reason}. The reading was discarded (decoded ${JSON.stringify(parsedData)}).`);
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Why a decoded property is not a reading, or nothing when it is.
|
|
8
|
+
*
|
|
9
|
+
* The checks are the last thing between a misread frame and a clinical record, so each one
|
|
10
|
+
* says what was wrong rather than returning a bare false: a property the measurement does
|
|
11
|
+
* not have is a declaration mistake, a value that is not a finite number is a frame shorter
|
|
12
|
+
* than the declaration expects, and a value outside the envelope is a decoding fault
|
|
13
|
+
* wearing the shape of a reading.
|
|
14
|
+
*/
|
|
15
|
+
const rejectCustomReading = (fields, measurementTypeKey, name, value) => {
|
|
16
|
+
const field = fields.get(`${measurementTypeKey}:${name}`);
|
|
17
|
+
if (!field) {
|
|
18
|
+
return `decoded "${name}", which is not declared for ${measurementTypeKey}`;
|
|
19
|
+
}
|
|
20
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
21
|
+
return `could not decode ${name}; the frame was shorter than the declaration expects`;
|
|
22
|
+
}
|
|
23
|
+
if (value < field.min || value > field.max) {
|
|
24
|
+
return `decoded ${name} = ${value} ${field.unit}, outside the accepted range ${field.min}-${field.max} ${field.unit}`;
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
};
|
|
28
|
+
export { discardedReadingError, rejectCustomReading };
|
|
29
|
+
//# sourceMappingURL=reject-custom-reading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["discardedReadingError","deviceId","reason","parsedData","Error","JSON","stringify","rejectCustomReading","fields","measurementTypeKey","name","value","field","get","Number","isFinite","min","max","unit","undefined"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/reject-custom-reading.ts"],"mappings":";;AAEA;AACA,MAAMA,qBAAqB,GAAGA,CAC5BC,QAAgB,EAChBC,MAAc,EACdC,UAAmB,KAEnB,IAAIC,KAAK,CACP,kBAAkBH,QAAQ,MAAMC,MAAM,wCAAwCG,IAAI,CAACC,SAAS,CAACH,UAAU,CAAC,IAC1G,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,mBAAmB,GAAGA,CAC1BC,MAAgD,EAChDC,kBAA0B,EAC1BC,IAAY,EACZC,KAAc,KACS;EACvB,MAAMC,KAAK,GAAGJ,MAAM,CAACK,GAAG,CAAC,GAAGJ,kBAAkB,IAAIC,IAAI,EAAE,CAAC;EAEzD,IAAI,CAACE,KAAK,EAAE;IACV,OAAO,YAAYF,IAAI,gCAAgCD,kBAAkB,EAAE;EAC7E;EAEA,IAAI,OAAOE,KAAK,KAAK,QAAQ,IAAI,CAACG,MAAM,CAACC,QAAQ,CAACJ,KAAK,CAAC,EAAE;IACxD,OAAO,oBAAoBD,IAAI,sDAAsD;EACvF;EAEA,IAAIC,KAAK,GAAGC,KAAK,CAACI,GAAG,IAAIL,KAAK,GAAGC,KAAK,CAACK,GAAG,EAAE;IAC1C,OAAO,WAAWP,IAAI,MAAMC,KAAK,IAAIC,KAAK,CAACM,IAAI,gCAAgCN,KAAK,CAACI,GAAG,IAAIJ,KAAK,CAACK,GAAG,IAAIL,KAAK,CAACM,IAAI,EAAE;EACvH;EAEA,OAAOC,SAAS;AAClB,CAAC;AAED,SAASnB,qBAAqB,EAAEO,mBAAmB","ignoreList":[]}
|
package/lib/typescript/commonjs/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-instruction-pdfs.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-device/constants/device-instruction-pdfs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAOxD,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"device-instruction-pdfs.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-device/constants/device-instruction-pdfs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAOxD,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,iBAAiB,EAAE,MAAM,CAsBrE,CAAC"}
|
package/lib/typescript/commonjs/src/modules/bt-management/constants/integrated-devices-map.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integrated-devices-map.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/constants/integrated-devices-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"integrated-devices-map.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/constants/integrated-devices-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,eAAO,MAAM,oBAAoB,gCAqB/B,CAAC"}
|
|
@@ -34,6 +34,10 @@ export * from "./services/devices/custom/custom.device";
|
|
|
34
34
|
export * from "./services/bt-manager";
|
|
35
35
|
export * from "./services/custom/define-custom-device";
|
|
36
36
|
export * from "./services/devices/standard-gatt/standard-gatt.devices";
|
|
37
|
+
export * from "./services/devices/veroval/veroval.bp-monitors";
|
|
38
|
+
export * from "./services/devices/veroval/veroval.duo-control-device";
|
|
39
|
+
export * from "./services/devices/veroval/veroval.ecg-device";
|
|
40
|
+
export * from "./services/devices/veroval/veroval.ecg-samples";
|
|
37
41
|
export * from "./services/devices/lepu/lepu.transports";
|
|
38
42
|
export * from "./services/devices/aoj/aoj.thermometers";
|
|
39
43
|
export * from "./services/devices/viatom/viatom.bp-monitors";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/bt-management/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AAC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|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CustomCaseSpec } from "../../types/custom-case-spec";
|
|
2
|
+
/**
|
|
3
|
+
* How long a frame of this shape is, which may be longer than the shortest the
|
|
4
|
+
* characteristic emits but never shorter: the selector chose this shape, so its own fields
|
|
5
|
+
* are the ones that have to fit.
|
|
6
|
+
*/
|
|
7
|
+
declare const assertCaseLength: (id: string, path: string, caseSpec: CustomCaseSpec, frameMinLengthBytes: number) => number;
|
|
8
|
+
/**
|
|
9
|
+
* A frame that is a run of records, and how wide one is.
|
|
10
|
+
*
|
|
11
|
+
* The characteristic has to guarantee at least one whole record, otherwise a declaration
|
|
12
|
+
* whose fields all fit could still never decode anything.
|
|
13
|
+
*/
|
|
14
|
+
declare const assertRepeatedRecords: (id: string, path: string, caseSpec: CustomCaseSpec, frameMinLengthBytes: number) => {
|
|
15
|
+
recordBytes: number;
|
|
16
|
+
from: number;
|
|
17
|
+
} | undefined;
|
|
18
|
+
export { assertCaseLength, assertRepeatedRecords };
|
|
19
|
+
//# sourceMappingURL=compile-case-shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-case-shape.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/compile-case-shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAI9D;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,GACpB,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,UAAU,cAAc,EACxB,qBAAqB,MAAM,KAC1B,MAgBF,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,qBAAqB,GACzB,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,UAAU,cAAc,EACxB,qBAAqB,MAAM,KAC1B;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAkC1C,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-custom-case.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/compile-custom-case.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAI9D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"compile-custom-case.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/compile-custom-case.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAI9D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAgGvD,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,GAC5B,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,UAAU,cAAc,EACxB,gBAAgB,MAAM,EACtB,QAAQ,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,KACvC,WA+FF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compile-custom-field.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/compile-custom-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"compile-custom-field.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/custom/compile-custom-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAGhD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AA+GhE,8FAA8F;AAC9F,eAAO,MAAM,kBAAkB,GAC7B,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,OAAO,eAAe,EACtB,oBAAoB,kBAAkB,EACtC,gBAAgB,MAAM,KACrB,mBAyDF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-creator.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/services/device-creator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"device-creator.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/services/device-creator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AA6D9D,qBAAa,aAAa,CAAC,CAAC,SAAS,SAAS,cAAc,EAAE;IAKhD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IAJhD,OAAO,CAAC,eAAe,CAAuC;IAC9D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAO;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAsC;gBAEvC,mBAAmB,EAAE,CAAC;IAI5C,aAAa,GAAI,WAAW,MAAM,KAAG,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAkBpE;IAEK,YAAY,CAAC,CAAC,SAAS,SAAS,EACrC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC5B,eAAe,CAAC,CAAC,CAAC;IAmCd,OAAO,aAEZ;IAEF;;;OAGG;IACH,OAAO,CAAC,eAAe,CAmBrB;IAEF,OAAO,CAAC,eAAe;CAexB"}
|
package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts
CHANGED
|
@@ -48,6 +48,13 @@ export declare class BTCommandWriter {
|
|
|
48
48
|
* for - worse than sending nothing, because it would be answered.
|
|
49
49
|
*/
|
|
50
50
|
private writeCommand;
|
|
51
|
+
/**
|
|
52
|
+
* Writes one chunk the way the characteristic accepts writes.
|
|
53
|
+
*
|
|
54
|
+
* A with-response write to a characteristic that only supports write-without-response
|
|
55
|
+
* fails outright, so the command says which it is rather than the transport guessing.
|
|
56
|
+
*/
|
|
57
|
+
private writeTo;
|
|
51
58
|
/**
|
|
52
59
|
* Splits a frame into writes the link will carry whole.
|
|
53
60
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bt-command-writer.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/devices/bt-command-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAW3D;;;;;;;;GAQG;AACH,qBAAa,eAAe;IAKxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IAL3B,OAAO,CAAC,aAAa,CAAoC;IACzD,OAAO,CAAC,GAAG,CAAmB;gBAGX,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,GAAE,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,KAAK,IAAI,aAAA;IAG9D;;;;;;OAMG;IACI,gBAAgB,GAAI,MAAM,MAAM,KAAG,IAAI,CAI5C;IAEF,kEAAkE;IAC3D,KAAK,QAAO,IAAI,CAErB;IAEF;;;;;;;OAOG;IACI,IAAI,GAAI,UAAU,SAAS,aAAa,EAAE,KAAG,OAAO,CAAC,IAAI,CAAC,CAQ/D;IAEF,OAAO,CAAC,YAAY,CAMlB;IAEF;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,YAAY,CAQlB;IAEF;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CASd;IAEF;;;;;;OAMG;IACH,OAAO,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"bt-command-writer.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/devices/bt-command-writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAIxD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAW3D;;;;;;;;GAQG;AACH,qBAAa,eAAe;IAKxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IAL3B,OAAO,CAAC,aAAa,CAAoC;IACzD,OAAO,CAAC,GAAG,CAAmB;gBAGX,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,GAAE,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,KAAK,IAAI,aAAA;IAG9D;;;;;;OAMG;IACI,gBAAgB,GAAI,MAAM,MAAM,KAAG,IAAI,CAI5C;IAEF,kEAAkE;IAC3D,KAAK,QAAO,IAAI,CAErB;IAEF;;;;;;;OAOG;IACI,IAAI,GAAI,UAAU,SAAS,aAAa,EAAE,KAAG,OAAO,CAAC,IAAI,CAAC,CAQ/D;IAEF,OAAO,CAAC,YAAY,CAMlB;IAEF;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,YAAY,CAQlB;IAEF;;;;;OAKG;IACH,OAAO,CAAC,OAAO,CAmBb;IAEF;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,CASd;IAEF;;;;;;OAMG;IACH,OAAO,CAAC,UAAU,CA8BhB;CACH"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CommandSequencer } from "../../../types/command-sequencer";
|
|
2
2
|
import { CustomLepuSpec } from "../../../types/custom-lepu-spec";
|
|
3
|
+
import { DeviceData } from "../../../types/device-data";
|
|
3
4
|
import { LepuDeviceInfo } from "../lepu/lepu.device-info";
|
|
4
5
|
interface IdentityReport {
|
|
5
6
|
onIdentified: (info: LepuDeviceInfo) => void;
|
|
@@ -16,6 +17,14 @@ interface IdentityReport {
|
|
|
16
17
|
* answers on the one it is addressed with, so the list matters for reading and its head for
|
|
17
18
|
* writing.
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Records what the device said it was.
|
|
22
|
+
*
|
|
23
|
+
* The model number is logged because it is the only place one exists: the vendor's SDK
|
|
24
|
+
* never reads the field back, so a declaration written without it is completed by
|
|
25
|
+
* connecting once and reading this line.
|
|
26
|
+
*/
|
|
27
|
+
declare const recordLepuIdentity: (deviceData: DeviceData, info: LepuDeviceInfo) => void;
|
|
28
|
+
declare const createLepuSequencer: (lepu: CustomLepuSpec, report: IdentityReport) => CommandSequencer;
|
|
29
|
+
export { createLepuSequencer, recordLepuIdentity };
|
|
21
30
|
//# sourceMappingURL=custom-lepu-sequencer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-lepu-sequencer.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"custom-lepu-sequencer.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAM1D,UAAU,cAAc;IACtB,YAAY,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,CAAC;IAC7C,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED;;;;;;;;;;GAUG;AACH;;;;;;GAMG;AACH,QAAA,MAAM,kBAAkB,GACtB,YAAY,UAAU,EACtB,MAAM,cAAc,KACnB,IAUF,CAAC;AAEF,QAAA,MAAM,mBAAmB,GACvB,MAAM,cAAc,EACpB,QAAQ,cAAc,KACrB,gBAWC,CAAC;AAEL,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC"}
|
package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts
CHANGED
|
@@ -31,18 +31,7 @@ export declare class CustomDevice extends BTManagedDevice<CustomDeviceId> {
|
|
|
31
31
|
* gate would poll hardware it had not identified, which is the case the gate exists for.
|
|
32
32
|
*/
|
|
33
33
|
private declareLepuProtocol;
|
|
34
|
-
/**
|
|
35
|
-
* Records what the device said it was.
|
|
36
|
-
*
|
|
37
|
-
* The model number is logged because it is the only place one exists: the vendor's SDK
|
|
38
|
-
* never reads the field back, so a declaration written without it is completed by
|
|
39
|
-
* connecting once and reading this line.
|
|
40
|
-
*/
|
|
41
34
|
private onIdentified;
|
|
42
|
-
/**
|
|
43
|
-
* Nothing is sent to a device that could not be identified, because the same opcode means
|
|
44
|
-
* different things on different models in this family.
|
|
45
|
-
*/
|
|
46
35
|
private onIdentityRefused;
|
|
47
36
|
protected validatePackage: (pkg: string[], uuid: string) => boolean;
|
|
48
37
|
/**
|
|
@@ -56,6 +45,15 @@ export declare class CustomDevice extends BTManagedDevice<CustomDeviceId> {
|
|
|
56
45
|
* readings themselves are reported from handleDependentResult, so there is nothing to do.
|
|
57
46
|
*/
|
|
58
47
|
protected handleSuccessResult(): void | boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Reports what the frame carried, which may be more than one reading.
|
|
50
|
+
*
|
|
51
|
+
* A device handing over its stored history answers one request with every record it
|
|
52
|
+
* holds, back to back. Those were taken at different times and are separate readings, so
|
|
53
|
+
* each record is decoded and reported on its own. A trailing part-record is ignored: half
|
|
54
|
+
* a record is not a reading.
|
|
55
|
+
*/
|
|
56
|
+
private reportFrame;
|
|
59
57
|
/**
|
|
60
58
|
* Reports every reading the frame carried.
|
|
61
59
|
*
|
|
@@ -68,9 +66,8 @@ export declare class CustomDevice extends BTManagedDevice<CustomDeviceId> {
|
|
|
68
66
|
* not take is no reason to withhold the heart rate in the same frame.
|
|
69
67
|
*/
|
|
70
68
|
private report;
|
|
69
|
+
private discard;
|
|
71
70
|
private reportMeasurement;
|
|
72
|
-
private reject;
|
|
73
|
-
private fail;
|
|
74
71
|
}
|
|
75
72
|
export {};
|
|
76
73
|
//# sourceMappingURL=custom.device.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom.device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/custom/custom.device.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"custom.device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/custom/custom.device.ts"],"names":[],"mappings":"AAAA,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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1B"}
|
package/lib/typescript/commonjs/src/modules/bt-management/services/devices/frame-parser.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame-parser.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/devices/frame-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAK9D;;;;;;;GAOG;AACH,qBAAa,WAAW,CAAC,CAAC,SAAS,WAAW;IAChC,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,cAAc,CAAC,aAAa,CAAC;IAEjE,KAAK,CACV,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EAAE,GACd,4BAA4B,CAAC,CAAC,CAAC,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"frame-parser.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/devices/frame-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAK9D;;;;;;;GAOG;AACH,qBAAa,WAAW,CAAC,CAAC,SAAS,WAAW;IAChC,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAAZ,YAAY,EAAE,cAAc,CAAC,aAAa,CAAC;IAEjE,KAAK,CACV,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EAAE,GACd,4BAA4B,CAAC,CAAC,CAAC,GAAG,SAAS;IA+B9C,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,aAAa;CAMtB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { FrameReadResult } from "../../types/frame-read-result";
|
|
2
|
+
import { FrameReader } from "../../types/frame-reader";
|
|
3
|
+
interface SentinelFrameSpec {
|
|
4
|
+
/** Byte that ends a reply. Excluded from the frame, being framing rather than payload. */
|
|
5
|
+
terminator: string;
|
|
6
|
+
/** Byte that begins one, when the device sends one. Also excluded. */
|
|
7
|
+
start?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Longest reply worth waiting for.
|
|
10
|
+
*
|
|
11
|
+
* A sentinel protocol has no length field, so a lost terminator is indistinguishable from
|
|
12
|
+
* a reply that has not finished arriving - the buffer would grow for as long as the link
|
|
13
|
+
* stayed up. Past this the buffer is dropped and reported, which resynchronises on the
|
|
14
|
+
* next reply instead of holding a partial one for ever.
|
|
15
|
+
*/
|
|
16
|
+
maxFrameBytes: number;
|
|
17
|
+
/**
|
|
18
|
+
* Bytes that are a whole reply on their own, carrying no delimiters at all.
|
|
19
|
+
*
|
|
20
|
+
* Serial protocols answer with a bare acknowledgement as often as with a payload, and a
|
|
21
|
+
* reader that only knows delimited replies would wait for a terminator that is never
|
|
22
|
+
* coming. Only the first byte of the buffer is tested, which is the one place a reply can
|
|
23
|
+
* begin - so a control code inside a payload is still payload.
|
|
24
|
+
*/
|
|
25
|
+
standaloneBytes?: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Reads a reply that ends on a sentinel byte rather than declaring its length.
|
|
29
|
+
*
|
|
30
|
+
* The Veroval duo control answers this way, as serial protocols generally do: a request is
|
|
31
|
+
* answered across as many notifications as it takes and the end is marked, not counted. The
|
|
32
|
+
* reader therefore cannot know how much is coming and holds the buffer until the terminator
|
|
33
|
+
* lands - which is why the cap exists.
|
|
34
|
+
*
|
|
35
|
+
* There is no integrity check to make. A sentinel protocol carries no checksum, so a frame
|
|
36
|
+
* that reaches a parser here has been delimited, not verified, and whatever decodes it is
|
|
37
|
+
* the only thing standing between a corrupted reply and a reported reading. Declare a range
|
|
38
|
+
* for every field.
|
|
39
|
+
*/
|
|
40
|
+
export declare class SentinelFrameReader implements FrameReader {
|
|
41
|
+
private readonly spec;
|
|
42
|
+
constructor(spec: SentinelFrameSpec);
|
|
43
|
+
readFrame(buffer: readonly string[]): FrameReadResult;
|
|
44
|
+
/**
|
|
45
|
+
* Where the payload begins: after the start byte when one is declared, and at zero when
|
|
46
|
+
* none is. A declared start byte that has not arrived means the reply has not begun.
|
|
47
|
+
*/
|
|
48
|
+
private frameStart;
|
|
49
|
+
private incompleteOrOverlong;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=sentinel-frame-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sentinel-frame-reader.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/bt-management/services/devices/sentinel-frame-reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,UAAU,iBAAiB;IAEzB,0FAA0F;IAC1F,UAAU,EAAE,MAAM,CAAC;IAEnB,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;;OAOG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;;;;;OAOG;IACH,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAID;;;;;;;;;;;;GAYG;AACH,qBAAa,mBAAoB,YAAW,WAAW;IAClC,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,iBAAiB;IAEpD,SAAS,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,GAAG,eAAe;IAoC5D;;;OAGG;IACH,OAAO,CAAC,UAAU;IAUlB,OAAO,CAAC,oBAAoB;CAU7B"}
|