Wrap all APIs to wifi-manager API
[platform/core/api/wifi.git] / include / net_wifi_private.h
1 /*
2  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __NET_WIFI_PRIVATE_H__
18 #define __NET_WIFI_PRIVATE_H__
19
20 #include <dlog.h>
21 #include <stdio.h>
22 #include <string.h>
23 #include <stdlib.h>
24
25 #include <wifi-manager.h>
26 #include "wifi.h"
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif /* __cplusplus */
31
32 #undef LOG_TAG
33 #define LOG_TAG "CAPI_NETWORK_WIFI"
34
35 #define WIFI_INFO       1
36 #define WIFI_ERROR      2
37 #define WIFI_WARN       3
38
39 #define DEPRECATED_LOG(origin, substitution) \
40         do { \
41                 LOGW("DEPRECATION WARNING: %s() is deprecated and will be removed " \
42                                 "from next release. Use %s() instead.", origin, substitution); \
43         } while (0)
44
45 #define WIFI_LOG(log_level, format, args...) \
46         do { \
47                 switch (log_level) { \
48                 case WIFI_ERROR: \
49                         LOGE(format, ## args); \
50                         break; \
51                 case WIFI_WARN: \
52                         LOGW(format, ## args); \
53                         break; \
54                 default: \
55                         LOGI(format, ## args); \
56                 } \
57         } while (0)
58
59 #define SECURE_WIFI_LOG(log_level, format, args...) \
60         do { \
61                 switch (log_level) { \
62                 case WIFI_ERROR: \
63                         SECURE_LOGE(format, ## args); \
64                         break; \
65                 case WIFI_WARN: \
66                         SECURE_LOGW(format, ## args); \
67                         break; \
68                 default: \
69                         SECURE_LOGI(format, ## args); \
70                 } \
71         } while (0)
72
73 wifi_error_e convert_to_wifi_error(wifi_manager_error_e error);
74 wifi_security_type_e convert_to_wifi_security_type(wifi_manager_security_type_e type);
75 wifi_eap_type_e convert_to_wifi_eap_type(wifi_manager_eap_type_e type);
76
77 #ifdef __cplusplus
78 }
79 #endif /* __cplusplus */
80
81 #endif