mirror of git://git.sysmocom.de/ofono
Style: Repeat for plugins
This commit is contained in:
parent
955e6a61ee
commit
57512ad924
|
@ -121,8 +121,9 @@ static int atgen_enable(struct ofono_modem *modem)
|
||||||
syntax = g_at_syntax_new_gsm_permissive();
|
syntax = g_at_syntax_new_gsm_permissive();
|
||||||
else
|
else
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
} else
|
} else {
|
||||||
syntax = g_at_syntax_new_gsmv1();
|
syntax = g_at_syntax_new_gsmv1();
|
||||||
|
}
|
||||||
|
|
||||||
chat = g_at_chat_new(channel, syntax);
|
chat = g_at_chat_new(channel, syntax);
|
||||||
g_at_syntax_unref(syntax);
|
g_at_syntax_unref(syntax);
|
||||||
|
|
|
@ -211,8 +211,9 @@ static void cfun_set_on_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||||
g_at_mux_shutdown(data->mux);
|
g_at_mux_shutdown(data->mux);
|
||||||
g_at_mux_unref(data->mux);
|
g_at_mux_unref(data->mux);
|
||||||
data->mux = NULL;
|
data->mux = NULL;
|
||||||
} else
|
} else {
|
||||||
setup_modem(modem);
|
setup_modem(modem);
|
||||||
|
}
|
||||||
|
|
||||||
ofono_modem_set_powered(modem, ok);
|
ofono_modem_set_powered(modem, ok);
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,15 +57,17 @@ static int set_address(struct ofono_modem *modem,
|
||||||
if (value) {
|
if (value) {
|
||||||
ofono_modem_set_string(modem, "Address", value);
|
ofono_modem_set_string(modem, "Address", value);
|
||||||
g_free(value);
|
g_free(value);
|
||||||
} else
|
} else {
|
||||||
ofono_modem_set_string(modem, "Address", "127.0.0.1");
|
ofono_modem_set_string(modem, "Address", "127.0.0.1");
|
||||||
|
}
|
||||||
|
|
||||||
value = g_key_file_get_string(keyfile, group, "Port", NULL);
|
value = g_key_file_get_string(keyfile, group, "Port", NULL);
|
||||||
if (value) {
|
if (value) {
|
||||||
ofono_modem_set_integer(modem, "Port", atoi(value));
|
ofono_modem_set_integer(modem, "Port", atoi(value));
|
||||||
g_free(value);
|
g_free(value);
|
||||||
} else
|
} else {
|
||||||
ofono_modem_set_integer(modem, "Port", 12345);
|
ofono_modem_set_integer(modem, "Port", 12345);
|
||||||
|
}
|
||||||
|
|
||||||
value = g_key_file_get_string(keyfile, group, "Modem", NULL);
|
value = g_key_file_get_string(keyfile, group, "Modem", NULL);
|
||||||
if (value) {
|
if (value) {
|
||||||
|
|
|
@ -245,9 +245,10 @@ static int phonesim_enable(struct ofono_modem *modem)
|
||||||
g_at_mux_setup_gsm0710(data->chat, mux_setup, modem, NULL);
|
g_at_mux_setup_gsm0710(data->chat, mux_setup, modem, NULL);
|
||||||
g_at_chat_unref(data->chat);
|
g_at_chat_unref(data->chat);
|
||||||
data->chat = NULL;
|
data->chat = NULL;
|
||||||
} else
|
} else {
|
||||||
g_at_chat_send(data->chat, "AT+CFUN=1", NULL,
|
g_at_chat_send(data->chat, "AT+CFUN=1", NULL,
|
||||||
cfun_set_on_cb, modem, NULL);
|
cfun_set_on_cb, modem, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
return -EINPROGRESS;
|
return -EINPROGRESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,8 +115,9 @@ static void add_mbm(struct ofono_modem *modem,
|
||||||
devnode = udev_device_get_property_value(udev_device,
|
devnode = udev_device_get_property_value(udev_device,
|
||||||
"INTERFACE");
|
"INTERFACE");
|
||||||
ofono_modem_set_string(modem, NETWORK_INTERFACE, devnode);
|
ofono_modem_set_string(modem, NETWORK_INTERFACE, devnode);
|
||||||
} else
|
} else {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
device = ofono_modem_get_string(modem, MODEM_DEVICE);
|
device = ofono_modem_get_string(modem, MODEM_DEVICE);
|
||||||
network = ofono_modem_get_string(modem, NETWORK_INTERFACE);
|
network = ofono_modem_get_string(modem, NETWORK_INTERFACE);
|
||||||
|
@ -158,8 +159,9 @@ static void add_hso(struct ofono_modem *modem,
|
||||||
devnode = udev_device_get_property_value(udev_device,
|
devnode = udev_device_get_property_value(udev_device,
|
||||||
"INTERFACE");
|
"INTERFACE");
|
||||||
ofono_modem_set_string(modem, NETWORK_INTERFACE, devnode);
|
ofono_modem_set_string(modem, NETWORK_INTERFACE, devnode);
|
||||||
} else
|
} else {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
app = ofono_modem_get_string(modem, APPLICATION_PORT);
|
app = ofono_modem_get_string(modem, APPLICATION_PORT);
|
||||||
control = ofono_modem_get_string(modem, CONTROL_PORT);
|
control = ofono_modem_get_string(modem, CONTROL_PORT);
|
||||||
|
|
Loading…
Reference in New Issue