dbus_message_iter_next(&dict);
}
- if (wps == TRUE) {
- struct connman_network *network;
-
- network = __connman_service_get_network(
- passphrase_reply->service);
- if (network == NULL)
- goto done;
-
- connman_network_set_bool(network, "WiFi.UseWPS", wps);
-
- if (wpspin != NULL && strlen(wpspin) > 0)
- connman_network_set_string(network,
- "WiFi.PinWPS", wpspin);
- else
- connman_network_set_string(network,
- "WiFi.PinWPS", NULL);
- }
-
done:
passphrase_reply->callback(passphrase_reply->service, values_received,
name, name_len,
return;
}
+ err = check_wpspin(wpspin);
+ if (err < 0)
+ goto done;
+ if (service->network != NULL) {
+ connman_network_set_bool(service->network, "Wifi.UseWPS", wps);
+ connman_network_set_string(service->network, "Wifi.PinWPS",
+ wpspin);
+ }
+
if (identity != NULL)
__connman_service_set_agent_identity(service, identity);
if (passphrase != NULL)
err = __connman_service_add_passphrase(service, passphrase);
+ done:
if (err >= 0) {
__connman_service_connect(service);