diff options
author | Martin Hundebøll <martin@geanix.com> | 2019-07-16 21:10:50 +0200 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2019-07-17 10:26:53 -0500 |
commit | 5a255d6e62b3aeeaa3fe4ec7b97ef0adf887e157 (patch) | |
tree | a0d36178e746ee882488d55b72ae97e1f43ac86a /plugins/quectel.c | |
parent | bac8a9cf8d09d04b8896f68f3b2211342b272685 (diff) | |
download | ofono-5a255d6e62b3aeeaa3fe4ec7b97ef0adf887e157.tar.gz |
quectel: store model id in private data
Some Quectel models supports different features such as GNSS or
different URC strings. Add a field in the quectel data structure to be
used when adding support for said features.
Diffstat (limited to 'plugins/quectel.c')
-rw-r--r-- | plugins/quectel.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/quectel.c b/plugins/quectel.c index 61b82744..e84e3cf1 100644 --- a/plugins/quectel.c +++ b/plugins/quectel.c @@ -70,6 +70,13 @@ static const uint8_t gsm0710_terminate[] = { 0xf9, /* close flag */ }; +enum quectel_model { + QUECTEL_UNKNOWN, + QUECTEL_UC15, + QUECTEL_M95, + QUECTEL_MC60, +}; + struct quectel_data { GAtChat *modem; GAtChat *aux; @@ -77,6 +84,7 @@ struct quectel_data { guint call_ready; bool have_sim; enum ofono_vendor vendor; + enum quectel_model model; struct l_timeout *sms_ready_timer; /* used by quectel uart driver */ @@ -329,12 +337,15 @@ static void cgmm_cb(int ok, GAtResult *result, void *user_data) if (strcmp(model, "UC15") == 0) { DBG("%p model UC15", modem); data->vendor = OFONO_VENDOR_QUECTEL; + data->model = QUECTEL_UC15; } else if (strcmp(model, "Quectel_M95") == 0) { DBG("%p model M95", modem); data->vendor = OFONO_VENDOR_QUECTEL_SERIAL; + data->model = QUECTEL_M95; } else { ofono_warn("%p unknown model: '%s'", modem, model); data->vendor = OFONO_VENDOR_QUECTEL; + data->model = QUECTEL_UNKNOWN; } g_at_chat_send(data->aux, "AT+CFUN?", cfun_prefix, cfun_query, modem, |