samsung: allow setting a single band only

This commit is contained in:
Aleksander Morgado
2011-04-29 12:31:11 +02:00
parent db7c11768a
commit bb827c3ef7
+6 -1
View File
@@ -31,6 +31,7 @@
#include "mm-modem-gsm-card.h"
#include "mm-log.h"
#include "mm-modem-icera.h"
#include "mm-utils.h"
static void modem_init (MMModem *modem_class);
static void modem_gsm_network_init (MMModemGsmNetwork *gsm_network_class);
@@ -168,7 +169,11 @@ set_band (MMModemGsmNetwork *modem,
return;
}
if (!band_mm_to_samsung (band, modem)) {
/* TODO: Check how to pass more than one band in the same AT%%IPBM command */
if (!utils_check_for_single_value (band)) {
info->error = g_error_new_literal (MM_MODEM_ERROR, MM_MODEM_ERROR_GENERAL, "Cannot set more than one band.");
mm_callback_info_schedule (info);
} else if (!band_mm_to_samsung (band, modem)) {
info->error = g_error_new_literal (MM_MODEM_ERROR, MM_MODEM_ERROR_GENERAL, "Invalid band.");
mm_callback_info_schedule (info);
} else {