示例#1
0
void sap_power_sim_off_req(void *sap_device)
{
    uint8_t result;

    DBG("sap_device %p", sap_device);

    if (u8500.state != STE_ENABLED) {
        result = get_sap_result(STE_POWER_OFF_MSG, STE_STATUS_FAILURE);
        sap_power_sim_off_rsp(sap_device, result);
        return;
    }

    if (send_request(u8500.io, STE_POWER_OFF_REQ, NULL) < 0)
        sap_power_sim_off_rsp(sap_device, SAP_RESULT_ERROR_NO_REASON);
}
示例#2
0
void sap_power_sim_off_req(void *sap_device)
{
	DBG("status: %d", sim_card_conn_status);

	if (sim_card_conn_status == SIM_MISSING) {
		sap_power_sim_off_rsp(sap_device,
					SAP_RESULT_ERROR_CARD_REMOVED);
	} else if (sim_card_conn_status == SIM_POWERED_OFF) {
		sap_power_sim_off_rsp(sap_device,
					SAP_RESULT_ERROR_POWERED_OFF);
	} else if (sim_card_conn_status != SIM_CONNECTED) {
		sap_power_sim_off_rsp(sap_device,
					SAP_RESULT_ERROR_NO_REASON);
	} else {
		sap_power_sim_off_rsp(sap_device, SAP_RESULT_OK);
		sim_card_conn_status = SIM_POWERED_OFF;
	}
}
void sap_power_sim_off_req(void *sap_device)
{
	DBG("status: %d", sim_card_conn_status);

	switch (sim_card_conn_status) {
	case SIM_MISSING:
		sap_power_sim_off_rsp(sap_device,
					SAP_RESULT_ERROR_CARD_REMOVED);
		break;
	case SIM_POWERED_OFF:
		sap_power_sim_off_rsp(sap_device,
					SAP_RESULT_ERROR_POWERED_OFF);
		break;
	case SIM_DISCONNECTED:
		sap_power_sim_off_rsp(sap_device, SAP_RESULT_ERROR_NO_REASON);
		break;
	case SIM_CONNECTED:
		sap_power_sim_off_rsp(sap_device, SAP_RESULT_OK);
		sim_card_conn_status = SIM_POWERED_OFF;
		break;
	}
}