Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 218 → Rev 219

/DUBwise/trunk/android/AndroidManifest.xml
48,7 → 48,17
</intent-filter>
</activity>
 
<activity android:name=".SettingsActivity"
android:label="@string/app_name"
>
<intent-filter>
 
<action android:name="android.intent.action.MAIN" />
 
</intent-filter>
</activity>
 
 
<activity android:name=".RCDataActivity"
android:label="@string/app_name"
>
/DUBwise/trunk/android/res/layout/settings.xml
0,0 → 1,52
<?xml version="1.0" encoding="utf-8"?>
 
 
 
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
 
 
 
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
 
 
 
<CheckBox android:id="@+id/check_fullscreen"
android:paddingBottom="24sp"
android:paddingTop="24sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fullscreen" />
 
<View
 
android:layout_height="2px"
android:layout_width="fill_parent"
 
android:background="#DDFFDD"
android:layout_marginTop="5dip"
android:layout_marginBottom="5dip"/>
 
 
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:text="Front:"
android:textAppearance="?android:attr/textAppearanceLarge"
android:focusable="true"
/>
</LinearLayout>
 
</ScrollView>
 
 
 
 
/DUBwise/trunk/android/src/org/ligi/android/DUBwise.java
55,8 → 55,8
boolean do_sound;
boolean fullscreen;
MKCommunicator mk;
String[] menu_items = new String[]{"Connection", "Old Interface" , "View On Maps", "Flight Settings","RCData","Motor Test", "About","Quit"};
int[] menu_actions= new int[]{ACTIONID_CONN , ACTIONID_OLDINTERFACE , ACTIONID_MAPS ,ACTIONID_FLIGHTSETTINGS,ACTIONID_RCDATA,ACTIONID_MOTORTEST, ACTIONID_ABOUT , ACTIONID_QUIT };
String[] menu_items = new String[]{"Settings","Connection", "Old Interface" , "View On Maps", "Flight Settings","RCData","Motor Test", "About","Quit"};
int[] menu_actions= new int[]{ACTIONID_SETTINGS,ACTIONID_CONN , ACTIONID_OLDINTERFACE , ACTIONID_MAPS ,ACTIONID_FLIGHTSETTINGS,ACTIONID_RCDATA,ACTIONID_MOTORTEST, ACTIONID_ABOUT , ACTIONID_QUIT };
 
public final static int ACTIONID_CONN=0;
public final static int ACTIONID_MAPS=1;
65,6 → 65,7
public final static int ACTIONID_FLIGHTSETTINGS=4;
public final static int ACTIONID_MOTORTEST=5;
public final static int ACTIONID_RCDATA=6;
public final static int ACTIONID_SETTINGS=7;
public final static int ACTIONID_QUIT=100;
 
SharedPreferences settings;
112,6 → 113,12
switch(menu_actions[position])
{
 
case ACTIONID_SETTINGS:
// setContentView(new ConnectionView(this));
 
startActivity(new Intent(this, SettingsActivity.class));
break;
 
case ACTIONID_CONN:
// setContentView(new ConnectionView(this));
 
/DUBwise/trunk/android/src/org/ligi/android/R.java
20,6 → 20,7
public static final class id {
public static final int cancel_btn=0x7f060004;
public static final int check_autoconn=0x7f060002;
public static final int check_fullscreen=0x7f060015;
public static final int check_fullspeed=0x7f060005;
public static final int edit_host=0x7f060000;
public static final int edit_port=0x7f060001;
44,6 → 45,7
public static final int connection=0x7f030000;
public static final int motortest=0x7f030001;
public static final int rcdata=0x7f030002;
public static final int settings=0x7f030003;
}
public static final class raw {
public static final int voice_sample_01=0x7f040000;
/DUBwise/trunk/android/src/org/ligi/android/SettingsActivity.java
0,0 → 1,79
 
package org.ligi.android;
 
import android.app.ListActivity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
 
import android.util.Log;
 
import android.app.Activity;
import android.os.Bundle;
 
 
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.net.Uri;
 
import java.net.URISyntaxException;
import android.widget.*;
import android.content.DialogInterface;
import android.content.Context.*;
import android.widget.EditText;
import android.text.method.NumberKeyListener;
 
 
import com.google.android.maps.MapView;
 
import android.app.AlertDialog.*;
import android.app.AlertDialog;
 
import android.content.SharedPreferences;
 
import org.ligi.ufo.*;
 
public class SettingsActivity extends Activity
 
{
 
 
CheckBox fullscreen;
 
 
AndroidMKCommunicator mk;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
 
setContentView(R.layout.settings);
 
 
fullscreen=(CheckBox)findViewById( R.id.check_fullscreen);
 
}
@Override
protected void onDestroy()
{
 
super.onDestroy();
 
}
 
 
}
/DUBwise/trunk/android/src/org/ligi/android/SettingsActivity.xml
0,0 → 1,138
 
package org.ligi.android;
 
import android.app.ListActivity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
 
import android.util.Log;
 
import android.app.Activity;
import android.os.Bundle;
 
 
import android.view.View;
import android.widget.ListView;
import android.widget.SimpleAdapter;
 
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import android.net.Uri;
 
import java.net.URISyntaxException;
import android.widget.*;
import android.content.DialogInterface;
import android.content.Context.*;
import android.widget.EditText;
import android.text.method.NumberKeyListener;
 
 
import com.google.android.maps.MapView;
 
import android.app.AlertDialog.*;
import android.app.AlertDialog;
 
import android.content.SharedPreferences;
 
import org.ligi.ufo.*;
 
public class MotorTestActivity extends Activity
implements SeekBar.OnSeekBarChangeListener
{
 
SeekBar seek_right,seek_left,seek_front,seek_back,seek_all;
CheckBox full_speed;
boolean toasted=false;
 
AndroidMKCommunicator mk;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
 
mk= new AndroidMKCommunicator(this);
setContentView(R.layout.motortest);
 
seek_right=(SeekBar)findViewById( R.id.seek_right);
seek_left=(SeekBar)findViewById( R.id.seek_left);
seek_front=(SeekBar)findViewById( R.id.seek_front);
seek_back=(SeekBar)findViewById( R.id.seek_back);
seek_all=(SeekBar)findViewById( R.id.seek_all);
full_speed=(CheckBox)findViewById( R.id.check_fullspeed);
seek_right.setOnSeekBarChangeListener(this);
seek_left.setOnSeekBarChangeListener(this);
seek_front.setOnSeekBarChangeListener(this);
seek_back.setOnSeekBarChangeListener(this);
seek_all.setOnSeekBarChangeListener(this);
// toast=Toast;
toast=toast.makeText(this, "Value too Dangerous - Clipping! Activate 'Allow Full Speed' to Override" + mk.stats.debug_data_count,Toast.LENGTH_LONG );
}
@Override
protected void onDestroy()
{
mk.close_connections(true);
mk=null;
super.onDestroy();
 
}
 
Toast toast;
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromTouch) {
// mProgressText.setText(progress + " " +
// getString(R.string.seekbar_from_touch) + "=" + fromTouch);
if (( progress>50)&&(!full_speed.isChecked()))
{
seekBar.setProgress(50);
progress=50;
toast.show ();
}
else
{
toast.cancel();
}
if (seekBar==seek_all)
{
seek_right.setProgress(progress);
seek_left.setProgress(progress);
seek_front.setProgress(progress);
seek_back.setProgress(progress);
}
 
 
int[] params=new int[4];
params[0] = seek_right.getProgress();
params[1] = seek_left.getProgress();
params[2] = seek_front.getProgress();
params[3] = seek_back.getProgress();
 
 
params[3] = seek_right.getProgress();
params[2] = seek_left.getProgress();
params[0] = seek_front.getProgress();
params[1] = seek_back.getProgress();
 
mk.motor_test(params);
}
 
 
public void onStartTrackingTouch(SeekBar seekBar) {
//mTrackingText.setText(getString(R.string.seekbar_tracking_on));
}
 
