On 06/07/2012 02:54 AM, Philipp von Weitershausen wrote:
> Hi Yoshi, thanks for bringing this up again. Do you have interface
> specs for nsIDOMMozStkResponse as well as the event that is passed to
> 'onstkmessage'?
>
Yes, I just don't want to post too many things at one time to distract
people,
as my last time did.
I shall start explaining nsIDOMMozStkCommand, since it's issued by ICC
first.
The name StkCommand is named following the "Proactive Command" from spec.
It means this command is initiated by ICC.
nsIDOMMozStkCommand will be the parameter in onstkmessage.
(PS. Or if you think commmand/message/event will confuse you, I will try
to choose a unique one.)
interface nsIDOMMozStkCommand
{
/**
* The detail information of the proactive command issued by ICC.
*/
readonly attribute nsIDOMMozStkCmdDetails cmdDetails;
/**
* One of nsIDOMMozStkCmd*Param.
*/
readonly attribute nsIDOMMozStkCmdParameter param;
};
You could see the diagram in TS 11.14(GSM) Annex D or
TS 102.223(For UICC) Annex C for the structure of STK commands.
Each proactive command consists of several chunks, or Simple TLV
But it must contain one "Command Details" Simple-TLV (TS 11.14, clause 12.6)
The remaining Simple TLVs should be used according to this "Command Details"
For example.
A Proactive Command "SET_UP_MENU" is the first proactive command to set
up the STK menu.
It usually consists of
- Command Details TLV : type is SET_UP_MENU
- Alpha ID TLV --> should be used as Menu title
- Item TLV-> should be used as 1st Item
- Item TLV -> should be used as 2nd item
And its UI should look like:
-------------
| Title |
-------------
| Item 1 |
-------------
| Item 2 |
-------------
In this case, in nsIDOMMozStkCommand
cmdDetails will be the "Command Details" TLV.
and param should contain the remaining TLVs:
- Alpha ID TLV
- Item 1 TLV
- Item 2 TLV
They will be assembled to be a StkMenu, which is wrapped into a
StkCmdParameter
interface nsIDOMMozStkMenu
{
// items[], title, etc
};
interface nsIDOMMozStkCmdSelectItemParam : nsIDOMMozStkCmdParameter
{
readonly attribute nsIDOMMozStkMenu menu;
};
Next I'll explain StkResponse briefly.
nsIDOMMozStkResponse is the message sent from ME to ICC
The name StkResponse is named following the term "Terminal Response"
from spec.
interface nsIDOMMozStkResponse
{
/**
* The detail information of the proactive command issued by ICC.
*/
readonly attribute nsIDOMMozStkCmdDetails cmdDetails;
/**
* One of STK_RESULT_*.
*/
attribute unsigned short resultCode;
/**
* The identifier of the menu item selected by user.
*/
attribute unsigned short menuSelection;
/**
* User input.
*/
attribute DOMString input;
/**
* YES/NO response.
*
* @see TS 11.14, clause 12.6, Command Qualifier, GET INKEY, bit 3.
*
* true: User selects 'Yes'.
* false: User selects 'No'.
*/
attribute boolean yesNo;
/**
* User has accepted or rejected the call during STK_CMD_CALL_SET_UP.
*
* @see RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM
*
* true: Confirmed by User.
* false: Rejected by User.
*/
attribute boolean confirmation;
};
This response is used to handle many kinds of proactive commands,
like SET_UP_MENU, SELECT_ITEM, GET_INPUT, ... etc
So each attribute has its own purpose to be interpreted by ICC.
Noted here the cmdDetails value in StkResponse should be the same with
corresponding StkCommand.
So ICC won't be confused by multiple Proactive commands.
Once you got a more clear understanding about STK, I will post the WebIDL
But it will be long, as you can see my first STK proposal last week , it
contains many data structures.
Or maybe I'll consider post it in Bugzilla.
Again, thanks for your comments