Cep Terminals GSM/GPRS TERMINAL CT63 JAVA 6203 User Manual
Product codes
6203
Java User’s Guide
12.1 Using the AT Command API
109
wm_java_usersguide_v19
Page 107 of 109
2012-01-27
Confidential / Released
12.1.3.3
Registering a Listener with an ATCommand Instance
After creating an instance of the ATCommandListener class, it must be passed as a parameter
to the ATCommand.addListener() method. The callback methods of the instance will be called
by the runtime system each time the corresponding events (URCs or signal state changes) oc-
cur on the corresponding device AT parser.
to the ATCommand.addListener() method. The callback methods of the instance will be called
by the runtime system each time the corresponding events (URCs or signal state changes) oc-
cur on the corresponding device AT parser.
The ATCommand.removeListener() method removes a listener object that has been previously
added to the internal list table of listener objects. After it has been removed from the list it will
not be called when URCs occur. If it was not previously registered the list remains unchanged.
added to the internal list table of listener objects. After it has been removed from the list it will
not be called when URCs occur. If it was not previously registered the list remains unchanged.
The same ATCommandListener may be added to several ATCommand instances and several
ATCommandListeners may be added to the same ATCommand.
ATCommandListeners may be added to the same ATCommand.
/* we have two ATCommands instances, atc1 and atc2 */
ATListenerA reminder_listener = new ATListenerA();
ATListenerB card_listener = new ATListenerB();
ATListenerA reminder_listener = new ATListenerA();
ATListenerB card_listener = new ATListenerB();
atc1.addListener(reminder_listener);
atc2.addListener(card_listener);
atc2.addListener(card_listener);