public void onStopTrackingTouch(SeekBar seekBar) {
// mTrackingText.setText(getString(R.string.seekbar_tracking_off));
}
 
}
/DUBwise/trunk/j2me/bin/128x128/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-128x128-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 249717
MIDlet-Jar-Size: 251573
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/128x128/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/128x128/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-128x128-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 222981
MIDlet-Jar-Size: 224837
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/128x128/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/128x128/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-128x128-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 235648
MIDlet-Jar-Size: 237504
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/128x128/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/128x128/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-128x128-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 197017
MIDlet-Jar-Size: 198846
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/128x128/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/128x128/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-128x128-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 425973
MIDlet-Jar-Size: 427829
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/128x128/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-128x128-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/176x220/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-176x220-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 291930
MIDlet-Jar-Size: 293786
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/176x220/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/176x220/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-176x220-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 265194
MIDlet-Jar-Size: 267050
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/176x220/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/176x220/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-176x220-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 277861
MIDlet-Jar-Size: 279717
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/176x220/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/176x220/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-176x220-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 239230
MIDlet-Jar-Size: 241059
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/176x220/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/176x220/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-176x220-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 468186
MIDlet-Jar-Size: 470042
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/176x220/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-176x220-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/200x300/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-200x300-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 321073
MIDlet-Jar-Size: 322928
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/200x300/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/200x300/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-200x300-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 294337
MIDlet-Jar-Size: 296192
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/200x300/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/200x300/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-200x300-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 307004
MIDlet-Jar-Size: 308859
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/200x300/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/200x300/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-200x300-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 268379
MIDlet-Jar-Size: 270201
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/200x300/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/200x300/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-200x300-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 497329
MIDlet-Jar-Size: 499184
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/200x300/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-200x300-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/240x320/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-240x320-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 291751
MIDlet-Jar-Size: 293606
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/240x320/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/240x320/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-240x320-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 265015
MIDlet-Jar-Size: 266870
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/240x320/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/240x320/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-240x320-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 277682
MIDlet-Jar-Size: 279537
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/240x320/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/240x320/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-240x320-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 239057
MIDlet-Jar-Size: 240879
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/240x320/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/240x320/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-240x320-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 468007
MIDlet-Jar-Size: 469862
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/240x320/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-240x320-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/340x400/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-340x400-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 390300
MIDlet-Jar-Size: 392155
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/340x400/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/340x400/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-340x400-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 363564
MIDlet-Jar-Size: 365419
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/340x400/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/340x400/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-340x400-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 376231
MIDlet-Jar-Size: 378086
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/340x400/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/340x400/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-340x400-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 337606
MIDlet-Jar-Size: 339428
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/340x400/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/340x400/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-340x400-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 566556
MIDlet-Jar-Size: 568411
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/340x400/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-340x400-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/480x640/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-480x640-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 535081
MIDlet-Jar-Size: 536936
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/480x640/cldc11/de_64kbit_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-de_64kbit_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/480x640/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-480x640-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 508345
MIDlet-Jar-Size: 510200
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/480x640/cldc11/de_tts/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-de_tts-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/480x640/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-480x640-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 521012
MIDlet-Jar-Size: 522867
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/480x640/cldc11/en_speedy/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-en_speedy-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/480x640/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-480x640-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 482387
MIDlet-Jar-Size: 484209
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/480x640/cldc11/no_voice/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-no_voice-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/bin/480x640/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jad
1,5 → 1,5
MIDlet-Jar-URL: DUBwise-480x640-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
MIDlet-Jar-Size: 711337
MIDlet-Jar-Size: 713192
MIDlet-Name: DUBwise
MIDlet-Vendor: LiGi
MIDlet-Version: 0.51
/DUBwise/trunk/j2me/bin/480x640/cldc11/wav/bluetooth_on/fileapi_on/devicecontrol_on/DUBwise-480x640-cldc11-wav-all_firmwares-bluetooth_on-fileapi_on-devicecontrol_on.jar
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/DUBwise/trunk/j2me/build.rb
9,14 → 9,19
resdir="res/"
 
 
puts `mv build.props build.props.bak`
puts `ant clean`
#puts `rm -rf bin`
puts `mkdir bin`
 
 
 
 
 
