int raw_ssid_len; /** Raw SSID length */
GSList *vsie_list; /** List of Vendor Specific Information Element of AP*/
int assoc_status_code; /** Supplicant WiFi Association Status Code */
+ char country_code[NET_WLAN_COUNTRY_CODE_LEN]; /** Country code received from AP */
} net_profile_info_s;
typedef struct {
/** Length of Frequency */
#define NET_WLAN_FREQ_LEN 5
+/** Length of country code */
+#define NET_WLAN_COUNTRY_CODE_LEN 3
+
/**
* Length of WPS PIN code
* WPS PIN code should be 4 or 8 digits
} else if (g_strcmp0(key, "Keymgmt") == 0) {
ProfInfo->security_info.keymgmt = (unsigned int)g_variant_get_uint32(var);
+ } else if (g_strcmp0(key, "Country") == 0) {
+ value = g_variant_get_string(var, NULL);
+
+ if (value != NULL)
+ g_strlcpy(ProfInfo->country_code, value, NET_WLAN_COUNTRY_CODE_LEN);
} else
Error = __net_extract_common_info(key, var, ProfInfo);
}
return WIFI_MANAGER_ERROR_NONE;
}
+EXPORT_API int wifi_manager_ap_get_countrycode(wifi_manager_ap_h ap,
+ char **country_code)
+{
+ __NETWORK_CAPI_FUNC_ENTER__;
+
+ CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
+
+ if (_wifi_check_ap_validity(ap) == false || country_code == NULL) {
+ WIFI_LOG(WIFI_ERROR, "Invalid parameter");
+ __NETWORK_CAPI_FUNC_EXIT__;
+ return WIFI_MANAGER_ERROR_INVALID_PARAMETER;
+ }
+
+ net_profile_info_s *profile_info = ap;
+ if (profile_info->country_code[0] != '\0') {
+ *country_code = strdup(profile_info->country_code);
+ if (*country_code == NULL) {
+ __NETWORK_CAPI_FUNC_EXIT__;
+ return WIFI_MANAGER_ERROR_OUT_OF_MEMORY;
+ }
+ } else
+ *country_code = NULL;
+
+ __NETWORK_CAPI_FUNC_EXIT__;
+
+ return WIFI_MANAGER_ERROR_NONE;
+}
+
/* Wi-Fi security information ************************************************/
EXPORT_API int wifi_manager_ap_get_security_type(wifi_manager_ap_h ap,
wifi_manager_security_type_e *type)
else
printf("Fail to get passpoint state\n");
+ if (wifi_manager_ap_get_countrycode(ap, &str_value) == WIFI_MANAGER_ERROR_NONE) {
+ if (str_value) {
+ printf("Country Code : %s\n", str_value);
+ free(str_value);
+ } else
+ printf("Country code is NULL\n");
+ } else
+ printf("Fail to get Country code\n");
+
if (sec_type != WIFI_MANAGER_SECURITY_TYPE_EAP) {
g_free(ap_name);
return false;