* [PATCH] Simulate provide local info command in sim app
@ 2010-12-08 7:18 Yang Gu
2010-12-08 14:04 ` Denis Kenzior
0 siblings, 1 reply; 4+ messages in thread
From: Yang Gu @ 2010-12-08 7:18 UTC (permalink / raw)
To: ofono
[-- 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
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH] Simulate provide local info command in sim app
@ 2010-11-30 10:43 Yang Gu
2010-12-07 13:43 ` Denis Kenzior
0 siblings, 1 reply; 4+ messages in thread
From: Yang Gu @ 2010-11-30 10:43 UTC (permalink / raw)
To: ofono
[-- 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
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-12-08 14:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-08 7:18 [PATCH] Simulate provide local info command in sim app Yang Gu
2010-12-08 14:04 ` 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
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.