public class PublishFilter extends AbstractFilter
Modifier and Type | Field and Description |
---|---|
protected java.net.DatagramSocket |
datagramSocket |
protected float |
frequency |
protected java.lang.String |
host |
protected float[] |
latest |
protected lejos.robotics.filter.PublishFilter.Listener |
listener |
protected java.lang.String |
name |
protected static int |
PUBLISH_PORT |
protected lejos.robotics.filter.PublishFilter.Publisher |
publisher |
protected byte[] |
publishMessage |
protected java.net.DatagramPacket |
publishPacket |
protected java.net.ServerSocket |
ss |
protected java.util.ArrayList<java.net.Socket> |
subscribers |
protected static int |
UDP_PERIOD |
sampleSize, source
Constructor and Description |
---|
PublishFilter(SampleProvider source,
java.lang.String name,
float frequency) |
Modifier and Type | Method and Description |
---|---|
void |
fetchSample(float[] sample,
int offset)
Fetches a sample from a sensor or filter.
|
sampleSize
protected static final int PUBLISH_PORT
protected static final int UDP_PERIOD
protected java.lang.String name
protected java.lang.String host
protected java.net.DatagramSocket datagramSocket
protected lejos.robotics.filter.PublishFilter.Publisher publisher
protected lejos.robotics.filter.PublishFilter.Listener listener
protected float[] latest
protected float frequency
protected byte[] publishMessage
protected java.net.DatagramPacket publishPacket
protected java.net.ServerSocket ss
protected java.util.ArrayList<java.net.Socket> subscribers
public PublishFilter(SampleProvider source, java.lang.String name, float frequency) throws java.io.IOException
java.io.IOException
public void fetchSample(float[] sample, int offset)
SampleProvider
fetchSample
in interface SampleProvider
fetchSample
in class AbstractFilter
sample
- The array to store the sample in.offset
- The elements of the sample are stored in the array starting at the offset position.