|
SunSPOT API V4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.squawk.io.ConnectionBase
com.sun.squawk.io.j2me.serial.Protocol
public class Protocol
serial.Protocol - provides read access to the serial/USB port for an eSPOT
This protocol understands only three URLs: "serial://usb", "serial://usart" and "serial://".
The first two refer to connections to the USB and USART respectively. The first is known as the
"default" connection and refers to a combination which will be the USB if the SPOT has
been connected to a host computer and enumerated, otherwise the USART. This "default" connection
is the one normally used for System.out and System.err traffic. By assigning System.out and
System.err to a specific url, it is possible to use one connection for System.out and System.err
and the other for a specific application purpose.
Note that in the case where the URL is "serial://usart" it is possible to append parameters
to control the serial port settings. For example:
"serial://usart?baudrate=115200&databits=8&parity=even&stopbits=0"
Allowed values for parity are even, odd, mark and none.
| Field Summary | |
|---|---|
static int |
US_BRGR
|
static int |
US_MR
|
static int |
USART0_BASE_ADDRESS
|
| Constructor Summary | |
|---|---|
Protocol()
|
|
| Method Summary | |
|---|---|
void |
close()
Close |
Connection |
open(String protocol,
String name,
int mode,
boolean timeouts)
Open a connection to a target. |
InputStream |
openInputStream()
Open and return a data input stream for a connection. |
OutputStream |
openOutputStream()
Open and return a data output stream for a connection. |
static void |
setResourceRegistry(IResourceRegistry resourceRegistry)
This method is provided for test purposes only. |
| Methods inherited from class com.sun.squawk.io.ConnectionBase |
|---|
openDataInputStream, openDataOutputStream |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.microedition.io.InputConnection |
|---|
openDataInputStream |
| Methods inherited from interface javax.microedition.io.OutputConnection |
|---|
openDataOutputStream |
| Field Detail |
|---|
public static final int USART0_BASE_ADDRESS
public static final int US_BRGR
public static final int US_MR
| Constructor Detail |
|---|
public Protocol()
| Method Detail |
|---|
public static void setResourceRegistry(IResourceRegistry resourceRegistry)
resourceRegistry -
public Connection open(String protocol,
String name,
int mode,
boolean timeouts)
throws IOException
ConnectionBase
open in class ConnectionBaseprotocol - The URL protocolname - The URL for the connectionmode - The access modetimeouts - A flag to indicate that the caller
wants timeout exceptions
IOException - If some other kind of I/O error occurs.
public void close()
throws IOException
ConnectionBase
close in interface Connectionclose in class ConnectionBaseIOException - If an I/O error occurs
public InputStream openInputStream()
throws IOException
ConnectionBase
openInputStream in interface InputConnectionopenInputStream in class ConnectionBaseIOException - If an I/O error occurs
public OutputStream openOutputStream()
throws IOException
ConnectionBase
openOutputStream in interface OutputConnectionopenOutputStream in class ConnectionBaseIOException - If an I/O error occurs
|
SunSPOT API V4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||