summaryrefslogtreecommitdiff
path: root/ug-wifidirect/include/wfd_client.h
diff options
context:
space:
mode:
Diffstat (limited to 'ug-wifidirect/include/wfd_client.h')
-rw-r--r--ug-wifidirect/include/wfd_client.h156
1 files changed, 131 insertions, 25 deletions
diff --git a/ug-wifidirect/include/wfd_client.h b/ug-wifidirect/include/wfd_client.h
index 2e65b2e..e8b6c5e 100644
--- a/ug-wifidirect/include/wfd_client.h
+++ b/ug-wifidirect/include/wfd_client.h
@@ -22,44 +22,150 @@
#define __WFD_CLIENT_H__
-typedef enum
-{
- WFD_DEVICE_TYPE_COMPUTER = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_COMPUTER, // 1
- WFD_DEVICE_TYPE_INPUT_DEVICE= WIFI_DIRECT_PRIMARY_DEVICE_TYPE_INPUT_DEVICE,
- WFD_DEVICE_TYPE_PRINTER = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_PRINTER,
- WFD_DEVICE_TYPE_CAMERA = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_CAMERA,
- WFD_DEVICE_TYPE_STORAGE = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_STORAGE, // 5
- WFD_DEVICE_TYPE_NW_INFRA = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_NETWORK_INFRA,
- WFD_DEVICE_TYPE_DISPLAYS = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_DISPLAY,
- WFD_DEVICE_TYPE_MM_DEVICES = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_MULTIMEDIA_DEVICE,
- WFD_DEVICE_TYPE_GAME_DEVICES = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_GAME_DEVICE,
- WFD_DEVICE_TYPE_TELEPHONE = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_TELEPHONE, // 10
- WFD_DEVICE_TYPE_AUDIO = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_AUDIO,
- WFD_DEVICE_TYPE_OTHER = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_OTHER, // 255
+typedef enum {
+ WFD_DEVICE_TYPE_COMPUTER = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_COMPUTER,
+ WFD_DEVICE_TYPE_INPUT_DEVICE = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_INPUT_DEVICE,
+ WFD_DEVICE_TYPE_PRINTER = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_PRINTER,
+ WFD_DEVICE_TYPE_CAMERA = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_CAMERA,
+ WFD_DEVICE_TYPE_STORAGE = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_STORAGE,
+ WFD_DEVICE_TYPE_NW_INFRA = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_NETWORK_INFRA,
+ WFD_DEVICE_TYPE_DISPLAYS = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_DISPLAY,
+ WFD_DEVICE_TYPE_MM_DEVICES = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_MULTIMEDIA_DEVICE,
+ WFD_DEVICE_TYPE_GAME_DEVICES = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_GAME_DEVICE,
+ WFD_DEVICE_TYPE_TELEPHONE = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_TELEPHONE,
+ WFD_DEVICE_TYPE_AUDIO = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_AUDIO,
+ WFD_DEVICE_TYPE_OTHER = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_OTHER,
} device_type_e;
typedef enum {
- WFD_LINK_STATUS_DEACTIVATED = WIFI_DIRECT_STATE_DEACTIVATED, // 0
- WFD_LINK_STATUS_DEACTIVATING = WIFI_DIRECT_STATE_DEACTIVATING,
- WFD_LINK_STATUS_ACTIVATING = WIFI_DIRECT_STATE_ACTIVATING,
- WFD_LINK_STATUS_ACTIVATED = WIFI_DIRECT_STATE_ACTIVATED,
- WFD_LINK_STATUS_DISCOVERING = WIFI_DIRECT_STATE_DISCOVERING,
- WFD_LINK_STATUS_CONNECTING = WIFI_DIRECT_STATE_CONNECTING, // 5
- WFD_LINK_STATUS_DISCONNECTING = WIFI_DIRECT_STATE_DISCONNECTING,
- WFD_LINK_STATUS_CONNECTED = WIFI_DIRECT_STATE_CONNECTED,
- WFD_LINK_STATUS_GROUP_OWNER = WIFI_DIRECT_STATE_GROUP_OWNER,
+ WFD_LINK_STATUS_DEACTIVATED = WIFI_DIRECT_STATE_DEACTIVATED,
+ WFD_LINK_STATUS_DEACTIVATING = WIFI_DIRECT_STATE_DEACTIVATING,
+ WFD_LINK_STATUS_ACTIVATING = WIFI_DIRECT_STATE_ACTIVATING,
+ WFD_LINK_STATUS_ACTIVATED = WIFI_DIRECT_STATE_ACTIVATED,
+ WFD_LINK_STATUS_DISCOVERING = WIFI_DIRECT_STATE_DISCOVERING,
+ WFD_LINK_STATUS_CONNECTING = WIFI_DIRECT_STATE_CONNECTING,
+ WFD_LINK_STATUS_DISCONNECTING = WIFI_DIRECT_STATE_DISCONNECTING,
+ WFD_LINK_STATUS_CONNECTED = WIFI_DIRECT_STATE_CONNECTED,
+ WFD_LINK_STATUS_GROUP_OWNER = WIFI_DIRECT_STATE_GROUP_OWNER,
} link_status_e;
-int wfd_get_vconf_status(void *data);
+/**
+ * This function let the ug get wi-fi direct status from vconf
+ * @return If success, return the wfd status, else return -1
+ * @param[in] void
+ */
+int wfd_get_vconf_status();
+
+/**
+ * This function let the ug get device name from vconf
+ * @return If success, return 0, else return -1
+ * @param[in] data the pointer to the main data structure
+ */
+int wfd_get_vconf_device_name(void *data);
+
+#ifndef MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE
+/**
+ * This function let the ug turn wifi off
+ * @return If success, return 0, else return -1
+ * @param[in] data the pointer to the main data structure
+ */
int wfd_wifi_off(void *data);
+#endif /* MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE */
+
+/**
+ * This function let the ug turn AP on
+ * @return If success, return 0, else return -1
+ * @param[in] data the pointer to the main data structure
+ */
+int wfd_mobile_ap_on(void *data);
+
+/**
+ * This function let the ug turn AP off
+ * @return If success, return 0, else return -1
+ * @param[in] data the pointer to the main data structure
+ */
+int wfd_mobile_ap_off(void *data);
+
+/**
+ * This function let the ug do initialization
+ * @return If success, return 0, else return -1
+ * @param[in] data the pointer to the main data structure
+ */
int init_wfd_client(void *data);
+
+
+/**
+ * This function let the ug load wfd manager
+ * @return If success, return 0, else return -1
+ * @param[in] data the pointer to the main data structure
+ */
+int launch_wifi_direct_manager(void *data);
+
+/**
+ * This function let the ug do de-initialization
+ * @return If success, return 0, else return -1
+ * @param[in] data the pointer to the main data structure
+ */
int deinit_wfd_client(void *data);
-int wfd_client_start_discovery(void *data);
+
+/**
+ * This function let the ug turn wi-fi direct on
+ * @return If success, return 0, else return -1
+ * @param[in] data the pointer to the main data structure
+ */
int wfd_client_switch_on(void *data);
+
+/**
+ * This function let the ug turn wi-fi direct off
+ * @return If success, return 0, else return -1
+ * @param[in] data the pointer to the main data structure
+ */
int wfd_client_switch_off(void *data);
+
+#ifdef WFD_ON_OFF_GENLIST
+/**
+ * This function let the ug turn wi-fi direct on/off forcely
+ * @return If success, return 0, else return -1
+ * @param[in] data the pointer to the main data structure
+ * @param[in] onoff whether to turn on/off wi-fi direct
+ */
int wfd_client_swtch_force(void *data, int onoff);
+#endif
+
+/**
+ * This function let the ug create a group
+ * @return If success, return 0, else return -1
+ */
+int wfd_client_group_add();
+
+/**
+ * This function let the ug connect to the device by mac address
+ * @return If success, return 0, else return -1
+ * @param[in] mac_addr the pointer to the mac address of device
+ */
int wfd_client_connect(const char *mac_addr);
+
+/**
+ * This function let the ug disconnect to the device by mac address
+ * @return If success, return 0, else return -1
+ * @param[in] mac_addr the pointer to the mac address of device
+ */
int wfd_client_disconnect(const char *mac_addr);
+
+/**
+ * This function let the ug set the intent of a group owner
+ * @return If success, return 0, else return -1
+ * @param[in] go_intent the intent parameter
+ */
int wfd_client_set_p2p_group_owner_intent(int go_intent);
+/**
+ * This function let the ug destroy tethering
+ * @return void
+ * @param[in] ugd the pointer to the main data structure
+ */
+void wfd_client_destroy_tethering(struct ug_data *ugd);
+
+void wfd_client_free_raw_discovered_peers(struct ug_data *ugd);
+
#endif /* __WFD_CLIENT_H__ */