Cep Terminals GSM/GPRS TERMINAL CT63 JAVA 6203 User Manual

Product codes
6203
Page of 109
Java User’s Guide
12.1 Using the AT Command API
109
wm_java_usersguide_v19
Page 101 of 109
2012-01-27
Confidential / Released
12.1.1.2
Sending an AT Command to the Device, the send() Method
An AT command is sent to the device by using the send() method. The AT command is sent 
as a string which must include the finalizing line feed "\r" or the corresponding line end charac-
ter. 
This send function is a blocking call, which means that the calling thread will be interrupted until 
the module returns a response. The function returns the response, the result code of the AT 
command, as a string. 
Occasionally it may be infeasible to wait for an AT command that requires some time to be pro-
cessed, such as AT+COPS. There is a second, non-blocking, send function which takes a sec-
ond parameter in addition to the AT command. This second parameter is a callback instance, 
ATCommandResponseListener.  Any response to the AT command is delivered to the callback 
instance when it becomes available. The method itself returns immediately. The ATComman-
dResponseListener
 and the non-blocking send method are described in 
.
Note: Using the send methods with strings with incorrect AT command syntax will cause errors.
String response = atc.send(“at+cpin?\r”);
/* method returns when the module returns a response */
System.out.println(response);
#Possible response printed to System.out:
+CPIN: READY OK