private class APRS.FormatTask
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
login
Standard login data.
|
private java.lang.String |
NEWLINE
APRS proprietary line separator - do not localize.
|
Modifier | Constructor and Description |
---|---|
private |
FormatTask() |
Modifier and Type | Method and Description |
---|---|
private java.net.Socket |
connectAPRS()
Creates a socket connection to a host.
|
private void |
loginAPRS(java.io.OutputStream os,
java.io.InputStream is)
Logs in to APRS using the previously formatted login string.
|
private java.lang.String |
processResponse(java.lang.String response)
Compares APRS response with the configured error responses.
|
private java.lang.String |
readResponse(java.io.InputStream is)
Reads APRS response until CR/LF or EOF is received.
|
void |
run()
Task proc.
|
private final java.lang.String NEWLINE
private final java.lang.String login
public void run()
run
in interface java.lang.Runnable
private java.net.Socket connectAPRS() throws java.io.IOException
java.io.IOException
- if none of the hosts connect.private void loginAPRS(java.io.OutputStream os, java.io.InputStream is) throws java.io.IOException, ServiceException
os
- output stream.is
- input stream.java.io.IOException
- if unable to read or write streams.ServiceException
- if login is rejected.private java.lang.String readResponse(java.io.InputStream is) throws java.io.IOException
is
- input stream to read.java.io.IOException
- if the read fails.private java.lang.String processResponse(java.lang.String response) throws ServiceException
response
- sent by APRS.ServiceException
- if an error response is received.