From: Yang Gu <yang.gu@intel.com>
To: ofono@ofono.org
Subject: [PATCH] Simulate provide local info command in sim app
Date: Tue, 30 Nov 2010 18:43:43 +0800 [thread overview]
Message-ID: <1291113823-22575-1-git-send-email-yang.gu@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3653 bytes --]
---
src/simapplication.cpp | 68 ++++++++++++++++++++++++++++++++++++++++++++++++
src/simapplication.h | 2 +
2 files changed, 70 insertions(+), 0 deletions(-)
diff --git a/src/simapplication.cpp b/src/simapplication.cpp
index 05ae21f..bc96a8c 100644
--- a/src/simapplication.cpp
+++ b/src/simapplication.cpp
@@ -288,6 +288,7 @@ const QString DemoSimApplication::getName()
#define MainMenu_SendUSSD 13
#define MainMenu_SendSMS 14
#define MainMenu_Polling 15
+#define MainMenu_LocalInfo 16
#define SportsMenu_Chess 1
#define SportsMenu_Painting 2
@@ -346,6 +347,9 @@ const QString DemoSimApplication::getName()
#define SendUSSD_Error 4
#define SendUSSD_Main 5
+#define LocalInfoMenu_Time 1
+#define LocalInfoMenu_Lang 2
+
enum SendSMSMenuItems {
SendSMS_Unpacked = 1,
SendSMS_Packed,
@@ -426,6 +430,10 @@ void DemoSimApplication::mainMenu()
item.setLabel( "SIM Polling" );
items += item;
+ item.setIdentifier( MainMenu_LocalInfo );
+ item.setLabel( "Provide Local Information" );
+ items += item;
+
cmd.setMenuItems( items );
command( cmd, 0, 0 );
@@ -550,6 +558,12 @@ void DemoSimApplication::mainMenuSelection( int id )
}
break;
+ case MainMenu_LocalInfo:
+ {
+ sendLocalInfoMenu();
+ }
+ break;
+
default:
{
// Don't know what this item is, so just re-display the main menu.
@@ -2044,3 +2058,57 @@ void DemoSimApplication::pollingMenuResp( const QSimTerminalResponse& resp )
break;
}
}
+
+void DemoSimApplication::sendLocalInfoMenu()
+{
+ QSimCommand cmd;
+ QSimMenuItem item;
+ QList<QSimMenuItem> items;
+
+ cmd.setType( QSimCommand::SelectItem );
+ cmd.setTitle( "Provide Local Information" );
+
+ item.setIdentifier( LocalInfoMenu_Time );
+ item.setLabel( "Date, time and time zone" );
+ items += item;
+
+ item.setIdentifier( LocalInfoMenu_Lang );
+ item.setLabel( "Language setting" );
+ items += item;
+
+ cmd.setMenuItems( items );
+
+ command( cmd, this, SLOT(localInfoMenu(QSimTerminalResponse)) );
+}
+
+void DemoSimApplication::localInfoMenu( const QSimTerminalResponse& resp )
+{
+ QSimCommand cmd;
+
+ if ( resp.result() == QSimTerminalResponse::Success ) {
+ switch ( resp.menuItem() ) {
+
+ case LocalInfoMenu_Time:
+ {
+ cmd.setType( QSimCommand::ProvideLocalInformation );
+ cmd.setQualifier( 0x03 );
+ command( cmd, this, SLOT(sendLocalInfoMenu()) );
+ }
+ break;
+
+ case LocalInfoMenu_Lang:
+ {
+ cmd.setType( QSimCommand::ProvideLocalInformation );
+ cmd.setQualifier( 0x04 );
+ command( cmd, this, SLOT(sendLocalInfoMenu()) );
+ }
+ break;
+
+ default:
+ endSession();
+ break;
+ }
+ } else {
+ endSession();
+ }
+}
\ No newline at end of file
diff --git a/src/simapplication.h b/src/simapplication.h
index 4a2430f..6f90a1f 100644
--- a/src/simapplication.h
+++ b/src/simapplication.h
@@ -119,6 +119,8 @@ protected slots:
void smsSetTextResp( const QSimTerminalResponse& resp );
void sendPollingMenu();
void pollingMenuResp( const QSimTerminalResponse& resp );
+ void sendLocalInfoMenu();
+ void localInfoMenu ( const QSimTerminalResponse& resp );
private:
int sticksLeft;
--
1.7.2.3
next reply other threads:[~2010-11-30 10:43 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-30 10:43 Yang Gu [this message]
2010-12-07 13:43 ` [PATCH] Simulate provide local info command in sim app Denis Kenzior
-- strict thread matches above, loose matches on Subject: below --
2010-12-08 7:18 Yang Gu
2010-12-08 14:04 ` Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1291113823-22575-1-git-send-email-yang.gu@intel.com \
--to=yang.gu@intel.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox