public class ATCommand extends Object
AT commands can be sent directly to the connected device or to remote devices and may have parameters.
After executing an AT Command, an AT Response is received from the device.
ATCommandResponse
Constructor and Description |
---|
ATCommand(String command)
Class constructor.
|
ATCommand(String command,
byte[] parameter)
Class constructor.
|
ATCommand(String command,
String parameter)
Class constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getCommand()
Returns the AT command alias.
|
byte[] |
getParameter()
Returns the AT command parameter.
|
String |
getParameterString()
Returns the AT command parameter in string format.
|
void |
setParameter(byte[] parameter)
Sets the AT command parameter as byte array.
|
void |
setParameter(String parameter)
Sets the AT command parameter as string.
|
public ATCommand(String command)
ATCommand
with the given parameters.command
- The AT Command alias.IllegalArgumentException
- if command.length() != 2
.NullPointerException
- if command == null
.public ATCommand(String command, byte[] parameter)
ATCommand
with the given parameters.
If not parameter is required the constructor
ATCommand(String)
is recommended.
command
- The AT Command alias.parameter
- The command parameter as byte array.IllegalArgumentException
- if command.length() != 2
.NullPointerException
- if command == null
.public ATCommand(String command, String parameter)
ATCommand
with the given parameters.
If not parameter is required the constructor
ATCommand(String)
is recommended.
command
- The AT Command alias.parameter
- The command parameter as string.IllegalArgumentException
- if command.length() != 2
.NullPointerException
- if command == null
.public String getCommand()
public byte[] getParameter()
null
if the command does not
have a parameter.public String getParameterString()
null
if the command does not
have a parameter.public void setParameter(byte[] parameter)
parameter
- The AT command parameter as byte array.public void setParameter(String parameter)
parameter
- The AT command parameter as string.© Copyright 2014–2014 Digi International Inc. All rights reserved.