mirror of git://git.sysmocom.de/ofono
Update atmodem gprs driver to the new API
This commit is contained in:
parent
7972f844c7
commit
36a8801115
|
@ -89,23 +89,23 @@ static void at_cgreg_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
struct cb_data *cbd = user_data;
|
struct cb_data *cbd = user_data;
|
||||||
ofono_gprs_status_cb_t cb = cbd->cb;
|
ofono_gprs_status_cb_t cb = cbd->cb;
|
||||||
struct ofono_error error;
|
struct ofono_error error;
|
||||||
int status, lac, ci, tech;
|
int status;
|
||||||
struct gprs_data *gd = cbd->user;
|
struct gprs_data *gd = cbd->user;
|
||||||
|
|
||||||
decode_at_error(&error, g_at_result_final_response(result));
|
decode_at_error(&error, g_at_result_final_response(result));
|
||||||
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
cb(&error, -1, -1, -1, -1, cbd->data);
|
cb(&error, -1, cbd->data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (at_util_parse_reg(result, "+CGREG:", NULL, &status,
|
if (at_util_parse_reg(result, "+CGREG:", NULL, &status,
|
||||||
&lac, &ci, &tech, gd->vendor) == FALSE) {
|
NULL, NULL, NULL, gd->vendor) == FALSE) {
|
||||||
CALLBACK_WITH_FAILURE(cb, -1, -1, -1, -1, cbd->data);
|
CALLBACK_WITH_FAILURE(cb, -1, cbd->data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cb(&error, status, lac, ci, tech, cbd->data);
|
cb(&error, status, cbd->data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void at_gprs_registration_status(struct ofono_gprs *gprs,
|
static void at_gprs_registration_status(struct ofono_gprs *gprs,
|
||||||
|
@ -128,20 +128,20 @@ error:
|
||||||
if (cbd)
|
if (cbd)
|
||||||
g_free(cbd);
|
g_free(cbd);
|
||||||
|
|
||||||
CALLBACK_WITH_FAILURE(cb, -1, -1, -1, -1, data);
|
CALLBACK_WITH_FAILURE(cb, -1, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cgreg_notify(GAtResult *result, gpointer user_data)
|
static void cgreg_notify(GAtResult *result, gpointer user_data)
|
||||||
{
|
{
|
||||||
struct ofono_gprs *gprs = user_data;
|
struct ofono_gprs *gprs = user_data;
|
||||||
int status, lac, ci, tech;
|
int status;
|
||||||
struct gprs_data *gd = ofono_gprs_get_data(gprs);
|
struct gprs_data *gd = ofono_gprs_get_data(gprs);
|
||||||
|
|
||||||
if (at_util_parse_reg_unsolicited(result, "+CGREG:", &status,
|
if (at_util_parse_reg_unsolicited(result, "+CGREG:", &status,
|
||||||
&lac, &ci, &tech, gd->vendor) == FALSE)
|
NULL, NULL, NULL, gd->vendor) == FALSE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ofono_gprs_status_notify(gprs, status, lac, ci, tech);
|
ofono_gprs_status_notify(gprs, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cgev_notify(GAtResult *result, gpointer user_data)
|
static void cgev_notify(GAtResult *result, gpointer user_data)
|
||||||
|
@ -319,7 +319,7 @@ static struct ofono_gprs_driver driver = {
|
||||||
.probe = at_gprs_probe,
|
.probe = at_gprs_probe,
|
||||||
.remove = at_gprs_remove,
|
.remove = at_gprs_remove,
|
||||||
.set_attached = at_gprs_set_attached,
|
.set_attached = at_gprs_set_attached,
|
||||||
.registration_status = at_gprs_registration_status,
|
.attached_status = at_gprs_registration_status,
|
||||||
};
|
};
|
||||||
|
|
||||||
void at_gprs_init()
|
void at_gprs_init()
|
||||||
|
|
Loading…
Reference in New Issue