All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/1] Simulate send ss command in sim app
@ 2010-09-10  6:09 Yang Gu
  2010-09-10 21:26 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Gu @ 2010-09-10  6:09 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 21533 bytes --]

---
 src/simapplication.cpp |  672 ++++++++++++++++++++++++++++++++++++++++++++++++
 src/simapplication.h   |   16 ++
 2 files changed, 688 insertions(+), 0 deletions(-)

diff --git a/src/simapplication.cpp b/src/simapplication.cpp
index 6ca03d9..4af510b 100644
--- a/src/simapplication.cpp
+++ b/src/simapplication.cpp
@@ -280,6 +280,7 @@ const QString DemoSimApplication::getName()
 #define MainMenu_Finance    8
 #define MainMenu_Browser    9
 #define MainMenu_DTMF       10
+#define MainMenu_SendSS     11
 
 #define SportsMenu_Chess        1
 #define SportsMenu_Painting     2
@@ -290,6 +291,44 @@ const QString DemoSimApplication::getName()
 #define CallsMenu_Disconnect    2
 #define CallsMenu_Hold          3
 
+#define SendSSMenu_CB       1
+#define SendSSMenu_CF       2
+#define SendSSMenu_CW       3
+#define SendSSMenu_CLIP     4
+#define SendSSMenu_CLIR     5
+#define SendSSMenu_CoLP     6
+#define SendSSMenu_CoLR     7
+
+#define CBMenu_Activation       1
+#define CBMenu_Interrogation    2
+#define CBMenu_Deactivation     3
+
+#define CFMenu_Registration     1
+#define CFMenu_Activation       2
+#define CFMenu_Interrogation    3
+#define CFMenu_Deactivation     4
+#define CFMenu_Erasure          5
+
+#define CWMenu_Activation       1
+#define CWMenu_Interrogation    2
+#define CWMenu_Deactivation     3
+
+#define CLIPMenu_Activation       1
+#define CLIPMenu_Interrogation    2
+#define CLIPMenu_Deactivation     3
+
+#define CLIRMenu_Activation       1
+#define CLIRMenu_Interrogation    2
+#define CLIRMenu_Deactivation     3
+
+#define CoLPMenu_Activation       1
+#define CoLPMenu_Interrogation    2
+#define CoLPMenu_Deactivation     3
+
+#define CoLRMenu_Activation       1
+#define CoLRMenu_Interrogation    2
+#define CoLRMenu_Deactivation     3
+
 void DemoSimApplication::mainMenu()
 {
     QSimCommand cmd;
@@ -338,6 +377,10 @@ void DemoSimApplication::mainMenu()
     item.setLabel( "DialTones" );
     items += item;
 
+    item.setIdentifier( MainMenu_SendSS );
+    item.setLabel( "Send SS" );
+    items += item;
+
     cmd.setMenuItems( items );
 
     command( cmd, 0, 0 );
@@ -432,6 +475,12 @@ void DemoSimApplication::mainMenuSelection( int id )
         }
         break;
 
+        case MainMenu_SendSS:
+        {
+            sendSendSSMenu();
+        }
+        break;
+
         default:
         {
             // Don't know what this item is, so just re-display the main menu.
@@ -970,3 +1019,626 @@ void DemoSimApplication::browserMenu( const QSimTerminalResponse& resp )
         endSession();
     }
 }
