WebAPI/WebSTK: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 3: Line 3:


= Interface =
= Interface =
* These interface will be added in WebMobileConnection
* 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:
   *         
   *         
   */  
   */  
  // TODO - Add deviceId for multi-SIM
   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.
<br>
Between the proactive command and the corresponding terminal respomnse,
their 'Command Details' data object should be identical.


== From ICC to ME ==
Basically, a STK message is of a BER-TLV object, which contains several Comprehension-TLV objects
* See TS 102.223, Annex C for the structure of STK communications
Basically, a Proactive command is a BER-TLV object, which contains several Comprehension-TLV objects
(TLV : Tag-Length-Value)
(TLV : Tag-Length-Value)
<pre>
<pre>
                       ----- ----- ------------------------------------
                       ----- ----- ------------------------------------
Line 79: Line 75:


</pre>
</pre>
Each Proactive Command consists of at least two mandatory Comprehension-TLVs
 
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 general term, MozStkCmdParameter
"Command Details" and "Device Identities" to a more high level UI component according
to the typeOfCommand.
<pre>
<pre>
   ---------------- -------------- --------------------
   ---------------- -------------- --------------
   | CmdDetails-TLV | DeviceId-TLV | MozStkCmdParameter |
   | CmdDetails-TLV | DeviceId-TLV | UI Component |
   ---------------- -------------- --------------------
   ---------------- -------------- --------------
</pre>
</pre>
So web apps can parse MozStkCmdParameter according to the typeOfCommand specified in CmdDetails.
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 ===
* TODO: add deviceId for multi-SIM
<pre>
<pre>
interface nsIDOMMozStkCommand : nsISupports
interface nsIDOMMozStkCommand : nsISupports
{
  /**
  * The detail information of the proactive command issued by ICC.
  */
  readonly attribute nsIDOMMozStkCmdDetails cmdDetails;
  /**
  * The parameter of this proactive command issued by ICC.
  */
  readonly attribute nsIDOMMozStkCmdParameter param;
  //TODO: add deviceId for multi-SIM
};
</pre>
==== Command Details ====
<pre>
interface nsIDOMMozStkCmdDetails : nsISupports
{
{
   /**
   /**
Line 168: Line 178:
   */  
   */  
   readonly attribute unsigned short commandQualifier;
   readonly attribute unsigned short commandQualifier;
};
 
</pre>
 
==== Command Parameter ====
<pre>
interface nsIDOMMozStkCmdParameter : nsISupports
{
   /**
   /**
   * 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 detail format contained in MozStkCmdParameter =====
==== 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>
mobileConnection.onstkcommand = function (command) {
mozIcc.onstkcommand = function (command) {
  var details = command.cmdDetails;
   switch (command.typeOfCommand) {
   switch (details.typeOfCommand) {
     case MozStkProactiveCommand.SET_UP_MENU:
     case MozStkProactiveCommand.SET_UP_MENU:
       var menu = command.param.menu;
       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) {
   mobileConnection.sendMenuSelection(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;
mobileConnection.sendStkResponse(response);
mozIcc.sendStkResponse(response);
</pre>
</pre>


== Get Input ==
== Get Input ==
<pre>
<pre>
mobileConnection.onstkcommand = function (command) {
mozIcc.onstkcommand = function (command) {
  var details = command.cmdDetails;
   switch (command.typeOfCommand) {
   switch (details.typeOfCommand) {
     case MozStkProactiveCommand.GET_INPUT:
     case MozStkProactiveCommand.GET_INPUT:
       var input = command.param.input;
       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;
   mobileConnection.sendStkResponse(response);
   mozIcc.sendStkResponse(response);
}
}
</pre>
</pre>
Line 682: Line 685:
== Set Up Call ==
== Set Up Call ==
<pre>
<pre>
mobileConnection.onstkcommand = function (command) {
mozIcc.onstkcommand = function (command) {
  var details = command.cmdDetails;
   switch (command.typeOfCommand) {
   switch (details.typeOfCommand) {
     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;
   mobileConnection.sendStkResponse(response);
   mozIcc.sendStkResponse(response);
}
}
</pre>
</pre>
Confirmed users
266

edits

Navigation menu