|
||||||||
上一个类 下一个类 | 框架 无框架 | |||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Objectprocessing.android.dandelion.Dandelion
public class Dandelion
This is a template class and can be used to start a new processing library or tool. Make sure you rename this class as well as the name of the example package 'template' to your own lobrary or tool naming convention.
字段摘要 | |
---|---|
int[] |
analogInput
|
static boolean |
continuousMode
|
static boolean |
DEBUG
|
static java.lang.String |
DEBUGTAG
|
boolean[] |
digitalInput
|
boolean[] |
digitalOutput
|
static java.lang.String |
VERSION
|
构造方法摘要 | |
---|---|
Dandelion(Context ctx)
a Constructor, used to establish a connection to a Dandelion the library will look for its path. |
|
Dandelion(Context ctx,
int num)
|
方法摘要 | |
---|---|
int |
available()
Returns the available number of bytes in the buffer. |
void |
beginAnalogInput()
|
void |
beginDigitalInput()
|
int |
buffer(int bytes)
Sets the number of bytes to buffer. |
void |
clear()
Clears the byte buffer. |
void |
disconnect()
Disconnects the bluetooth socket. |
boolean |
discoveryComplete()
|
void |
endAnalogInput()
|
void |
endDigitalInput()
|
java.lang.String |
getName()
|
java.lang.String |
getReturnCode()
|
boolean |
isConnected()
Returns the status of the connection. |
boolean |
isEnabled()
Returns whether the adapter is enabled. |
int |
last()
Returns the last byte in the buffer. |
char |
lastChar()
Returns the last byte in the buffer as char. |
java.lang.String[] |
list()
Returns the list of bonded devices. |
void |
pairWith(java.lang.String thisAddress)
|
void |
peekAnalogInput()
Sample values of all analog channels. |
void |
peekDigitalInput()
Sample values of all digital channels. |
void |
putReturnCode()
|
int |
read()
Returns the next byte in the buffer as an int (0-255); |
byte[] |
readBytes()
Returns the whole byte buffer. |
int |
readBytes(byte[] buffer)
Returns the available number of bytes in the buffer, and copies the buffer contents to the passed byte[] |
byte[] |
readBytesUntil(byte b)
Returns a bytebuffer until the byte b. |
void |
readBytesUntil(byte b,
byte[] buffer)
TODO |
char |
readChar()
Returns the next byte in the buffer as a char, if nothing is there it returns -1. |
java.lang.String |
readString()
Returns the buffer as a string. |
java.lang.String |
readStringUntil(char c)
Returns the buffer as string until character c. |
boolean |
setHigh(int channel)
Put specified channel High. |
boolean |
setLow(int channel)
Put specified channel Low. |
void |
startDiscovery()
|
void |
stop()
Kills the main thread. |
static java.lang.String |
version()
return the version of the library. |
void |
write(byte[] buffer)
Writes a byte[] buffer to the output stream. |
void |
write(int thisInt)
Writes a String to the output stream. |
void |
write(java.lang.String thisString)
Writes a String to the output stream. |
从类 java.lang.Object 继承的方法 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段详细信息 |
---|
public static final java.lang.String VERSION
public static boolean DEBUG
public static java.lang.String DEBUGTAG
public int[] analogInput
public boolean[] digitalInput
public boolean[] digitalOutput
public static boolean continuousMode
构造方法详细信息 |
---|
public Dandelion(Context ctx)
theParent
- use "this".public Dandelion(Context ctx, int num)
方法详细信息 |
---|
public boolean isConnected()
public boolean isEnabled()
public java.lang.String[] list()
public void startDiscovery()
public void pairWith(java.lang.String thisAddress)
public boolean discoveryComplete()
public java.lang.String getName()
public int available()
public static java.lang.String version()
public void write(byte[] buffer)
buffer
- public void write(java.lang.String thisString)
thisString
- public void write(int thisInt)
buffer
- public int read()
public byte[] readBytes()
public int readBytes(byte[] buffer)
buffer
-
public byte[] readBytesUntil(byte b)
b
-
public void readBytesUntil(byte b, byte[] buffer)
b
- buffer
- public char readChar()
public java.lang.String readString()
public java.lang.String readStringUntil(char c)
c
-
public int buffer(int bytes)
bytes
-
public int last()
public char lastChar()
public void clear()
public void disconnect()
public void stop()
public void peekDigitalInput()
public void beginDigitalInput()
public void endDigitalInput()
public void beginAnalogInput()
public void endAnalogInput()
public void peekAnalogInput()
public boolean setHigh(int channel)
channel
- the number of digital channelpublic boolean setLow(int channel)
channel
- the number of digital channelpublic void putReturnCode()
public java.lang.String getReturnCode()
|
||||||||
上一个类 下一个类 | 框架 无框架 | |||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |