public interface GpsLogger extends ShutdownHandler
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.).Modifier and Type | Method and Description |
---|---|
void |
close()
Stop using this format of logger.
|
void |
logJSON(java.util.Map<java.lang.String,java.lang.Object> jsonMsg,
GpsFix fix,
SatelliteCatalog satelliteCatalog,
java.lang.String source)
Log this GPS JSON event that was received from GPSD.
|
void |
logNMEA(java.lang.String nmeaSentence,
GpsFix fix,
SatelliteCatalog satelliteCatalog,
java.lang.String source)
Log this GPS event that was reported as an ASCII NMEA sentence.
|
void |
open()
Set up for logging using a new format.
|
shutdown
void open()
void logNMEA(java.lang.String nmeaSentence, GpsFix fix, SatelliteCatalog satelliteCatalog, java.lang.String source)
nmeaSentence
- String of the NMEA sentence to logfix
- the GpsFix object that has been updated (if necessary) by the NMEA sentence, or null if not changedsatelliteCatalog
- the SatelliteCatalog that has been updated (if necessary) by the sentence, or null if not changedsource
- String name of remote GPS, or null if it is GPS data for the local stationvoid logJSON(java.util.Map<java.lang.String,java.lang.Object> jsonMsg, GpsFix fix, SatelliteCatalog satelliteCatalog, java.lang.String source)
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 changedsatelliteCatalog
- the SatelliteCatalog that has been updated (if necessary) by the JSON structuresource
- String name of remote GPS, or null if it is GPS data for the local stationvoid close()