[ug-wifi-direct]Sync with Tizen 2.4
[apps/native/ug-wifi-direct.git] / ug-wifidirect / include / wfd_client.h
1 /*
2 *  WiFi-Direct UG
3 *
4 * Copyright 2012  Samsung Electronics Co., Ltd
5
6 * Licensed under the Flora License, Version 1.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9
10 * http://www.tizenopensource.org/license
11
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20
21 #ifndef __WFD_CLIENT_H__
22 #define __WFD_CLIENT_H__
23
24
25 typedef enum {
26         WFD_DEVICE_TYPE_COMPUTER = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_COMPUTER,
27         WFD_DEVICE_TYPE_INPUT_DEVICE = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_INPUT_DEVICE,
28         WFD_DEVICE_TYPE_PRINTER = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_PRINTER,
29         WFD_DEVICE_TYPE_CAMERA = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_CAMERA,
30         WFD_DEVICE_TYPE_STORAGE = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_STORAGE,
31         WFD_DEVICE_TYPE_NW_INFRA = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_NETWORK_INFRA,
32         WFD_DEVICE_TYPE_DISPLAYS = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_DISPLAY,
33         WFD_DEVICE_TYPE_MM_DEVICES = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_MULTIMEDIA_DEVICE,
34         WFD_DEVICE_TYPE_GAME_DEVICES = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_GAME_DEVICE,
35         WFD_DEVICE_TYPE_TELEPHONE = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_TELEPHONE,
36         WFD_DEVICE_TYPE_AUDIO = WIFI_DIRECT_PRIMARY_DEVICE_TYPE_AUDIO,
37         WFD_DEVICE_TYPE_OTHER =  WIFI_DIRECT_PRIMARY_DEVICE_TYPE_OTHER,
38 } device_type_e;
39
40 typedef enum {
41         WFD_LINK_STATUS_DEACTIVATED = WIFI_DIRECT_STATE_DEACTIVATED,
42         WFD_LINK_STATUS_DEACTIVATING = WIFI_DIRECT_STATE_DEACTIVATING,
43         WFD_LINK_STATUS_ACTIVATING = WIFI_DIRECT_STATE_ACTIVATING,
44         WFD_LINK_STATUS_ACTIVATED = WIFI_DIRECT_STATE_ACTIVATED,
45         WFD_LINK_STATUS_DISCOVERING = WIFI_DIRECT_STATE_DISCOVERING,
46         WFD_LINK_STATUS_CONNECTING = WIFI_DIRECT_STATE_CONNECTING,
47         WFD_LINK_STATUS_DISCONNECTING = WIFI_DIRECT_STATE_DISCONNECTING,
48         WFD_LINK_STATUS_CONNECTED = WIFI_DIRECT_STATE_CONNECTED,
49         WFD_LINK_STATUS_GROUP_OWNER = WIFI_DIRECT_STATE_GROUP_OWNER,
50 } link_status_e;
51
52 /**
53  *      This function let the ug get wi-fi direct status from vconf
54  *      @return   If success, return the wfd status, else return -1
55  *      @param[in] void
56  */
57 int wfd_get_vconf_status();
58
59 /**
60  *      This function let the ug get device name from vconf
61  *      @return   If success, return 0, else return -1
62  *      @param[in] data the pointer to the main data structure
63  */
64 int wfd_get_vconf_device_name(void *data);
65
66 #ifndef MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE
67 /**
68  *      This function let the ug turn wifi off
69  *      @return   If success, return 0, else return -1
70  *      @param[in] data the pointer to the main data structure
71  */
72 int wfd_wifi_off(void *data);
73 #endif /* MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE */
74
75 /**
76  *      This function let the ug turn AP on
77  *      @return   If success, return 0, else return -1
78  *      @param[in] data the pointer to the main data structure
79  */
80 int wfd_mobile_ap_on(void *data);
81
82 /**
83  *      This function let the ug turn AP off
84  *      @return   If success, return 0, else return -1
85  *      @param[in] data the pointer to the main data structure
86  */
87 int wfd_mobile_ap_off(void *data);
88
89 /**
90  *      This function let the ug do initialization
91  *      @return   If success, return 0, else return -1
92  *      @param[in] data the pointer to the main data structure
93  */
94 int init_wfd_client(void *data);
95
96
97 /**
98  *      This function let the ug load wfd manager
99  *      @return   If success, return 0, else return -1
100  *      @param[in] data the pointer to the main data structure
101  */
102 int launch_wifi_direct_manager(void *data);
103
104 /**
105  *      This function let the ug do de-initialization
106  *      @return   If success, return 0, else return -1
107  *      @param[in] data the pointer to the main data structure
108  */
109 int deinit_wfd_client(void *data);
110
111 /**
112  *      This function let the ug turn wi-fi direct on
113  *      @return   If success, return 0, else return -1
114  *      @param[in] data the pointer to the main data structure
115  */
116 int wfd_client_switch_on(void *data);
117
118 /**
119  *      This function let the ug turn wi-fi direct off
120  *      @return   If success, return 0, else return -1
121  *      @param[in] data the pointer to the main data structure
122  */
123 int wfd_client_switch_off(void *data);
124
125 #ifdef WFD_ON_OFF_GENLIST
126 /**
127  *      This function let the ug turn wi-fi direct on/off forcely
128  *      @return   If success, return 0, else return -1
129  *      @param[in] data the pointer to the main data structure
130   *     @param[in] onoff whether to turn on/off wi-fi direct
131  */
132 int wfd_client_swtch_force(void *data, int onoff);
133 #endif
134
135 /**
136  *      This function let the ug create a group
137  *      @return   If success, return 0, else return -1
138  */
139 int wfd_client_group_add();
140
141 /**
142  *      This function let the ug connect to the device by mac address
143  *      @return   If success, return 0, else return -1
144  *      @param[in] mac_addr the pointer to the mac address of device
145  */
146 int wfd_client_connect(const char *mac_addr);
147
148 /**
149  *      This function let the ug disconnect to the device by mac address
150  *      @return   If success, return 0, else return -1
151  *      @param[in] mac_addr the pointer to the mac address of device
152  */
153 int wfd_client_disconnect(const char *mac_addr);
154
155 /**
156  *      This function let the ug set the intent of a group owner
157  *      @return   If success, return 0, else return -1
158  *      @param[in] go_intent the intent parameter
159  */
160 int wfd_client_set_p2p_group_owner_intent(int go_intent);
161
162 /**
163  *      This function let the ug destroy tethering
164  *      @return   void
165  *      @param[in] ugd the pointer to the main data structure
166  */
167 void wfd_client_destroy_tethering(struct ug_data *ugd);
168
169 void wfd_client_free_raw_discovered_peers(struct ug_data *ugd);
170
171 #endif /* __WFD_CLIENT_H__ */