Skip to content

Commit

Permalink
hack to open the G4 usb before each download, alpha10
Browse files Browse the repository at this point in the history
  • Loading branch information
jasoncalabrese committed May 9, 2015
1 parent 665ecd8 commit aefdd85
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ android {
minSdkVersion 18
targetSdkVersion 18
versionCode 22
versionName "0.2.0-alpha9"
versionName "0.2.0-alpha10"
buildConfigField "String", "GIT_SHA", "\"${gitSha}\""
buildConfigField "String", "BUILD_TIME", "\"${buildTime}\""
buildConfigField "String", "VERSION_CODENAME", "\"${codeName}\""
Expand Down
14 changes: 13 additions & 1 deletion app/src/main/java/com/nightscout/android/CollectorService.java
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,19 @@ protected G4Download doInBackground(Integer... params) {
}

long nextUploadTime = Minutes.minutes(2).toStandardDuration().getMillis();
if (!device.isConnected()) {

SupportedDevices deviceType = preferences.getDeviceType();

if (deviceType == SupportedDevices.DEXCOM_G4) {
try {
driver.open();
Log.i(TAG, "DEXCOM_G4 was opened for download");
} catch (IOException e) {
Log.e(TAG, "Unable to open DEXCOM_G4, will keep trying", e);
setNextPoll(nextUploadTime);
return null;
}
} else if (!device.isConnected()) {
Log.e(TAG, "Device is not connected");
try {
driver.open();
Expand Down

0 comments on commit aefdd85

Please sign in to comment.