Class StreamSensorDataFile

java.lang.Object
se.hendeby.sensordata.StreamSensorDataFile

public class StreamSensorDataFile extends Object
A collection of functions to read a log file and restream it This class provides the means to read a log file produced by the Sensor Fusion app and stream it as if it had been measured in real time from a smartphone using the Sensor Fusion app. This is intended as a way to provide a completely transparent handling processing real-time data and data saved in a log file.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    broadcastFile(File fname, String ip, int port)
    Restream the data in a given log file.
    static void
    main(String[] args)
    Program to stream a given log file to a server The program simulates measurements from a Sensor Fusion app running on a smartphone, based on measurements collected in a log file from the same app.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StreamSensorDataFile

      public StreamSensorDataFile()
  • Method Details

    • broadcastFile

      public static void broadcastFile(File fname, String ip, int port) throws UnknownHostException, IOException
      Restream the data in a given log file.
      Parameters:
      fname - The path of the log file.
      ip - The IP address to which the data should be streamed.
      port - The port on the server to use.
      Throws:
      UnknownHostException - Throws a UnknownHostException when no connection to the server can be established.
      IOException - Throws an IOException in case of I/O errors, such as inability to read the given log file.
    • main

      public static void main(String[] args)
      Program to stream a given log file to a server The program simulates measurements from a Sensor Fusion app running on a smartphone, based on measurements collected in a log file from the same app.
      Parameters:
      args - The input has the following form (when called from the command line): StreamSensorDataFile [--ip <127.0.0.1>] [--port <3400>] [--] logfile]