* [PATCH] Added support for PIN retry count.
@ 2014-04-16 14:26 jussi.pakkanen
0 siblings, 0 replies; 3+ messages in thread
From: jussi.pakkanen @ 2014-04-16 14:26 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3800 bytes --]
Hi
Here's a patch for ofono-phonesim. It adds the command AT+CPINR that returns
the amount of PIN unlock attempts remaining. It also tracks the value properly
according to state changes. The output format is (roughly) as specified in ETSI
TS 127 007 v11.8.0.
PS I'm hoping this is the correct place to send this patch, ofono-phonesim's
README and HACKING files don't seem to contain patch submission guidelines.
---
src/default.xml | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/src/default.xml b/src/default.xml
index 2868587..e195cfa 100644
--- a/src/default.xml
+++ b/src/default.xml
@@ -232,6 +232,9 @@
<!-- Value of the PIN that is required -->
<set name="PINVALUE" value="2468"/>
+ <!-- How many times can PIN unlocking be attempted -->
+ <set name="PINRETRYCOUNT" value="3"/>
+
<!-- pin protection status -->
<set name="SC" value="0"/>
@@ -2280,6 +2283,13 @@
</chat>
<chat>
+ <!-- How many pin unlock attempts remain -->
+ <command>AT+CPINR</command>
+ <response>+CPINR: SIM PIN,${PINRETRYCOUNT},3\n</response>
+</chat>
+
+
+<chat>
<!-- Check for which PIN is required -->
<command>AT+CPIN?</command>
<response delay="2000">+CPIN: ${PINNAME}\n\nOK</response>
@@ -2290,6 +2300,7 @@
<command>AT+CPIN="${PINVALUE}"</command>
<response>+CPIN: READY\n\nOK</response>
<set name="PINNAME" value="READY"/>
+ <set name="PINRETRYCOUNT" value="3"/>
</chat>
<chat>
@@ -2305,6 +2316,7 @@
<response>+CPIN: READY\n\nOK</response>
<set name="PINVALUE" value="${*}"/>
<set name="PINNAME" value="READY"/>
+ <set name="PINRETRYCOUNT" value="3"/>
</chat>
<chat>
@@ -2320,6 +2332,7 @@
<command>AT+CPIN="*","*"</command>
<response>+CPIN: SIM PUK\n\nERROR</response>
<set name="PINNAME" value="SIM PUK"/>
+ <set name="PINRETRYCOUNT" value="0"/>
</chat>
<chat>
@@ -2327,6 +2340,7 @@
<command>AT+CPIN=*</command>
<response>+CPIN: SIM PIN\n\nERROR</response>
<set name="PINNAME" value="SIM PIN"/>
+ <set name="PINRETRYCOUNT" value="2"/>
<switch name="pinretry1"/>
</chat>
@@ -2337,6 +2351,7 @@
<command>AT+CPIN="${PINVALUE}"</command>
<response>+CPIN: READY\n\nOK</response>
<set name="PINNAME" value="READY"/>
+ <set name="PINRETRYCOUNT" value="3"/>
<switch name="default"/>
</chat>
@@ -2346,6 +2361,7 @@
<response>+CPIN: READY\n\nOK</response>
<set name="PINVALUE" value="${*}"/>
<set name="PINNAME" value="READY"/>
+ <set name="PINRETRYCOUNT" value="3"/>
<switch name="default"/>
</chat>
@@ -2354,6 +2370,7 @@
<command>AT+CPIN=*</command>
<response>+CPIN: SIM PIN\n\nERROR</response>
<set name="PINNAME" value="SIM PIN"/>
+ <set name="PINRETRYCOUNT" value="1"/>
<switch name="pinretry2"/>
</chat>
@@ -2366,6 +2383,7 @@
<command>AT+CPIN="${PINVALUE}"</command>
<response>+CPIN: READY\n\nOK</response>
<set name="PINNAME" value="READY"/>
+ <set name="PINRETRYCOUNT" value="3"/>
<switch name="default"/>
</chat>
@@ -2375,6 +2393,7 @@
<response>+CPIN: READY\n\nOK</response>
<set name="PINVALUE" value="${*}"/>
<set name="PINNAME" value="READY"/>
+ <set name="PINRETRYCOUNT" value="3"/>
<switch name="default"/>
</chat>
@@ -2383,6 +2402,7 @@
<command>AT+CPIN=*</command>
<response>+CPIN: SIM PUK\n\nERROR</response>
<set name="PINNAME" value="SIM PUK"/>
+ <set name="PINRETRYCOUNT" value="0"/>
</chat>
</state>
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] Added support for PIN retry count.
@ 2014-04-16 15:08 jussi.pakkanen
2014-04-17 15:53 ` Denis Kenzior
0 siblings, 1 reply; 3+ messages in thread
From: jussi.pakkanen @ 2014-04-16 15:08 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3678 bytes --]
Hi
Sorry, had a bit of a Git mixup in the previous patch. Here's the correct one,
now comes with the =? query interface as well as standards conforming output.
---
src/default.xml | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/src/default.xml b/src/default.xml
index 2868587..e0cafbb 100644
--- a/src/default.xml
+++ b/src/default.xml
@@ -232,6 +232,9 @@
<!-- Value of the PIN that is required -->
<set name="PINVALUE" value="2468"/>
+ <!-- How many times can PIN unlocking be attempted -->
+ <set name="PINRETRYCOUNT" value="3"/>
+
<!-- pin protection status -->
<set name="SC" value="0"/>
@@ -2280,6 +2283,19 @@
</chat>
<chat>
+ <!-- Do we support CPINR? -->
+ <command>AT+CPINR=?</command>
+ <response>OK\n</response>
+</chat>
+
+<chat>
+ <!-- How many pin unlock attempts remain -->
+ <command>AT+CPINR</command>
+ <response>+CPINR: SIM PIN,${PINRETRYCOUNT},3\nOK\n</response>
+</chat>
+
+
+<chat>
<!-- Check for which PIN is required -->
<command>AT+CPIN?</command>
<response delay="2000">+CPIN: ${PINNAME}\n\nOK</response>
@@ -2290,6 +2306,7 @@
<command>AT+CPIN="${PINVALUE}"</command>
<response>+CPIN: READY\n\nOK</response>
<set name="PINNAME" value="READY"/>
+ <set name="PINRETRYCOUNT" value="3"/>
</chat>
<chat>
@@ -2305,6 +2322,7 @@
<response>+CPIN: READY\n\nOK</response>
<set name="PINVALUE" value="${*}"/>
<set name="PINNAME" value="READY"/>
+ <set name="PINRETRYCOUNT" value="3"/>
</chat>
<chat>
@@ -2320,6 +2338,7 @@
<command>AT+CPIN="*","*"</command>
<response>+CPIN: SIM PUK\n\nERROR</response>
<set name="PINNAME" value="SIM PUK"/>
+ <set name="PINRETRYCOUNT" value="0"/>
</chat>
<chat>
@@ -2327,6 +2346,7 @@
<command>AT+CPIN=*</command>
<response>+CPIN: SIM PIN\n\nERROR</response>
<set name="PINNAME" value="SIM PIN"/>
+ <set name="PINRETRYCOUNT" value="2"/>
<switch name="pinretry1"/>
</chat>
@@ -2337,6 +2357,7 @@
<command>AT+CPIN="${PINVALUE}"</command>
<response>+CPIN: READY\n\nOK</response>
<set name="PINNAME" value="READY"/>
+ <set name="PINRETRYCOUNT" value="3"/>
<switch name="default"/>
</chat>
@@ -2346,6 +2367,7 @@
<response>+CPIN: READY\n\nOK</response>
<set name="PINVALUE" value="${*}"/>
<set name="PINNAME" value="READY"/>
+ <set name="PINRETRYCOUNT" value="3"/>
<switch name="default"/>
</chat>
@@ -2354,6 +2376,7 @@
<command>AT+CPIN=*</command>
<response>+CPIN: SIM PIN\n\nERROR</response>
<set name="PINNAME" value="SIM PIN"/>
+ <set name="PINRETRYCOUNT" value="1"/>
<switch name="pinretry2"/>
</chat>
@@ -2366,6 +2389,7 @@
<command>AT+CPIN="${PINVALUE}"</command>
<response>+CPIN: READY\n\nOK</response>
<set name="PINNAME" value="READY"/>
+ <set name="PINRETRYCOUNT" value="3"/>
<switch name="default"/>
</chat>
@@ -2375,6 +2399,7 @@
<response>+CPIN: READY\n\nOK</response>
<set name="PINVALUE" value="${*}"/>
<set name="PINNAME" value="READY"/>
+ <set name="PINRETRYCOUNT" value="3"/>
<switch name="default"/>
</chat>
@@ -2383,6 +2408,7 @@
<command>AT+CPIN=*</command>
<response>+CPIN: SIM PUK\n\nERROR</response>
<set name="PINNAME" value="SIM PUK"/>
+ <set name="PINRETRYCOUNT" value="0"/>
</chat>
</state>
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Added support for PIN retry count.
2014-04-16 15:08 [PATCH] Added support for PIN retry count jussi.pakkanen
@ 2014-04-17 15:53 ` Denis Kenzior
0 siblings, 0 replies; 3+ messages in thread
From: Denis Kenzior @ 2014-04-17 15:53 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 649 bytes --]
Hi Jussi,
On 04/16/2014 10:08 AM, jussi.pakkanen(a)canonical.com wrote:
> Hi
>
> Sorry, had a bit of a Git mixup in the previous patch. Here's the correct one,
> now comes with the =? query interface as well as standards conforming output.
>
> ---
> src/default.xml | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
Patch looks fine to me, but can you please fix the patch description?
Also, please get in the habit of adding version information to your
patches, e.g. using '[PATCH v2] foo: bar'. That way it is easier for
the maintainers to track which patch to pay attention to.
Regards,
-Denis
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-17 15:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-16 15:08 [PATCH] Added support for PIN retry count jussi.pakkanen
2014-04-17 15:53 ` Denis Kenzior
-- strict thread matches above, loose matches on Subject: below --
2014-04-16 14:26 jussi.pakkanen
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.