summaryrefslogtreecommitdiff
path: root/plugins/ublox.c
diff options
context:
space:
mode:
authorDragos Tatulea <dragos@endocode.com>2016-03-17 13:38:27 +0100
committerDenis Kenzior <denkenz@gmail.com>2016-03-17 09:40:59 -0500
commit82fb20d707cf68624a6d5d230305a564ed9b11d5 (patch)
tree0854d8d4d097d8a9d8103b3ce8ff6b8754d26c21 /plugins/ublox.c
parent5b6ac8c14fb2daaad5bcd091324cfd0b74681a79 (diff)
downloadofono-82fb20d707cf68624a6d5d230305a564ed9b11d5.tar.gz
ublox: give names to model ids
To make it easier to understand the code.
Diffstat (limited to 'plugins/ublox.c')
-rw-r--r--plugins/ublox.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/plugins/ublox.c b/plugins/ublox.c
index 5e442a14..938777c5 100644
--- a/plugins/ublox.c
+++ b/plugins/ublox.c
@@ -44,9 +44,17 @@
static const char *none_prefix[] = { NULL };
+enum supported_models {
+ SARA_G270 = 1102,
+ TOBYL2_COMPATIBLE_MODE = 1141,
+ TOBYL2_MEDIUM_THROUGHPUT_MODE = 1143,
+ TOBYL2_HIGH_THROUGHPUT_MODE = 1146,
+};
+
struct ublox_data {
GAtChat *modem;
GAtChat *aux;
+ int model_id;
enum ofono_vendor vendor_family;
};
@@ -140,7 +148,6 @@ static int ublox_enable(struct ofono_modem *modem)
{
struct ublox_data *data = ofono_modem_get_data(modem);
const char *model_str = NULL;
- int model_id;
DBG("%p", modem);
@@ -152,19 +159,20 @@ static int ublox_enable(struct ofono_modem *modem)
* Toby L2 devices are more complex and special than previously
* supported U-Blox devices. So they need a vendor of their own.
*/
- model_id = atoi(model_str);
- switch (model_id) {
- case 1102:
+ data->model_id = atoi(model_str);
+
+ switch (data->model_id) {
+ case SARA_G270:
data->vendor_family = OFONO_VENDOR_UBLOX;
break;
- case 1141:
- case 1146:
+ case TOBYL2_COMPATIBLE_MODE:
+ case TOBYL2_HIGH_THROUGHPUT_MODE:
data->vendor_family = OFONO_VENDOR_UBLOX_TOBY_L2;
break;
- case 1143:
+ case TOBYL2_MEDIUM_THROUGHPUT_MODE:
DBG("low/medium throughtput profile unsupported");
default:
- DBG("unknown ublox model id %d", model_id);
+ DBG("unknown ublox model id %d", data->model_id);
return -EINVAL;
}