|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--tinyvm.rcx.Serial
Low-level APIs for serial communications. Communication is carried out by sending packets with specific opcode formats. See the Opcodes section in Kekoa Proudfoot's RCX Internals page and the Opcode Reference. Additionally, see the serial and serial2rcx examples.
Method Summary | |
static boolean |
isPacketAvailable()
Checks to see if a packet is available. |
static int |
readPacket(byte[] aBuffer)
Reads a packet received by the RCX, if one is available. |
static void |
resetRcx()
Resets serial communications. |
static void |
sendPacket(byte[] aBuffer,
int aOffset,
int aLen)
Sends a packet to the PC or another RCX. |
static void |
setDataBuffer(byte[] aData)
Sets the buffer that will be used to save data transferred with opcode 0x45. |
Methods inherited from class java.lang.Object |
getClass,
toString |
Method Detail |
public static int readPacket(byte[] aBuffer)
isPacketAvailable()
,
setDataBuffer(byte[])
public static void setDataBuffer(byte[] aData)
Note: This method must be used with caution. A pointer to the data buffer is passed to the ROM for asynchronous use. If more data is received than can be stored in the buffer, the VM's memory will be corrupted and it will crash or at least misbehave.
public static boolean isPacketAvailable()
public static void sendPacket(byte[] aBuffer, int aOffset, int aLen)
public static void resetRcx()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |