Debug messages for read buffer

pull/4/head
Felipe Herranz 2014-10-03 11:55:24 +02:00
rodzic 974ec50f99
commit 7d5645b5ea
6 zmienionych plików z 29 dodań i 1 usunięć

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -64,6 +64,8 @@ public class SerialBuffer
byte[] dst = new byte[readBuffer.position()];
readBuffer.position(0);
readBuffer.get(dst, 0, dst.length);
if(debugging)
UsbSerialDebugger.printReadLogGet(dst, true);
return dst;
}
}

Wyświetl plik

@ -40,6 +40,32 @@ public class UsbSerialDebugger
}
}
// TODO Debug read buffer
public static void printReadLogGet(byte[] src, boolean verbose)
{
if(!verbose)
{
Log.i(CLASS_ID, "Data obtained from Read buffer: " + new String(src));
}else
{
Log.i(CLASS_ID, "Data obtained from Read buffer: " + new String(src));
Log.i(CLASS_ID, "Raw data from Read buffer: " + HexData.hexToString(src));
Log.i(CLASS_ID, "Number of bytes obtained from Read buffer: " + src.length);
}
}
public static void printReadLogPut(byte[] src, boolean verbose)
{
if(!verbose)
{
Log.i(CLASS_ID, "Data obtained pushed to read buffer: " + new String(src));
}else
{
Log.i(CLASS_ID, "Data obtained pushed to read buffer: " + new String(src));
Log.i(CLASS_ID, "Raw data pushed to read buffer: " + HexData.hexToString(src));
Log.i(CLASS_ID, "Number of bytes pushed from read buffer: " + src.length);
}
}
}