Interface GpsLogger

All Superinterfaces:
ShutdownHandler
All Known Implementing Classes:
GpsCsvLogger, GpsdJsonLogger, GpxLogger, NativeGpsLogger, NmeaLogger

public interface GpsLogger extends ShutdownHandler
This interface specifies how the GPSDistributor will record GPS position events to disk files. Different interface implementors can choose different file formats as they choose. All loggers should behave similarly to the FileLogger in that they should not write continuously to disk, but should use a buffer with a flush either when the buffer is full or a designated time interval is up, so as to minimize disk fragmentation and wear on Raspberry Pi SD cards. They should also register a ShutdownHandler so YAAC termination will cause the file to be closed correctly with any trailing suffix contents (XML close tags, etc.).
Author:
Andrew Pavlin, KA2DDO
  • Method Details

    • open

      void open()
      Set up for logging using a new format. Note this will not be called for day rollover or similar log segmenting events. That is up to the logger class itself to implement.
    • logNMEA

      void logNMEA(String nmeaSentence, GpsFix fix, SatelliteCatalog satelliteCatalog, String source)
      Log this GPS event that was reported as an ASCII NMEA sentence. Note that there is a YAAC-proprietary NMEA message used to mark an event point in the file, sentence $PYAACMRK, that must also be handled.
      Parameters:
      nmeaSentence - String of the NMEA sentence to log
      fix - the GpsFix object that has been updated (if necessary) by the NMEA sentence, or null if not changed
      satelliteCatalog - the SatelliteCatalog that has been updated (if necessary) by the sentence, or null if not changed
      source - String name of remote GPS, or null if it is GPS data for the local station
    • logJSON

      void logJSON(Map<String,Object> jsonMsg, GpsFix fix, SatelliteCatalog satelliteCatalog, String source)
      Log this GPS JSON event that was received from GPSD.
      Parameters:
      jsonMsg - Map<String, Object> of the JSON structure, as returned by Json
      fix - the GpsFix object that has been updated (if necessary) by the JSON structure, or null if not changed
      satelliteCatalog - the SatelliteCatalog that has been updated (if necessary) by the JSON structure
      source - String name of remote GPS, or null if it is GPS data for the local station
    • close

      void close()
      Stop using this format of logger. Any buffered output will be flushed and the current log file will be closed.