|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlejos.nxt.comm.Bluetooth
public class Bluetooth
Support for Bluetooth communications.
Method Summary | |
---|---|
static int |
btGetCmdMode()
Low-level nethod to get the BC4 chip mode - does not work. |
static void |
btReceive(byte[] buf)
Low-level method to receive BT replies or data |
static void |
btSend(byte[] buf,
int len)
Low-level method to send a BT command or data |
static void |
btSetCmdMode(int mode)
Low-level method to switch BC4 chip between command and data (stream) mode. |
static void |
btStartADConverter()
Low-level method to start ADC converter - does not wok. |
static int |
readPacket(byte[] buf,
int bufLen)
Read a data packet (with 2-byte length header) from a stream connection. |
static int |
receiveReply(byte[] buf,
int bufLen)
Receive a command or reply from the BC4 chip. |
static void |
sendCommand(byte[] cmd,
int len)
Send a command to the BC4 chip. |
static void |
sendPacket(byte[] buf,
int bufLen)
Send a data packet. |
static BTConnection |
waitForConnection()
Wait for a remote device to connect. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait |
Field Detail |
---|
public static final int MSG_BEGIN_INQUIRY
public static final int MSG_CANCEL_INQUIRY
public static final int MSG_CONNECT
public static final int MSG_OPEN_PORT
public static final int MSG_LOOKUP_NAME
public static final int MSG_ADD_DEVICE
public static final int MSG_REMOVE_DEVICE
public static final int MSG_DUMP_LIST
public static final int MSG_CLOSE_CONNECTION
public static final int MSG_ACCEPT_CONNECTION
public static final int MSG_PIN_CODE
public static final int MSG_OPEN_STREAM
public static final int MSG_START_HEART
public static final int MSG_HEARTBEAT
public static final int MSG_INQUIRY_RUNNING
public static final int MSG_INQUIRY_RESULT
public static final int MSG_INQUIRY_STOPPED
public static final int MSG_LOOKUP_NAME_RESULT
public static final int MSG_LOOKUP_NAME_FAILURE
public static final int MSG_CONNECT_RESULT
public static final int MSG_RESET_INDICATION
public static final int MSG_REQUEST_PIN_CODE
public static final int MSG_REQUEST_CONNECTION
public static final int MSG_LIST_RESULT
public static final int MSG_LIST_ITEM
public static final int MSG_LIST_DUMP_STOPPED
public static final int MSG_CLOSE_CONNECTION_RESULT
public static final int MSG_PORT_OPEN_RESULT
public static final int MSG_SET_DISCOVERABLE
public static final int MSG_CLOSE_PORT
public static final int MSG_CLOSE_PORT_RESULT
public static final int MSG_PIN_CODE_ACK
public static final int MSG_DISCOVERABLE_ACK
public static final int MSG_SET_FRIENDLY_NAME
public static final int MSG_SET_FRIENDLY_NAME_ACK
public static final int MSG_GET_LINK_QUALITY
public static final int MSG_LINK_QUALITY_RESULT
public static final int MSG_SET_FACTORY_SETTINGS
public static final int MSG_SET_FACTORY_SETTINGS_ACK
public static final int MSG_GET_LOCAL_ADDR
public static final int MSG_GET_LOCAL_ADDR_RESULT
public static final int MSG_GET_FRIENDLY_NAME
public static final int MSG_GET_DISCOVERABLE
public static final int MSG_GET_PORT_OPEN
public static final int MSG_GET_FRIENDLY_NAME_RESULT
public static final int MSG_GET_DISCOVERABLE_RESULT
public static final int MSG_GET_PORT_OPEN_RESULT
public static final int MSG_GET_VERSION
public static final int MSG_GET_VERSION_RESULT
public static final int MSG_GET_BRICK_STATUSBYTE_RESULT
public static final int MSG_SET_BRICK_STATUSBYTE_RESULT
public static final int MSG_GET_BRICK_STATUSBYTE
public static final int MSG_SET_BRICK_STATUSBYTE
Method Detail |
---|
public static void btSend(byte[] buf, int len)
buf
- the buffer to sendlen
- the number of bytes to sendpublic static void btReceive(byte[] buf)
buf
- the buffer to receive data inpublic static void btSetCmdMode(int mode)
mode
- 0=data mode, 1=command modepublic static int btGetCmdMode()
public static void btStartADConverter()
public static void sendCommand(byte[] cmd, int len)
cmd
- the commandlen
- the number of bytespublic static int receiveReply(byte[] buf, int bufLen)
buf
- the buffer to receive the replybufLen
- the length of the buffer
public static int readPacket(byte[] buf, int bufLen)
buf
- the buffer to receive the data inbufLen
- the length of the buffer
public static void sendPacket(byte[] buf, int bufLen)
buf
- the data to sendbufLen
- the number of bytes to sendpublic static BTConnection waitForConnection()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |