Confirmed users
266
edits
Allstars.chh (talk | contribs) |
Allstars.chh (talk | contribs) No edit summary |
||
| Line 3: | Line 3: | ||
= Interface = | = Interface = | ||
* These interface will be added in | * These interface will be added in MozIccManager | ||
== Event handlers for receiving messages from ICC to ME == | == Event handlers for receiving messages from ICC to ME == | ||
| Line 54: | Line 54: | ||
* | * | ||
*/ | */ | ||
void sendStkMenuSelection(in unsigned short itemIdentifier, in boolean helpRequested); | void sendStkMenuSelection(in unsigned short itemIdentifier, in boolean helpRequested); | ||
</pre> | </pre> | ||
= STK message format = | = STK message format = | ||
* TS 102.223, Annex C for the structure of STK communications | |||
The specification of the message received from ICC and sent to ICC. | The specification of the message received from ICC and sent to ICC. | ||
Basically, a STK message is of a BER-TLV object, which contains several Comprehension-TLV objects | |||
Basically, a | |||
(TLV : Tag-Length-Value) | (TLV : Tag-Length-Value) | ||
<pre> | <pre> | ||
----- ----- ------------------------------------ | ----- ----- ------------------------------------ | ||
| Line 79: | Line 75: | ||
</pre> | </pre> | ||
Each | |||
Each STK message consists of at least two mandatory Comprehension-TLVs | |||
* Command Details | * Command Details | ||
* Device Identities | * Device Identities | ||
The remaining Comprehension-TLVs varies according to different type of proactive command. | |||
The remaining Comprehension-TLVs varies according to different type of STK message. | |||
<br> | |||
For the "Command Details" data object,<br> | |||
this data object shall be identical to the command details data object (including the comprehension required flag) given | |||
by the UICC in the proactive command to which the terminal is giving the result. | |||
<br> | |||
And there two kinds of STK messages | |||
* From ICC to ME | |||
** MozStkCommand | |||
* From ME to ICC | |||
** MozStkResponse | |||
In both MozStkCommand and MozStkCommand, we expose the content of 'Command Details' as: | |||
* commandNumber | |||
* typeOfCommand | |||
* commandQualifier | |||
So when a webapp tries to create a MozStkResponse, the webapp needs to create exactly the same 'Command Details' as it got from MozStkCommand. | |||
== From ICC to ME == | |||
The STK message sent from ICC to ME called 'Proactive Command'. | |||
And we use MozStkCommand to represent 'Proactive Command'. | |||
<br> | <br> | ||
For example, a Proactive Command SET_UP_MENU whose Comprehension-TLVs will be looked like | For example, a Proactive Command SET_UP_MENU whose Comprehension-TLVs will be looked like | ||
<pre> | <pre> | ||
---------------- -------------- ------------- ---------- ---------- | ---------------- -------------- ------------- ---------- ---------- | ||
| Line 98: | Line 118: | ||
In designing this message format, we wrap up the Comprehension-TLVs other than | In designing this message format, we wrap up the Comprehension-TLVs other than | ||
"Command Details" and "Device Identities" to a more | "Command Details" and "Device Identities" to a more high level UI component according | ||
to the typeOfCommand. | |||
<pre> | <pre> | ||
---------------- -------------- -------------- | |||
| CmdDetails-TLV | DeviceId-TLV | | | CmdDetails-TLV | DeviceId-TLV | UI Component | | ||
---------------- -------------- -------------- | |||
</pre> | </pre> | ||
So web apps can parse | The UI componet includes | ||
* Menu | |||
* Text Message | |||
* Input | |||
* Call set up | |||
* Launch Browser | |||
So web apps can parse the UI componet according to the typeOfCommand. | |||
<br> | |||
In this case, web apps can display a Menu-like UI according to this MozStkCmdParameter | In this case, web apps can display a Menu-like UI according to this MozStkCmdParameter | ||
| Line 128: | Line 158: | ||
=== STK command === | === STK command === | ||
<pre> | <pre> | ||
interface nsIDOMMozStkCommand : nsISupports | interface nsIDOMMozStkCommand : nsISupports | ||
{ | { | ||
/** | /** | ||
| Line 168: | Line 178: | ||
*/ | */ | ||
readonly attribute unsigned short commandQualifier; | readonly attribute unsigned short commandQualifier; | ||
/** | /** | ||
* Used when typeOfCommand in nsIDOMMozStkCommand is | * Used when typeOfCommand in nsIDOMMozStkCommand is | ||
* DISPLAY_TEXT, SET_UP_IDLE_MODE_TEXT, REFRESH and SEND_*. | * DISPLAY_TEXT, SET_UP_IDLE_MODE_TEXT, REFRESH and SEND_*. | ||
*/ | */ | ||
readonly attribute nsIDOMMozStkTextMessage textMessage; | readonly attribute nsIDOMMozStkTextMessage textMessage; | ||
| Line 207: | Line 212: | ||
</pre> | </pre> | ||
==== UI parts - The UI Component contained in MozStkCommand ==== | |||
<pre> | <pre> | ||
interface nsIDOMMozStkTextMessage : nsISupports | interface nsIDOMMozStkTextMessage : nsISupports | ||
| Line 630: | Line 635: | ||
== Show STK menu == | == Show STK menu == | ||
<pre> | <pre> | ||
mozIcc.onstkcommand = function (command) { | |||
switch (command.typeOfCommand) { | |||
switch ( | |||
case MozStkProactiveCommand.SET_UP_MENU: | case MozStkProactiveCommand.SET_UP_MENU: | ||
var menu = command | var menu = command.menu; | ||
// create a Menu-like UI according to 'menu' | // create a Menu-like UI according to 'menu' | ||
break; | break; | ||
| Line 644: | Line 648: | ||
<pre> | <pre> | ||
function menuSelection(id, helpRequested) { | function menuSelection(id, helpRequested) { | ||
mozIcc.sendMenuSelection(id, helpRequested); | |||
} | } | ||
</pre> | </pre> | ||
| Line 656: | Line 660: | ||
// 'id' is got from the chosen item identifier (menu.item[].identifier) | // 'id' is got from the chosen item identifier (menu.item[].identifier) | ||
response.itemIdentifier = id; | response.itemIdentifier = id; | ||
mozIcc.sendStkResponse(response); | |||
</pre> | </pre> | ||
== Get Input == | == Get Input == | ||
<pre> | <pre> | ||
mozIcc.onstkcommand = function (command) { | |||
switch (command.typeOfCommand) { | |||
switch ( | |||
case MozStkProactiveCommand.GET_INPUT: | case MozStkProactiveCommand.GET_INPUT: | ||
var input = command | var input = command.input; | ||
// create a TextInput-like UI according to 'input' | // create a TextInput-like UI according to 'input' | ||
break; | break; | ||
| Line 676: | Line 679: | ||
response.resultCode = MozStkResultCode.RESULT_OK; | response.resultCode = MozStkResultCode.RESULT_OK; | ||
response.input = input; | response.input = input; | ||
mozIcc.sendStkResponse(response); | |||
} | } | ||
</pre> | </pre> | ||
| Line 682: | Line 685: | ||
== Set Up Call == | == Set Up Call == | ||
<pre> | <pre> | ||
mozIcc.onstkcommand = function (command) { | |||
switch (command.typeOfCommand) { | |||
switch ( | |||
case MozStkProactiveCommand.SET_UP_CALL: | case MozStkProactiveCommand.SET_UP_CALL: | ||
var setup = command.param.setup; | var setup = command.param.setup; | ||
| Line 698: | Line 700: | ||
response.resultCode = MozStkResultCode.RESULT_OK; | response.resultCode = MozStkResultCode.RESULT_OK; | ||
response.confirmation = confirm; | response.confirmation = confirm; | ||
mozIcc.sendStkResponse(response); | |||
} | } | ||
</pre> | </pre> | ||