void ril_power_on(void)
{
- int status;
-
LOGD("Powering on");
- // Echo enabled, send results, verbose enabled
- at_send_expect_status("ATE1Q0V1", NULL);
-
- // Extended errors
- at_send_expect_status("AT+CMEE=1", NULL);
-
- // Detailed rings, service reporting
- at_send_expect_status("AT+CRC=1;+CR=1", NULL);
-
- // 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)) {
- LOGD("Modem doesn't support AT+CREG=2");
- at_send_expect_status("AT+CREG=1", NULL);
- }
-
at_send_expect_to_func("AT+CFUN=1", NULL, NULL, 0x0000, at_cfun_enable_expect);
+
+ ril_device_at_power_on(ril_device);
}
void ril_power_off(void)
{
+ LOGD("Powering off");
+
+ ril_device_at_power_off(ril_device);
+
at_send_expect_to_func("AT+CFUN=0", NULL, NULL, 0x0000, at_cfun_disable_expect);
}
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);
}