mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-30 08:24:11 +01:00
Enable some debugging statements
This commit is contained in:
parent
3445cafb0a
commit
3bcfeca77c
@ -17,7 +17,7 @@ public class TcpUAVTalk {
|
||||
public static boolean DEBUG = LOGLEVEL > 0;
|
||||
|
||||
// Temporarily define fixed device name
|
||||
public final static String IP_ADDRESS = "127.0.0.1";
|
||||
public final static String IP_ADDRESS = "10.21.18.120";
|
||||
public final static int PORT = 9001;
|
||||
|
||||
private UAVTalk uavTalk;
|
||||
@ -47,7 +47,7 @@ public class TcpUAVTalk {
|
||||
|
||||
|
||||
private boolean openTelemetryTcp(UAVObjectManager objMngr) {
|
||||
Log.d(TAG, "Opening conncetion to " + IP_ADDRESS);
|
||||
Log.d(TAG, "Opening conncetion to " + IP_ADDRESS + " at address " + PORT);
|
||||
|
||||
InetAddress serverAddr = null;
|
||||
try {
|
||||
|
@ -17,7 +17,7 @@ import android.util.Log;
|
||||
public class Telemetry {
|
||||
|
||||
private final String TAG = "Telemetry";
|
||||
public static int LOGLEVEL = 0;
|
||||
public static int LOGLEVEL = 2;
|
||||
public static boolean WARN = LOGLEVEL > 1;
|
||||
public static boolean DEBUG = LOGLEVEL > 0;
|
||||
|
||||
|
@ -185,7 +185,8 @@ public class TelemetryMonitor extends Observable{
|
||||
// Force update if not yet connected
|
||||
gcsStatsObj = objMngr.getObject("GCSTelemetryStats");
|
||||
flightStatsObj = objMngr.getObject("FlightTelemetryStats");
|
||||
|
||||
if (DEBUG) Log.d(TAG,"GCS Status: " + gcsStatsObj.getField("Status").getValue());
|
||||
if (DEBUG) Log.d(TAG,"Flight Status: " + flightStatsObj.getField("Status").getValue());
|
||||
if ( ((String) gcsStatsObj.getField("Status").getValue()).compareTo("Connected") != 0 ||
|
||||
((String) flightStatsObj.getField("Status").getValue()).compareTo("Connected") == 0 )
|
||||
{
|
||||
|
@ -12,7 +12,7 @@ import android.util.Log;
|
||||
public class UAVTalk extends Observable {
|
||||
|
||||
static final String TAG = "UAVTalk";
|
||||
public static int LOGLEVEL = 0;
|
||||
public static int LOGLEVEL = 2;
|
||||
public static boolean WARN = LOGLEVEL > 1;
|
||||
public static boolean DEBUG = LOGLEVEL > 0;
|
||||
|
||||
@ -433,6 +433,7 @@ public class UAVTalk extends Observable {
|
||||
rxCSPacket = rxbyte;
|
||||
|
||||
if (rxCS != rxCSPacket) { // packet error - faulty CRC
|
||||
if (DEBUG) Log.d(TAG,"Bad crc");
|
||||
stats.rxErrors++;
|
||||
rxState = RxStateType.STATE_SYNC;
|
||||
break;
|
||||
@ -441,11 +442,14 @@ public class UAVTalk extends Observable {
|
||||
if (rxPacketLength != (packetSize + 1)) { // packet error -
|
||||
// mismatched packet
|
||||
// size
|
||||
if (DEBUG) Log.d(TAG,"Bad size");
|
||||
stats.rxErrors++;
|
||||
rxState = RxStateType.STATE_SYNC;
|
||||
break;
|
||||
}
|
||||
|
||||
if (DEBUG) Log.d(TAG,"Received");
|
||||
|
||||
rxBuffer.position(0);
|
||||
receiveObject(rxType, rxObjId, rxInstId, rxBuffer);
|
||||
stats.rxObjectBytes += rxLength;
|
||||
@ -500,8 +504,8 @@ public class UAVTalk extends Observable {
|
||||
case TYPE_OBJ_ACK:
|
||||
// All instances, not allowed for OBJ_ACK messages
|
||||
if (!allInstances) {
|
||||
// System.out.println("Received object ack: " + objId + " " +
|
||||
// objMngr.getObject(objId).getName());
|
||||
System.out.println("Received object ack: " + objId + " " +
|
||||
objMngr.getObject(objId).getName());
|
||||
// Get object and update its data
|
||||
obj = updateObject(objId, instId, data);
|
||||
// Transmit ACK
|
||||
@ -517,8 +521,8 @@ public class UAVTalk extends Observable {
|
||||
case TYPE_OBJ_REQ:
|
||||
// Get object, if all instances are requested get instance 0 of the
|
||||
// object
|
||||
// System.out.println("Received object request: " + objId + " " +
|
||||
// objMngr.getObject(objId).getName());
|
||||
System.out.println("Received object request: " + objId + " " +
|
||||
objMngr.getObject(objId).getName());
|
||||
if (allInstances) {
|
||||
obj = objMngr.getObject(objId);
|
||||
} else {
|
||||
@ -534,8 +538,8 @@ public class UAVTalk extends Observable {
|
||||
case TYPE_ACK:
|
||||
// All instances, not allowed for ACK messages
|
||||
if (!allInstances) {
|
||||
// System.out.println("Received ack: " + objId + " " +
|
||||
// objMngr.getObject(objId).getName());
|
||||
System.out.println("Received ack: " + objId + " " +
|
||||
objMngr.getObject(objId).getName());
|
||||
// Get object
|
||||
obj = objMngr.getObject(objId, instId);
|
||||
// Check if an ack is pending
|
||||
|
Loading…
Reference in New Issue
Block a user