| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlejos.nxt.comm.NXTCommDevice
public abstract class NXTCommDevice
Base class for nxt communications devices. Provides a common address/name, plus utility functions.
| Field Summary | |
|---|---|
static int | 
ADDRESS_LEN
 | 
protected static char[] | 
cs
 | 
static String | 
NAME
 | 
static int | 
NAME_LEN
 | 
static String | 
SERIAL_NO
 | 
| Constructor Summary | |
|---|---|
NXTCommDevice()
 | 
|
| Method Summary | |
|---|---|
static String | 
addressToString(byte[] addr)
Helper method to convert address byte array to String.  | 
static String | 
getAddress()
Return the current USB serial number.  | 
static String | 
getName()
Return the current USB devName.  | 
static boolean | 
isAddress(String s)
Determine if a string contains a Bluetooth style address.  | 
static void | 
loadSettings()
Load the current system settings associated with this class.  | 
static String | 
nameToString(byte[] name)
Return a string version of a device devName held as a byte array  | 
static void | 
setAddress(String sn)
Set the USB serial number.  | 
static void | 
setName(String nam)
Set the USB devName.  | 
static byte[] | 
stringToAddress(String strAddress)
Convert a string version of a Bluetooth address into a byte array address.  | 
static byte[] | 
stringToName(String strName)
Convert the string version of a devName into a byte array.  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final int ADDRESS_LEN
public static final int NAME_LEN
public static final String SERIAL_NO
public static final String NAME
protected static final char[] cs
| Constructor Detail | 
|---|
public NXTCommDevice()
| Method Detail | 
|---|
public static boolean isAddress(String s)
s - String to test
public static byte[] stringToAddress(String strAddress)
strAddress - The string version of the address
public static byte[] stringToName(String strName)
strName - string version of the devName
public static String addressToString(byte[] addr)
addr - A byte array of bytes containing the address.
public static String nameToString(byte[] name)
name - 
public static void setAddress(String sn)
sn - public static String getAddress()
public static void setName(String nam)
nam - the mamepublic static String getName()
public static void loadSettings()
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||