Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Flush voltage data.

  • Loading branch information...
commit 2a790bb88193289f9ddc5c3b30a6e5fe43da5ba2 1 parent 0614e1b
@PurpleGuitar authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/org/metawatch/manager/MetaWatchService.java
View
9 src/org/metawatch/manager/MetaWatchService.java
@@ -635,15 +635,18 @@ else if (bytes[2] == eMessageType.GeneralPurposePhoneMsg.msg) {
+ " battery_charging=" + batteryCharging
+ " battery_sense=" + batterySense
+ " battery_average=" + batteryAverage);
- if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean(
- "readWatchVoltage", false)) {
+ String voltageFrequencyString = PreferenceManager.getDefaultSharedPreferences(this).getString(
+ "collectWatchVoltage", "0");
+ final int voltageFrequency = Integer.parseInt(voltageFrequencyString);
+ if (voltageFrequency > 0) {
File sdcard = Environment.getExternalStorageDirectory();
File csv = new File(sdcard,"metawatch_voltage.csv");
FileWriter fw = new FileWriter(csv, true);
Date date = new Date();
fw.write("\"" + date.toString()+ "\"," + batteryAverage + "\n");
+ fw.flush();
fw.close();
- }
+ }
} else {
Log.d(MetaWatch.TAG,
"MetaWatchService.readFromDevice(): Unknown message?");
Please sign in to comment.
Something went wrong with that request. Please try again.