From: Yang Gu <yang.gu@intel.com>
To: ofono@ofono.org
Subject: [PATCH] Simulate provide local info command in sim app
Date: Wed, 08 Dec 2010 15:18:27 +0800 [thread overview]
Message-ID: <1291792707-4988-1-git-send-email-yang.gu@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3648 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 62bbe9d..388b2ce 100644
--- a/src/simapplication.cpp
+++ b/src/simapplication.cpp
@@ -290,6 +290,7 @@ const QString DemoSimApplication::getName()
#define MainMenu_Polling 15
#define MainMenu_Timers 16
#define MainMenu_Refresh 17
+#define MainMenu_LocalInfo 18
#define SportsMenu_Chess 1
#define SportsMenu_Painting 2
@@ -348,6 +349,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,
@@ -443,6 +447,10 @@ void DemoSimApplication::mainMenu()
item.setLabel( "SIM Refresh" );
items += item;
+ item.setIdentifier( MainMenu_LocalInfo );
+ item.setLabel( "Provide Local Information" );
+ items += item;
+
cmd.setMenuItems( items );
command( cmd, 0, 0 );
@@ -579,6 +587,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.
@@ -2319,3 +2333,57 @@ void DemoSimApplication::refreshMenuResp( const QSimTerminalResponse& resp )
command( cmd, this, SLOT(endSession()) );
}
+
+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();
+ }
+}
diff --git a/src/simapplication.h b/src/simapplication.h
index df36bbb..45cfa84 100644
--- a/src/simapplication.h
+++ b/src/simapplication.h
@@ -126,6 +126,8 @@ protected slots:
void timersCmdResp( const QSimTerminalResponse& resp );
void sendRefreshMenu();
void refreshMenuResp( const QSimTerminalResponse& resp );
+ void sendLocalInfoMenu();
+ void localInfoMenu( const QSimTerminalResponse& resp );
private:
int sticksLeft;
--
1.7.2.3
next reply other threads:[~2010-12-08 7:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-08 7:18 Yang Gu [this message]
2010-12-08 14:04 ` [PATCH] Simulate provide local info command in sim app Denis Kenzior
-- strict thread matches above, loose matches on Subject: below --
2010-11-30 10:43 Yang Gu
2010-12-07 13:43 ` 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=1291792707-4988-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