Power: removed double request and only issue AT+CPIN? on power on
authorPaul Kocialkowski <contact@paulk.fr>
Mon, 30 Jul 2012 11:09:44 +0000 (13:09 +0200)
committerPaul Kocialkowski <contact@paulk.fr>
Mon, 30 Jul 2012 11:09:44 +0000 (13:09 +0200)
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
power.c

diff --git a/power.c b/power.c
index a497629..97d576b 100644 (file)
--- a/power.c
+++ b/power.c
@@ -78,9 +78,6 @@ void ril_power_on(void)
        // SMS PDU mode
        at_send_expect_status("AT+CMGF=0", NULL);
 
-       // SMS PDU mode
-       at_send_expect_status("AT+CMGF=0", NULL);
-
        // Network registration notifications
        status = at_send_expect_status("AT+CREG=2", NULL);
        if(at_status_error(status)) {
@@ -103,12 +100,12 @@ void ril_request_radio_power(RIL_Token t, void *data, size_t length)
 
        if(power_state > 0) {
                ril_power_on();
+
+               // Ask for PIN status
+               at_send_expect_to_func("AT+CPIN?", NULL, NULL, 0x0000, at_cpin_expect);
        } else {
                ril_power_off();
        }
 
-       // Send AT+CPIN
-       at_send_expect_to_func("AT+CPIN?", NULL, NULL, 0x0000, at_cpin_expect);
-
        RIL_onRequestComplete(t, RIL_E_SUCCESS, NULL, 0);
 }