tizen 2.0beta
[framework/connectivity/libwifi-direct.git] / src / include / wifi-direct-client-proxy.h
1 /*
2  * libwifi-direct
3  *
4  * Copyright (c) 2000 - 2012 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Sungsik Jang <sungsik.jang@samsung.com>, Dongwook Lee <dwmax.lee@samsung.com> 
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21
22 #ifndef __WIFI_DIRECT_CLIENT_PROXY_H_
23 #define __WIFI_DIRECT_CLIENT_PROXY_H_
24
25 /*****************************************************************************
26  *      Standard headers
27  *****************************************************************************/
28
29 /*****************************************************************************
30  *      Platform headers
31  *****************************************************************************/
32 #include <glib.h>
33
34 /*****************************************************************************
35  *      Wi-Fi Manager headers
36  *****************************************************************************/
37 #include "wifi-direct.h"
38
39 /*****************************************************************************
40  *      Macro Definition
41  *****************************************************************************/
42 #ifdef VITA_FEATURE
43 #include <dlog.h>
44
45 #define WFD_LOG_LOW     LOG_VERBOSE
46 #define WFD_LOG_HIGH    LOG_INFO
47 #define WFD_LOG_ERROR   LOG_ERROR
48 #define WFD_LOG_WARN    LOG_WARN
49 #define WFD_LOG_ASSERT  LOG_FATAL
50 #define WFD_LOG_EXCEPTION       LOG_FATAL
51
52 #define WFD_CLIENT_MID  "wfd-client"
53
54 char *wfd_trim_path(const char *filewithpath);
55
56 #define WFD_CLIENT_LOG(log_level, format, args...) \
57         LOG(log_level, WFD_CLIENT_MID, "[%s:%04d] " format, wfd_trim_path(__FILE__), __LINE__, ##args)
58 #define __WFD_CLIENT_FUNC_START__       LOG(LOG_VERBOSE, WFD_CLIENT_MID, "[%s:%04d] Enter: %s()\n", wfd_trim_path(__FILE__), __LINE__,__func__)
59 #define __WFD_CLIENT_FUNC_END__ LOG(LOG_VERBOSE, WFD_CLIENT_MID, "[%s:%04d] Quit: %s()\n", wfd_trim_path(__FILE__), __LINE__,__func__)
60
61 #else /** _DLOG_UTIL */
62
63 #define WFD_CLIENT_LOG(log_level, format, args...)
64 #define __WFD_CLIENT_FUNC_START__
65 #define __WFD_CLIENT_FUNC_END__
66
67 #endif /** _DLOG_UTIL */
68
69 typedef struct
70 {
71         bool is_registered;
72         int client_id;
73         int sync_sockfd;
74         int async_sockfd;
75         int g_client_info;
76         int g_source_id;
77         wifi_direct_device_state_changed_cb activation_cb;
78         wifi_direct_discovery_state_chagned_cb discover_cb;
79         wifi_direct_connection_state_changed_cb connection_cb;
80         wifi_direct_client_ip_address_assigned_cb ip_assigned_cb;       
81         void *user_data_for_cb_activation;
82         void *user_data_for_cb_discover;
83         void *user_data_for_cb_connection;
84         void *user_data_for_cb_ip_assigned;
85
86 } wifi_direct_client_info_s;
87
88 extern char *wfd_debug_print(char *file, int line, char *format, ...);
89
90 #endif /** __WIFI_DIRECT_CLIENT_PROXY_H_ */