aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2010-12-07 16:33:12 -0200
committerDenis Kenzior <denkenz@gmail.com>2010-12-16 15:56:12 -0600
commitdaf9828d9f59018e8c972ec482bb80229056daad (patch)
treedbd40b67aa9a22071249d7dbd09f27b13f6c569c
parent4bb943ca5d14ce4c78d5c130be847e74c9a2acf3 (diff)
downloadphonesim-daf9828d9f59018e8c972ec482bb80229056daad.tar.gz
Add support to CNAP ss command
-rw-r--r--src/simapplication.cpp80
-rw-r--r--src/simapplication.h2
2 files changed, 82 insertions, 0 deletions
diff --git a/src/simapplication.cpp b/src/simapplication.cpp
index 388b2ce..4595e75 100644
--- a/src/simapplication.cpp
+++ b/src/simapplication.cpp
@@ -308,6 +308,7 @@ const QString DemoSimApplication::getName()
#define SendSSMenu_CLIR 5
#define SendSSMenu_CoLP 6
#define SendSSMenu_CoLR 7
+#define SendSSMenu_CNAP 8
#define CBMenu_Activation 1
#define CBMenu_Interrogation 2
@@ -339,6 +340,10 @@ const QString DemoSimApplication::getName()
#define CoLRMenu_Interrogation 2
#define CoLRMenu_Deactivation 3
+#define CNAPMenu_Activation 1
+#define CNAPMenu_Interrogation 2
+#define CNAPMenu_Deactivation 3
+
#define Language_Specific 1
#define Language_Non_Specific 2
#define Language_Main 3
@@ -1157,6 +1162,10 @@ void DemoSimApplication::sendSendSSMenu()
item.setLabel( "CLIP (Calling Line Identification Presentation)" );
items += item;
+ item.setIdentifier( SendSSMenu_CNAP );
+ item.setLabel( "CNAP (Calling Name Identification Presentation)" );
+ items += item;
+
item.setIdentifier( SendSSMenu_CLIR );
item.setLabel( "CLIR (Calling Line Identification Restriction)" );
items += item;
@@ -1755,6 +1764,77 @@ void DemoSimApplication::CoLRMenu( const QSimTerminalResponse& resp )
}
}
+void DemoSimApplication::sendCNAPMenu()
+{
+ QSimCommand cmd;
+ QSimMenuItem item;
+ QList<QSimMenuItem> items;
+
+ cmd.setType( QSimCommand::SelectItem );
+ cmd.setTitle( "CNAP" );
+
+ item.setIdentifier( CNAPMenu_Activation );
+ item.setLabel( "Activation" );
+ items += item;
+
+ item.setIdentifier( CNAPMenu_Interrogation );
+ item.setLabel( "Interrogation" );
+ items += item;
+
+ item.setIdentifier( CNAPMenu_Deactivation );
+ item.setLabel( "Deactivation" );
+ items += item;
+
+ cmd.setMenuItems( items );
+
+ command( cmd, this, SLOT(CNAPMenu(QSimTerminalResponse)) );
+}
+
+void DemoSimApplication::CNAPMenu( const QSimTerminalResponse& resp )
+{
+ QSimCommand cmd;
+
+ if ( resp.result() == QSimTerminalResponse::Success ) {
+ switch ( resp.menuItem() ) {
+
+ case CNAPMenu_Activation:
+ {
+ cmd.setType( QSimCommand::SendSS );
+ cmd.setDestinationDevice( QSimCommand::Network );
+ cmd.setNumber( "*300#" );
+ command( cmd, this, SLOT(sendCNAPMenu()) );
+ }
+ break;
+
+ case CNAPMenu_Interrogation:
+ {
+ cmd.setType( QSimCommand::SendSS );
+ cmd.setDestinationDevice( QSimCommand::Network );
+ cmd.setNumber( "*#300#" );
+ command( cmd, this, SLOT(sendCNAPMenu()) );
+ }
+ break;
+
+ case CNAPMenu_Deactivation:
+ {
+ cmd.setType( QSimCommand::SendSS );
+ cmd.setDestinationDevice( QSimCommand::Network );
+ cmd.setNumber( "#300#" );
+ command( cmd, this, SLOT(sendCNAPMenu()) );
+ }
+ break;
+
+ default:
+ endSession();
+ break;
+ }
+ } else if ( resp.result() == QSimTerminalResponse::BackwardMove ) {
+ sendSendSSMenu();
+ } else {
+ endSession();
+ }
+}
+
void DemoSimApplication::sendLanguageMenu()
{
QSimCommand cmd;
diff --git a/src/simapplication.h b/src/simapplication.h
index 45cfa84..cd93f7e 100644
--- a/src/simapplication.h
+++ b/src/simapplication.h
@@ -111,6 +111,8 @@ protected slots:
void CoLPMenu( const QSimTerminalResponse& resp );
void sendCoLRMenu();
void CoLRMenu( const QSimTerminalResponse& resp );
+ void sendCNAPMenu();
+ void CNAPMenu( const QSimTerminalResponse& resp );
void sendLanguageMenu();
void languageMenu( const QSimTerminalResponse& resp );
void sendUSSDMenu();