+
+void DemoSimApplication::sendSendSSMenu()
+{
+    QSimCommand cmd;
+    QSimMenuItem item;
+    QList<QSimMenuItem> items;
+
+    cmd.setType( QSimCommand::SelectItem );
+    cmd.setTitle( "Send SS" );
+
+    item.setIdentifier( SendSSMenu_CB );
+    item.setLabel( "CB (Call Barring)" );
+    items += item;
+
+    item.setIdentifier( SendSSMenu_CF );
+    item.setLabel( "CF (Call Forwarding)" );
+    items += item;
+
+    item.setIdentifier( SendSSMenu_CW );
+    item.setLabel( "CW (Call Waiting)" );
+    items += item;
+
+    item.setIdentifier( SendSSMenu_CLIP );
+    item.setLabel( "CLIP (Calling Line Idnetification Presentation)" );
+    items += item;
+
+    item.setIdentifier( SendSSMenu_CLIR );
+    item.setLabel( "CLIR (Calling Line Identification Restriction)" );
+    items += item;
+
+    item.setIdentifier( SendSSMenu_CoLP );
+    item.setLabel( "CoLP (Connected Line Identification Presentation)" );
+    items += item;
+
+    item.setIdentifier( SendSSMenu_CoLR );
+    item.setLabel( "CoLR (Connected Line Identification Restriction)" );
+    items += item;
+
+    cmd.setMenuItems( items );
+
+    command( cmd, this, SLOT(sendSSMenu(QSimTerminalResponse)) );
+}
+
+void DemoSimApplication::sendSSMenu( const QSimTerminalResponse& resp )
+{
+    QSimCommand cmd;
+
+    if ( resp.result() == QSimTerminalResponse::Success ) {
+        switch ( resp.menuItem() ) {
+
+            case SendSSMenu_CB:
+            {
+                sendCBMenu();
+            }
+            break;
+
+            case SendSSMenu_CF:
+            {
+                sendCFMenu();
+            }
+            break;
+
+            case SendSSMenu_CW:
+            {
+                sendCWMenu();
+            }
+            break;
+
+            case SendSSMenu_CLIP:
+            {
+                sendCLIPMenu();
+            }
+            break;
+
+            case SendSSMenu_CLIR:
+            {
+                sendCLIRMenu();
+            }
+            break;
+
+            case SendSSMenu_CoLP:
+            {
+                sendCoLPMenu();
+            }
+            break;
+
+            case SendSSMenu_CoLR:
+            {
+                sendCoLRMenu();
+            }
+            break;
+
+            default:
+                endSession();
+                break;
+        }
+    } else {
+        endSession();
+    }
+}
+
+void DemoSimApplication::sendCBMenu()
+{
+    QSimCommand cmd;
+    QSimMenuItem item;
+    QList<QSimMenuItem> items;
+
+    cmd.setType( QSimCommand::SelectItem );
+    cmd.setTitle( "CB" );
+
+    item.setIdentifier( CBMenu_Activation );
+    item.setLabel( "Activation" );
+    items += item;
+
+    item.setIdentifier( CBMenu_Interrogation );
+    item.setLabel( "Interrogation" );
+    items += item;
+
+    item.setIdentifier( CBMenu_Deactivation );
+    item.setLabel( "Deactivation" );
+    items += item;
+
+    cmd.setMenuItems( items );
+
+    command( cmd, this, SLOT(CBMenu(QSimTerminalResponse)) );
+}
+
+void DemoSimApplication::CBMenu( const QSimTerminalResponse& resp )
+{
+    QSimCommand cmd;
+
+    if ( resp.result() == QSimTerminalResponse::Success ) {
+        switch ( resp.menuItem() ) {
+
+            case CBMenu_Activation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "*33*3579#" );
+                command( cmd, this, SLOT(sendCBMenu()) );
+            }
+            break;
+
+            case CBMenu_Interrogation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "*#33#" );
+                command( cmd, this, SLOT(sendCBMenu()) );
+            }
+                break;
+
+            case CBMenu_Deactivation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "#33*3579#" );
+                command( cmd, this, SLOT(sendCBMenu()) );
+            }
+            break;
+
+            default:
+                endSession();
+                break;
+        }
+    } else if ( resp.result() == QSimTerminalResponse::BackwardMove ) {
+        sendSendSSMenu();
+    } else {
+        endSession();
+    }
+}
+
+void DemoSimApplication::sendCFMenu()
+{
+    QSimCommand cmd;
+    QSimMenuItem item;
+    QList<QSimMenuItem> items;
+
+    cmd.setType( QSimCommand::SelectItem );
+    cmd.setTitle( "CF" );
+
+    item.setIdentifier( CFMenu_Registration );
+    item.setLabel( "Registration" );
+    items += item;
+
+    item.setIdentifier( CFMenu_Activation );
+    item.setLabel( "Activation" );
+    items += item;
+
+    item.setIdentifier( CFMenu_Interrogation );
+    item.setLabel( "Interrogation" );
+    items += item;
+
+    item.setIdentifier( CFMenu_Deactivation );
+    item.setLabel( "Deactivation" );
+    items += item;
+
+    item.setIdentifier( CFMenu_Erasure );
+    item.setLabel( "Erasure" );
+    items += item;
+
+    cmd.setMenuItems( items );
+
+    command( cmd, this, SLOT(CFMenu(QSimTerminalResponse)) );
+}
+
+void DemoSimApplication::CFMenu( const QSimTerminalResponse& resp )
+{
+    QSimCommand cmd;
+
+    if ( resp.result() == QSimTerminalResponse::Success ) {
+        switch ( resp.menuItem() ) {
+
+            case CFMenu_Registration:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "**62*+155543*11#" );
+                command( cmd, this, SLOT(sendCFMenu()) );
+            }
+            break;
+
+            case CFMenu_Activation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "*62#" );
+                command( cmd, this, SLOT(sendCFMenu()) );
+            }
+            break;
+
+            case CFMenu_Interrogation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "*#62**11#" );
+                command( cmd, this, SLOT(sendCFMenu()) );
+            }
+            break;
+
+            case CFMenu_Deactivation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "#62#" );
+                command( cmd, this, SLOT(sendCFMenu()) );
+            }
+            break;
+
+            case CFMenu_Erasure:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "##62#" );
+                command( cmd, this, SLOT(sendCFMenu()) );
+            }
+            break;
+
+            default:
+                endSession();
+                break;
+        }
+    } else if ( resp.result() == QSimTerminalResponse::BackwardMove ) {
+        sendSendSSMenu();
+    } else {
+        endSession();
+    }
+}
+
+void DemoSimApplication::sendCWMenu()
+{
+    QSimCommand cmd;
+    QSimMenuItem item;
+    QList<QSimMenuItem> items;
+
+    cmd.setType( QSimCommand::SelectItem );
+    cmd.setTitle( "CW" );
+
+    item.setIdentifier( CWMenu_Activation );
+    item.setLabel( "Activation" );
+    items += item;
+
+    item.setIdentifier( CWMenu_Interrogation );
+    item.setLabel( "Interrogation" );
+    items += item;
+
+    item.setIdentifier( CWMenu_Deactivation );
+    item.setLabel( "Deactivation" );
+    items += item;
+
+    cmd.setMenuItems( items );
+
+    command( cmd, this, SLOT(CWMenu(QSimTerminalResponse)) );
+}
+
+void DemoSimApplication::CWMenu( const QSimTerminalResponse& resp )
+{
+    QSimCommand cmd;
+
+    if ( resp.result() == QSimTerminalResponse::Success ) {
+        switch ( resp.menuItem() ) {
+
+            case CWMenu_Activation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "*43#" );
+                command( cmd, this, SLOT(sendCWMenu()) );
+            }
+            break;
+
+            case CWMenu_Interrogation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "*#43#" );
+                command( cmd, this, SLOT(sendCWMenu()) );
+            }
+            break;
+
+            case CWMenu_Deactivation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "#43#" );
+                command( cmd, this, SLOT(sendCWMenu()) );
+            }
+            break;
+
+            default:
+                endSession();
+                break;
+        }
+    } else if ( resp.result() == QSimTerminalResponse::BackwardMove ) {
+        sendSendSSMenu();
+    } else {
+        endSession();
+    }
+}
+
+void DemoSimApplication::sendCLIPMenu()
+{
+    QSimCommand cmd;
+    QSimMenuItem item;
+    QList<QSimMenuItem> items;
+
+    cmd.setType( QSimCommand::SelectItem );
+    cmd.setTitle( "CLIP" );
+
+    item.setIdentifier( CLIPMenu_Activation );
+    item.setLabel( "Activation" );
+    items += item;
+
+    item.setIdentifier( CLIPMenu_Interrogation );
+    item.setLabel( "Interrogation" );
+    items += item;
+
+    item.setIdentifier( CLIPMenu_Deactivation );
+    item.setLabel( "Deactivation" );
+    items += item;
+
+    cmd.setMenuItems( items );
+
+    command( cmd, this, SLOT(CLIPMenu(QSimTerminalResponse)) );
+}
+
+void DemoSimApplication::CLIPMenu( const QSimTerminalResponse& resp )
+{
+    QSimCommand cmd;
+
+    if ( resp.result() == QSimTerminalResponse::Success ) {
+        switch ( resp.menuItem() ) {
+
+            case CLIPMenu_Activation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "*30#" );
+                command( cmd, this, SLOT(sendCLIPMenu()) );
+            }
+            break;
+
+            case CLIPMenu_Interrogation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "*#30#" );
+                command( cmd, this, SLOT(sendCLIPMenu()) );
+            }
+            break;
+
+            case CLIPMenu_Deactivation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "#30#" );
+                command( cmd, this, SLOT(sendCLIPMenu()) );
+            }
+            break;
+
+            default:
+                endSession();
+                break;
+        }
+    } else if ( resp.result() == QSimTerminalResponse::BackwardMove ) {
+        sendSendSSMenu();
+    } else {
+        endSession();
+    }
+}
+
+void DemoSimApplication::sendCLIRMenu()
+{
+    QSimCommand cmd;
+    QSimMenuItem item;
+    QList<QSimMenuItem> items;
+
+    cmd.setType( QSimCommand::SelectItem );
+    cmd.setTitle( "CLIR" );
+
+    item.setIdentifier( CLIRMenu_Activation );
+    item.setLabel( "Activation" );
+    items += item;
+
+    item.setIdentifier( CLIRMenu_Interrogation );
+    item.setLabel( "Interrogation" );
+    items += item;
+
+    item.setIdentifier( CLIRMenu_Deactivation );
+    item.setLabel( "Deactivation" );
+    items += item;
+
+    cmd.setMenuItems( items );
+
+    command( cmd, this, SLOT(CLIRMenu(QSimTerminalResponse)) );
+}
+
+void DemoSimApplication::CLIRMenu( const QSimTerminalResponse& resp )
+{
+    QSimCommand cmd;
+
+    if ( resp.result() == QSimTerminalResponse::Success ) {
+        switch ( resp.menuItem() ) {
+
+            case CLIRMenu_Activation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "*31#" );
+                command( cmd, this, SLOT(sendCLIRMenu()) );
+            }
+            break;
+
+            case CLIRMenu_Interrogation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "*#31#" );
+                command( cmd, this, SLOT(sendCLIRMenu()) );
+            }
+            break;
+
+            case CLIRMenu_Deactivation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "#31#" );
+                command( cmd, this, SLOT(sendCLIRMenu()) );
+            }
+            break;
+
+            default:
+                endSession();
+                break;
+        }
+    } else if ( resp.result() == QSimTerminalResponse::BackwardMove ) {
+        sendSendSSMenu();
+    } else {
+        endSession();
+    }
+}
+
+void DemoSimApplication::sendCoLPMenu()
+{
+    QSimCommand cmd;
+    QSimMenuItem item;
+    QList<QSimMenuItem> items;
+
+    cmd.setType( QSimCommand::SelectItem );
+    cmd.setTitle( "CoLP" );
+
+    item.setIdentifier( CoLPMenu_Activation );
+    item.setLabel( "Activation" );
+    items += item;
+
+    item.setIdentifier( CoLPMenu_Interrogation );
+    item.setLabel( "Interrogation" );
+    items += item;
+
+    item.setIdentifier( CoLPMenu_Deactivation );
+    item.setLabel( "Deactivation" );
+    items += item;
+
+    cmd.setMenuItems( items );
+
+    command( cmd, this, SLOT(CoLPMenu(QSimTerminalResponse)) );
+}
+
+void DemoSimApplication::CoLPMenu( const QSimTerminalResponse& resp )
+{
+    QSimCommand cmd;
+
+    if ( resp.result() == QSimTerminalResponse::Success ) {
+        switch ( resp.menuItem() ) {
+
+            case CoLPMenu_Activation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "*76#" );
+                command( cmd, this, SLOT(sendCoLPMenu()) );
+            }
+            break;
+
+            case CoLPMenu_Interrogation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "*#76#" );
+                command( cmd, this, SLOT(sendCoLPMenu()) );
+            }
+            break;
+
+            case CoLPMenu_Deactivation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "#76#" );
+                command( cmd, this, SLOT(sendCoLPMenu()) );
+            }
+            break;
+
+            default:
+                endSession();
+                break;
+        }
+    } else if ( resp.result() == QSimTerminalResponse::BackwardMove ) {
+        sendSendSSMenu();
+    } else {
+        endSession();
+    }
+}
+
+void DemoSimApplication::sendCoLRMenu()
+{
+    QSimCommand cmd;
+    QSimMenuItem item;
+    QList<QSimMenuItem> items;
+
+    cmd.setType( QSimCommand::SelectItem );
+    cmd.setTitle( "CoLR" );
+
+    item.setIdentifier( CoLRMenu_Activation );
+    item.setLabel( "Activation" );
+    items += item;
+
+    item.setIdentifier( CoLRMenu_Interrogation );
+    item.setLabel( "Interrogation" );
+    items += item;
+
+    item.setIdentifier( CoLRMenu_Deactivation );
+    item.setLabel( "Deactivation" );
+    items += item;
+
+    cmd.setMenuItems( items );
+
+    command( cmd, this, SLOT(CoLRMenu(QSimTerminalResponse)) );
+}
+
+void DemoSimApplication::CoLRMenu( const QSimTerminalResponse& resp )
+{
+    QSimCommand cmd;
+
+    if ( resp.result() == QSimTerminalResponse::Success ) {
+        switch ( resp.menuItem() ) {
+
+            case CoLRMenu_Activation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "*77#" );
+                command( cmd, this, SLOT(sendCoLRMenu()) );
+            }
+            break;
+
+            case CoLRMenu_Interrogation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "*#77#" );
+                command( cmd, this, SLOT(sendCoLRMenu()) );
+            }
+            break;
+
+            case CoLRMenu_Deactivation:
+            {
+                cmd.setType( QSimCommand::SendSS );
+                cmd.setDestinationDevice( QSimCommand::Network );
+                cmd.setNumber( "#77#" );
+                command( cmd, this, SLOT(sendCoLRMenu()) );
+            }
+            break;
+
+            default:
+                endSession();
+                break;
+        }
+    } else if ( resp.result() == QSimTerminalResponse::BackwardMove ) {
+        sendSendSSMenu();
+    } else {
+        endSession();
+    }
+}
diff --git a/src/simapplication.h b/src/simapplication.h
index adaf2c2..0f67317 100644
--- a/src/simapplication.h
+++ b/src/simapplication.h
@@ -93,6 +93,22 @@ protected slots:
     void sendBrowserMenu();
     void browserMenu( const QSimTerminalResponse& resp );
     void sendDTMF();
