int wifi_manager_ap_set_prefix_length(wifi_manager_ap_h ap,
wifi_manager_address_family_e address_family, int prefix_len);
+/*
+ * @brief Gets the error state.
+ * @since_tizen 4.0
+ * @param[in] ap The access point handle
+ * @param[out] error_state The Wi-Fi connection error state
+ * @return 0 on success, otherwise negative error value
+ * @retval #WIFI_MANAGER_ERROR_NONE Successful
+ * @retval #WIFI_MANAGER_ERROR_INVALID_OPERATION Invalid operation
+ * @retval #WIFI_MANAGER_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #WIFI_MANAGER_ERROR_NOT_SUPPORTED Not supported
+ */
+int wifi_manager_ap_get_error_state(wifi_manager_ap_h ap, wifi_manager_error_e *error_state);
+
+
/**
* @}
*/
return ap_state;
}
+
+wifi_manager_error_e __wifi_convert_to_ap_error_state(net_error_state_type_e error)
+{
+ wifi_manager_error_e ap_error_state;
+
+ switch (error) {
+ case NET_STATE_ERROR_OUT_OF_RANGE:
+ ap_error_state = WIFI_MANAGER_ERROR_OUT_OF_RANGE;
+ break;
+ case NET_STATE_ERROR_PIN_MISSING:
+ ap_error_state = WIFI_MANAGER_ERROR_PIN_MISSING;
+ break;
+ case NET_STATE_ERROR_DHCP_FAILED:
+ ap_error_state = WIFI_MANAGER_ERROR_DHCP_FAILED;
+ break;
+ case NET_STATE_ERROR_CONNECT_FAILED:
+ ap_error_state = WIFI_MANAGER_ERROR_OPERATION_FAILED;
+ break;
+ case NET_STATE_ERROR_LOGIN_FAILED:
+ ap_error_state = WIFI_MANAGER_ERROR_LOGIN_FAILED;
+ break;
+ case NET_STATE_ERROR_AUTH_FAILED:
+ ap_error_state = WIFI_MANAGER_ERROR_AUTHENTICATION_FAILED;
+ break;
+ case NET_STATE_ERROR_INVALID_KEY:
+ ap_error_state = WIFI_MANAGER_ERROR_INVALID_KEY;
+ break;
+ default:
+ ap_error_state = WIFI_MANAGER_ERROR_NONE;
+ break;
+ }
+
+ return ap_error_state;
+}
+
//LCOV_EXCL_STOP
EXPORT_API int wifi_manager_ap_create(wifi_manager_h wifi,
return WIFI_MANAGER_ERROR_NONE;
}
+
+EXPORT_API int wifi_manager_ap_get_error_state(wifi_manager_ap_h ap, wifi_manager_error_e* error_state)
+{
+ CHECK_FEATURE_SUPPORTED(WIFI_FEATURE);
+
+ if (_wifi_check_ap_validity(ap) == false || error_state == NULL) {
+ WIFI_LOG(WIFI_ERROR, "Invalid parameter"); //LCOV_EXCL_LINE
+ return WIFI_MANAGER_ERROR_INVALID_PARAMETER; //LCOV_EXCL_LINE
+ }
+
+ net_profile_info_s *profile_info = ap;
+ *error_state = __wifi_convert_to_ap_error_state(profile_info->ProfileErrorState);
+ WIFI_LOG(WIFI_INFO, "error_state %d\n", *error_state);
+
+ return WIFI_MANAGER_ERROR_NONE;
+}
+
else
printf("Fail to get disconnect reason\n");
+ if (wifi_manager_ap_get_error_state(ap, &int_value) == WIFI_MANAGER_ERROR_NONE)
+ printf("error state of AP : %s\n", __test_convert_error_to_string(int_value));
+ else
+ printf("Fail to get error state of AP\n");
+
/* Network info */
if (wifi_manager_ap_get_connection_state(ap, &conn_state) == WIFI_MANAGER_ERROR_NONE)
printf("Connection State : %d\n", conn_state);