diff options
Diffstat (limited to 'plugins/modemconf.c')
-rw-r--r-- | plugins/modemconf.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/modemconf.c b/plugins/modemconf.c index 3b34a6df..3a199382 100644 --- a/plugins/modemconf.c +++ b/plugins/modemconf.c @@ -23,6 +23,8 @@ #include <config.h> #endif +#include <errno.h> + #include <glib.h> #define OFONO_API_SUBJECT_TO_CHANGE @@ -32,6 +34,22 @@ static GSList *modem_list = NULL; +static int set_device(struct ofono_modem *modem, + GKeyFile *keyfile, const char *group) +{ + char *device; + + device = g_key_file_get_string(keyfile, group, "Device", NULL); + if (!device) + return -EINVAL; + + ofono_modem_set_string(modem, "Device", device); + + g_free(device); + + return 0; +} + static struct ofono_modem *create_modem(GKeyFile *keyfile, const char *group) { struct ofono_modem *modem; @@ -43,6 +61,9 @@ static struct ofono_modem *create_modem(GKeyFile *keyfile, const char *group) modem = ofono_modem_create(driver); + if (!g_strcmp0(driver, "g1") || !g_strcmp0(driver, "mbm")) + set_device(modem, keyfile, group); + g_free(driver); return modem; |