4 #include <sys/socket.h>
11 #include "wifi-direct-oem.h"
12 #include "wfd-plugin-wpasupplicant.h"
14 static wfd_oem_ops_s supplicant_ops = {
17 .activate = ws_activate,
18 .deactivate = ws_deactivate,
20 .start_scan = ws_start_scan,
21 .stop_scan = ws_stop_scan,
22 .get_visibility = ws_get_visibility,
23 .set_visibility = ws_set_visibility,
24 .get_scan_result = ws_get_scan_result,
25 .get_peer_info = ws_get_peer_info,
27 .prov_disc_req = ws_prov_disc_req,
29 .connect = ws_connect,
30 .disconnect = ws_disconnect,
31 .reject_connection = ws_reject_connection,
32 .cancel_connection = ws_cancel_connection,
33 .get_connected_peers = ws_get_connected_peers,
34 .get_pin = ws_get_pin,
35 .set_pin = ws_set_pin,
36 .get_supported_wps_mode = ws_get_supported_wps_mode,
38 .create_group = ws_create_group,
39 .destroy_group = ws_destroy_group,
41 .wps_start = ws_wps_start,
43 .get_dev_name = ws_get_dev_name,
44 .set_dev_name = ws_set_dev_name,
45 .get_dev_mac = ws_get_dev_mac,
46 .get_dev_type = ws_get_dev_type,
47 .set_dev_type = ws_set_dev_type,
48 .get_go_intent = ws_get_go_intent,
49 .set_go_intent = ws_set_go_intent,
50 .get_persistent_groups = ws_get_persistent_groups,
51 .remove_persistent_group = ws_remove_persistent_group,
52 .set_persistent_reconnect = ws_set_persistent_reconnect,
55 static ws_plugin_data_s *g_pd;
57 int wfd_plugin_load( struct wfd_oem_ops_s **ops)
63 int ws_init(wfd_oem_event_cb callback, void *user_data)
65 __WDP_LOG_FUNC_ENTER__;
67 __WDP_LOG_FUNC_EXIT__;
73 __WDP_LOG_FUNC_ENTER__;
75 __WDP_LOG_FUNC_EXIT__;
81 __WDP_LOG_FUNC_ENTER__;
83 __WDP_LOG_FUNC_EXIT__;
89 __WDP_LOG_FUNC_ENTER__;
91 __WDP_LOG_FUNC_EXIT__;
95 int ws_start_scan(wfd_oem_scan_param_s *param)
97 __WDP_LOG_FUNC_ENTER__;
99 __WDP_LOG_FUNC_EXIT__;
105 __WDP_LOG_FUNC_ENTER__;
107 __WDP_LOG_FUNC_EXIT__;
111 int ws_get_visibility(int *visibility)
113 __WDP_LOG_FUNC_ENTER__;
115 __WDP_LOG_FUNC_EXIT__;
119 int ws_set_visibility(int visibility)
121 __WDP_LOG_FUNC_ENTER__;
123 __WDP_LOG_FUNC_EXIT__;
127 int ws_get_scan_result(GList **peers, int *peer_count)
129 __WDP_LOG_FUNC_ENTER__;
131 __WDP_LOG_FUNC_EXIT__;
135 int ws_get_peer_info(unsigned char *peer_addr, wfd_oem_device_s **peer)
137 __WDP_LOG_FUNC_ENTER__;
139 __WDP_LOG_FUNC_EXIT__;
143 int ws_prov_disc_req(unsigned char *peer_addr, wfd_oem_wps_mode_e wps_mode, int join)
145 __WDP_LOG_FUNC_ENTER__;
147 __WDP_LOG_FUNC_EXIT__;
151 int ws_connect(unsigned char *peer_addr, wfd_oem_conn_param_s *param)
153 __WDP_LOG_FUNC_ENTER__;
155 __WDP_LOG_FUNC_EXIT__;
159 int ws_disconnect(unsigned char *peer_addr)
161 __WDP_LOG_FUNC_ENTER__;
163 __WDP_LOG_FUNC_EXIT__;
167 int ws_reject_connection(unsigned char *peer_addr)
169 __WDP_LOG_FUNC_ENTER__;
171 __WDP_LOG_FUNC_EXIT__;
175 int ws_cancel_connection(unsigned char *peer_addr)
177 __WDP_LOG_FUNC_ENTER__;
179 __WDP_LOG_FUNC_EXIT__;
183 int ws_get_connected_peers(GList **peers, int *peer_count)
185 __WDP_LOG_FUNC_ENTER__;
187 __WDP_LOG_FUNC_EXIT__;
191 int ws_get_pin(char *pin)
193 __WDP_LOG_FUNC_ENTER__;
195 __WDP_LOG_FUNC_EXIT__;
199 int ws_set_pin(char *pin)
201 __WDP_LOG_FUNC_ENTER__;
203 __WDP_LOG_FUNC_EXIT__;
207 int ws_get_supported_wps_mode()
209 __WDP_LOG_FUNC_ENTER__;
211 __WDP_LOG_FUNC_EXIT__;
215 int ws_create_group(int persistent, int freq)
217 __WDP_LOG_FUNC_ENTER__;
219 __WDP_LOG_FUNC_EXIT__;
223 int ws_destroy_group(const char *ifname)
225 __WDP_LOG_FUNC_ENTER__;
227 __WDP_LOG_FUNC_EXIT__;
231 int ws_invite(unsigned char *peer_addr, wfd_oem_invite_param_s *param)
233 __WDP_LOG_FUNC_ENTER__;
235 __WDP_LOG_FUNC_EXIT__;
239 // Only group owner can use this command
240 int ws_wps_start(unsigned char *peer_addr, int wps_mode, const char *pin)
242 __WDP_LOG_FUNC_ENTER__;
244 __WDP_LOG_FUNC_EXIT__;
248 int ws_get_dev_name(char *dev_name)
250 __WDP_LOG_FUNC_ENTER__;
252 __WDP_LOG_FUNC_EXIT__;
256 int ws_set_dev_name(char *dev_name)
258 __WDP_LOG_FUNC_ENTER__;
260 __WDP_LOG_FUNC_EXIT__;
264 int ws_get_dev_mac(char *dev_mac)
266 __WDP_LOG_FUNC_ENTER__;
268 __WDP_LOG_FUNC_EXIT__;
272 int ws_get_dev_type(int *pri_dev_type, int *sec_dev_type)
274 __WDP_LOG_FUNC_ENTER__;
276 __WDP_LOG_FUNC_EXIT__;
280 int ws_set_dev_type(int pri_dev_type, int sec_dev_type)
282 __WDP_LOG_FUNC_ENTER__;
284 __WDP_LOG_FUNC_EXIT__;
288 int ws_get_go_intent(int *go_intent)
290 __WDP_LOG_FUNC_ENTER__;
292 __WDP_LOG_FUNC_EXIT__;
296 int ws_set_go_intent(int go_intent)
298 __WDP_LOG_FUNC_ENTER__;
300 __WDP_LOG_FUNC_EXIT__;
304 int ws_get_persistent_groups(wfd_oem_persistent_group_s **groups, int *group_count)
306 __WDP_LOG_FUNC_ENTER__;
308 __WDP_LOG_FUNC_EXIT__;
312 int ws_remove_persistent_group(char *ssid, unsigned char *bssid)
314 __WDP_LOG_FUNC_ENTER__;
316 __WDP_LOG_FUNC_EXIT__;
320 int ws_set_persistent_reconnect(unsigned char *bssid, int reconnect)
322 __WDP_LOG_FUNC_ENTER__;
324 __WDP_LOG_FUNC_EXIT__;