Hi Yang,
+void DemoSimApplication::CBMenu( const QSimTerminalResponse&
resp )
+{
+ QSimCommand cmd;
+
+ if ( resp.result() == QSimTerminalResponse::Success ) {
+ switch ( resp.menuItem() ) {
+
+ case CBMenu_Registration:
+ {
+ cmd.setType( QSimCommand::SendSS );
+ cmd.setDestinationDevice( QSimCommand::Network );
+ cmd.setNumber( "**33#" );
+ command( cmd, this, SLOT(sendCBMenu()) );
+ }
+ break;
+
+ case CBMenu_Activation:
+ {
+ cmd.setType( QSimCommand::SendSS );
+ cmd.setDestinationDevice( QSimCommand::Network );
+ cmd.setNumber( "*33#" );
+ command( cmd, this, SLOT(sendCBMenu()) );
+ }
+ break;
You have to be careful here:
- For call barring, activation and registration are equivalent
- Activation requires PIN2, so this is not a valid request
+
+ case CBMenu_Interrogation:
+ {
+ cmd.setType( QSimCommand::SendSS );
+ cmd.setDestinationDevice( QSimCommand::Network );
+ cmd.setNumber( "*#33#" );
+ command( cmd, this, SLOT(sendCBMenu()) );
+ }
+ break;
+
+ case CBMenu_Deactivation:
+ {
+ cmd.setType( QSimCommand::SendSS );
+ cmd.setDestinationDevice( QSimCommand::Network );
+ cmd.setNumber( "#33#" );
+ command( cmd, this, SLOT(sendCBMenu()) );
+ }
+ break;
+
+ case CBMenu_Erasure:
+ {
+ cmd.setType( QSimCommand::SendSS );
+ cmd.setDestinationDevice( QSimCommand::Network );
+ cmd.setNumber( "##33#" );
+ command( cmd, this, SLOT(sendCBMenu()) );
+ }
+ break;
Same comments as for Activation/Registration above
+
+ default:
+ endSession();
+ break;
+ }
+ } else if ( resp.result() == QSimTerminalResponse::BackwardMove ) {
+ sendSendSSMenu();
+ } else {
+ endSession();
+ }
+}
+
<snip>
+void DemoSimApplication::CFMenu( const QSimTerminalResponse&
resp )
+{
+ QSimCommand cmd;
+
+ if ( resp.result() == QSimTerminalResponse::Success ) {
+ switch ( resp.menuItem() ) {
+
+ case CFMenu_Registration:
+ {
+ cmd.setType( QSimCommand::SendSS );
+ cmd.setDestinationDevice( QSimCommand::Network );
+ cmd.setNumber( "**002#" );
+ command( cmd, this, SLOT(sendCFMenu()) );
This is not a valid request, registration must provide a phone number
+ }
+ break;
+
+ case CFMenu_Activation:
+ {
+ cmd.setType( QSimCommand::SendSS );
+ cmd.setDestinationDevice( QSimCommand::Network );
+ cmd.setNumber( "*002#" );
+ command( cmd, this, SLOT(sendCFMenu()) );
+ }
+ break;
+
+ case CFMenu_Interrogation:
+ {
+ cmd.setType( QSimCommand::SendSS );
+ cmd.setDestinationDevice( QSimCommand::Network );
+ cmd.setNumber( "*#002#" );
+ command( cmd, this, SLOT(sendCFMenu()) );
+ }
+ break;
Interrogation of 'All CF' is actually not supported natively by GSM.
oFono handles this nicely, but you should filter such requests for Send
SS. Same goes for call barring '330', '333' and '353' services.
Refer
to 22.004 Section 7.2 for more details.
+
+ case CFMenu_Deactivation:
+ {
+ cmd.setType( QSimCommand::SendSS );
+ cmd.setDestinationDevice( QSimCommand::Network );
+ cmd.setNumber( "#002#" );
+ command( cmd, this, SLOT(sendCFMenu()) );
+ }
+ break;
+
+ case CFMenu_Erasure:
+ {
+ cmd.setType( QSimCommand::SendSS );
+ cmd.setDestinationDevice( QSimCommand::Network );
+ cmd.setNumber( "##002#" );
+ command( cmd, this, SLOT(sendCFMenu()) );
+ }
+ break;
+
+ default:
+ endSession();
+ break;
+ }
+ } else if ( resp.result() == QSimTerminalResponse::BackwardMove ) {
+ sendSendSSMenu();
+ } else {
+ endSession();
+ }
+}
Please fix up this patch with the call forwarding / call barring
changes. Otherwise it looks good to me.
Regards,
-Denis