Skip to contentSkip to conversation

phonesim: Simulate a Send DTMF command in sim app.

PATCH In review Andrzej Zaborowski 2 participants 2 messages Sep 8, 2010 – Sep 9, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phonesim: Simulate a Send DTMF command in sim app.

---
 src/qsimcommand.cpp    |    6 ++++--
 src/simapplication.cpp |   23 +++++++++++++++++++++++
 src/simapplication.h   |    1 +
 3 files changed, 28 insertions(+), 2 deletions(-)
src/qsimcommand.cpp +4 -2
index 770925f..9a9a169 100644
@@ -815,7 +815,8 @@ void QSimCommand::setHasHelp( bool value )
 
     Applies to: \c DisplayText, \c GetInkey, \c GetInput, \c SendSS, \c SendSMS,
     \c SendUSSD, \c PlayTone, \c ServiceSearch, \c GetServiceInformation,
-    \c RetrieveMultimediaMessage, \c SubmitMultimediaMessage.
+    \c RetrieveMultimediaMessage, \c SubmitMultimediaMessage, \c RunATCommand,
+    \c SendDTMF, \c LaunchBrowser, \c SetupIdleModeText, \c SetupCall.
 
     \sa setText()
 */
@@ -830,7 +831,8 @@ QString QSimCommand::text() const
 
     Applies to: \c DisplayText, \c GetInkey, \c GetInput, \c SendSS, \c SendSMS,
     \c SendUSSD, \c PlayTone, \c ServiceSearch, \c GetServiceInformation,
-    \c RetrieveMultimediaMessage, \c SubmitMultimediaMessage.
+    \c RetrieveMultimediaMessage, \c SubmitMultimediaMessage, \c RunATCommand,
+    \c SendDTMF, \c LaunchBrowser, \c SetupIdleModeText, \c SetupCall.
 
     \sa text()
 */
src/simapplication.cpp +23 -0
index fe6e183..6ca03d9 100644
@@ -279,6 +279,7 @@ const QString DemoSimApplication::getName()
 #define MainMenu_IconsSE    7
 #define MainMenu_Finance    8
 #define MainMenu_Browser    9
+#define MainMenu_DTMF       10
 
 #define SportsMenu_Chess        1
 #define SportsMenu_Painting     2
@@ -333,6 +334,10 @@ void DemoSimApplication::mainMenu()
     item.setLabel( "Web Browser" );
     items += item;
 
+    item.setIdentifier( MainMenu_DTMF );
+    item.setLabel( "DialTones" );
+    items += item;
+
     cmd.setMenuItems( items );
 
     command( cmd, 0, 0 );
@@ -421,6 +426,12 @@ void DemoSimApplication::mainMenuSelection( int id )
         }
         break;
 
+        case MainMenu_DTMF:
+        {
+            sendDTMF();
+        }
+        break;
+
         default:
         {
             // Don't know what this item is, so just re-display the main menu.
@@ -751,6 +762,18 @@ void DemoSimApplication::toneMenu( const QSimTerminalResponse& resp )
     }
 }
 
+void DemoSimApplication::sendDTMF()
+{
+    QSimCommand cmd;
+
+    cmd.setType( QSimCommand::SendDTMF );
+    cmd.setDestinationDevice( QSimCommand::Network );
+    cmd.setNumber( "1p234ppp5" );
+    cmd.setText( "Sending DTMFs to network" );
+
+    command( cmd, this, SLOT(endSession()) );
+}
+
 void DemoSimApplication::sendIconMenu()
 {
     QSimCommand cmd;
src/simapplication.h +1 -0
index 75abd0b..adaf2c2 100644
@@ -92,6 +92,7 @@ protected slots:
     void displayTextResponse( const QSimTerminalResponse& resp );
     void sendBrowserMenu();
     void browserMenu( const QSimTerminalResponse& resp );
+    void sendDTMF();
 
 private:
     int sticksLeft;
Signature · 1 line
1.7.1.86.g0e460.dirty
#1 lore raw

Hi Andrew,

Quoted 5 lines · Andrzej Zaborowski
---
 src/qsimcommand.cpp    |    6 ++++--
 src/simapplication.cpp |   23 +++++++++++++++++++++++
 src/simapplication.h   |    1 +
 3 files changed, 28 insertions(+), 2 deletions(-)

Patch has been applied, thanks.

Regards,
-Denis