mirror of git://git.sysmocom.de/ofono
quectel: improve coding style
This commit is contained in:
parent
181e8d3da7
commit
db74f0998a
|
@ -91,8 +91,8 @@ static void quectel_remove(struct ofono_modem *modem)
|
||||||
g_free(data);
|
g_free(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GAtChat *open_device(struct ofono_modem *modem,
|
static GAtChat *open_device(struct ofono_modem *modem, const char *key,
|
||||||
const char *key, char *debug)
|
char *debug)
|
||||||
{
|
{
|
||||||
return at_util_open_device(modem, key, quectel_debug, debug, NULL);
|
return at_util_open_device(modem, key, quectel_debug, debug, NULL);
|
||||||
}
|
}
|
||||||
|
@ -151,8 +151,8 @@ static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
|
|
||||||
data->cpin_ready = g_at_chat_register(data->aux, "+CPIN", cpin_notify,
|
data->cpin_ready = g_at_chat_register(data->aux, "+CPIN", cpin_notify,
|
||||||
FALSE, modem, NULL);
|
FALSE, modem, NULL);
|
||||||
g_at_chat_send(data->aux, "AT+CPIN?", cpin_prefix, cpin_query,
|
g_at_chat_send(data->aux, "AT+CPIN?", cpin_prefix, cpin_query, modem,
|
||||||
modem, NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cfun_query(gboolean ok, GAtResult *result, gpointer user_data)
|
static void cfun_query(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
|
@ -185,8 +185,8 @@ static void cfun_query(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (status != 1) {
|
if (status != 1) {
|
||||||
g_at_chat_send(data->aux, "AT+CFUN=4", none_prefix,
|
g_at_chat_send(data->aux, "AT+CFUN=4", none_prefix, cfun_enable,
|
||||||
cfun_enable, modem, NULL);
|
modem, NULL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,13 +212,12 @@ static int quectel_enable(struct ofono_modem *modem)
|
||||||
|
|
||||||
g_at_chat_set_slave(data->modem, data->aux);
|
g_at_chat_set_slave(data->modem, data->aux);
|
||||||
|
|
||||||
g_at_chat_send(data->modem, "ATE0 &C0 +CMEE=1", none_prefix,
|
g_at_chat_send(data->modem, "ATE0 &C0 +CMEE=1", none_prefix, NULL, NULL,
|
||||||
NULL, NULL, NULL);
|
NULL);
|
||||||
g_at_chat_send(data->aux, "ATE0 &C0 +CMEE=1", none_prefix,
|
g_at_chat_send(data->aux, "ATE0 &C0 +CMEE=1", none_prefix, NULL, NULL,
|
||||||
NULL, NULL, NULL);
|
NULL);
|
||||||
|
g_at_chat_send(data->aux, "AT+CFUN?", cfun_prefix, cfun_query, modem,
|
||||||
g_at_chat_send(data->aux, "AT+CFUN?", cfun_prefix,
|
NULL);
|
||||||
cfun_query, modem, NULL);
|
|
||||||
|
|
||||||
return -EINPROGRESS;
|
return -EINPROGRESS;
|
||||||
}
|
}
|
||||||
|
@ -277,8 +276,8 @@ static void quectel_set_online(struct ofono_modem *modem, ofono_bool_t online,
|
||||||
|
|
||||||
DBG("modem %p %s", modem, online ? "online" : "offline");
|
DBG("modem %p %s", modem, online ? "online" : "offline");
|
||||||
|
|
||||||
if (g_at_chat_send(data->aux, command, cfun_prefix, set_online_cb,
|
if (g_at_chat_send(data->aux, command, cfun_prefix, set_online_cb, cbd,
|
||||||
cbd, g_free) > 0)
|
g_free) > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
CALLBACK_WITH_FAILURE(cb, cbd->data);
|
CALLBACK_WITH_FAILURE(cb, cbd->data);
|
||||||
|
@ -295,7 +294,7 @@ static void quectel_pre_sim(struct ofono_modem *modem)
|
||||||
|
|
||||||
ofono_devinfo_create(modem, 0, "atmodem", data->aux);
|
ofono_devinfo_create(modem, 0, "atmodem", data->aux);
|
||||||
sim = ofono_sim_create(modem, OFONO_VENDOR_QUECTEL, "atmodem",
|
sim = ofono_sim_create(modem, OFONO_VENDOR_QUECTEL, "atmodem",
|
||||||
data->aux);
|
data->aux);
|
||||||
|
|
||||||
if (sim && data->have_sim == TRUE)
|
if (sim && data->have_sim == TRUE)
|
||||||
ofono_sim_inserted_notify(sim, TRUE);
|
ofono_sim_inserted_notify(sim, TRUE);
|
||||||
|
|
Loading…
Reference in New Issue