This content has been marked as final. Show 5 replies
Shylin wrote:As far as I'm concerned, the requestPollInterval() method is only used for requesting poll interval when you receive the event EVENT_STATUS_COMMAND. So you can not register this event by writing reg.requestPollInterval((short) 30).
I dont know this is the right forum to post a message about SIM Toolkit or not, because every time I post a message about STK, I dont get any answer! :(
So if it is not the right forum please tell me!
I am developing a SIM Toolkit Applet (STK), I need to catch the following events: EVENT_PROFILE_DOWNLOAD and EVENT_STATUS_COMMAND.
but unfortunately these events aren't triggered in my STK!
I have registered my STK for these events as you can see here :
any help would be appreciated!
reg.setEvent(EVENT_PROFILE_DOWNLOAD); reg.requestPollInterval((short) 30);
You should try to register this event by the usual way that you did with others.
Hope it helps,
In your case, you only need set EVENT_STATUS_COMMAND follow this:
And then, if you want to catch this event, you do like as:
1/ SELECT DF-gsm
2/ After receive status word: 9Fxx, you send APDU: A0 F2 00 00 xx
3/ Your SIM applet will be triggered at the moment
Have you been able to solve the problem?
If not, you can check the following things:
1. In your code, ensure that besides registering the events, you need also to put switch-case condition for those events under processToolkit(). Add something to indicate that the event is working, e.g. display text "Hello 1" on profile download and "Hello 2" on status command (use ProactiveHandler class).
2. Check some lines before the event registration, ensure that there is no possible code that can lead to an exception.
3. Ensure that the CAP/IJC is loaded correctly to the card
4. If you are using real mobile/handset for testing, ensure that it supports Poll Interval command in its Terminal Profile (you need to have a spy tool such as Micropross for this, but from my experience most handsets support this feature). Check that you get "Hello 1" followed by "Hello 2"
5. If you are using desktop application that can send APDU as follow:
a. Reset the card
b. Send Terminal Profile, e.g. A010000008FFFFFFFFFFFFFFFF
c. The status word shall be 91XX, indicating that the card is about to send Poll Interval (as a result of requestPollInterval)
d. Fetch the proactive command, A0120000XX (XX shall match with point c above, most likely 0F)
e. The response shall look similar to this: D0 0D 81 03 01 03 00 82 02 81 82 04 02 01 1E (1E is the duration, which is 30 in decimal)
f. On step e above, the code is working, that is the applet can send poll. You can send Terminal Response A0 14 00 00 10 81 03 01 03 00 02 02 82 81 03 01 00 04 02 01 1E
g. The card response with SW 91XX, if fetched the content shall be "Hello 1"
h. After e, you can send Status command to trigger "Hello 2", e.g. A0F200000F
Hope that helps!
Edited by: 960222 on Sep 19, 2012 9:27 PM