Class PublishFilter

    • Constructor Summary

      Constructors 
      Constructor Description
      PublishFilter​(SampleProvider source, java.lang.String name, float frequency)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void fetchSample​(float[] sample, int offset)
      Fetches a sample from a sensor or filter.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • name

        protected java.lang.String name
      • host

        protected java.lang.String host
      • datagramSocket

        protected java.net.DatagramSocket datagramSocket
      • publisher

        protected lejos.robotics.filter.PublishFilter.Publisher publisher
      • listener

        protected lejos.robotics.filter.PublishFilter.Listener listener
      • latest

        protected float[] latest
      • frequency

        protected float frequency
      • publishMessage

        protected byte[] publishMessage
      • publishPacket

        protected java.net.DatagramPacket publishPacket
      • ss

        protected java.net.ServerSocket ss
      • subscribers

        protected java.util.ArrayList<java.net.Socket> subscribers
    • Constructor Detail

      • PublishFilter

        public PublishFilter​(SampleProvider source,
                             java.lang.String name,
                             float frequency)
                      throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • fetchSample

        public void fetchSample​(float[] sample,
                                int offset)
        Description copied from interface: SampleProvider
        Fetches a sample from a sensor or filter.
        Specified by:
        fetchSample in interface SampleProvider
        Overrides:
        fetchSample in class AbstractFilter
        Parameters:
        sample - The array to store the sample in.
        offset - The elements of the sample are stored in the array starting at the offset position.