g_variant_builder_add(builder, "{sv}", "passphrase",
g_variant_new_string(param->passphrase));
+ if (param->ssid && strlen(param->ssid) > 0)
+ g_variant_builder_add(builder, "{sv}", "ssid",
+ g_variant_new_string(param->ssid));
+
if (param->freq)
g_variant_builder_add(builder, "{sv}", "frequency",
g_variant_new_int32(param->freq));
"</interface>"
"<interface name='net.wifidirect.group'>"
"<method name='CreateGroup'>"
+ "<arg type='a{sv}' name='parameters' direction='in'/>"
"<arg type='i' name='error_code' direction='out'/>"
"</method>"
"<method name='DestroyGroup'>"
if (!g_strcmp0(method_name, "CreateGroup")) {
wfd_group_s *group = manager->group;
wfd_oem_group_param_s param;
+ GVariantIter *iter = NULL;
+ gchar *key = NULL;
+ GVariant *var = NULL;
+ const char *ssid = NULL;
+
+ g_variant_get(parameters, "(a{sv})", &iter);
+ while (g_variant_iter_loop(iter, "{sv}", &key, &var)) {
+ if (!g_strcmp0(key, "ssid")) {
+ g_variant_get(var, "&s", &ssid);
+ if (ssid == NULL) {
+ ret = WIFI_DIRECT_ERROR_INVALID_PARAMETER;
+ g_variant_iter_free(iter);
+ goto failed;
+ }
+ WDS_LOGD("SSID received [%s]", ssid);
+ }
+ }
if (group || manager->state < WIFI_DIRECT_STATE_ACTIVATED) {
WDS_LOGE("Group already exist or not a proper state");
ret = WIFI_DIRECT_ERROR_NOT_PERMITTED;
+ g_variant_iter_free(iter);
goto failed;
}
if (!group) {
WDS_LOGE("Failed to create pending group");
ret = WIFI_DIRECT_ERROR_OPERATION_FAILED;
+ g_variant_iter_free(iter);
goto failed;
}
group->flags |= WFD_GROUP_FLAG_AUTONOMOUS;
param.freq = WFD_FREQ_2G;
#endif
+ if (ssid != NULL)
+ g_strlcpy(param.ssid, ssid, WIFI_DIRECT_MAX_DEVICE_NAME_LEN+1);
+
+ g_variant_iter_free(iter);
+
ret = wfd_oem_create_group(manager->oem_ops, ¶m);
if (ret < 0) {
WDS_LOGE("Failed to create group");