DLog macro is changed
[platform/core/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 USE_DLOG
43 #include <dlog.h>
44
45 #undef LOG_TAG
46 #define LOG_TAG "WIFI_DIRECT"
47
48 #define WDC_LOGV(format, args...) LOGV(format, ##args)
49 #define WDC_LOGD(format, args...) LOGD(format, ##args)
50 #define WDC_LOGI(format, args...) LOGI(format, ##args)
51 #define WDC_LOGW(format, args...) LOGW(format, ##args)
52 #define WDC_LOGE(format, args...) LOGE(format, ##args)
53 #define WDC_LOGF(format, args...) LOGF(format, ##args)
54
55 #define __WDC_LOG_FUNC_START__ LOGV("Enter")
56 #define __WDC_LOG_FUNC_END__ LOGV("Quit")
57
58 #else /** _DLOG_UTIL */
59
60 #define WDC_LOGV(format, args...) \
61         printf("[V/WIFI_DIRECT] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
62 #define WDC_LOGD(format, args...) \
63         printf("[D/WIFI_DIRECT] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
64 #define WDC_LOGI(format, args...) \
65         printf("[I/WIFI_DIRECT] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
66 #define WDC_LOGW(format, args...) \
67         printf("[W/WIFI_DIRECT] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
68 #define WDC_LOGE(format, args...) \
69         printf("[E/WIFI_DIRECT] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
70 #define WDC_LOGF(format, args...) \
71         printf("[F/WIFI_DIRECT] %s: %s()(%4d)> "format, __FILE__, __FUNCTION__, __LINE__, ##args)
72
73 #define __WDC_LOG_FUNC_START__ \
74         printf("[V/WIFI_DIRECT] %s: %s()(%4d)> Start", __FILE__, __FUNCTION__, __LINE__)
75 #define __WDC_LOG_FUNC_END__ \
76         printf("[V/WIFI_DIRECT] %s: %s()(%4d)> End", __FILE__, __FUNCTION__, __LINE__)
77
78 #endif /** _DLOG_UTIL */
79
80 typedef struct
81 {
82         bool is_registered;
83         int client_id;
84         int sync_sockfd;
85         int async_sockfd;
86         int g_client_info;
87         int g_source_id;
88         wifi_direct_device_state_changed_cb activation_cb;
89         wifi_direct_discovery_state_chagned_cb discover_cb;
90         wifi_direct_connection_state_changed_cb connection_cb;
91         wifi_direct_client_ip_address_assigned_cb ip_assigned_cb;       
92         void *user_data_for_cb_activation;
93         void *user_data_for_cb_discover;
94         void *user_data_for_cb_connection;
95         void *user_data_for_cb_ip_assigned;
96
97 } wifi_direct_client_info_s;
98
99 extern char *wfd_debug_print(char *file, int line, char *format, ...);
100
101 #endif /** __WIFI_DIRECT_CLIENT_PROXY_H_ */