Cloud API added
[apps/native/gear-racing-car.git] / inc / cloud / car_info.h
1 /*
2  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 __CAR_INFO_H_
18 #define __CAR_INFO_H_
19
20 #include <stdbool.h>
21
22 /**
23  * @brief The car info structure template.
24  */
25 typedef struct car_info car_info_t;
26
27 /**
28  * @brief Creates new instance of car_info_t.
29  * @return new car_info_t object, or NULL on error.
30  */
31 car_info_t *car_info_create();
32
33 /**
34  * @brief Crates deep copy of given car_info_t object.
35  * @return Copied car_info_t object, or NULL on error.
36  */
37 car_info_t *car_info_copy(const car_info_t *car_info);
38
39 /**
40  * @brief Releases car_info_t.
41  * @param[in] car_info Car info struct.
42  */
43 void car_info_destroy(car_info_t *car_info);
44
45 /**
46  * @brief Checks if car_info_t structure core fields are set.
47  * @param[in] car_info Car info struct.
48  * @returns Returns true if object is valid, otherwise false.
49  */
50 bool car_info_is_valid(car_info_t *car_info);
51
52 /**
53  * @brief Gets car id.
54  * @param[in] car_info Car info struct.
55  * @param[out] car_id The car id.
56  * @return Returns car id or NULL on error.
57  * @remark This value is valid only during car_info life.
58  */
59 const char *car_info_get_car_id(car_info_t *car_info);
60
61 /**
62  * @brief Sets car id.
63  * @param[in] car_info Car info struct.
64  * @param[in] car_id The car id.
65  * @return Returns 0 on success, -1 otherwise.
66  */
67 int car_info_set_car_id(car_info_t *car_info, const char *car_id);
68
69 /**
70  * @brief Gets car name.
71  * @param[in] car_info Car info struct.
72  * @param[out] car_id The car id.
73  * @return Returns car name or NULL on error.
74  * @remark This value is valid only during car_info life.
75  */
76 const char *car_info_get_car_name(car_info_t *car_info);
77
78 /**
79  * @brief Sets car name.
80  * @param[in] car_info Car info struct.
81  * @param[in] car_name The car name.
82  * @return Returns 0 on success, -1 otherwise.
83  */
84 int car_info_set_car_name(car_info_t *car_info, const char *car_name);
85
86 /**
87  * @brief Gets car ip.
88  * @param[in] car_info Car info struct.
89  * @param[out] car_ip The car ip.
90  * @return Returns car ip or NULL on error.
91  * @remark This value is valid only during car_info life.
92  */
93 const char *car_info_get_car_ip(car_info_t *car_info);
94
95 /**
96  * @brief Sets car ip.
97  * @param[in] car_info Car info struct.
98  * @param[in] car_ip The car ip.
99  * @return Returns 0 on success, -1 otherwise.
100  * @remarks Param car_ip should be valid ip address.
101  */
102 int car_info_set_car_ip(car_info_t *car_info, const char *car_ip);
103
104 /**
105  * @brief Gets access point mac.
106  * @param[in] car_info Car info struct.
107  * @param[out] ap_mac The access point mac address.
108  * @return Returns access po id or NULL on error.
109  * @remark This value is valid only during car_info life.
110  */
111 const char *car_info_get_ap_mac(car_info_t *car_info);
112
113 /**
114  * @brief Sets access point mac.
115  * @param[in] car_info Car info struct.
116  * @param[in] ap_mac The access point mac address.
117  * @return Returns 0 on success, -1 otherwise.
118  * @remarks Param ap_max should be valid mac address.
119  */
120 int car_info_set_car_ap_mac(car_info_t *car_info, const char *ap_mac);
121
122 /**
123  * @brief Gets access point ssid.
124  * @param[in] car_info Car info struct.
125  * @param[out] ap_ssid The access point ssid.
126  * @return Returns -1 if any error occurred, 0 otherwise.
127  */
128 const char *car_info_get_ap_ssid(car_info_t *car_info);
129
130 /**
131  * @brief Sets access point ssid.
132  * @param[out] ap_ssid The access point ssid.
133  * @param[in] car_id The car id.
134  * @return Returns 0 on success, -1 otherwise.
135  */
136 int car_info_set_ap_ssid(car_info_t *car_info, const char *ap_ssid);
137
138 #endif