diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2011-01-22 11:24:17 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-01-22 11:27:53 +0100 |
commit | b7739919f8772edf03afe0874e67e1b27fa8062d (patch) | |
tree | e1d251daaa13184faf17d100b1dc46b9f392d44d | |
parent | 2253222069fcb58542a88c3334ed94238ed34727 (diff) | |
download | ofono-b7739919f8772edf03afe0874e67e1b27fa8062d.tar.bz2 |
atmodem: Use switch statements for USSD vendor quirks
-rw-r--r-- | drivers/atmodem/ussd.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/atmodem/ussd.c b/drivers/atmodem/ussd.c index 651b6afe..67f1e50e 100644 --- a/drivers/atmodem/ussd.c +++ b/drivers/atmodem/ussd.c @@ -219,13 +219,17 @@ static void at_ussd_request(struct ofono_ussd *ussd, int dcs, converted, dcs); } - if (data->vendor == OFONO_VENDOR_QUALCOMM_MSM) { + switch (data->vendor) { + case OFONO_VENDOR_QUALCOMM_MSM: /* Ensure that the modem is using GSM character set. It * seems it defaults to IRA and then umlauts are not * properly encoded. The modem returns some weird from * of Latin-1, but it is not really Latin-1 either. */ g_at_chat_send(data->chat, "AT+CSCS=\"GSM\"", none_prefix, NULL, NULL, NULL); + break; + default: + break; } if (g_at_chat_send(data->chat, buf, cusd_prefix, @@ -247,12 +251,16 @@ static void cusd_cancel_cb(gboolean ok, GAtResult *result, gpointer user_data) decode_at_error(&error, g_at_result_final_response(result)); - if (data->vendor == OFONO_VENDOR_QUALCOMM_MSM) { + switch (data->vendor) { + case OFONO_VENDOR_QUALCOMM_MSM: /* All errors and notifications arrive unexpected and * thus just reset the state here. This is safer than * getting stuck in a dead-lock. */ error.type = OFONO_ERROR_TYPE_NO_ERROR; error.error = 0; + break; + default: + break; } cb(&error, cbd->data); |