summaryrefslogtreecommitdiffstats
path: root/plugins/modemconf.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-09-08 03:01:52 +0200
committerMarcel Holtmann <marcel@holtmann.org>2009-09-08 03:01:52 +0200
commit0910ee73495196280a3acab1dfb649a8ceb7140e (patch)
tree338d0853aad324d4e60dfbad7102f2c649e95eff /plugins/modemconf.c
parent02eacb65afbbdf224bd61d228aa9601f528f35a8 (diff)
downloadofono-0910ee73495196280a3acab1dfb649a8ceb7140e.tar.bz2
Add support for using phonesim and calypso for testing
Diffstat (limited to 'plugins/modemconf.c')
-rw-r--r--plugins/modemconf.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/plugins/modemconf.c b/plugins/modemconf.c
index c15286de..b306a4ce 100644
--- a/plugins/modemconf.c
+++ b/plugins/modemconf.c
@@ -38,22 +38,28 @@ static GSList *modem_list = NULL;
static int set_address(struct ofono_modem *modem,
GKeyFile *keyfile, const char *group)
{
- char *address, *port;
+ char *value;
- address = g_key_file_get_string(keyfile, group, "Address", NULL);
- if (address) {
- ofono_modem_set_string(modem, "Address", address);
- g_free(address);
+ value = g_key_file_get_string(keyfile, group, "Address", NULL);
+ if (value) {
+ ofono_modem_set_string(modem, "Address", value);
+ g_free(value);
} else
ofono_modem_set_string(modem, "Address", "127.0.0.1");
- port = g_key_file_get_string(keyfile, group, "Port", NULL);
- if (port) {
- ofono_modem_set_integer(modem, "Port", atoi(port));
- g_free(port);
+ value = g_key_file_get_string(keyfile, group, "Port", NULL);
+ if (value) {
+ ofono_modem_set_integer(modem, "Port", atoi(value));
+ g_free(value);
} else
ofono_modem_set_integer(modem, "Port", 12345);
+ value = g_key_file_get_string(keyfile, group, "Modem", NULL);
+ if (value) {
+ ofono_modem_set_string(modem, "Modem", value);
+ g_free(value);
+ }
+
return 0;
}