+    void sendSendSSMenu();
+    void sendSSMenu( const QSimTerminalResponse& resp );
+    void sendCBMenu();
+    void CBMenu( const QSimTerminalResponse& resp );
+    void sendCFMenu();
+    void CFMenu( const QSimTerminalResponse& resp );
+    void sendCWMenu();
+    void CWMenu( const QSimTerminalResponse& resp );
+    void sendCLIPMenu();
+    void CLIPMenu( const QSimTerminalResponse& resp );
+    void sendCLIRMenu();
+    void CLIRMenu( const QSimTerminalResponse& resp );
+    void sendCoLPMenu();
+    void CoLPMenu( const QSimTerminalResponse& resp );
+    void sendCoLRMenu();
+    void CoLRMenu( const QSimTerminalResponse& resp );
 
 private:
     int sticksLeft;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2 1/1] Simulate send ss command in sim app
  2010-09-10  6:09 [PATCH v2 1/1] Simulate send ss command in sim app Yang Gu
@ 2010-09-10 21:26 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2010-09-10 21:26 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 294 bytes --]

Hi Yang,

On 09/10/2010 01:09 AM, Yang Gu wrote:
> ---
>  src/simapplication.cpp |  672 ++++++++++++++++++++++++++++++++++++++++++++++++
>  src/simapplication.h   |   16 ++
>  2 files changed, 688 insertions(+), 0 deletions(-)

This patch has been applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-09-10 21:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-10  6:09 [PATCH v2 1/1] Simulate send ss command in sim app Yang Gu
2010-09-10 21:26 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.