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 */
+ char vsie[NET_WLAN_MAX_VSIE_LEN+1]; /** Vendor Specific Information Element of AP*/
+ gsize vsie_len; /** VSIE length */
} net_profile_info_s;
typedef struct {
*/
#define NET_WLAN_PRIVATE_KEY_PASSWD_LEN 50
+/** Length of VSIE(vendor specific information element) */
+#define NET_WLAN_MAX_VSIE_LEN 255
+
/**
* Below security modes are used in infrastructure and ad-hoc mode
* For now all EAP security mechanisms are provided only in infrastructure mode
wifi_manager_vsie_list_cb callback, void *user_data);
/**
+ * @brief Gets the vsie result of the AP.
+ * @since_tizen 5.0
+ * @remarks @a vsie must be released with free().
+ *
+ * @param[in] ap The access point handle
+ * @param[out] vsie The vendor specific information element
+ * @param[out] length The VSIE 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_vsie(wifi_manager_ap_h ap,
+ char **vsie, int *length);
+
+/**
* @brief Flush BSS
* @since_tizen 4.0
*
return Error;
}
+static int __net_convert_byte_to_txt(const unsigned char *src, char **dst, int src_len)
+{
+ int dst_length = 0;
+ int i = 0;
+ char *buf = NULL;
+
+ if (src_len <= 0) {
+ WIFI_LOG(WIFI_ERROR, "Invalid source length");
+ return -1;
+ }
+
+ *dst = (char *) g_try_malloc0((2*src_len)+1);
+ if (!(*dst)) {
+ WIFI_LOG(WIFI_ERROR, "failed to allocate memory to buffer");
+ return -1;
+ }
+
+ buf = (*dst);
+
+ for (i = 0; i < src_len; i++) {
+ snprintf(buf, 3, "%02x", src[i]);
+ buf += 2;
+ dst_length += 2;
+ }
+
+ return dst_length;
+}
+
static int __net_extract_wifi_info(GVariantIter *array, net_profile_info_s* ProfInfo)
{
net_err_e Error = NET_ERR_NONE;
} else if (g_strcmp0(key, "Frequency") == 0) {
ProfInfo->frequency = (unsigned int)g_variant_get_uint16(var);
+ } else if (g_strcmp0(key, "Vsie") == 0) {
+ const unsigned char *vsie_bytes = NULL;
+ char *vsie = NULL;
+ gsize size;
+ int buf_len = 0;
+
+ vsie_bytes = g_variant_get_fixed_array(var, &size, sizeof(guchar));
+
+ if (vsie_bytes) {
+ ProfInfo->vsie_len = size;
+
+ buf_len = __net_convert_byte_to_txt(vsie_bytes, &vsie, size);
+ if (buf_len > 0)
+ g_strlcpy(ProfInfo->vsie, vsie, buf_len+1);
+
+ g_free(vsie);
+ }
} else if (g_strcmp0(key, "DisconnectReason") == 0) {
ProfInfo->disconnect_reason = g_variant_get_int32(var);
return WIFI_MANAGER_ERROR_NONE;
}
+EXPORT_API int wifi_manager_ap_get_vsie(wifi_manager_ap_h ap,
+ char **vsie, int *length)
+{
+ __NETWORK_CAPI_FUNC_ENTER__;
+
+ CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
+
+ WIFI_LOG(WIFI_INFO, "WiFi get vsie\n");
+ if (_wifi_check_ap_validity(ap) == false || vsie == NULL || length == NULL) {
+ WIFI_LOG(WIFI_ERROR, "Invalid parameter");
+ __NETWORK_CAPI_FUNC_EXIT__;
+ return WIFI_MANAGER_ERROR_INVALID_PARAMETER;
+ }
+
+ net_profile_info_s *profile_info = ap;
+
+ *length = (int)profile_info->vsie_len;
+ *vsie = strdup(profile_info->vsie);
+ if (*vsie == NULL) {
+ WIFI_LOG(WIFI_ERROR, "Failed to allocate memory");
+ __NETWORK_CAPI_FUNC_EXIT__;
+ return WIFI_MANAGER_ERROR_OUT_OF_MEMORY; //LCOV_EXCL_LINE
+ }
+
+ __NETWORK_CAPI_FUNC_EXIT__;
+ return WIFI_MANAGER_ERROR_NONE;
+}
+
EXPORT_API int wifi_manager_ap_get_max_speed(wifi_manager_ap_h ap, int *max_speed)
{
__NETWORK_CAPI_FUNC_ENTER__;
char *ap_name_part = (char*)user_data;
wifi_manager_disconnect_reason_e disconnect_reason;
wifi_manager_rssi_level_e rssi_level;
+ char *vsie;
+ int length;
rv = wifi_manager_ap_get_essid(ap, &ap_name);
if (rv != WIFI_MANAGER_ERROR_NONE) {
else
printf("Fail to get Frequency\n");
+ if (wifi_manager_ap_get_vsie(ap, &vsie, &length) == WIFI_MANAGER_ERROR_NONE) {
+ printf("VSIE Len: %d vendor element: %s\n", length, vsie);
+ free(vsie);
+ } else
+ printf("Fail to get VSIE\n");
+
if (wifi_manager_ap_get_max_speed(ap, &int_value) == WIFI_MANAGER_ERROR_NONE)
printf("Max speed : %d\n", int_value);
else