mirror of git://git.sysmocom.de/ofono
Remove supports_tech variable
The proper way to register with a particular network technology is to use a band selection command (e.g. select 2G only or 3G only, or hybrid) The tech selection according to 27.007 is non-binding anyway
This commit is contained in:
parent
863f4e367f
commit
89af1fcabe
|
@ -44,7 +44,6 @@ static const char *cops_prefix[] = { "+COPS:", NULL };
|
||||||
static const char *csq_prefix[] = { "+CSQ:", NULL };
|
static const char *csq_prefix[] = { "+CSQ:", NULL };
|
||||||
|
|
||||||
struct netreg_data {
|
struct netreg_data {
|
||||||
gboolean supports_tech;
|
|
||||||
char mcc[OFONO_MAX_MCC_LENGTH + 1];
|
char mcc[OFONO_MAX_MCC_LENGTH + 1];
|
||||||
char mnc[OFONO_MAX_MNC_LENGTH + 1];
|
char mnc[OFONO_MAX_MNC_LENGTH + 1];
|
||||||
};
|
};
|
||||||
|
@ -63,7 +62,6 @@ static void extract_mcc_mnc(const char *str, char *mcc, char *mnc)
|
||||||
static void at_creg_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
static void at_creg_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
{
|
{
|
||||||
struct cb_data *cbd = user_data;
|
struct cb_data *cbd = user_data;
|
||||||
struct at_data *at = ofono_modem_userdata(cbd->modem);
|
|
||||||
GAtResultIter iter;
|
GAtResultIter iter;
|
||||||
ofono_registration_status_cb_t cb = cbd->cb;
|
ofono_registration_status_cb_t cb = cbd->cb;
|
||||||
int status;
|
int status;
|
||||||
|
@ -103,8 +101,7 @@ static void at_creg_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
else
|
else
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (g_at_result_iter_next_number(&iter, &tech) == TRUE)
|
g_at_result_iter_next_number(&iter, &tech);
|
||||||
at->netreg->supports_tech = TRUE;
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
ofono_debug("creg_cb: %d, %d, %d, %d", status, lac, ci, tech);
|
ofono_debug("creg_cb: %d, %d, %d, %d", status, lac, ci, tech);
|
||||||
|
@ -457,11 +454,7 @@ static void at_register_manual(struct ofono_modem *modem,
|
||||||
if (!cbd)
|
if (!cbd)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (at->netreg->supports_tech && oper->tech != -1)
|
sprintf(buf, "AT+COPS=1,2,\"%s%s\"", oper->mcc, oper->mnc);
|
||||||
sprintf(buf, "AT+COPS=1,2,\"%s%s\",%1d", oper->mcc, oper->mnc,
|
|
||||||
oper->tech);
|
|
||||||
else
|
|
||||||
sprintf(buf, "AT+COPS=1,2,\"%s%s\"", oper->mcc, oper->mnc);
|
|
||||||
|
|
||||||
if (g_at_chat_send(at->parser, buf, none_prefix,
|
if (g_at_chat_send(at->parser, buf, none_prefix,
|
||||||
register_cb, cbd, g_free) > 0)
|
register_cb, cbd, g_free) > 0)
|
||||||
|
@ -589,7 +582,6 @@ error:
|
||||||
static void creg_notify(GAtResult *result, gpointer user_data)
|
static void creg_notify(GAtResult *result, gpointer user_data)
|
||||||
{
|
{
|
||||||
struct ofono_modem *modem = user_data;
|
struct ofono_modem *modem = user_data;
|
||||||
struct at_data *at = ofono_modem_userdata(modem);
|
|
||||||
GAtResultIter iter;
|
GAtResultIter iter;
|
||||||
int status;
|
int status;
|
||||||
int lac = -1, ci = -1, tech = -1;
|
int lac = -1, ci = -1, tech = -1;
|
||||||
|
@ -614,8 +606,7 @@ static void creg_notify(GAtResult *result, gpointer user_data)
|
||||||
else
|
else
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (g_at_result_iter_next_number(&iter, &tech) == TRUE)
|
g_at_result_iter_next_number(&iter, &tech);
|
||||||
at->netreg->supports_tech = TRUE;
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
ofono_debug("creg_notify: %d, %d, %d, %d", status, lac, ci, tech);
|
ofono_debug("creg_notify: %d, %d, %d, %d", status, lac, ci, tech);
|
||||||
|
|
Loading…
Reference in New Issue