Skip to content

Commit

Permalink
update support for power-down mode in android app; update API version…
Browse files Browse the repository at this point in the history
… and docs
  • Loading branch information
voroshkov committed Jul 4, 2019
1 parent d9d042b commit 1bce858
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Android/ChorusRFLaptimer/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "app.andrey_voroshkov.chorus_laptimer"
minSdkVersion 16
targetSdkVersion 26
versionCode 24
versionName "0.7.12"
versionCode 25
versionName "0.7.14"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
archivesBaseName = "ChorusRFLaptimer"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,7 @@ public static void applyInAppPreferences() {
}
}

if (app.deviceStates != null) {
String statuses = app.preferences.getString(DEVICE_ENABLED, "");
if (!statuses.equals("")) {
String[] statusesArray = TextUtils.split(statuses, STRING_ITEMS_DELIMITER);
int statusesCount = statusesArray.length;
for(int i = 0; i < app.deviceStates.size(); i++) {
if (i < statusesCount) {
app.changeDeviceEnabled(i, Boolean.parseBoolean(statusesArray[i]));
}
}
}
}

}

public static void applyDeviceDependentPreferences() {
Expand Down Expand Up @@ -282,6 +271,19 @@ public static void applyDeviceDependentPreferences() {
}
}

String enabledStatuses = app.preferences.getString(DEVICE_ENABLED, "");
if (!enabledStatuses.equals("")) {
String[] enabledStatusesArray = TextUtils.split(enabledStatuses, STRING_ITEMS_DELIMITER);
int statusesCount = enabledStatusesArray.length;
for(int i = 0; i < app.deviceStates.size(); i++) {
if (i < statusesCount) {
boolean prefEnabledStatus = Boolean.parseBoolean(enabledStatusesArray[i]);
app.changeDeviceEnabled(i, prefEnabledStatus);
app.sendBtCommand("R" + String.format("%X", i) + "A" + (prefEnabledStatus ? "1" : "0"));
}
}
}

}
}

Expand Down
2 changes: 1 addition & 1 deletion Arduino/chorus_rf_laptimer/chorus_rf_laptimer.ino
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ TODO: there's possible optimization in send queue:
remove already existing items from queue
*/

#define API_VERSION 5 // version number to be increased with each API change (int16)
#define API_VERSION 6 // version number to be increased with each API change (int16)

#define EXPERIMENTAL_FEATURES_AVAILABLE // comment out if current code version doesn't contain any experimental features

Expand Down
Binary file modified docs/ChorusAPI.xlsx
Binary file not shown.

0 comments on commit 1bce858

Please sign in to comment.