×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    11

    EVENT_MO_SHORT_MESSAGE_CONTROL_BY_SIM

    Hi all, i have a problem with event handler in my sim toolkit applet.
    i wrote the code:

    reg.setEvent(EVENT_MO_SHORT_MESSAGE_CONTROL_BY_SIM);
    ...
    case EVENT_MENU_SELECTION:
    proHdlr.init(PRO_CMD_SEND_SHORT_MESSAGE, (byte)0x00, DEV_ID_NETWORK);
    proHdlr.appendTLV(TAG_ALPHA_IDENTIFIER, strings,
    (short)((MSG_SENDING_SMS * STRING_RECORD_LENGTH)+(short)1),
    (short)(strings[(short)(MSG_SENDING_SMS * STRING_RECORD_LENGTH)]));
    // Define and append optional "Service center address" for the message (TON/NPI + number)
    Util.arrayFillNonAtomic(tempBuffer, (short)0, (short)tempBuffer.length, (byte)0x00);
    tempBuffer[0] = (byte)0x91;
    tempBuffer[1] = (byte)0x21;
    tempBuffer[2] = (byte)0x43;
    tempBuffer[3] = (byte)0x65;
    tempBuffer[4] = (byte)0x87;
    proHdlr.appendTLV(TAG_ADDRESS, tempBuffer, (short)0, (short)5);
    // Define and append SMS TPDU
    Util.arrayFillNonAtomic(tempBuffer, (short)0, (short)tempBuffer.length, (byte)0x00);
    // TP-MTI
    tempBuffer[0] = (byte)0x01;
    // TP-MR
    tempBuffer[1] = (byte)0x00;
    // TP-DA length
    tempBuffer[2] = (byte)0x04;
    // TP-DA
    tempBuffer[3] = (byte)0x91;
    tempBuffer[4] = (byte)0x34;
    tempBuffer[5] = (byte)0x12;
    // TP-PID
    tempBuffer[6] = (byte)0x41;
    // TP-DCS
    tempBuffer[7] = (byte)0xF2;
    // TP-UDL
    tempBuffer[8] = (byte)0x05;
    // TP-UD 'Hello' in 7-bit packed format
    tempBuffer[9] = (byte)'H';
    tempBuffer[10] = (byte)'E';
    tempBuffer[11] = (byte)'L';
    tempBuffer[12] = (byte)'L';
    tempBuffer[13] = (byte)'O';
    proHdlr.appendTLV(TAG_SMS_TPDU, tempBuffer, (byte)0, (byte)14);
    // Send the command to the mobile
    proHdlr.send();
    return;

    case EVENT_MO_SHORT_MESSAGE_CONTROL_BY_SIM:
    EnvelopeResponseHandler erh = EnvelopeResponseHandler.getTheHandler();


    the sms is correctly sent, but the event is not captured!by debugging i can see that the line "EnvelopeResponseHandler erh = EnvelopeResponseHandler.getTheHandler();" is never reached!
    Can anyone help me?
    thanks!

  2. #2
    Regular Contributor
    Join Date
    Oct 2007
    Location
    Pune
    Posts
    189

    Re: EVENT_MO_SHORT_MESSAGE_CONTROL_BY_SIM

    Hello,

    As per specification -
    Only one toolkit applet can register to this event.

    Before registring this event from your applet check any another applet has registred to this event by

    public boolean isEventSet(byte event) of ToolkitRegistry class.
    Regards,
    Dinanath


    It's a matter of attitude.

  3. #3
    Registered User
    Join Date
    Nov 2009
    Posts
    11

    Re: EVENT_MO_SHORT_MESSAGE_CONTROL_BY_SIM

    Hi Dinanath,
    thank you very much for your answer.
    i tried isEventSet(EVENT_MO_SHORT_MESSAGE_CONTROL_BY_SIM) and it returns false,and my project has one unique applet.
    The costructor is:

    public MyApplet() {

    buffer = JCSystem.makeTransientByteArray((short)256, JCSystem.CLEAR_ON_RESET);
    gsmFile = SIMSystem.getTheSIMView();
    gsmFileBuffer = new byte[122];

    reg = ToolkitRegistry.getEntry();

    item_1 = reg.initMenuEntry(strings, (short)1,(short)10, PRO_CMD_DISPLAY_TEXT, false, (byte)0, (short)0);
    reg.setEvent(EVENT_MO_SHORT_MESSAGE_CONTROL_BY_SIM);
    ...
    }


    public void processToolkit(byte event) {
    EnvelopeHandler envHdlr;
    EnvelopeResponseHandler envRspHdlr;
    ProactiveHandler proHdlr;
    ProactiveResponseHandler rspHdlr;
    switch(event) {

    case EVENT_MENU_SELECTION:
    ....

    case EVENT_MO_SHORT_MESSAGE_CONTROL_BY_SIM:
    ....

    }

    it's very strange because if i do the same thing with EVENT_CALL_CONTROL_BY_SIM, i.e. register the event, put in case EVENT_MENU_SELECTION the action of making a call, and then the case EVENT_CALL_CONTROL_BY_SIM, the event is intercepted!
    So i have no more idea to solve this problem.
    Do you have any hint?
    thanks a lot!

  4. #4
    Regular Contributor
    Join Date
    Oct 2007
    Location
    Pune
    Posts
    189

    Re: EVENT_MO_SHORT_MESSAGE_CONTROL_BY_SIM

    Hello,

    I got your point...

    The SMS/Call you are making is not Mobile Originated (MO) its from SIM not from terminal/mobile, as in your code you are sending it in EVENT_MENU_SELECTION event.

    Off course this will not work.

    Only Mobile Originated SMS/Call will fall in resp. events; as your action like SMS/Call are SIM originated.
    Regards,
    Dinanath


    It's a matter of attitude.

  5. #5
    Registered User
    Join Date
    Nov 2009
    Posts
    11

    Re: EVENT_MO_SHORT_MESSAGE_CONTROL_BY_SIM

    but if i wrote the code:

    public MyApplet() {

    buffer = JCSystem.makeTransientByteArray((short)256, JCSystem.CLEAR_ON_RESET);
    gsmFile = SIMSystem.getTheSIMView();
    gsmFileBuffer = new byte[122];

    reg = ToolkitRegistry.getEntry();

    item_1 = reg.initMenuEntry(strings, (short)1,(short)10, PRO_CMD_DISPLAY_TEXT, false, (byte)0, (short)0);
    reg.setEvent(EVENT_CALL_CONTROL_BY_SIM);
    ...
    }


    public void processToolkit(byte event) {

    EnvelopeHandler envHdlr;
    EnvelopeResponseHandler envRspHdlr;
    ProactiveHandler proHdlr;
    ProactiveResponseHandler rspHdlr;
    switch(event) {

    case EVENT_MENU_SELECTION:
    proHdlr.init(PRO_CMD_SET_UP_CALL, (byte) 0x00, DEV_ID_NETWORK);
    proHdlr.appendTLV(TAG_ALPHA_IDENTIFIER, ALPHA_ID_2, (short) 0,
    (short) ALPHA_ID_2.length);
    proHdlr.appendTLV(TAG_ADDRESS, NUMBER_CALLED, (short) 0,
    (short) NUMBER_CALLED.length);
    proHdlr.send();
    return;

    case EVENT_CALL_CONTROL_BY_SIM:
    EnvelopeResponseHandler erh = EnvelopeResponseHandler.getTheHandler();

    the event is captured and the line EnvelopeResponseHandler erh = EnvelopeResponseHandler.getTheHandler();is executed, so my question is: also in this case the call is not MO (because i'm sending the call from EVENT_MENU_SELECTION) , but why here the event is captured, while in the case of sms, the event is not intercepted?

    Moreover, can you suggest me a way to simulate that my applet intercepts the sms that the user is sending?
    thank you very much!

  6. #6
    Registered User
    Join Date
    Nov 2009
    Posts
    11

    Re: EVENT_MO_SHORT_MESSAGE_CONTROL_BY_SIM

    Hi dinanath,
    i think i have found my problem.
    i'm using gemalto simulator and in a paper it is written that MO SHORT MESSAGE CONTROL is not supported by mobile feature of the simulator, while call control is supported.
    thank you very much for your help!
    bye!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×