Boilerplate is modified
[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.1 (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://floralicense.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 0, else return -1
55  *      @param[in] data the pointer to the main data structure
56  */
57 int wfd_get_vconf_status(void *data);
58
59 /**
60  *      This function let the ug turn wifi off
61  *      @return   If success, return 0, else return -1
62  *      @param[in] data the pointer to the main data structure
63  */
64 int wfd_wifi_off(void *data);
65
66 /**
67  *      This function let the ug turn AP on
68  *      @return   If success, return 0, else return -1
69  *      @param[in] data the pointer to the main data structure
70  */
71 int wfd_mobile_ap_on(void *data);
72
73 /**
74  *      This function let the ug turn AP off
75  *      @return   If success, return 0, else return -1
76  *      @param[in] data the pointer to the main data structure
77  */
78 int wfd_mobile_ap_off(void *data);
79
80 /**
81  *      This function let the ug do initialization
82  *      @return   If success, return 0, else return -1
83  *      @param[in] data the pointer to the main data structure
84  */
85 int init_wfd_client(void *data);
86
87 /**
88  *      This function let the ug do de-initialization
89  *      @return   If success, return 0, else return -1
90  *      @param[in] data the pointer to the main data structure
91  */
92 int deinit_wfd_client(void *data);
93
94 /**
95  *      This function let the ug turn wi-fi direct on
96  *      @return   If success, return 0, else return -1
97  *      @param[in] data the pointer to the main data structure
98  */
99 int wfd_client_switch_on(void *data);
100
101 /**
102  *      This function let the ug turn wi-fi direct off
103  *      @return   If success, return 0, else return -1
104  *      @param[in] data the pointer to the main data structure
105  */
106 int wfd_client_switch_off(void *data);
107
108 /**
109  *      This function let the ug turn wi-fi direct on/off forcely
110  *      @return   If success, return 0, else return -1
111  *      @param[in] data the pointer to the main data structure
112   *     @param[in] onoff whether to turn on/off wi-fi direct
113  */
114 int wfd_client_swtch_force(void *data, int onoff);
115
116 /**
117  *      This function let the ug create a group
118  *      @return   If success, return 0, else return -1
119  */
120 int wfd_client_group_add();
121
122 /**
123  *      This function let the ug connect to the device by mac address
124  *      @return   If success, return 0, else return -1
125  *      @param[in] mac_addr the pointer to the mac address of device
126  */
127 int wfd_client_connect(const char *mac_addr);
128
129 /**
130  *      This function let the ug disconnect to the device by mac address
131  *      @return   If success, return 0, else return -1
132  *      @param[in] mac_addr the pointer to the mac address of device
133  */
134 int wfd_client_disconnect(const char *mac_addr);
135
136 /**
137  *      This function let the ug set the intent of a group owner
138  *      @return   If success, return 0, else return -1
139  *      @param[in] go_intent the intent parameter
140  */
141 int wfd_client_set_p2p_group_owner_intent(int go_intent);
142
143 #endif /* __WFD_CLIENT_H__ */