public class UrlPort extends Object implements IStringCommand
| Constructor and Description |
|---|
UrlPort(String protocol,
String hostIp,
int portNumber,
String prefix,
String suffix,
int timeout,
boolean verbose) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
connect() |
String |
getVersion()
Returns the hardware version (not the version of the driver software).
|
boolean |
isValid()
Tries to identify instances that are not valid.
|
static void |
main(String[] args) |
void |
open()
Opens the device with previously set parameters.
|
String |
readString()
Reads a line of text.
|
boolean |
ready()
Tells whether this stream is ready to be read.
|
void |
sendString(String payload) |
void |
setDebug(int debug)
Sets a debug parameter.
|
void |
setTimeout(int timeout)
Set timeout in milliseconds.
|
void |
setVerbosity(boolean verbosity)
Sets a verbosity flag, causing commands to be executed verbosely.
|
public void connect()
throws IOException
IOExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic void sendString(String payload) throws IOException
sendString in interface IStringCommandIOExceptionpublic String readString()
IStringCommandreadString in interface IStringCommandpublic static void main(String[] args)
args - the command line argumentspublic String getVersion() throws IOException
IHarcHardwaregetVersion in interface IHarcHardwareIOExceptionpublic void setVerbosity(boolean verbosity)
IHarcHardwaresetVerbosity in interface IHarcHardwareverbosity - on or offpublic void setDebug(int debug)
IHarcHardwaresetDebug in interface IHarcHardwarepublic void setTimeout(int timeout)
IHarcHardwaresetTimeout in interface IHarcHardwaretimeout - Timeout in milliseconds.public boolean isValid()
IHarcHardwareisValid in interface IHarcHardwarepublic void open()
throws HarcHardwareException,
IOException
IHarcHardwareopen in interface IHarcHardwareHarcHardwareExceptionIOExceptionpublic boolean ready()
throws IOException
IStringCommandready in interface IStringCommandIOException - If an I/O error occursCopyright © 2015. All rights reserved.