2 * Application Service Platform(ASP)
4 * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 * This file declares macros for usefuls.
24 * @author Jiung Yu (jiung.yu.com)
28 #ifndef __ASP_UTIL_H__
29 #define __ASP_UTIL_H__
31 #define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5]
32 #define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
33 #define IP2STR(a) (a)[0], (a)[1], (a)[2], (a)[3]
34 #define IPSTR "%d.%d.%d.%d"
35 #define MAC2SECSTR(a) (a)[0], (a)[4], (a)[5]
36 #define MACSECSTR "%02x:%02x:%02x"
37 #define IP2SECSTR(a) (a)[0], (a)[3]
38 #define IPSECSTR "%d..%d"
46 #define TIZEN_FEATURE_P2PS "tizen.org/feature/network.asp"
49 #define CHECK_FEATURE_SUPPORTED(feature_name)\
51 bool feature_supported = FALSE;\
52 if (!system_info_get_platform_bool(feature_name, &feature_supported)) {\
53 if (feature_supported == FALSE) {\
54 LOGE("%s feature is disabled", feature_name);\
55 return P2PS_ERROR_NOT_SUPPORTED;\
58 LOGE("Error - Feature getting from System Info");\
59 return P2PS_ERROR_OPERATION_FAILED;\
64 #define CHECK_FEATURE_SUPPORTED(feature_name)
67 #endif /** __ASP_UTIL_H__ */