/* Dbus method for softap APIs */
gboolean softap_enable(Softap *obj, GDBusMethodInvocation *context,
- gchar *ssid, gchar *key, gint hide_mode, gint security_type);
+ gchar *ssid, gchar *key, gchar *vendor_elements, gint hide_mode, gint security_type);
gboolean softap_disable(Softap *obj,
GDBusMethodInvocation *context);
gboolean softap_reload_settings(Softap *obj, GDBusMethodInvocation *context,
- gchar *ssid, char *key, gint visibility, gint security_type);
+ gchar *ssid, gchar *key, gchar *vendor_elements, gint visibility, gint security_type);
gboolean softap_set_wps_pin(Softap *obj,
GDBusMethodInvocation *context, gchar *wps_pin);
#endif
/* Vendor elements conf. */
- if (type == MOBILE_AP_TYPE_WIFI) {
+ if (strlen(settings->vendor_elements)) {
snprintf(buf, sizeof(buf),
- "vendor_elements=%s\n", HOSTAPD_VENDOR_ELEMENTS_TETH);
- } else if (type == MOBILE_AP_TYPE_WIFI_AP) {
- snprintf(buf, sizeof(buf),
- "vendor_elements=%s\n", HOSTAPD_VENDOR_ELEMENTS_WIFI_AP);
- } else {
- ERR("Unknown type: %d\n", type);
- g_free(conf);
- return MOBILE_AP_ERROR_INVALID_PARAM;
+ "vendor_elements=%s\n", settings->vendor_elements);
}
old_conf = conf;
conf = g_strconcat(old_conf, buf, NULL);
conf = g_strdup(buf);
/* Vendor elements conf. */
- if (type == MOBILE_AP_TYPE_WIFI) {
+ if (strlen(settings->vendor_elements)) {
snprintf(buf, sizeof(buf),
- "vendor_elements=%s\n", HOSTAPD_VENDOR_ELEMENTS_TETH);
- } else if (type == MOBILE_AP_TYPE_WIFI_AP) {
- snprintf(buf, sizeof(buf),
- "vendor_elements=%s\n", HOSTAPD_VENDOR_ELEMENTS_WIFI_AP);
- } else {
- ERR("Unknown type: %d\n", type);
- g_free(conf);
- return MOBILE_AP_ERROR_INVALID_PARAM;
+ "vendor_elements=%s\n", settings->vendor_elements);
}
old_conf = conf;
conf = g_strconcat(old_conf, buf, NULL);
static guint wifi_recovery_timeout_id = 0;
static gboolean prev_wifi_on = FALSE;
static gboolean is_softap = FALSE;
-static softap_settings_t wifi_settings = {0, "", "", "", "", 0, 0, 0, 0};
-static softap_settings_t wifi_ap_settings = {0, "", "", "", "", 0, 0, 0, 0};
-static softap_settings_t obj_softap_settings = {0, "", "", "", "", 0, 0, 0, 0};
+static softap_settings_t wifi_settings = {0, "", "", "", "", "", 0, 0, 0, 0};
+static softap_settings_t wifi_ap_settings = {0, "", "", "", "", "", 0, 0, 0, 0};
+static softap_settings_t obj_softap_settings = {0, "", "", "", "", "", 0, 0, 0, 0};
static wifi_manager_h wifi_manager = NULL;
if (strlen(src->mode))
g_strlcpy(dst->mode, src->mode, sizeof(dst->mode));
+ if (strlen(src->vendor_elements))
+ g_strlcpy(dst->vendor_elements, src->vendor_elements, sizeof(dst->vendor_elements));
+
dst->channel = src->channel;
dst->hide_mode = src->hide_mode;
dst->mac_filter = src->mac_filter;
dst->max_sta = src->max_sta;
dst->address_type = src->address_type;
- SDBG("ssid : %s security type : %s hide mode : %d mac filter : %d max_sta: %d hw_mode: %s \n",
- dst->ssid, dst->security_type, dst->hide_mode, dst->mac_filter, dst->max_sta, dst->mode);
+ SDBG("ssid : %s security type : %s hide mode : %d mac filter : %d max_sta: %d hw_mode: %s vendor: %s \n",
+ dst->ssid, dst->security_type, dst->hide_mode, dst->mac_filter, dst->max_sta, dst->mode, dst->vendor_elements);
return MOBILE_AP_ERROR_NONE;
}
}
gboolean softap_enable(Softap *obj, GDBusMethodInvocation *context,
- gchar *ssid, gchar *key, gint visibility, gint security_type)
+ gchar *ssid, gchar *key, gchar *vendor_elements, gint visibility, gint security_type)
{
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
gboolean ret_val = FALSE;
sizeof(wifi_ap_settings.security_type));
}
+ g_strlcpy(wifi_ap_settings.vendor_elements, vendor_elements, sizeof(wifi_ap_settings.vendor_elements));
wifi_ap_settings.hide_mode = (!visibility);
wifi_ap_settings.address_type = MOBILE_AP_ADDRESS_TYPE_IPV4;
wifi_ap_settings.channel = MOBILE_AP_WIFI_CHANNEL;
gboolean softap_reload_settings(Softap *obj,
GDBusMethodInvocation *context, gchar *ssid,
- gchar *key, gint visibility, gint security_type)
+ gchar *key, gchar *vendor_elements, gint visibility, gint security_type)
{
mobile_ap_error_code_e ret = MOBILE_AP_ERROR_NONE;
gboolean ret_val = TRUE;
sizeof(settings.security_type));
}
+ g_strlcpy(wifi_ap_settings.vendor_elements, vendor_elements, sizeof(wifi_ap_settings.vendor_elements));
+
settings.hide_mode = (!visibility);
settings.address_type = MOBILE_AP_ADDRESS_TYPE_IPV4;
settings.channel = MOBILE_AP_WIFI_CHANNEL;