public class GPSdEndpoint extends Object
| Constructor and Description |
|---|
GPSdEndpoint(String server,
int port,
AbstractResultParser resultParser)
Instantiate this class to connect to a GPSd server
|
GPSdEndpoint(String server,
int port,
AbstractResultParser resultParser,
boolean daemon)
Instantiate this class to connect to a GPSd server
|
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(IObjectListener listener) |
long |
getRetryInterval()
Returns the retry interval for reconnecting to GPSD if the socket closes.
|
void |
kickDevice(String path)
Attempt to kick a failed device back into life on gpsd server.
|
PollObject |
poll()
Poll GPSd for Message
|
void |
removeListener(IObjectListener listener) |
void |
setRetryInterval(long millis)
Set a retry interval for reconnecting to GPSD if the socket closes.
|
void |
start()
start the endpoint
|
void |
stop()
Stops the endpoint.
|
VersionObject |
version()
Poll GPSd version
|
WatchObject |
watch(boolean enable,
boolean dumpData)
send WATCH command
|
WatchObject |
watch(boolean enable,
boolean dumpData,
String device)
send WATCH command
|
public GPSdEndpoint(String server, int port, AbstractResultParser resultParser, boolean daemon) throws UnknownHostException, IOException
server - the server name or IPport - the server portresultParser - the result parserdaemon - whether to start the underlying socket thread as a daemon, as defined in Thread.setDaemon(boolean)UnknownHostExceptionIOExceptionpublic GPSdEndpoint(String server, int port, AbstractResultParser resultParser) throws UnknownHostException, IOException
server - the server name or IPport - the server portresultParser - the result parserUnknownHostExceptionIOExceptionpublic void start()
public void stop()
public WatchObject watch(boolean enable, boolean dumpData) throws IOException, org.json.JSONException
enable - enable/disable watch modedumpData - enable/disable dumping of dataWatchObjectIOException - on IO error in socketorg.json.JSONExceptionpublic WatchObject watch(boolean enable, boolean dumpData, String device) throws IOException, org.json.JSONException
enable - enable/disable watch modedumpData - enable/disable dumping of datadevice - If present, enable watching only of the specified device rather than all devicesWatchObjectIOException - on IO error in socketorg.json.JSONExceptionpublic PollObject poll() throws IOException
PollObjectIOException - on IO error in socketpublic VersionObject version() throws IOException
VersionObjectIOException - on IO error in socketpublic void addListener(IObjectListener listener)
listener - the listener to addpublic void removeListener(IObjectListener listener)
listener - the listener to removepublic void kickDevice(String path) throws IOException, org.json.JSONException
see: https://lists.gnu.org/archive/html/gpsd-dev/2015-06/msg00001.html
path - Path of device known to gpsdIOExceptionorg.json.JSONExceptionpublic void setRetryInterval(long millis)
millis - how long to wait between each reconnection attempts.public long getRetryInterval()
Copyright © 2011–2017 Taimos GmbH. All rights reserved.