diff options
Diffstat (limited to 'src/network.c')
-rw-r--r-- | src/network.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/network.c b/src/network.c index aebf7cf7..079453c0 100644 --- a/src/network.c +++ b/src/network.c @@ -1442,6 +1442,34 @@ const char *connman_network_get_string(struct connman_network *network, } /** + * connman_network_set_passphrase: + * @network: network structure + * @passphrase: network passphrase + * + * Set network passphrase. + * If the network is linked to a service, the latter gets his passphrase + * set as well. + */ +int connman_network_set_passphrase(struct connman_network *network, + const char* passphrase) +{ + struct connman_service *service; + + service = __connman_service_lookup_from_network(network); + if (service == NULL) { + connman_network_set_string(network, "WiFi.Passphrase", + passphrase); + + return 0; + } + + __connman_service_set_passphrase(service, passphrase); + + return 0; +} + + +/** * connman_network_set_bool: * @network: network structure * @key: unique identifier |