|
@@ -1218,22 +1218,31 @@ public class BaristaService extends IntentService implements SharedPreferences.O
|
|
|
|
|
|
void do_firmware_2( String firmware_file ) {
|
|
void do_firmware_2( String firmware_file ) {
|
|
|
|
|
|
|
|
+ Logx logx = new Logx( ma, ma.getBaseContext() );
|
|
|
|
+
|
|
if( connected_os == null || connected_is == null ) {
|
|
if( connected_os == null || connected_is == null ) {
|
|
|
|
|
|
Log.i(TAG, "do_firmware_2 - aborted, no connection");
|
|
Log.i(TAG, "do_firmware_2 - aborted, no connection");
|
|
|
|
|
|
|
|
+ logx.logcat("No device connected.", "v");
|
|
|
|
+
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
Log.i(TAG, "do_firmware_2 - nieuwe stijl");
|
|
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 )
|
|
if( bt2 != null )
|
|
bt2.discover_stop( );
|
|
bt2.discover_stop( );
|
|
|
|
|
|
load_firmware(firmware_file);
|
|
load_firmware(firmware_file);
|
|
|
|
|
|
- Logx logx = new Logx( ma, ma.getBaseContext() );
|
|
|
|
-
|
|
|
|
// First reset enable might cause a reset
|
|
// First reset enable might cause a reset
|
|
Log.i( TAG, "First reset" );
|
|
Log.i( TAG, "First reset" );
|
|
write_flush_sleep("\ncmd reset en\n", 5000);
|
|
write_flush_sleep("\ncmd reset en\n", 5000);
|