Rearrange folder
[platform/core/api/uwb.git] / src / uwb-private.h
1 /*
2  * Copyright (c) 2020 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
18 #ifndef __UWB_PRIVATE_H__
19 #define __UWB_PRIVATE_H__
20
21 #include <gio/gio.h>
22 #include <glib.h>
23 #include <uwb.h>
24 #include <uwb-log.h>
25 #include <system_info.h>
26
27 #define UWB_FEATURE "http://tizen.org/feature/network.uwb"
28
29 #define CHECK_INPUT_PARAMETER(arg)                  \
30         if (arg == NULL) {                          \
31                 _WARN("INVALID_PARAMETER"); \
32                 return UWB_ERROR_INVALID_PARAMETER; \
33         }
34
35 #if 0
36 #define CHECK_FEATURE_SUPPORTED(feature_name)                                            \
37         {                                                                                \
38                 bool uwb_supported = FALSE;                                              \
39                 if (!system_info_get_platform_bool(feature_name, &uwb_supported)) {      \
40                         if (uwb_supported == FALSE) {                                    \
41                                 _WARN("UWB Manager feature is disabled"); \
42                                 return UWB_ERROR_NOT_SUPPORTED;                          \
43                         }                                                                \
44                 } else {                                                                 \
45                         _ERR("Error - Feature getting from System Info");                \
46                         return UWB_ERROR_NOT_SUPPORTED;                                  \
47                 }                                                                        \
48         }
49 #else
50 #define CHECK_FEATURE_SUPPORTED(feature_name)         \
51         {                                             \
52                 _WARN("[Feature] Should be check !"); \
53         }
54 #endif
55
56 typedef struct {
57         uint64_t node_id;
58         uint16_t pan_id;
59         bool is_remote;
60         uint64_t distance;
61         int x;
62         int y;
63         int z;
64 } uwb_node_s;
65
66 typedef struct {
67         uint16_t pan_id;
68         GSList *remote_node_list;
69         int remote_node_count;
70 } uwb_network_s;
71
72 #endif /* __UWB_PRIVATE_H__ */