diff --git a/lib/drivers/bluetoothLE/bluetoothLEDriver.js b/lib/drivers/bluetoothLE/bluetoothLEDriver.js index 76f940517..ce31b5a26 100644 --- a/lib/drivers/bluetoothLE/bluetoothLEDriver.js +++ b/lib/drivers/bluetoothLE/bluetoothLEDriver.js @@ -95,7 +95,7 @@ module.exports = (config) => { return cb (new Error('We don\'t currently support this meter.')); } - if (cfg.deviceInfo.manufacturers == null && cfg.deviceInfo.name.startsWith('TNG')) { + if (cfg.deviceInfo.name.startsWith('TNG')) { // Fora meters don't set the BLE manufacturer string cfg.deviceInfo.manufacturers = ['ForaCare']; } @@ -249,9 +249,14 @@ module.exports = (config) => { cfg.deviceComms.ble.addEventListener('numberOfRecords', handleNumberOfRecords, { once: true }); setTimeout(async () => { + retryTimer = setTimeout(async () => { debug('Retrying..'); - await cfg.deviceComms.ble.getNumberOfRecords(); + try{ + await cfg.deviceComms.ble.getNumberOfRecords(); + } catch(err) { + console.log('Retry failed:', err); + } }, 1000); try { diff --git a/locales/en/translation.missing.json b/locales/en/translation.missing.json index 61cc43322..204277f67 100644 --- a/locales/en/translation.missing.json +++ b/locales/en/translation.missing.json @@ -78,5 +78,6 @@ "login to your account in Tidepool Web": "login to your account in Tidepool Web", "Go to Workspace": "Go to Workspace", "Want to use Tidepool for your private data?": "Want to use Tidepool for your private data?", - "Go to Private Workspace": "Go to Private Workspace" + "Go to Private Workspace": "Go to Private Workspace", + "Couldn't connect to device.": "Couldn't connect to device." } \ No newline at end of file