diff options
author | Martin Xu <martin.xu@intel.com> | 2010-01-28 22:38:46 +0800 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-01-29 08:12:52 +0100 |
commit | 27c7fd4ec4582769b1164be1daaf56e8f070f0f5 (patch) | |
tree | 52e206500fe0c92f43661f43760ef7e5d4be3a9b /src/network.c | |
parent | 1e3def632f54af8437080f8fe6db7f1d833f606d (diff) | |
download | connman-27c7fd4ec4582769b1164be1daaf56e8f070f0f5.tar.gz connman-27c7fd4ec4582769b1164be1daaf56e8f070f0f5.tar.bz2 connman-27c7fd4ec4582769b1164be1daaf56e8f070f0f5.zip |
Add network->driver->setup() callback function
After string value has been set in function connman_network_set_string()
call network->driver->setup() to let network driver handle the value.
ofono network driver setup call back function handles "Cellular.APN" to
set up APN.
Diffstat (limited to 'src/network.c')
-rw-r--r-- | src/network.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/network.c b/src/network.c index c233c8f5..5698809b 100644 --- a/src/network.c +++ b/src/network.c @@ -1017,6 +1017,8 @@ int connman_network_set_roaming(struct connman_network *network, int connman_network_set_string(struct connman_network *network, const char *key, const char *value) { + int err; + DBG("network %p key %s value %s", network, key, value); if (g_strcmp0(key, "Name") == 0) @@ -1060,7 +1062,17 @@ int connman_network_set_string(struct connman_network *network, network->wifi.phase2_auth = g_strdup(value); } - return connman_element_set_string(&network->element, key, value); + err = connman_element_set_string(&network->element, key, value); + if (err < 0) + return err; + + if (network->driver == NULL) + return 0; + + if (network->driver->setup) + return network->driver->setup(network, key); + + return 0; } /** |