Java Tutorial; Using The At Command Api; Class Atcommand; Instantiation With Or Without Csd Support - Siemens XT65 User Manual

Siemens cell phone accessories user manual
Hide thumbs Also See for XT65:
Table of Contents

Advertisement

Java User's Guide

13 Java Tutorial

122
13
Java Tutorial
This small tutorial includes explanations on how to use the AT Command API and suggestions
for programming MIDlets. The developer should read about MIDlets, Threads and AT com-
mands as a complement to this tutorial.
13.1

Using the AT Command API

Perhaps the most important API for the developer is the AT command API. This is the API that
lets the developer issue commands to control the module. This API consists of the ATCom-
mand class and the ATCommandListener and ATCommandResponseListener interfaces.
Their javadocs can be found in ...\wtk\doc\html\index.html, [3].
13.1.1

Class ATCommand

The ATCommand class supports the execution of AT commands in much the same way as
they would be executed over a serial interface. It provides a simple way to send strings directly
to the device's AT parsers.
13.1.1.1

Instantiation with or without CSD Support

There can be only exactly as many ATCommand instances as there are parsers on the device.
If there are no more parsers available, the ATCommand constructor will throw ATCommand-
FailedException. All AT parser instances support CSD. However from a Java application point
of view it may make sense to have one dedicated instance for CSD call handling. Therefore,
and also for historical reasons, only one parser with CSD support may be requested through
the constructor. If more then one parser with CSD support is requested, the constructor will
throw ATCommandFailedException.
try {
ATCommand atc = new ATCommand(false);
/* An instance of ATCommand is created. CSD is not explicitly
* requested. */
}
catch (ATCommandFailedException e) {
System.out.println(e);
}
The csdSupported() method returns the CSD capability of the connected instance of the
device's AT parser. The method checks as well, if the current mode of the module supports
CSD. Please notice that this check has not been done when opening the ATCommand
instance.
boolean csd_support = atc.csdSupported();
release() releases the resources held by the instance of the ATCommand class. After calling
this function the class instance cannot be used any more but the resources are free to be used
by a new instance
wm_java_usersguide_v12
Confidential / Released
Page 113 of 123
s
2008-02-25

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ac65Ac75Xt75Tc65

Table of Contents