|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.InputStream com.sun.spot.peripheral.radio.RadioInputStream
public class RadioInputStream
Helper class for "radiostream:" connections. This class provides an InputStream over the data received from another Spot. It also provides a small set of accessors to get information about the quality of the link. You should NOT normally instantiate this class directly, but rather via the GCF framework: see the first reference below for more details.
RadiostreamConnection
Constructor Summary | |
---|---|
RadioInputStream(IRadiostreamProtocolManager dispatcher,
ConnectionID cid,
long timeout,
RadioPolicy initialPolicy,
IRadioPolicyManager radioPolicyManager)
Deprecated. Construct a RadioInputStream |
Method Summary | |
---|---|
int |
available()
Deprecated. Return the number of bytes available to be read from the stream without blocking. |
void |
close()
Deprecated. Closes this input stream and releases any system resources associated with the stream. |
int |
getCorr()
Deprecated. CORR measures the average correlation value of the first 4 bytes of the packet header. |
int |
getLinkQuality()
Deprecated. Link Quality Indication (LQI) is a characterization of the quality of a received packet. |
byte |
getLocalPort()
Deprecated. Answer the port number for this connection |
int |
getRssi()
Deprecated. RSSI (received signal strength indicator) measures the strength (power) of the signal for the packet. |
int |
read()
Deprecated. Reads the next byte of data from the input stream. |
void |
setRadioPolicy(RadioPolicy selection)
Deprecated. Set the radio policy for this connection |
Methods inherited from class java.io.InputStream |
---|
mark, markSupported, read, read, reset, skip |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RadioInputStream(IRadiostreamProtocolManager dispatcher, ConnectionID cid, long timeout, RadioPolicy initialPolicy, IRadioPolicyManager radioPolicyManager)
dispatcher
- the PortBasedProtocolManager that will dispatch radio packetscid
- the ConnectionID object being usedtimeout
- the timeout to use when waiting for inputMethod Detail |
---|
public int read() throws IOException
InputStream
int
in the range 0
to
255
. If no byte is available because the end of the stream
has been reached, the value -1
is returned. This method
blocks until input data is available, the end of the stream is detected,
or an exception is thrown.
A subclass must provide an implementation of this method.
read
in class InputStream
-1
if the end of the
stream is reached.
IOException
- if an I/O error occurs.public int available() throws IOException
available
in class InputStream
IOException
- if an I/O error occurs.public int getLinkQuality()
RadioPacket.getLinkQuality()
public int getCorr()
RadioPacket.getCorr()
public int getRssi()
RadioPacket.getRssi()
public void close() throws IOException
InputStream
The close
method of InputStream
does
nothing.
close
in class InputStream
IOException
- if an I/O error occurs.public void setRadioPolicy(RadioPolicy selection)
IRadioControl
setRadioPolicy
in interface IRadioControl
selection
- the policy requiredpublic byte getLocalPort()
IRadioControl
getLocalPort
in interface IRadioControl
|
SunSPOT API V3.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |