|
@@ -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);
|