mirror of git://git.sysmocom.de/ofono
ublox: gprs-context: take model parameter
This commit is contained in:
parent
e2d2712708
commit
d393863486
|
@ -45,6 +45,7 @@ static const char *cgcontrdp_prefix[] = { "+CGCONTRDP:", NULL };
|
|||
static const char *uipaddr_prefix[] = { "+UIPADDR:", NULL };
|
||||
|
||||
struct gprs_context_data {
|
||||
const struct ublox_model *model;
|
||||
GAtChat *chat;
|
||||
unsigned int active_context;
|
||||
ofono_gprs_context_cb_t cb;
|
||||
|
@ -462,7 +463,7 @@ static void cgev_notify(GAtResult *result, gpointer user_data)
|
|||
}
|
||||
|
||||
static int ublox_gprs_context_probe(struct ofono_gprs_context *gc,
|
||||
unsigned int vendor, void *data)
|
||||
unsigned int model_id, void *data)
|
||||
{
|
||||
GAtChat *chat = data;
|
||||
struct gprs_context_data *gcd;
|
||||
|
@ -473,6 +474,10 @@ static int ublox_gprs_context_probe(struct ofono_gprs_context *gc,
|
|||
if (gcd == NULL)
|
||||
return -ENOMEM;
|
||||
|
||||
gcd->model = ublox_model_from_id(model_id);
|
||||
if (!gcd->model)
|
||||
return -EINVAL;
|
||||
|
||||
gcd->chat = g_at_chat_clone(chat);
|
||||
|
||||
ofono_gprs_context_set_data(gc, gcd);
|
||||
|
|
Loading…
Reference in New Issue