if ARGV.length==2
bindir=ARGV[1]
else
bindir="bin"
end
 
 
ARGV<<"" if ARGV==[]
 
case ARGV[0]
when "p910"
screensizes=["200x300"]
34,9 → 39,18
fileapi_modes=["on"]
cldc11_modes=["on"]
#firmware_modes=["fc_mk3mag_firmwares"]
#firmware_modes=["all_firmwares"]
firmware_modes=["no_firmwares"]
#firmware_modes=["all_firmwares"]
firmware_modes=["no_firmwares"]
 
when "bltest"
screensizes=["240x320"]
voice_modes=["en_speedy"]
bluetooth_modes=["on"]
devicecontrol_modes=["on"]
fileapi_modes=["on"]
cldc11_modes=["on"]
firmware_modes=["all_firmwares"]
 
when "test2"
screensizes=["176x220"]
voice_modes=["en_speedy"]
91,6 → 105,10
end
 
 
puts `mv build.props build.props.bak`
puts `ant clean`
#puts `rm -rf #{bindir}`
puts `mkdir #{bindir}`
 
 
propertys={}
135,15 → 153,15
 
`ant build`.each_line { |l| puts l }
 
`mkdir -p bin/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}`
`mkdir -p #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}`
 
# `mv build/bin/#{propertys["basename"]}* bin/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}`
# `mv build/bin/#{propertys["basename"]}* #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}`
 
 
 
`mkdir -p bin/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}`
`mkdir -p #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}`
 
`mv build/bin/#{propertys["basename"]}* bin/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}`
`mv build/bin/#{propertys["basename"]}* #{bindir}/#{screensize}/#{cldc11=="on"?"cldc11":"cldc10"}/#{voice_mode}/bluetooth_#{bluetooth}/fileapi_#{fileapi}/devicecontrol_#{devicecontrol}`
}
 
/DUBwise/trunk/j2me/src/DUBwiseCanvas.java
9,7 → 9,6
 
import javax.microedition.lcdui.*;
 
 
import javax.microedition.media.*;
import javax.microedition.media.control.*;
 
237,7 → 236,7
}
 
 
if ((settings.expert_mode)&& ( mk.ufo_prober.is_navi()||mk.ufo_prober.is_mk()||mk.ufo_prober.is_mk3mag()||mk.ufo_prober.is_incompatible() ))
//if ((settings.expert_mode)&& ( mk.ufo_prober.is_navi()||mk.ufo_prober.is_mk()||mk.ufo_prober.is_mk3mag()||mk.ufo_prober.is_incompatible() ))
{
tmp_actions[setup_pos]=ACTIONID_FLASH;
tmp_items[setup_pos++] ="Flash Firmware";
266,6 → 265,7
tmp_actions_fin[tmp_p]=tmp_actions[tmp_p];
tmp_items_fin[tmp_p] =tmp_items[tmp_p];
}
act_menu_select=0;
setup_menu(tmp_items_fin,tmp_actions_fin);
}
 
518,7 → 518,7
}
break;
case STATEID_KEYCONTROL:
mk.send_keys(keycontrol_bitfield);
//mk.send_keys(keycontrol_bitfield);
break;
case STATEID_NC_ERRORS:
771,9 → 771,10
}
 
int symbol_left=0;
int symbol_spacer=5;
 
g.setClip(symbol_left,0,(symbols_img.getWidth()/10),symbols_img.getHeight());;
if ((mk.ufo_prober.is_navi()||mk.ufo_prober.is_mk()))
if (mk.connected)
{
 
if (((mk.stats.bytes_in>>3)&1)==1)
782,8 → 783,22
g.drawImage(symbols_img,(-3)*(symbols_img.getWidth()/10),0, g.TOP | g.LEFT);
 
int symbol_spacer=5;
 
symbol_left+=symbol_spacer+(symbols_img.getWidth()/10);
 
 
}
else
g.drawImage(symbols_img,(-1)*(symbols_img.getWidth()/10),0, g.TOP | g.LEFT);
 
 
 
 
 
 
if ((mk.ufo_prober.is_navi()||mk.ufo_prober.is_mk()))
{
 
g.setClip(symbol_left,0,(symbols_img.getWidth()/10),symbols_img.getHeight());;
 
g.drawImage(symbols_img,symbol_left+(-4)*(symbols_img.getWidth()/10),0, g.TOP | g.LEFT);
823,8 → 838,6
 
}
 
