SunSPOT API V6.0


com.sun.spot.peripheral
Interface ISerial

All Superinterfaces:
Connection, InputConnection, IResource, OutputConnection, StreamConnection
All Known Implementing Classes:
EDemoSerial, Serial

public interface ISerial
extends IResource, StreamConnection

Interface for Serial devices


Method Summary
 int available()
           
 void closeInputStream()
           
 void closeOutputStream()
           
 InputStream openInputStream()
          Open and return an input stream for a connection.
 OutputStream openOutputStream()
          Open and return an output stream for a connection.
 int read()
           
 int read(byte[] b, int off, int len)
           
 void setUSARTParams(int baudrate, int databits, String parity, float stopbits)
          Set the USART line parameteres.
 void write(byte[] b, int off, int len)
           
 void write(int b)
           
 
Methods inherited from interface com.sun.spot.resources.IResource
addTag, getTags, getTagValue, hasTag, removeTag
 
Methods inherited from interface javax.microedition.io.InputConnection
openDataInputStream
 
Methods inherited from interface javax.microedition.io.Connection
close
 
Methods inherited from interface javax.microedition.io.OutputConnection
openDataOutputStream
 
Methods inherited from interface javax.microedition.io.Connection
close
 

Method Detail

setUSARTParams

void setUSARTParams(int baudrate,
                    int databits,
                    String parity,
                    float stopbits)
                    throws IOException
Set the USART line parameteres.

Parameters:
baudrate - baud speed to set module to
databits - supported values are 5,6,7,8
parity - supported options are none, odd, even, space & mark
stopbits - supported options are 1, 1.5 or 2
Throws:
IOException

openInputStream

InputStream openInputStream()
                            throws IOException
Description copied from interface: InputConnection
Open and return an input stream for a connection.

Specified by:
openInputStream in interface InputConnection
Returns:
An input stream
Throws:
IOException - If an I/O error occurs

openOutputStream

OutputStream openOutputStream()
                              throws IOException
Description copied from interface: OutputConnection
Open and return an output stream for a connection.

Specified by:
openOutputStream in interface OutputConnection
Returns:
An output stream
Throws:
IOException - If an I/O error occurs

closeInputStream

void closeInputStream()
                      throws IOException
Throws:
IOException

closeOutputStream

void closeOutputStream()
                       throws IOException
Throws:
IOException

read

int read()
         throws IOException
Throws:
IOException

read

int read(byte[] b,
         int off,
         int len)
         throws IOException
Throws:
IOException

available

int available()
              throws IOException
Throws:
IOException

write

void write(int b)
           throws IOException
Throws:
IOException

write

void write(byte[] b,
           int off,
           int len)
           throws IOException
Throws:
IOException

SunSPOT API V6.0


Copyright © 2006-2010 Oracle. All Rights Reserved.