public class LegoMindstormsNxtBase extends AndroidNonvisibleComponent implements Component, Deleteable
Modifier and Type | Field and Description |
---|---|
protected BluetoothClient |
bluetooth |
protected java.lang.String |
logTag |
form
ACCELEROMETER_SENSITIVITY_MODERATE, ACCELEROMETER_SENSITIVITY_STRONG, ACCELEROMETER_SENSITIVITY_WEAK, ALIGNMENT_CENTER, ALIGNMENT_NORMAL, ALIGNMENT_OPPOSITE, ASSET_DIRECTORY, BUTTON_SHAPE_DEFAULT, BUTTON_SHAPE_OVAL, BUTTON_SHAPE_RECT, BUTTON_SHAPE_ROUNDED, COLOR_BLACK, COLOR_BLUE, COLOR_CYAN, COLOR_DEFAULT, COLOR_DKGRAY, COLOR_GRAY, COLOR_GREEN, COLOR_LTGRAY, COLOR_MAGENTA, COLOR_NONE, COLOR_ORANGE, COLOR_PINK, COLOR_RED, COLOR_WHITE, COLOR_YELLOW, DEFAULT_VALUE_COLOR_BLACK, DEFAULT_VALUE_COLOR_BLUE, DEFAULT_VALUE_COLOR_CYAN, DEFAULT_VALUE_COLOR_DEFAULT, DEFAULT_VALUE_COLOR_DKGRAY, DEFAULT_VALUE_COLOR_GRAY, DEFAULT_VALUE_COLOR_GREEN, DEFAULT_VALUE_COLOR_LTGRAY, DEFAULT_VALUE_COLOR_MAGENTA, DEFAULT_VALUE_COLOR_NONE, DEFAULT_VALUE_COLOR_ORANGE, DEFAULT_VALUE_COLOR_PINK, DEFAULT_VALUE_COLOR_RED, DEFAULT_VALUE_COLOR_WHITE, DEFAULT_VALUE_COLOR_YELLOW, DIRECTION_EAST, DIRECTION_MAX, DIRECTION_MIN, DIRECTION_NONE, DIRECTION_NORTH, DIRECTION_NORTHEAST, DIRECTION_NORTHWEST, DIRECTION_SOUTH, DIRECTION_SOUTHEAST, DIRECTION_SOUTHWEST, DIRECTION_WEST, FONT_DEFAULT_SIZE, LAYOUT_ORIENTATION_HORIZONTAL, LAYOUT_ORIENTATION_VERTICAL, LENGTH_FILL_PARENT, LENGTH_PREFERRED, LENGTH_UNKNOWN, SLIDER_MAX_VALUE, SLIDER_MIN_VALUE, SLIDER_THUMB_VALUE, TOAST_LENGTH_LONG, TOAST_LENGTH_SHORT, TYPEFACE_DEFAULT, TYPEFACE_MONOSPACE, TYPEFACE_SANSSERIF, TYPEFACE_SERIF
Modifier | Constructor and Description |
---|---|
protected |
LegoMindstormsNxtBase()
This constructor is for testing purposes only.
|
protected |
LegoMindstormsNxtBase(ComponentContainer container,
java.lang.String logTag)
Creates a new LegoMindstormsNxtBase.
|
Modifier and Type | Method and Description |
---|---|
void |
afterConnect(BluetoothConnectionBase bluetoothConnection) |
void |
beforeDisconnect(BluetoothConnectionBase bluetoothConnection) |
BluetoothClient |
BluetoothClient()
Returns the BluetoothClient component that should be used for communication.
|
void |
BluetoothClient(BluetoothClient bluetoothClient)
Specifies the BluetoothClient component that should be used for communication.
|
protected boolean |
checkBluetooth(java.lang.String functionName) |
protected int |
convertMotorPortLetterToNumber(char motorPortLetter) |
protected int |
convertMotorPortLetterToNumber(java.lang.String motorPortLetter) |
protected int |
convertSensorPortLetterToNumber(char sensorPortLetter) |
protected int |
convertSensorPortLetterToNumber(java.lang.String sensorPortLetter) |
protected void |
copyBooleanValueToBytes(boolean value,
byte[] bytes,
int offset) |
protected void |
copySBYTEValueToBytes(int value,
byte[] bytes,
int offset) |
protected void |
copySLONGValueToBytes(int value,
byte[] bytes,
int offset) |
protected void |
copyStringValueToBytes(java.lang.String value,
byte[] bytes,
int offset,
int maxCount) |
protected void |
copySWORDValueToBytes(int value,
byte[] bytes,
int offset) |
protected void |
copyUBYTEValueToBytes(int value,
byte[] bytes,
int offset) |
protected void |
copyULONGValueToBytes(long value,
byte[] bytes,
int offset) |
protected void |
copyUWORDValueToBytes(int value,
byte[] bytes,
int offset) |
protected boolean |
evaluateStatus(java.lang.String functionName,
byte[] returnPackage,
byte command) |
protected boolean |
getBooleanValueFromBytes(byte[] bytes,
int offset) |
protected byte[] |
getInputValues(java.lang.String functionName,
int port) |
protected int |
getSBYTEValueFromBytes(byte[] bytes,
int offset) |
protected int |
getSLONGValueFromBytes(byte[] bytes,
int offset) |
protected int |
getStatus(java.lang.String functionName,
byte[] returnPackage,
byte command) |
protected java.lang.String |
getStringValueFromBytes(byte[] bytes,
int offset) |
protected java.lang.String |
getStringValueFromBytes(byte[] bytes,
int offset,
int count) |
protected int |
getSWORDValueFromBytes(byte[] bytes,
int offset) |
protected int |
getUBYTEValueFromBytes(byte[] bytes,
int offset) |
protected long |
getULONGValueFromBytes(byte[] bytes,
int offset) |
protected int |
getUWORDValueFromBytes(byte[] bytes,
int offset) |
void |
Initialize()
Default Initialize
|
protected int |
lsGetStatus(java.lang.String functionName,
int port) |
protected byte[] |
lsRead(java.lang.String functionName,
int port) |
protected void |
lsWrite(java.lang.String functionName,
int port,
byte[] data,
int rxDataLength) |
void |
onDelete() |
protected void |
resetInputScaledValue(java.lang.String functionName,
int port) |
protected int |
sanitizePower(int power) |
protected int |
sanitizeTurnRatio(int turnRatio) |
protected void |
sendCommand(java.lang.String functionName,
byte[] command) |
protected byte[] |
sendCommandAndReceiveReturnPackage(java.lang.String functionName,
byte[] command) |
protected void |
setInputMode(java.lang.String functionName,
int port,
int sensorType,
int sensorMode) |
protected void |
setOutputState(java.lang.String functionName,
int port,
int power,
int mode,
int regulationMode,
int turnRatio,
int runState,
long tachoLimit) |
getDispatchDelegate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDispatchDelegate
protected final java.lang.String logTag
protected BluetoothClient bluetooth
protected LegoMindstormsNxtBase(ComponentContainer container, java.lang.String logTag)
protected LegoMindstormsNxtBase()
public final void Initialize()
public BluetoothClient BluetoothClient()
public void BluetoothClient(BluetoothClient bluetoothClient)
protected final void setOutputState(java.lang.String functionName, int port, int power, int mode, int regulationMode, int turnRatio, int runState, long tachoLimit)
protected final void setInputMode(java.lang.String functionName, int port, int sensorType, int sensorMode)
protected final byte[] getInputValues(java.lang.String functionName, int port)
protected final void resetInputScaledValue(java.lang.String functionName, int port)
protected final int lsGetStatus(java.lang.String functionName, int port)
protected final void lsWrite(java.lang.String functionName, int port, byte[] data, int rxDataLength)
protected final byte[] lsRead(java.lang.String functionName, int port)
protected final boolean checkBluetooth(java.lang.String functionName)
protected final byte[] sendCommandAndReceiveReturnPackage(java.lang.String functionName, byte[] command)
protected final void sendCommand(java.lang.String functionName, byte[] command)
protected final boolean evaluateStatus(java.lang.String functionName, byte[] returnPackage, byte command)
protected final int getStatus(java.lang.String functionName, byte[] returnPackage, byte command)
protected final void copyBooleanValueToBytes(boolean value, byte[] bytes, int offset)
protected final void copySBYTEValueToBytes(int value, byte[] bytes, int offset)
protected final void copyUBYTEValueToBytes(int value, byte[] bytes, int offset)
protected final void copySWORDValueToBytes(int value, byte[] bytes, int offset)
protected final void copyUWORDValueToBytes(int value, byte[] bytes, int offset)
protected final void copySLONGValueToBytes(int value, byte[] bytes, int offset)
protected final void copyULONGValueToBytes(long value, byte[] bytes, int offset)
protected final void copyStringValueToBytes(java.lang.String value, byte[] bytes, int offset, int maxCount)
protected final boolean getBooleanValueFromBytes(byte[] bytes, int offset)
protected final int getSBYTEValueFromBytes(byte[] bytes, int offset)
protected final int getUBYTEValueFromBytes(byte[] bytes, int offset)
protected final int getSWORDValueFromBytes(byte[] bytes, int offset)
protected final int getUWORDValueFromBytes(byte[] bytes, int offset)
protected final int getSLONGValueFromBytes(byte[] bytes, int offset)
protected final long getULONGValueFromBytes(byte[] bytes, int offset)
protected final java.lang.String getStringValueFromBytes(byte[] bytes, int offset)
protected final java.lang.String getStringValueFromBytes(byte[] bytes, int offset, int count)
protected final int convertMotorPortLetterToNumber(java.lang.String motorPortLetter)
protected final int convertMotorPortLetterToNumber(char motorPortLetter)
protected final int convertSensorPortLetterToNumber(java.lang.String sensorPortLetter)
protected final int convertSensorPortLetterToNumber(char sensorPortLetter)
protected final int sanitizePower(int power)
protected final int sanitizeTurnRatio(int turnRatio)
public void afterConnect(BluetoothConnectionBase bluetoothConnection)
public void beforeDisconnect(BluetoothConnectionBase bluetoothConnection)
public void onDelete()
onDelete
in interface Deleteable