else
g.drawImage(symbols_img,(-1)*(symbols_img.getWidth()/10),0, g.TOP | g.LEFT);
 
// if (mk.connected)
 
961,11 → 974,12
break;
 
case STATEID_FLASHING:
g.setFont(f2);
int msg_pos=0;
while (mk.flash_msgs[msg_pos]!=null)
{
g.drawString(mk.flash_msgs[msg_pos] ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
y_off+=spacer1;
msg_pos++;
}
break;
993,24 → 1007,29
 
case STATEID_KEYCONTROL:
 
 
y_off+=spacer;
g.drawString("UP&DOWN => nick",0,y_off,Graphics.TOP | Graphics.LEFT);
g.drawString("UP&DOWN => nick " + mk.extern_control[EXTERN_CONTROL_NICK],0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.drawString("LEFT&RIGHT => roll",0,y_off,Graphics.TOP | Graphics.LEFT);
g.drawString("LEFT&RIGHT => roll " + mk.extern_control[EXTERN_CONTROL_ROLL],0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.drawString("1&4 => altitude",0,y_off,Graphics.TOP | Graphics.LEFT);
g.drawString("1&4 => altitude " + mk.extern_control[EXTERN_CONTROL_HIGHT],0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer;
g.drawString("2&3 => gier",0,y_off,Graphics.TOP | Graphics.LEFT);
g.drawString("2&3 => gier " + mk.extern_control[EXTERN_CONTROL_GIER],0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer;
g.drawString("6&9 => gas " + mk.extern_control[EXTERN_CONTROL_GAS],0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer;
g.drawString("Press # and * at once",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.drawString("to quit KeyControl",0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
g.drawString("bf1:"+ keycontrol_bitfield[0] ,0,y_off,Graphics.TOP | Graphics.LEFT);
g.drawString("bf2:"+ keycontrol_bitfield[1] ,canvas_width/2,y_off,Graphics.TOP | Graphics.LEFT);
 
g.drawString("sent:" + mk.stats.external_control_request_count +"confirm:" + mk.stats.external_control_confirm_frame_count,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer;
// g.drawString("bf1:"+ keycontrol_bitfield[0] ,0,y_off,Graphics.TOP | Graphics.LEFT);
//g.drawString("bf2:"+ keycontrol_bitfield[1] ,canvas_width/2,y_off,Graphics.TOP | Graphics.LEFT);
break;
 
1123,19 → 1142,24
 
g.drawString( " debug:"+mk.stats.debug_data_count+ " LCD:" + mk.stats.lcd_data_count + " vers:" + mk.stats.version_data_count,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
g.drawString( " other:"+mk.stats.other_data_count+" params:"+mk.stats.params_data_count + " GPS:"+mk.stats.navi_data_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
g.drawString( " rc:"+mk.stats.stick_data_count+" params:"+mk.stats.params_data_count + " GPS:"+mk.stats.navi_data_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
g.drawString( " debug_names:" + mk.stats.debug_names_count + " angles:" + mk.stats.angle_data_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
 
 
g.drawString( " other:"+mk.stats.other_data_count,0,y_off,Graphics.TOP | Graphics.LEFT);
 
y_off+=spacer1+3;
g.drawString( "<<out:"+mk.stats.bytes_out + " bytes =>" + mk.stats.bytes_out/mk.conn_time_in_s() + "bytes/s", 0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
g.drawString( " LCD:" + mk.stats.lcd_data_request_count + " vers:" + mk.stats.version_data_request_count,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
g.drawString( " params:"+mk.stats.params_data_request_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
g.drawString( " params:"+mk.stats.params_data_request_count +" rc:" + mk.stats.stick_data_request_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
g.drawString( " resend:"+mk.stats.resend_count ,0,y_off,Graphics.TOP | Graphics.LEFT);
y_off+=spacer1;
 
paint_menu(g);
break;
 
1341,7 → 1365,7
 
// int intro_str_pos=0;
// int intro_str_delay=3;
boolean init_bootloader=false;
// boolean init_bootloader=false;
 
public void chg_state(byte next_state)
{
1360,7 → 1384,8
break;
case STATEID_FLASHING:
mk.bootloader_intension_flash=true;
init_bootloader=true;
mk.bl_retrys=0;
mk.init_bootloader=true;
break;
 
//#if fileapi=="on"
1501,6 → 1526,7
 
break;
case STATEID_KEYCONTROL:
mk.user_intent= USER_INTENT_EXTERNAL_CONTROL;
keycontrol_exit=0;
break;
 
1619,38 → 1645,11
if (keyCode==KEY_STAR)
keycontrol_exit &= 255^2;
else
if ((keyCode >= this.KEY_NUM0) && (keyCode < this.KEY_NUM8))
keycontrol_bitfield[0]&=255^( 1<<(keyCode-this.KEY_NUM0));
else
if ((keyCode >= this.KEY_NUM8) && (keyCode <= this.KEY_NUM9))
keycontrol_bitfield[1]&=255^( 1<<(keyCode-this.KEY_NUM8));
else
switch (getGameAction (keyCode))
{
case UP:
keycontrol_bitfield[1]&=255^4;
break;
case DOWN:
keycontrol_bitfield[1]&=255^8;
break;
mod_external_control_by_keycode(keyCode,(byte)0);
 
case LEFT:
keycontrol_bitfield[1]&=255^16;
break;
 
case RIGHT:
keycontrol_bitfield[1]&=255^32;
break;
case FIRE:
keycontrol_bitfield[1]&=255^64;
break;
 
}
/*
mk.send_keys(keycontrol_bitfield);
*/
break;
}
 
1657,9 → 1656,58
}
 
 
public void mod_external_control_by_keycode(int keyCode,byte mul)
{
 
if (keyCode==this.KEY_NUM2)
mk.extern_control[EXTERN_CONTROL_GIER]=(byte)(-mul*settings.default_extern_control[EXTERN_CONTROL_GIER]);
else if (keyCode==this.KEY_NUM3)
mk.extern_control[EXTERN_CONTROL_GIER]=(byte)(mul*settings.default_extern_control[EXTERN_CONTROL_GIER]);
 
else if (keyCode==this.KEY_NUM1)
mk.extern_control[EXTERN_CONTROL_HIGHT]+=mul;
else if (keyCode==this.KEY_NUM4)
mk.extern_control[EXTERN_CONTROL_HIGHT]-=mul;
 
 
else if (keyCode==this.KEY_NUM6)
{ if ( mk.extern_control[EXTERN_CONTROL_GAS]<255) mk.extern_control[EXTERN_CONTROL_GAS]+=mul; }
else if (keyCode==this.KEY_NUM9)
{ if ( mk.extern_control[EXTERN_CONTROL_GAS]>0) mk.extern_control[EXTERN_CONTROL_GAS]-=mul; }
 
else switch (getGameAction (keyCode))
{
case UP:
mk.extern_control[EXTERN_CONTROL_NICK]=(byte)(mul*settings.default_extern_control[EXTERN_CONTROL_NICK]);
break;
case DOWN:
mk.extern_control[EXTERN_CONTROL_NICK]=(byte)(-mul*settings.default_extern_control[EXTERN_CONTROL_NICK]);
 
break;
case LEFT:
mk.extern_control[EXTERN_CONTROL_ROLL]=(byte)(mul*settings.default_extern_control[EXTERN_CONTROL_ROLL]);
break;
case RIGHT:
mk.extern_control[EXTERN_CONTROL_ROLL]=(byte)(-mul*settings.default_extern_control[EXTERN_CONTROL_ROLL]);
break;
case FIRE:
 
break;
}
 
}
 
// to check if 2 keys are pressed
byte keycontrol_exit=0;
public final static int[] keycontrol_bitfield={0,0};
// public final static int[] keycontrol_bitfield={0,0};
 
 
public void pointerPressed (int pointer_x, int pointer_y)
1706,14 → 1754,6
debug.process_key(keyCode);
if ((keyCode==KEY_NUM9))
{ chg_state(STATEID_STRINGINPUT); }
 
 
 
 
if (((keyCode==KEY_STAR) || (keyCode==113) ))//&&(state!= STATEID_STRINGINPUT))
{
if (state==STATEID_EDIT_PARAMS)
1927,6 → 1967,14
if (keyCode==KEY_STAR)
keycontrol_exit |= 2;
else
mod_external_control_by_keycode(keyCode,(byte)1);
 
 
 
if (keycontrol_exit==3)
chg_state(STATEID_MAINMENU);
 
/*
if ((keyCode >= this.KEY_NUM0) && (keyCode < this.KEY_NUM8))
keycontrol_bitfield[0]|=1<<(keyCode-this.KEY_NUM0);
else
1958,10 → 2006,9
break;
 
}
if (keycontrol_exit==3)
chg_state(STATEID_MAINMENU);
else
mk.send_keys(keycontrol_bitfield);
*/
break;
 
 
2115,7 → 2162,8
case ACTIONID_RESET_PARAMS:
state=STATEID_FLASHING;
mk.bootloader_intension_flash=false;
init_bootloader=true;
mk.bl_retrys=0;
mk.init_bootloader=true;
break;
 
case ACTIONID_FLASH:
/DUBwise/trunk/j2me/src/DUBwiseSettings.java
36,6 → 36,7
public byte speed_format=SPEED_FORMAT_KMH;
 
 
public byte[] default_extern_control=default_extern_keycontrol ;
 
//#if devicecontrol=="on"
public boolean keep_lighton=false;
/DUBwise/trunk/j2me
Property changes:
Modified: svn:ignore
tmp
build
+bin_tmp
*.tmp
/DUBwise/trunk/shared/src/DUBwiseDefinitions.java
4,19 → 4,49
public interface DUBwiseDefinitions
{
 
public final static byte USER_INTENT_NONE=0;
public final static byte USER_INTENT_RAWDEBUG=1;
public final static byte USER_INTENT_PARAMS=2;
public final static byte USER_INTENT_GRAPH=3;
public final static byte USER_INTENT_RCDATA=4;
public final static byte USER_INTENT_LCD=5;
public final static byte USER_INTENT_NONE =0;
public final static byte USER_INTENT_RAWDEBUG =1;
public final static byte USER_INTENT_PARAMS =2;
public final static byte USER_INTENT_GRAPH =3;
public final static byte USER_INTENT_RCDATA =4;
public final static byte USER_INTENT_LCD =5;
public final static byte USER_INTENT_EXTERNAL_CONTROL =6;
 
 
public final static byte GPS_FORMAT_DECIMAL=0;
public final static byte GPS_FORMAT_MINSEC=1;
public final static byte GPS_FORMAT_DECIMAL =0;
public final static byte GPS_FORMAT_MINSEC =1;
 
 
public final static byte SPEED_FORMAT_KMH=0; // km/h
public final static byte SPEED_FORMAT_MPH=1; // miles/h
public final static byte SPEED_FORMAT_CMS=2; // cm/s
public final static byte SPEED_FORMAT_KMH =0; // km/h
public final static byte SPEED_FORMAT_MPH =1; // miles/h
public final static byte SPEED_FORMAT_CMS =2; // cm/s
 
 
 
/* from uart.h
unsigned char Digital[2];
unsigned char RemoteTasten;
signed char Nick;
signed char Roll;
signed char Gier;
unsigned char Gas;
signed char Hight;
unsigned char free;
unsigned char Frame;
unsigned char Config;
*/
 
public final static byte EXTERN_CONTROL_NICK =3;
public final static byte EXTERN_CONTROL_ROLL =4;
public final static byte EXTERN_CONTROL_GIER =5;
public final static byte EXTERN_CONTROL_GAS =6;
public final static byte EXTERN_CONTROL_HIGHT =7;
public final static byte EXTERN_CONTROL_FRAME =9;
public final static byte EXTERN_CONTROL_CONFIG =10;
 
public final static byte EXTERN_CONTROL_LENGTH =11;
 
public final static byte EXTERN_CONTROL_DEFAULT =42;
 
public final static byte[] default_extern_keycontrol = { (byte)0, (byte)0, (byte)0, (byte)EXTERN_CONTROL_DEFAULT, (byte)EXTERN_CONTROL_DEFAULT, (byte)EXTERN_CONTROL_DEFAULT, (byte)255 , (byte)0, (byte)0, (byte)1, (byte)1 };
}
/DUBwise/trunk/shared/src/MKCommunicator.java
27,11 → 27,13
 
 
public class MKCommunicator
implements Runnable
implements Runnable,DUBwiseDefinitions
{
public byte bl_retrys=0;
public boolean init_bootloader=false;
 
public byte lib_version_major=0;
public byte lib_version_minor=1;
public byte lib_version_minor=3;
 
public String lib_version_str()
{
54,50 → 56,51
int data_buff_pos=0;
 
public byte user_intent=0;
public final static int[] crc16_table = {
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,
0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE,
0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485,
0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D,
0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4,
0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC,
0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823,
0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B,
0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12,
0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A,
0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41,
0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49,
0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70,
0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78,
0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F,
0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067,
0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E,
0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256,
0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D,
0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C,
0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634,
0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB,
0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3,
0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A,
0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92,
0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9,
0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1,
0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8,
0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0
};
public final static int[] crc16_table = {
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,
0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE,
0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485,
0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D,
0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4,
0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC,
0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823,
0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B,
0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12,
0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A,
0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41,
0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49,
0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70,
0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78,
0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F,
0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067,
0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E,
0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256,
0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D,
0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C,
0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634,
0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB,
0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3,
0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A,
0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92,
0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9,
0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1,
0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8,
0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0
};
 
public void log(String str)
{
//#ifdef android
if (do_log) Log.d("MK-Comm",str);
if (do_log) Log.d("MK-Comm",str);
//#endif
}
 
public int CRC16(int ch, int crc)
{ return crc16_table[((crc >> 8) ^ (ch)) & 0xFF] ^ (crc << 8);
{
return crc16_table[((crc >> 8) ^ (ch)) & 0xFF] ^ (crc << 8);
}
 
 
108,15 → 111,17
else
return 0;
}
public final static int BOOTLOADER_STAGE_NONE=0;
public final static int BOOTLOADER_STAGE_GOT_MKBL=1;
public final static byte BOOTLOADER_STAGE_NONE=0;
public final static byte BOOTLOADER_STAGE_GOT_MKBL=1;
 
int bootloader_stage= BOOTLOADER_STAGE_NONE;
byte bootloader_stage= BOOTLOADER_STAGE_NONE;
 
public MKLCD LCD;
public MKVersion version;
public MKDebugData debug_data;
 
public int[] extern_control;
 
public MKGPSPosition gps_position;
 
public MKStickData stick_data;
178,6 → 183,10
debug_data=new MKDebugData();
stick_data=new MKStickData();
params=new MKParamsParser();
extern_control=new int[EXTERN_CONTROL_LENGTH];
extern_control[EXTERN_CONTROL_CONFIG]=1;
extern_control[EXTERN_CONTROL_FRAME]=1;
LCD= new MKLCD(this);
watchdog=new MKWatchDog(this);
gps_position=new MKGPSPosition();
231,7 → 240,7
 
age%=DATA_BUFF_LEN;
if (age<=data_buff_pos)
if (age<=data_buff_pos)
return ""+data_buff[data_buff_pos-age];
else
return ""+data_buff[DATA_BUFF_LEN+data_buff_pos-age];
355,11 → 364,19
send_command(FC_SLAVE_ADDR,'t',params);
}
 
public void send_keys(int[] params)
 
public void send_extern_control()
{
send_command(FC_SLAVE_ADDR,'k',params);
 
stats.external_control_request_count++;
send_command(FC_SLAVE_ADDR,'b',extern_control);
}
 
/* public void send_keys(int[] params)
{
send_command(FC_SLAVE_ADDR,'k',params);
}*/
// get params
public void get_params(int id)
{
457,6 → 474,8
flash_msgs[msg_pos]="attempt "+attempt;
attempt++;
send_command_nocheck((byte)FC_SLAVE_ADDR,'R',new int[0]);
try{
writer.write( 27);
writer.flush();
 
464,7 → 483,8
writer.write( 0xAA);
writer.flush();
 
}
catch (Exception e) { }
sleep((attempt%2==0)?80:800); //800
}
msg_pos++;
563,7 → 583,6
// send command to FC ( add crc and pack into pseudo Base64
public void send_command(int modul,char cmd,int[] params)
{
 
// if (modul==0) return;
sending=true;
send_command_nocheck((byte)modul,cmd,params);
612,6 → 631,10
debug_data.set_names_by_mk_data(Decode64(data,3,len-3));
break;
 
case 'B': // external_control confirm frames
stats.external_control_confirm_frame_count++;
break;
 
case 'L': // LCD Data
stats.lcd_data_count++;
LCD.handle_lcd_data(Decode64(data,3,len-3));
722,7 → 745,7
//# catch (Exception inner_ex) { }
//#endif
ufo_prober.set_to_none();
stats.reset();
stats.reset();
connected=false;
version=new MKVersion();
}
730,7 → 753,7
// Thread to recieve data from Connection
public void run()
{
 
boolean sigfail=false;
if (bootloader_stage==BOOTLOADER_STAGE_GOT_MKBL)
{
try {
740,6 → 763,10
writer.flush();
int avr_sig=reader.read();
 
while (avr_sig==63)
avr_sig=reader.read();
 
flash_msgs[msg_pos++]="got avr sig " + avr_sig;
 
 
747,7 → 774,10
throw new Exception("val after avrsig isnt 0");
 
if ((avr_sig!=0x74)&&(avr_sig!=224)&&(avr_sig!=120))
throw new Exception("avr sig" + avr_sig + " unknown");
{
sigfail=true;
throw new Exception("avr sig" + avr_sig + " unknown");
}
writer.write('T');
// writer.flush();
779,101 → 809,106
flash_msgs[msg_pos++]="BUFF Size:" + send_buff_size;
// if (send_buff_size>128)
// send_buff_size=128;
if (bootloader_intension_flash)
{
 
byte[] flash_buff =new byte[send_buff_size]; ///!!
 
 
flash_msgs[msg_pos++]="Opening firmware ..";
 
 
InputStream in;
try {
in=this.getClass().getResourceAsStream((avr_sig==224)?"/navi.bin":((avr_sig==120)?"mk3.bin":"/fc.bin"));
}
catch (Exception e) { throw new Exception(" cant open firmware"); }
 
 
int firmware_size= ((int)in.read()<<24) |((int)in.read()<<16) | ((int)in.read()<<8) | ((int)in.read()&0xff) ;
 
flash_msgs[msg_pos++]=".. open with " + firmware_size + "bytes";
 
 
 
// if (true) throw new Exception("before erasing" );
 
flash_msgs[msg_pos++]="Erasing Flash ..";
writer.write('e');
writer.flush();
 
if (reader.read()!=0x0d)
throw new Exception("cant erase flash");
 
flash_msgs[msg_pos]+="OK";
 
 
writer.write('A');
writer.write(0);
writer.write(0);
writer.flush();
 
if (reader.read()!=0x0d)
throw new Exception("cant set addr");
flash_msgs[msg_pos++]="addr set";
 
 
int blocks2write=((firmware_size/send_buff_size));
if ((firmware_size%send_buff_size)>0)
blocks2write++;
 
for ( int block=0; block<blocks2write; block ++)
{
int hex_bytes_read=in.read(flash_buff,0,send_buff_size);
if (bootloader_intension_flash)
{
flash_msgs[msg_pos]="bl:" + block + "/" + blocks2write + " si:"+hex_bytes_read ;
 
 
writer.write('B');
writer.write((hex_bytes_read>>8)& 0xFF);
writer.write((hex_bytes_read)& 0xFF);
writer.write('F');
byte[] flash_buff =new byte[send_buff_size]; ///!!
String firmware_filename=(avr_sig==224)?"/navi.bin":((avr_sig==120)?"/mk3.bin":"/fc.bin");
flash_msgs[msg_pos++]="Opening firmware " + firmware_filename + "..";
InputStream in;
try {
in=this.getClass().getResourceAsStream(firmware_filename);
}
catch (Exception e) { throw new Exception(" .. cant open firmware"); }
int firmware_size=-1;
try {
firmware_size= ((int)in.read()<<24) |((int)in.read()<<16) | ((int)in.read()<<8) | ((int)in.read()&0xff) ;
}
catch (Exception e) { throw new Exception(" .. cant read size"); }
int blocks2write=((firmware_size/send_buff_size));
flash_msgs[msg_pos++]=".. open("+blocks2write+" blocks," + firmware_size + "bytes)";
// if (true) throw new Exception("before erasing");
// if (true) throw new Exception("before erasing" );
flash_msgs[msg_pos++]="Erasing Flash ..";
writer.write('e');
writer.flush();
 
writer.write(flash_buff,0,hex_bytes_read);
writer.flush();
 
if (avr_sig==224)
if (reader.read()!=0x0d)
throw new Exception("cant erase flash");
flash_msgs[msg_pos]+="OK";
writer.write('A');
writer.write(0);
writer.write(0);
writer.flush();
if (reader.read()!=0x0d)
throw new Exception("cant set addr");
flash_msgs[msg_pos++]="addr set";
// int blocks2write=((firmware_size/send_buff_size));
if ((firmware_size%send_buff_size)>0)
blocks2write++;
for ( int block=0; block<blocks2write; block ++)
{
int crc=0xFFFF;
for (int crc_pos=0;crc_pos<hex_bytes_read;crc_pos++)
crc=CRC16(flash_buff[crc_pos],crc);
writer.write(crc>>8);
writer.write(crc&0xff);
writer.flush();
}
int hex_bytes_read=in.read(flash_buff,0,send_buff_size);
flash_msgs[msg_pos]="bl:" + block + "/" + blocks2write + " si:"+hex_bytes_read ;
writer.write('B');
writer.write((hex_bytes_read>>8)& 0xFF);
writer.write((hex_bytes_read)& 0xFF);
writer.write('F');
writer.flush();
writer.write(flash_buff,0,hex_bytes_read);
writer.flush();
if (avr_sig==224)
{
int crc=0xFFFF;
for (int crc_pos=0;crc_pos<hex_bytes_read;crc_pos++)
crc=CRC16(flash_buff[crc_pos],crc);
writer.write(crc>>8);
writer.write(crc&0xff);
writer.flush();
}
// flash_msgs[msg_pos]+="ok";
// writer.flush();
 
 
if (reader.read()!=0x0d)
throw new Exception("abort write at block"+block);
// sleep(1000);
}
// flash_msgs[msg_pos]="bl:" + block + "/" + blocks2write + " si:"+hex_bytes_read ;
/*
 
if (reader.read()!=0x0d)
throw new Exception("abort write at block"+block);
// sleep(1000);
}
// flash_msgs[msg_pos]="bl:" + block + "/" + blocks2write + " si:"+hex_bytes_read ;
/*
int inp=0;
int block=0;
while (inp!=-1)
993,10 → 1028,12
flash_msgs[msg_pos++]="cant exit bootloader" ;
}
flash_msgs[msg_pos++]="Exit BL done" ;
 
 
 
close_connections(false);
if (sigfail&&(bl_retrys<3))
{
bl_retrys++;
init_bootloader=true;
}
close_connections(false);
}
 
 
/DUBwise/trunk/shared/src/MKStatistics.java
9,8 → 9,6
 
package org.ligi.ufo;
 
 
 
public class MKStatistics
 
{
19,6 → 17,8
public int bytes_out=0;
 
 
public int resend_count=0;
 
public int debug_data_count=0;
public int debug_names_count=0;
public int angle_data_count=0;
28,6 → 28,7
public int params_data_count=0;
public int navi_data_count=0;
public int stick_data_count=0;
public int external_control_confirm_frame_count=0;
 
 
public int debug_data_request_count=0;
38,7 → 39,9
// public int navi_data_count=0;
public int stick_data_request_count=0;
public int motortest_request_count=0;
public int external_control_request_count=0;
 
 
public void reset()
{
 
/DUBwise/trunk/shared/src/MKWatchDog.java
34,10 → 34,25
int last_count=0;
 
 
public boolean resend_check(int ref_count)
{
if (( last_count!=ref_count)||(resend_timeout<0))
{
if (resend_timeout<0) mk.stats.resend_count++;
last_count=ref_count;
resend_timeout=20;
return true;
}
else
resend_timeout--;
return false;
}
 
//#ifdef android
// public final static int BASE_SLEEP=50;
//#else
public final static int BASE_SLEEP=40;
public final static int BASE_SLEEP=10;
//#endif
 
public void run()
45,22 → 60,22
mk.log("starting Watchdog");
// get all params
int act_debug_name=0;
int sleeper=BASE_SLEEP;
// int sleeper=BASE_SLEEP;
while(true)
{
try {
Thread.sleep(sleeper);
sleeper=BASE_SLEEP;
Thread.sleep(BASE_SLEEP);
// sleeper=BASE_SLEEP;
if (mk.connected&&(!mk.force_disconnect))
{
 
mk.log("watchdog pre main loop");
/* if (mk.root.canvas.init_bootloader)
if (mk.init_bootloader)
{
mk.jump_bootloader();
mk.root.canvas.init_bootloader=false;
mk.init_bootloader=false;
}
else */if ( mk.version.major==-1 )
else if ( mk.version.major==-1 )
mk.get_version();
else if (mk.ufo_prober.is_navi()&&(mk.error_str==null))
mk.get_error_str();
68,7 → 83,8
else if (mk.ufo_prober.is_mk()&&(mk.params.last_parsed_paramset==-1))
{
mk.get_params(0xFF-1);
sleeper+=150;
Thread.sleep(150);
 
act_paramset=0; // warning - if dropped problem
}
else switch (mk.user_intent)
126,26 → 142,21
break;
 
case USER_INTENT_RCDATA:
mk.trigger_rcdata();
sleeper+=250;
if ( resend_check(mk.stats.stick_data_count) )
mk.trigger_rcdata();
break;
 
case USER_INTENT_EXTERNAL_CONTROL:
if (resend_check(mk.stats.external_control_confirm_frame_count))
mk.send_extern_control();
 
break;
 
case USER_INTENT_LCD:
if (resend_timeout==0)
{
if (resend_check(mk.stats.lcd_data_count))
mk.LCD.trigger_LCD();
resend_timeout=50;
}
if ( last_count!=mk.stats.lcd_data_count)
{
mk.LCD.trigger_LCD();
resend_timeout=50;
}
else
resend_timeout--;
//sleeper +=250;
 
break;
 
default: