public abstract class NXTCommDevice
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
ADDRESS_LEN |
protected static char[] |
cs |
static java.lang.String |
NAME |
static int |
NAME_LEN |
static java.lang.String |
SERIAL_NO |
Constructor and Description |
---|
NXTCommDevice() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
addressToString(byte[] addr)
Helper method to convert address byte array to String.
|
static java.lang.String |
getAddress()
Return the current USB serial number.
|
static java.lang.String |
getName()
Return the current USB devName.
|
static boolean |
isAddress(java.lang.String s)
Determine if a string contains a Bluetooth style address.
|
static void |
loadSettings()
Load the current system settings associated with this class.
|
static java.lang.String |
nameToString(byte[] name)
Return a string version of a device devName held as a byte array
|
static void |
setAddress(java.lang.String sn)
Set the USB serial number.
|
static void |
setName(java.lang.String nam)
Set the USB devName.
|
static byte[] |
stringToAddress(java.lang.String strAddress)
Convert a string version of a Bluetooth address into a byte array
address.
|
static byte[] |
stringToName(java.lang.String strName)
Convert the string version of a devName into a byte array.
|
public static final int ADDRESS_LEN
public static final int NAME_LEN
public static final java.lang.String SERIAL_NO
public static final java.lang.String NAME
protected static final char[] cs
public static boolean isAddress(java.lang.String s)
s
- String to testpublic static byte[] stringToAddress(java.lang.String strAddress)
strAddress
- The string version of the addresspublic static byte[] stringToName(java.lang.String strName)
strName
- string version of the devNamepublic static java.lang.String addressToString(byte[] addr)
addr
- A byte array of bytes containing the address.public static java.lang.String nameToString(byte[] name)
name
- public static void setAddress(java.lang.String sn)
sn
- public static java.lang.String getAddress()
public static void setName(java.lang.String nam)
nam
- the mamepublic static java.lang.String getName()
public static void loadSettings()