int wifi_direct_deinit_wifi_display(void);
/*****************************************************************************************/
-/* wifi_direct_service_del API function prototype
+/* wifi_direct_get_display_port API function prototype
* int wifi_direct_get_display_port(int *port)
*/
/**
- * \brief This API shall delete the service user expects. \n
+ * \brief This API shall get wifi display port. \n
* @param port TCP control port of this wifi direct diplay device. Application had enabled the wifi direct display before use this function.
*
* \see wifi_direct_init_wifi_display.
int wifi_direct_get_display_port(int *port);
/*****************************************************************************************/
-/* wifi_direct_service_del API function prototype
+/* wifi_direct_get_display_type API function prototype
* int wifi_direct_get_display_type(wifi_direct_display_type *type)
*/
/**
- * \brief This API shall delete the service user expects. \n
- * @param handle wifi direct display type of this device. Application had enabled the wifi direct display before use this function.
+ * \brief This API shall get wifi display type. \n
+ * @param type wifi direct display type of this device. Application had enabled the wifi direct display before use this function.
*
* \see wifi_direct_init_wifi_display.
* \see wifi_direct_deinit_wifi_display.
******************************************************************************/
int wifi_direct_get_display_type(wifi_direct_display_type_e *type);
+/*****************************************************************************************/
+/* wifi_direct_add_to_access_list API function prototype
+ * int wifi_direct_add_to_access_list(const char *mac_address, bool allow)
+ */
+/**
+ * \brief This API shall add device to list to automatically allow or deny connection request. \n
+ * @param mac_address device mac address to add device list.
+ * @param allow allow or deny flag.
+ *
+ * \see wifi_direct_del_from_access_list.
+ *
+ * \par Sync (or) Async:
+ * This is a Synchronous API.
+ *
+ * \warning
+ * None
+ *
+ *
+ * \return Return Type (int) \n
+ * WIFI_DIRECT_ERROR_NONE on Success \n
+ * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
+ * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
+ * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
+ * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
+ * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
+ * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
+ * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
+ * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
+ * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
+ * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
+ * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
+ * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
+ * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
+ * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
+ * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
+ *
+ *
+ *
+ *\endcode
+ *
+ *\remarks None.
+ *
+ ******************************************************************************/
+int wifi_direct_add_to_access_list(const char *mac_address, bool allow);
+
+/*****************************************************************************************/
+/* wifi_direct_del_from_access_list API function prototype
+ * int wifi_direct_del_from_access_list(const char *mac_address, bool allow)
+ */
+/**
+ * \brief This API shall add device to list to automatically allow or deny connection request. \n
+ * @param mac_address device mac address to delete from list.
+ *
+ * \see wifi_direct_add_to_access_list.
+ *
+ * \par Sync (or) Async:
+ * This is a Synchronous API.
+ *
+ * \warning
+ * None
+ *
+ *
+ * \return Return Type (int) \n
+ * WIFI_DIRECT_ERROR_NONE on Success \n
+ * WIFI_DIRECT_ERROR_NOT_PERMITTED for Operation not permitted \n
+ * WIFI_DIRECT_ERROR_OUT_OF_MEMORY for Out of memory \n
+ * WIFI_DIRECT_ERROR_RESOURCE_BUSY for Device or resource busy \n
+ * WIFI_DIRECT_ERROR_INVALID_PARAMETER for Invalid function parameter \n
+ * WIFI_DIRECT_ERROR_CONNECTION_TIME_OUT for Connection timed out \n
+ * WIFI_DIRECT_ERROR_NOT_INITIALIZED Not for initialized \n
+ * WIFI_DIRECT_ERROR_COMMUNICATION_FAILED for I/O error \n
+ * WIFI_DIRECT_ERROR_WIFI_USED for WiFi is being used \n
+ * WIFI_DIRECT_ERROR_MOBILE_AP_USED for Mobile AP is being used \n
+ * WIFI_DIRECT_ERROR_CONNECTION_FAILED for Connection failed \n
+ * WIFI_DIRECT_ERROR_AUTH_FAILED for Authentication failed \n
+ * WIFI_DIRECT_ERROR_OPERATION_FAILED for Operation failed \n
+ * WIFI_DIRECT_ERROR_TOO_MANY_CLIENT for Too many client \n
+ * WIFI_DIRECT_ERROR_ALREADY_INITIALIZED for Already initialized client \n
+ * WIFI_DIRECT_ERROR_CONNECTION_CANCELED \n
+ *
+ *
+ *
+ *\endcode
+ *
+ *\remarks None.
+ *
+ ******************************************************************************/
+int wifi_direct_del_from_access_list(const char *mac_address);
+
/**
* @}
*/
return "WIFI_DIRECT_CMD_GET_DISPLAY_PORT";
case WIFI_DIRECT_CMD_GET_DISPLAY_TYPE:
return "WIFI_DIRECT_CMD_GET_DISPLAY_TYPE";
+ case WIFI_DIRECT_CMD_ADD_TO_ACCESS_LIST:
+ return "WIFI_DIRECT_CMD_ADD_TO_ACCESS_LIST";
+ case WIFI_DIRECT_CMD_DEL_FROM_ACCESS_LIST:
+ return "WIFI_DIRECT_CMD_DEL_FROM_ACCESS_LIST";
default:
return "WIFI_DIRECT_CMD_INVALID";
__WDC_LOG_FUNC_END__;
return res;
}
- WDC_LOGD("wifi_direct_is_autoconnection_mode() SUCCESS");
+ WDC_LOGD("wifi_direct_get_display_port() SUCCESS");
*port = (int) rsp.param1;
__WDC_LOG_FUNC_END__;
__WDC_LOG_FUNC_END__;
return res;
}
- WDC_LOGD("wifi_direct_is_autoconnection_mode() SUCCESS");
+ WDC_LOGD("wifi_direct_get_display_type() SUCCESS");
*type = (wifi_direct_display_type_e) rsp.param1;
__WDC_LOG_FUNC_END__;
return WIFI_DIRECT_ERROR_NONE;
}
+int wifi_direct_add_to_access_list(const char *mac_address, bool allow)
+{
+ __WDC_LOG_FUNC_START__;
+ wifi_direct_client_info_s *client_info = __wfd_get_control();
+ unsigned char la_mac_addr[6];
+ wifi_direct_client_request_s req;
+ wifi_direct_client_response_s rsp;
+ int res = WIFI_DIRECT_ERROR_NONE;
+
+ if ((client_info->is_registered == false) ||
+ (client_info->client_id == WFD_INVALID_ID)) {
+ WDC_LOGE("Client is NOT registered");
+ __WDC_LOG_FUNC_END__;
+ return WIFI_DIRECT_ERROR_NOT_INITIALIZED;
+ }
+
+ if (!mac_address) {
+ WDC_LOGE("mac_addr is NULL");
+ __WDC_LOG_FUNC_END__;
+ return WIFI_DIRECT_ERROR_INVALID_PARAMETER;
+ }
+
+ memset(&req, 0, sizeof(wifi_direct_client_request_s));
+ memset(&rsp, 0, sizeof(wifi_direct_client_response_s));
+
+ req.cmd = WIFI_DIRECT_CMD_ADD_TO_ACCESS_LIST;
+ req.client_id = client_info->client_id;
+ req.data.int1 = allow;
+ macaddr_atoe(mac_address, la_mac_addr);
+ memcpy(req.data.mac_addr, la_mac_addr, MACADDR_LEN);
+
+ res = __wfd_client_send_request(client_info->sync_sockfd, &req, &rsp);
+ if (res != WIFI_DIRECT_ERROR_NONE) {
+ __WDC_LOG_FUNC_END__;
+ return res;
+ }
+ WDC_LOGD("wifi_direct_add_device_to_list() SUCCESS");
+
+ __WDC_LOG_FUNC_END__;
+ return WIFI_DIRECT_ERROR_NONE;
+}
+
+int wifi_direct_del_from_access_list(const char *mac_address)
+{
+ __WDC_LOG_FUNC_START__;
+ wifi_direct_client_info_s *client_info = __wfd_get_control();
+ unsigned char la_mac_addr[6];
+ wifi_direct_client_request_s req;
+ wifi_direct_client_response_s rsp;
+ int res = WIFI_DIRECT_ERROR_NONE;
+
+ if ((client_info->is_registered == false) ||
+ (client_info->client_id == WFD_INVALID_ID)) {
+ WDC_LOGE("Client is NOT registered");
+ __WDC_LOG_FUNC_END__;
+ return WIFI_DIRECT_ERROR_NOT_INITIALIZED;
+ }
+
+ if (!mac_address) {
+ WDC_LOGE("mac_addr is NULL");
+ __WDC_LOG_FUNC_END__;
+ return WIFI_DIRECT_ERROR_INVALID_PARAMETER;
+ }
+
+ memset(&req, 0, sizeof(wifi_direct_client_request_s));
+ memset(&rsp, 0, sizeof(wifi_direct_client_response_s));
+
+ req.cmd = WIFI_DIRECT_CMD_DEL_FROM_ACCESS_LIST;
+ req.client_id = client_info->client_id;
+ macaddr_atoe(mac_address, la_mac_addr);
+ memcpy(req.data.mac_addr, la_mac_addr, MACADDR_LEN);
+
+ res = __wfd_client_send_request(client_info->sync_sockfd, &req, &rsp);
+ if (res != WIFI_DIRECT_ERROR_NONE) {
+ __WDC_LOG_FUNC_END__;
+ return res;
+ }
+ WDC_LOGD("wifi_direct_del_device_from_list() SUCCESS");
+
+ __WDC_LOG_FUNC_END__;
+ return WIFI_DIRECT_ERROR_NONE;
+}
+