aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2013-01-01 22:52:16 -0600
committerDenis Kenzior <denkenz@gmail.com>2013-01-02 05:23:36 -0600
commit281b9806e94c7f7d17b32da8c8e97cd8aa7bddb8 (patch)
tree722e25e60bdd535a9026311f6a66cf2cc13aed92
parent6cdbb05b500c273ced56a7ec62a4db82a24fd237 (diff)
downloadphonesim-281b9806e94c7f7d17b32da8c8e97cd8aa7bddb8.tar.gz
phonesim: Support +SIMSTATE command
We also emit the unsolicited version (+USIMSTATE) when the check box is toggled.
-rw-r--r--src/control.cpp4
-rw-r--r--src/default.xml14
-rw-r--r--src/hardwaremanipulator.cpp1
3 files changed, 18 insertions, 1 deletions
diff --git a/src/control.cpp b/src/control.cpp
index 3f1dd45..e1838a6 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -612,7 +612,9 @@ void ControlWidget::cancelUSSD()
void ControlWidget::simInsertRemove()
{
- p->setSimPresent( ui->cbSimInserted->isChecked() );
+ bool isChecked = ui->cbSimInserted->isChecked();
+ p->setSimPresent( isChecked );
+ emit unsolicitedCommand( "+USIMSTATE: "+QString::number( isChecked ) );
}
void ControlWidget::handleNewApp()
diff --git a/src/default.xml b/src/default.xml
index ea46fae..8798326 100644
--- a/src/default.xml
+++ b/src/default.xml
@@ -308,6 +308,9 @@
<!-- Positioning reporting state -->
<set name="CPOSR" value="0" />
+ <!-- SIM insertion state -->
+ <set name="SIMSTATE" value="1" />
+
<!-- Time -->
<!-- Enable for testing
<unsolicited delay="3000" once="true">*TTZ: 2, "11/25/2007, 12:12:12+40", 0</unsolicited>
@@ -3060,6 +3063,17 @@
</chat>
</state>
+<chat>
+ <command>AT+SIMSTATE?</command>
+ <response>+SIMSTATE: ${SIMSTATE}\n\nOK</response>
+</chat>
+
+<chat>
+ <!-- Query if SIMSTATE supported -->
+ <command>AT+SIMSTATE=?</command>
+ <response>OK</response>
+</chat>
+
<!-- Modem compatibility commands for phones that support data services -->
<chat>
diff --git a/src/hardwaremanipulator.cpp b/src/hardwaremanipulator.cpp
index 528f119..6c83c8e 100644
--- a/src/hardwaremanipulator.cpp
+++ b/src/hardwaremanipulator.cpp
@@ -327,6 +327,7 @@ bool HardwareManipulator::getSimPresent()
void HardwareManipulator::setSimPresent( bool present )
{
simPresent = present;
+ rules->setVariable( "SIMSTATE", QString::number( present ) );
}
QStringList HardwareManipulator::getSimAppsNameList()