net_error_state_type_e ProfileErrorState; /** Service error state */
char Favourite; /** Favourite flag */
int disconnect_reason; /** Supplicant Disconnect Reason Code */
+ unsigned char raw_ssid[NET_WLAN_RAW_SSID_LEN+1];/** Raw SSID bytes */
+ int raw_ssid_len; /** Raw SSID length */
} net_profile_info_s;
typedef struct {
typedef struct {
char ssid[NET_WLAN_ESSID_LEN + 1];
+ unsigned char raw_ssid[NET_WLAN_RAW_SSID_LEN + 1]; /** Raw SSID bytes */
+ int raw_ssid_len; /** Raw SSID length */
wlan_security_mode_type_e security;
char wps;
} net_ssid_scan_bss_info_s;
extern "C" {
#endif /* __cplusplus */
-/** Length of essid */
+/** Length of raw SSID */
+#define NET_WLAN_RAW_SSID_LEN 32
+
+/** Length of ESSID */
#define NET_WLAN_ESSID_LEN 128
-/** Length of bssid */
+/** Length of BSSID */
#define NET_WLAN_BSSID_LEN 17
/**
*/
int wifi_manager_ap_get_essid(wifi_manager_ap_h ap, char **essid);
+/**
+ * @brief Gets raw SSID (Service Set Identifier).
+ * @since_tizen 4.0
+ * @remarks You must release @a ssid using free().
+ * @param[in] ap The access point handle
+ * @param[out] ssid The raw SSID bytes
+ * @param[out] ssid_len The raw SSID length
+ * @return 0 on success, otherwise negative error value
+ * @retval #WIFI_MANAGER_ERROR_NONE Successful
+ * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WIFI_MANAGER_ERROR_OUT_OF_MEMORY Out of memory
+ * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
+ */
+int wifi_manager_ap_get_raw_ssid(wifi_manager_ap_h ap, char **ssid, int *ssid_len);
+
/**
* @brief Gets BSSID (Basic Service Set Identifier).
* @since_tizen 3.0
ProfInfo->PassphraseRequired = TRUE;
else
ProfInfo->PassphraseRequired = FALSE;
+ } else if (g_strcmp0(key, "SSID") == 0) {
+ const gchar *ssid = NULL;
+ gsize ssid_len;
+ ssid = g_variant_get_fixed_array(var, &ssid_len, sizeof(guchar));
+ memcpy(ProfInfo->raw_ssid, ssid, ssid_len);
+ ProfInfo->raw_ssid_len = ssid_len;
} else if (g_strcmp0(key, "BSSID") == 0) {
value = g_variant_get_string(var, NULL);
GVariant *value = NULL;
gchar *key = NULL;
const gchar *ssid = NULL;
+ const unsigned char *raw_ssid = NULL;
+ gsize raw_ssid_len = 0;
gint32 security = 0;
gboolean wps = FALSE;
GSList *bss_info_list = NULL;
gboolean ssid_found = FALSE;
gboolean sec_found = FALSE;
gboolean wps_found = FALSE;
+ gboolean raw_ssid_found = FALSE;
g_variant_get(param, "(a{sv})", &iter);
WIFI_LOG(WIFI_INFO, "SSID: %s", ssid);
ssid_found = TRUE;
}
+ if (g_strcmp0(key, "raw_ssid") == 0 && raw_ssid_found == FALSE) {
+ raw_ssid = g_variant_get_fixed_array(value, &raw_ssid_len, sizeof(guchar));
+ raw_ssid_found = TRUE;
+ WIFI_LOG(WIFI_INFO, "raw SSID len: %d", raw_ssid_len);
+ raw_ssid_found = TRUE;
+ }
if (g_strcmp0(key, "security") == 0 && sec_found == FALSE) {
security = g_variant_get_int32(value);
WIFI_LOG(WIFI_INFO, "with security: %d", security);
wps_found = TRUE;
}
- if (ssid_found == TRUE && sec_found == TRUE && wps_found == TRUE) {
+ if (ssid_found == TRUE && raw_ssid_found == TRUE &&
+ sec_found == TRUE && wps_found == TRUE) {
net_ssid_scan_bss_info_s *bss = NULL;
bss = g_try_new0(net_ssid_scan_bss_info_s, 1);
if (bss == NULL) {
}
g_strlcpy(bss->ssid, ssid, NET_WLAN_ESSID_LEN);
+ if (raw_ssid != NULL && raw_ssid_len > 0 &&
+ raw_ssid_len < (NET_WLAN_RAW_SSID_LEN+1)) {
+ memcpy(bss->raw_ssid, raw_ssid, raw_ssid_len);
+ bss->raw_ssid_len = raw_ssid_len;
+ } else {
+ memset(bss->raw_ssid, 0, sizeof(bss->raw_ssid));
+ bss->raw_ssid_len = 0;
+ }
bss->security = __net_get_wlan_sec_mode(security);
bss->wps = (char)wps;
bss_info_list = g_slist_append(bss_info_list, bss);
- ssid_found = sec_found = wps_found = FALSE;
+ ssid_found = sec_found = wps_found = raw_ssid_found = FALSE;
}
}
g_variant_iter_free(iter);
return WIFI_MANAGER_ERROR_NONE;
}
+EXPORT_API int wifi_manager_ap_get_raw_ssid(wifi_manager_ap_h ap, char **ssid, int *ssid_len)
+{
+ CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
+
+ if (_wifi_check_ap_validity(ap) == false || ssid == NULL ||
+ ssid_len == NULL) {
+ WIFI_LOG(WIFI_ERROR, "Invalid parameter");
+ return WIFI_MANAGER_ERROR_INVALID_PARAMETER;
+ }
+
+ net_profile_info_s *profile_info = ap;
+ *ssid = g_try_malloc0(NET_WLAN_RAW_SSID_LEN + 1);
+ if (*ssid == NULL)
+ return WIFI_MANAGER_ERROR_OUT_OF_MEMORY;
+
+ memcpy(*ssid, profile_info->raw_ssid, NET_WLAN_RAW_SSID_LEN);
+ *ssid_len = profile_info->raw_ssid_len;
+
+ return WIFI_MANAGER_ERROR_NONE;
+}
+
EXPORT_API int wifi_manager_ap_get_bssid(wifi_manager_ap_h ap, char **bssid)
{
CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
return;
}
g_strlcpy(prof_info->essid, info->ssid, NET_WLAN_ESSID_LEN);
+ memcpy(prof_info->raw_ssid, info->raw_ssid, info->raw_ssid_len);
+ prof_info->raw_ssid_len = info->raw_ssid_len;
prof_info->security_info.sec_mode = info->security;
prof_info->security_info.wps_support = (char)info->wps;
specific_profile_iterator = g_slist_append(specific_profile_iterator,