1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-02 10:24:11 +01:00

AndroidGCS: Cleanup for some debugging output in telemetry. Make

uppdateRequested() a public method so anything can request a UAVO update.
This commit is contained in:
James Cotton 2012-08-05 16:11:40 -05:00
parent 1d387a2082
commit 3be2485b5e
4 changed files with 9 additions and 19 deletions

View File

@ -135,7 +135,6 @@ public class OPTelemetryService extends Service {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(OPTelemetryService.this); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(OPTelemetryService.this);
if(prefs.getBoolean("autoconnect", false)) { if(prefs.getBoolean("autoconnect", false)) {
Toast.makeText(getApplicationContext(), "Should auto connect", Toast.LENGTH_SHORT).show();
Message msg = mServiceHandler.obtainMessage(); Message msg = mServiceHandler.obtainMessage();
msg.arg1 = MSG_CONNECT; msg.arg1 = MSG_CONNECT;
msg.arg2 = 0; msg.arg2 = 0;

View File

@ -457,8 +457,6 @@ public class Telemetry {
if ( objInfo.obj.getObjID() != objMngr.getObject("GCSTelemetryStats").getObjID() ) if ( objInfo.obj.getObjID() != objMngr.getObject("GCSTelemetryStats").getObjID() )
{ {
if (DEBUG) Log.d(TAG,"transactionCompleted(false) due to receiving object not GCSTelemetryStats while not connected."); if (DEBUG) Log.d(TAG,"transactionCompleted(false) due to receiving object not GCSTelemetryStats while not connected.");
System.out.println(gcsStatsObj.toString());
System.out.println(objInfo.obj.toString());
objInfo.obj.transactionCompleted(false); objInfo.obj.transactionCompleted(false);
return; return;
} }

View File

@ -113,7 +113,7 @@ public abstract class UAVObject {
updateRequestedListeners.addObserver(o); updateRequestedListeners.addObserver(o);
} }
} }
void updateRequested() { public void updateRequested() {
synchronized(updateRequestedListeners) { synchronized(updateRequestedListeners) {
updateRequestedListeners.event(); updateRequestedListeners.event();
} }

View File

@ -182,22 +182,15 @@ public class UAVTalk extends Observable {
try { try {
// inStream.wait(); // inStream.wait();
val = inStream.read(); val = inStream.read();
} /* } catch (IOException e) {
* catch (InterruptedException e) { // TODO Auto-generated catch // TODO Auto-generated catch block
* block System.out.println("Connection was aborted\n"); e.printStackTrace();
* e.printStackTrace(); break; } return false;
*/catch (IOException e) { }
// TODO Auto-generated catch block if (val == -1) {
System.out.println("Error reading from stream\n"); return false;
e.printStackTrace(); }
return false;
}
if (val == -1) {
System.out.println("End of stream, terminating processInputStream thread");
return false;
}
//System.out.println("Received byte " + val + " in state + " + rxState);
processInputByte(val); processInputByte(val);
return true; return true;
} }