public class StreamSensorDataReader extends SensorDataReader
SensorDataReader
class.Constructor and Description |
---|
StreamSensorDataReader()
Default constructor.
|
StreamSensorDataReader(int port)
Constructor accepting setting the port to create a server on.
|
Modifier and Type | Method and Description |
---|---|
protected double[] |
get(long maxDiff)
Get a set of data with matching time stamp.
|
SensorData |
getSensorData()
Extract the next received SensorData object
Extracts a SensorData object from the receiver queue.
|
void |
reset()
Resets the data stream
This merely clears all outstanding SensorData objects so for not handled.
|
static void |
showIPs()
Show IP addresses of available interfaces
This is a convenience function to determine the IP address of all available
interfaces.
|
void |
start()
Start up a server to which the Sensor Fusion app can connect.
|
void |
start(java.net.InetAddress bindAddr)
Start up a server to which the Sensor Fusion app can connect.
|
void |
start(int n)
Start up a server to which the Sensor Fusion app can connect.
|
boolean |
status()
The status of the current connection.
|
void |
stop()
Stop the server.
|
finalize, getAll, getNext
public StreamSensorDataReader()
public StreamSensorDataReader(int port)
port
- Port to use for the connection.public void start() throws java.io.IOException
start
in class SensorDataReader
java.io.IOException
- If an I/O error is encountered an exception is
thrown.public void start(int n) throws java.io.IOException
n
- Interface number to bind to.java.io.IOException
- Throws an IOException on error conditions.public void start(java.net.InetAddress bindAddr) throws java.io.IOException
bindAddr
- Which is the interface to bind.java.io.IOException
- Throws an IOException on error conditions.public void stop()
stop
in class SensorDataReader
protected double[] get(long maxDiff)
get
in class SensorDataReader
maxDiff
- Milliseconds between measurements to be considered from the
same sample time.public SensorData getSensorData()
SensorDataReader
getSensorData
in class SensorDataReader
public void reset()
reset
in class SensorDataReader
public boolean status()
status
in class SensorDataReader
public static void showIPs() throws java.net.SocketException
java.net.SocketException
- Throws a SocketException on error conditions.