Siemens TC65 manual Registering a Listener with an ATCommand Instance

Models: TC65

1 90
Download 90 pages 14.61 Kb
Page 87
Image 87

TC65 JAVA User's Guide

Strictly confidential / Released

s

/* take some action when the DCD signal changes if you want to */

}

public void DSRChanged(boolean SignalState {}

/* take some action when the DSR signal changes if you want to */

}

public void CONNChanged(boolean SignalState {}

/* take some action when the state of a connection changes if you want to */

}

}

12.1.3.3Registering 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) occur on the corresponding device AT parser.

/* we have two ATCommands instances, atc1 and atc2 */ ATListenerA reminder_listener = new ATListenerA(); ATListenerB card_listener = new ATListenerB();

atc1.addListener(reminder_listener); atc2.addListener(card_listener);

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.

The same ATCommandListener may be added to several ATCommand instances and several ATCommandListeners may be added to the same ATCommand.

TC65 JAVA User's Guide_V05

Page 87 of 90

26.09.2005

Page 87
Image 87
Siemens TC65 manual Registering a Listener with an ATCommand Instance