Event Timer Expiration problem
Hello all,
I have problem with Timer, I've registered the Event, Timer was started and expirated. But the applet was not triggered. What I want to do is catching the event if the timer expirates and display some text or play tone. I tried to get the event "EVENT_TIMER_EXPIRATION" triggered or the envelop tag "BTAG_TIMER_EXPIRATION". Nothing happens. I checked the TERMINAL PROFILE where all items about Timer are supported.
Pls have a look at my source code following, if I am doing sth wrong. Any help would be appreciated!
p.s.: i simplified the applet for testing.
public MyApplet1 (){
reg = ToolkitRegistry.getEntry();
reg.allocateTimer();
// two events were registered for triggering
reg.setEvent(EVENT_FORMATTED_SMS_PP_ENV);
reg.setEvent(EVENT_UNFORMATTED_SMS_PP_ENV);
}
publicvoid processToolkit (byte event ){
ProactiveHandler proHdlr = ProactiveHandler.getTheHandler();
ProactiveResponseHandler rspHdlr = ProactiveResponseHandler.getTheHandler();
EnvelopeHandler envHdlr = EnvelopeHandler.getTheHandler();
EnvelopeResponseHandler envRspHdlr = EnvelopeResponseHandler.getTheHandler();
if (envHdlr.getEnvelopeTag() == BTAG_TIMER_EXPIRATION){
displayMessage ((byte)81, DCS_8_BIT_DATA, textToDisplay, (short)0, (short)2);
}
if (event == EVENT_TIMER_EXPIRATION){
displayMessage ((byte)81, DCS_8_BIT_DATA, textToDisplay, (short)2, (short)2);
}
if (event == EVENT_FORMATTED_SMS_PP_ENV || event == EVENT_UNFORMATTED_SMS_PP_ENV){
byte [] timerData =newbyte [3];
timerData [0] = (byte)0;
timerData [1] = (byte)0;
timerData [2] = (byte)0x51;
proHdlr.init(PRO_CMD_TIMER_MANAGEMENT, (byte)0, DEV_ID_ME);
proHdlr.appendTLV(TAG_TIMER_IDENTIFIER, (byte)1);
proHdlr.appendTLV(TAG_TIMER_VALUE, timerData, (short)0, (short)3);
proHdlr.send();
}
}

