Skip to content

Commit

Permalink
Merge branch 'master' into tandem-blobs
Browse files Browse the repository at this point in the history
  • Loading branch information
gniezen committed Oct 6, 2022
2 parents 11f835f + 476f9ac commit 097519e
Show file tree
Hide file tree
Showing 61 changed files with 881 additions and 147 deletions.
4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tidepool-uploader",
"productName": "tidepool-uploader",
"version": "2.46.0-electron-v16.11",
"version": "2.47.0",
"description": "Tidepool Project Universal Uploader",
"main": "./main.prod.js",
"author": {
Expand All @@ -13,6 +13,6 @@
"drivelist": "11.0.0",
"keytar": "7.9.0",
"@ronomon/direct-io": "3.0.1",
"usb": "2.4.3"
"usb": "2.5.2"
}
}
30 changes: 24 additions & 6 deletions app/reducers/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ const devices = {
source: {type: 'device', driverId: 'BayerContour'},
enabled: {mac: true, win: true, linux: true}
},
contourplusone: {
instructions: i18n.t('Plug meter into USB port'),
key: 'contourplusone',
name: 'Ascensia Contour Plus One',
source: {type: 'device', driverId: 'ContourPlusOne'},
contourplus: {
instructions: i18n.t('Plug in meter with micro-USB'),
key: 'contourplus',
name: 'Ascensia Contour Plus One/Blue',
source: {type: 'device', driverId: 'ContourPlus'},
enabled: {mac: true, win: true, linux: true}
},
caresens: {
Expand All @@ -78,7 +78,11 @@ const devices = {
enabled: {mac: true, win: true, linux: true}
},
caresensble: {
instructions: i18n.t('Once paired, hold in right arrow until "BT Send" appears on the screen'),
instructions: {
text: i18n.t('For uploading instructions,'),
linkText: i18n.t('visit our support site'),
link: 'https://support.tidepool.org/hc/en-us/articles/360035332972#h_01EDCWR70ZH3WMHY4RX3SC80NX',
},
name: 'CareSens N Premier, Dual & N Plus BT (using Bluetooth)',
key: 'caresensble',
source: {type: 'device', driverId: 'BluetoothLE'},
Expand Down Expand Up @@ -125,6 +129,13 @@ const devices = {
source: {type: 'device', driverId: 'GlucocardShineHID'},
enabled: {mac: true, win: true, linux: true}
},
glucocardvital: {
instructions: i18n.t('Make sure the meter is switched off and plug in cable'),
name: 'GLUCOCARD Vital',
key: 'glucocardvital',
source: {type: 'device', driverId: 'GlucocardVital'},
enabled: {mac: true, win: true, linux: true}
},
omnipod: {
instructions: [i18n.t('Classic PDM: Plug into USB. Wait for Export to complete. Click Upload.'), i18n.t('DASH PDM: Unlock. Plug into USB. Tap Export on PDM. Click Upload.')],
key: 'omnipod',
Expand Down Expand Up @@ -216,6 +227,13 @@ const devices = {
source: {type: 'device', driverId: 'ReliOnPremier'},
enabled: {mac: true, win: true, linux: true}
},
relionprime: {
instructions: i18n.t('Make sure meter is switched off before plugging in cable'),
name: 'ReliOn Prime',
key: 'relionprime',
source: {type: 'device', driverId: 'ReliOnPrime'},
enabled: {mac: true, win: true, linux: true},
},
accuchekusb: {
instructions: i18n.t('Plug in meter with micro-USB cable'),
name: 'Roche Accu-Chek Aviva Connect, Instant, Guide & Guide Me',
Expand Down
3 changes: 1 addition & 2 deletions app/utils/drivers.darwin.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,12 @@ export function checkVersion(dispatch) {
const appFolder = path.dirname(remote.app.getAppPath());
let helperPath = path.join(appFolder, 'driver/helpers/');
let driverPath = path.join(appFolder, 'driver/');
let iconsPath = path.join(appFolder, '/Tidepool Uploader.icns');
let iconsPath = path.join(appFolder, '/icon.icns');
let scriptPath = path.join(appFolder, 'driver/updateDrivers.sh');

if (!remote.app.isPackaged) {
driverPath = path.resolve(appFolder, 'build/driver/');
helperPath = path.join(appFolder, 'resources/mac/helpers/');
iconsPath = path.join(appFolder, 'resources/icon.icns');
scriptPath = path.resolve(appFolder, 'resources/mac/updateDrivers.sh');
}

Expand Down
8 changes: 4 additions & 4 deletions app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,10 @@ tunnel-agent@^0.6.0:
dependencies:
safe-buffer "^5.0.1"

usb@2.4.3:
version "2.4.3"
resolved "https://registry.yarnpkg.com/usb/-/usb-2.4.3.tgz#fab8c1820276d0cb34f87a5ddba0152633d4a829"
integrity sha512-BmCjjxsriODcrb+TdXdzSDDys+MOUeRvo22ywmyIxYcuVW9YKrr2Wp2gQZUfHrQbvovKu87Po9mk5OPftJdDeQ==
usb@2.5.2:
version "2.5.2"
resolved "https://registry.yarnpkg.com/usb/-/usb-2.5.2.tgz#081b83aff83279c6d7605608880009ad698bc2c8"
integrity sha512-/7hWfbPL4ExGTQO2v2XfuKoBHDwNMoNPZmyKjsPpS4bnEY3BIsaanPpGsLmaI4MOq9pAWDrIz0DwRA8SqJ1pVQ==
dependencies:
"@types/w3c-web-usb" "1.0.6"
node-addon-api "^4.2.0"
Expand Down
8 changes: 4 additions & 4 deletions config/device-debug.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export API_URL='http://localhost:3000'
export UPLOAD_URL='http://localhost:3000'
export DATA_URL='http://localhost:3000/dataservices'
export BLIP_URL='http://localhost:3000'
export API_URL='http://localhost:31500'
export UPLOAD_URL='http://localhost:31500'
export DATA_URL='http://localhost:31500/dataservices'
export BLIP_URL='http://localhost:31500'
export DEBUG_ERROR=true
export REDUX_LOG=false
export REDUX_DEV_UI=false
8 changes: 4 additions & 4 deletions config/local.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export API_URL='http://localhost:3000'
export UPLOAD_URL='http://localhost:3000'
export DATA_URL='http://localhost:3000/dataservices'
export BLIP_URL='http://localhost:3000'
export API_URL='http://localhost:31500'
export UPLOAD_URL='http://localhost:31500'
export DATA_URL='http://localhost:31500/dataservices'
export BLIP_URL='http://localhost:31500'
export DEBUG_ERROR=false
export REDUX_LOG=false
export REDUX_DEV_UI=false
7 changes: 7 additions & 0 deletions config/qa1.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export API_URL='https://qa1.development.tidepool.org'
export UPLOAD_URL='https://qa1.development.tidepool.org'
export BLIP_URL='https://qa1.development.tidepool.org'
export DATA_URL='https://qa1.development.tidepool.org/dataservices'
export DEBUG_ERROR=true
export REDUX_LOG=true
export REDUX_DEV_UI=true
7 changes: 7 additions & 0 deletions config/qa2.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export API_URL='https://qa2.development.tidepool.org'
export UPLOAD_URL='https://qa2.development.tidepool.org'
export BLIP_URL='https://qa2.development.tidepool.org'
export DATA_URL='https://qa2.development.tidepool.org/dataservices'
export DEBUG_ERROR=true
export REDUX_LOG=true
export REDUX_DEV_UI=true
8 changes: 4 additions & 4 deletions config/ui-debug.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export API_URL='http://localhost:3000'
export UPLOAD_URL='http://localhost:3000'
export DATA_URL='http://localhost:3000/dataservices'
export BLIP_URL='http://localhost:3000'
export API_URL='http://localhost:31500'
export UPLOAD_URL='http://localhost:31500'
export DATA_URL='http://localhost:31500/dataservices'
export BLIP_URL='http://localhost:31500'
export DEBUG_ERROR=false
export REDUX_LOG=true
export REDUX_DEV_UI=true
39 changes: 39 additions & 0 deletions docs/checklists/reliOnPrime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
## Checklist for ReliOn Prime meter

(Key:

- `[x]` available in data protocol/documented in spec and implemented
- `[-]` available in data protocol/documented in spec but *not* yet implemented
- `[?]` unknown whether available in data protocol/documented in spec; *not* yet implemented
- `*[ ]` TODO: needs implementation!
- `[ ]` unavailable in data protocol and/or not documented in spec and not yet implemented)

### Required if Present

- `[x]` smbg values
- `[ ]` units of smbg values (read from device, not hard-coded)
- `[x]` out-of-range values (LO or HI)
- `[ ]` out-of-range value thresholds (e.g., often 20 for low and 600 for high on BGMs)
- `[ ]` date & time settings changes
- `[ ]` blood ketone values
- `[ ]` units of blood ketone values (read from device, not hard-coded)
- `[ ]` ketone out-of-range values
- `[ ]` ketone out-of-range value thresholds
- `[x]` use `common.checkDeviceTime(currentDeviceTime, timezone, cb)` to check against server time

### No Tidepool Data Model Yet

- `[-]` control (solution) tests (whether marked in UI or auto-detected) - until we have a data model, these should be discarded
- `[ ]` device settings, other than date & time (e.g., target blood glucose range)
- `[ ]` tag/note (e.g., pre- vs. post-meal)

### Tidepool ingestion API

Choose one of the following:

- `[ ]` legacy "jellyfish" ingestion API
- `[x]` platform ingestion API

### Known implementation issues/TODOs

*Use this space to describe device-specific known issues or implementation TODOs **not** contained in the above datatype-specific sections.*
8 changes: 7 additions & 1 deletion lib/commonFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ var rollbar =require('../app/utils/rollbar');
var isBrowser = typeof window !== 'undefined';
var moment = require('moment');

var GLUCOSE_MM = 18.01559;

/**
* Computes the number of milliseconds after midnight on the date specified.
*
Expand Down Expand Up @@ -85,12 +87,16 @@ exports.getName = function (list, idx) {
};

exports.convertBackToMmol = function(n) {
var GLUCOSE_MM = 18.01559;
var inMmol = n / GLUCOSE_MM;
// return a value with a single significant digit
return Math.floor(inMmol * 10 + 0.5) / 10;
};

exports.convertToMgDl = function(n) {
// return a integer value
return Math.round(n * GLUCOSE_MM);
};

exports.finalScheduledBasal = function(currBasal, settings, source) {
var millisInDay = sundial.getMsFromMidnight(currBasal.time, currBasal.timezoneOffset);
var basalSched = settings.basalSchedules[currBasal.scheduleName];
Expand Down
19 changes: 16 additions & 3 deletions lib/core/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ import careSensDriver from '../drivers/i-sens/careSens';
import WeitaiUSB from '../drivers/weitai/weiTaiUSB';
import glucocardExpression from '../drivers/i-sens/glucocardExpression';
import libreViewDriver from '../drivers/abbott/libreViewDriver';
import reliOnPrime from '../drivers/i-sens/reliOnPrime';

const device = {
log: bows('Device'),
Expand Down Expand Up @@ -91,7 +92,7 @@ device.deviceDrivers = {
AbbottFreeStyleNeo: abbottFreeStyleNeo,
BayerContourNext: bayerContourNext,
BayerContour: bayerContour,
ContourPlusOne: bayerContourNext,
ContourPlus: bayerContourNext,
Animas: animasDriver,
Medtronic: medtronicDriver,
Medtronic600: medtronic600Driver,
Expand All @@ -101,9 +102,11 @@ device.deviceDrivers = {
CareSens: careSensDriver,
Weitai: WeitaiUSB,
ReliOnPremier: careSensDriver,
ReliOnPrime: reliOnPrime,
GlucocardExpression: glucocardExpression,
GlucocardShine: careSensDriver,
GlucocardShineHID: careSensDriver,
GlucocardVital: reliOnPrime,
AbbottLibreView: libreViewDriver,
};

Expand All @@ -122,7 +125,7 @@ device.deviceComms = {
Tandem: serialDevice,
BayerContourNext: hidDevice,
BayerContour: serialDevice,
ContourPlusOne: hidDevice,
ContourPlus: hidDevice,
Animas: serialDevice,
Medtronic: hidDevice,
Medtronic600: hidDevice,
Expand All @@ -132,9 +135,11 @@ device.deviceComms = {
CareSens: hidDevice,
Weitai: usbDevice,
ReliOnPremier: serialDevice,
ReliOnPrime: serialDevice,
GlucocardExpression: serialDevice,
GlucocardShine: serialDevice,
GlucocardShineHID: hidDevice,
GlucocardVital: serialDevice,
AbbottLibreView: libreViewDriver,
};

Expand Down Expand Up @@ -269,6 +274,7 @@ device.findUsbDevice = (driverId, usbDevices) => {
productId: result.productId,
userSpaceDriver,
bitrate: driverManifest.bitrate,
stopBits: driverManifest.stopBits,
}));

if (devices.length > 1) {
Expand Down Expand Up @@ -369,7 +375,11 @@ device.detect = (driverId, options, cb) => {
return cb(null, devdata);
});
})().catch((error) => {
if (webUSBDevice == null && driverId === 'InsuletOmniPod') {
if (webUSBDevice == null && (
driverId === 'InsuletOmniPod' ||
driverId === 'OneTouchVerio' ||
driverId === 'OneTouchSelect'
)) {
// could also be block mode device
device.deviceInfoCache[driverId] = _.cloneDeep(devdata);
device.detectHelper(driverId, options, (err) => {
Expand Down Expand Up @@ -416,6 +426,9 @@ device.detect = (driverId, options, cb) => {
if (driverManifest.ctsFlowControl) {
devdata.ctsFlowControl = driverManifest.ctsFlowControl;
}
if (driverManifest.stopBits) {
devdata.stopBits = driverManifest.stopBits;
}
device.deviceInfoCache[driverId] = _.cloneDeep(devdata);
device.detectHelper(driverId, options, (err) => {
if (err) {
Expand Down
24 changes: 23 additions & 1 deletion lib/core/driverManifests.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ const driverManifests = {
{ vendorId: 1027, productId: 24577, driver: 'ftdi' }, // FTDI cable
],
},
ContourPlusOne: {
ContourPlus: {
mode: 'HID',
usb: [
{ vendorId: 6777, productId: 30720 }, // Ascensia Contour Plus One
{ vendorId: 6777, productId: 31056 }, // Ascensia Contour Plus Blue
],
},
Animas: {
Expand Down Expand Up @@ -178,19 +179,31 @@ const driverManifests = {
mode: 'serial',
usb: [
{ vendorId: 1027, productId: 24597, driver: 'ftdi' }, // FT230x
{ vendorId: 1027, productId: 24577, driver: 'ftdi' }, // FTDI cable
],
},
ReliOnPrime: {
mode: 'serial',
bitrate: 19200,
stopBits: 2,
usb: [
{ vendorId: 3835, productId: 17, driver: 'cp2102' }, // Arkray cable
{ vendorId: 1027, productId: 24577 }, // FTDI cable
],
},
GlucocardShine: {
mode: 'serial',
usb: [
{ vendorId: 1027, productId: 24597, driver: 'ftdi' }, // FT230x
{ vendorId: 1027, productId: 24577, driver: 'ftdi' }, // FTDI cable
],
},
GlucocardExpression: {
mode: 'serial',
bitrate: 19200,
usb: [
{ vendorId: 1659, productId: 8963, driver: 'pl2303' },
{ vendorId: 1027, productId: 24577, driver: 'ftdi' }, // FTDI cable
],
},
GlucocardShineHID: {
Expand All @@ -199,6 +212,15 @@ const driverManifests = {
{ vendorId: 1155, productId: 41355 }, // Shine Connex & Express
],
},
GlucocardVital: {
mode: 'serial',
bitrate: 19200,
stopBits: 2,
usb: [
{ vendorId: 3835, productId: 17, driver: 'cp2102' }, // Arkray cable
{ vendorId: 1027, productId: 24577 }, // FTDI cable
],
},
AbbottLibreView: {
mode: 'block',
},
Expand Down
1 change: 1 addition & 0 deletions lib/drivers/bayer/bayerConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export const MODELS = {
Contour7220: 'Contour',
Contour7600: 'Contour Plus',
Contour7900: 'Contour Next',
Contour7950: 'Contour Plus Blue',
};

export const COMMANDS = {
Expand Down
Loading

0 comments on commit 097519e

Please sign in to comment.