Change the manifest and remove rule files
[apps/native/ug-wifi-direct.git] / popup-wifidirect / include / wfd-app-util.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  * This file declares wifi direct application util functions.
22  *
23  * @file    wfd-app-util.h
24  * @author  Sungsik Jang (sungsik.jang@samsung.com)
25  * @version 0.1
26  */
27
28
29 #ifndef __WFD_APP_UTIL_H__
30 #define __WFD_APP_UTIL_H__
31
32
33 #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
34 #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
35 #define WFD_MAX_SIZE            128
36 #define WFD_MAC_ADDRESS_SIZE    18
37
38 #ifdef USE_DLOG
39 #include <dlog.h>
40
41 #undef LOG_TAG
42 #define LOG_TAG "WIFI_DIRECT_POPUP"
43
44 #define WDPOP_LOGV(format, args...) LOGV(format, ##args)
45 #define WDPOP_LOGD(format, args...) LOGD(format, ##args)
46 #define WDPOP_LOGI(format, args...) LOGI(format, ##args)
47 #define WDPOP_LOGW(format, args...) LOGW(format, ##args)
48 #define WDPOP_LOGE(format, args...) LOGE(format, ##args)
49 #define WDPOP_LOGF(format, args...) LOGF(format, ##args)
50
51 #define __WDPOP_LOG_FUNC_ENTER__ LOGV("Enter")
52 #define __WDPOP_LOG_FUNC_EXIT__ LOGV("Quit")
53
54 #define assertm_if(expr, fmt, args...) do { \
55         if (expr) { \
56           WDPOP_LOGF(" ##(%s) -> assert!!## "fmt, #expr, ##args); \
57                  exit(1); \
58         } \
59 } while (0)
60
61 #else /** _DLOG_UTIL */
62
63 #define WDPOP_LOGV(format, args...)
64 #define WDPOP_LOGD(format, args...)
65 #define WDPOP_LOGI(format, args...)
66 #define WDPOP_LOGW(format, args...)
67 #define WDPOP_LOGE(format, args...)
68 #define WDPOP_LOGF(format, args...)
69
70 #define __WDPOP_LOG_FUNC_ENTER__
71 #define __WDPOP_LOG_FUNC_EXIT__
72
73 #endif /** _DLOG_UTIL */
74
75 #endif /* __WFD_APP_UTIL_H__ */