Browse Source

V39, merged shottimer fix

Info @ meCoffee 2 months ago
parent
commit
9d116f937b
3 changed files with 16 additions and 7 deletions
  1. 2 2
      AndroidManifest.xml
  2. 3 3
      res/xml/preference.xml
  3. 11 2
      src/nl/digitalthings/mebarista/BaristaService.java

+ 2 - 2
AndroidManifest.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="nl.digitalthings.mebarista"
-    android:versionCode="37"
-    android:versionName="v7.beta37" >
+    android:versionCode="39"
+    android:versionName="v7.beta39" >
 
     <uses-sdk
         android:minSdkVersion="11"

+ 3 - 3
res/xml/preference.xml

@@ -768,13 +768,13 @@
                 android:summary="Running version: %s"
                 />
 
-            <!-- nl.digitalthings.mebarista.EditTextPreferenceWithSummary
+            <nl.digitalthings.mebarista.EditTextPreferenceWithSummary
                 android:id="@+id/pref_fw_pin"
                 android:key="pref_fw_pin"
                 android:defaultValue=""
                 android:title="Pin code required for flashing"
                 android:summary="'%s'"
-                / -->
+                />
 
             <SwitchPreference
                 android:id="@+id/pref_support_fw_enable"
@@ -810,7 +810,7 @@
             <Preference android:title="Flash firmware V10 ( newest )"
                 android:summary="When selected, meBarista will reflash your espresso machine. Read help section first."
                 android:dependency="pref_support_fw_enable"
-                android:enabled="false">
+                android:enabled="true">
 
                 <intent android:targetPackage="nl.digitalthings.mebarista"
                     android:targetClass="nl.digitalthings.mebarista.MainActivity"

+ 11 - 2
src/nl/digitalthings/mebarista/BaristaService.java

@@ -1218,22 +1218,31 @@ public class BaristaService extends IntentService implements SharedPreferences.O
 
     void do_firmware_2( String firmware_file ) {
 
+        Logx logx = new Logx( ma, ma.getBaseContext() );
+
         if( connected_os == null || connected_is == null ) {
 
             Log.i(TAG, "do_firmware_2 - aborted, no connection");
 
+            logx.logcat("No device connected.", "v");
+
             return;
         }
 
         Log.i(TAG, "do_firmware_2 - nieuwe stijl");
 
+        SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(ma);
+        if ( !settings.getString( "pref_fw_pin", "" ).equals( "6502" ) ) {
+            logx.logcat("No soup for you: pincode not correct", "v");
+
+            return;
+        }
+
         if( bt2 != null )
             bt2.discover_stop( );
 
         load_firmware(firmware_file);
 
-        Logx logx = new Logx( ma, ma.getBaseContext() );
-
         // First reset enable might cause a reset
         Log.i( TAG, "First reset" );
         write_flush_sleep("\ncmd reset en\n", 5000);