com.dalsemi.jellybeans
Class Debug

java.lang.Object
  |
  +--com.dalsemi.jellybeans.Debug

public class Debug
extends java.lang.Object

This class encapsulates a small collection of hopefully useful debug utilities. All methods are static to keep performance up and memory usage down. We don't want these things to get in the way of the application we're trying to debug.


Field Summary
static boolean defaultStreams
           
 
Method Summary
static void debugDump(byte[] arr, int length)
          Dump an array to info port.
static void debugDump(int b)
          Dump a byte to info port.
static void debugDump(java.lang.String out)
          Dump a string to info port.
static void dump(byte[] arr, int length)
           
static void dump(int b)
           
static void dump(java.lang.String out)
           
static void hexDump(byte[] b)
          Dump hex representation of a byte array to System.out.
static void hexDump(byte[] b, int length)
          Dump hex representation of a byte array to System.out.
static void hexDump(int i)
          Dump hex representation of a four byte int to System.out.
static void intDump(int iVal)
          Dump hex representation of a four byte int to System.out.
static void resetDefaultStreams(boolean closeIn, boolean closeOut, boolean closeErr)
          Sets System.out, System.err, and System.in to Null Streams.
static void setDefaultStreams()
          Sets the old TINI default streams to Serial port 0.
static void setNativeVerboseDebugSpew(boolean verbose)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultStreams

public static boolean defaultStreams
Method Detail

hexDump

public static void hexDump(int i)
Dump hex representation of a four byte int to System.out.
Parameters:
i - integer to dump
See Also:

hexDump

public static void hexDump(byte[] b)
Dump hex representation of a byte array to System.out.
Parameters:
b - byte array to dump
Throws:
Throws - IOException on failed write
See Also:

hexDump

public static void hexDump(byte[] b,
                           int length)
Dump hex representation of a byte array to System.out.
Parameters:
b - byte array to dump
length - length of array

debugDump

public static void debugDump(java.lang.String out)
Dump a string to info port.
Parameters:
out - String to dump.
See Also:

dump

public static void dump(java.lang.String out)

debugDump

public static void debugDump(byte[] arr,
                             int length)
Dump an array to info port. This will print the ASCII representation of the byte array.
Parameters:
arr - Array to dump
length - Length of array
See Also:

dump

public static void dump(byte[] arr,
                        int length)

debugDump

public static void debugDump(int b)
Dump a byte to info port. This will print the hex representation of the byte.
Parameters:
b -  
See Also:

dump

public static void dump(int b)

intDump

public static void intDump(int iVal)
Dump hex representation of a four byte int to System.out.
Parameters:
iVal - integer to dump
See Also:
hexDump(int i)

setDefaultStreams

public static void setDefaultStreams()
Sets the old TINI default streams to Serial port 0. Binds System.out, System.err, and System.in.
See Also:

resetDefaultStreams

public static void resetDefaultStreams(boolean closeIn,
                                       boolean closeOut,
                                       boolean closeErr)
Sets System.out, System.err, and System.in to Null Streams.
See Also:

setNativeVerboseDebugSpew

public static void setNativeVerboseDebugSpew(boolean verbose)