2 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
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
8 * http://floralicense.org/license/
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.
23 * @brief The car info structure template.
25 typedef struct car_info car_info_t;
28 * @brief Creates new instance of car_info_t.
29 * @return new car_info_t object, or NULL on error.
31 car_info_t *car_info_create();
34 * @brief Crates deep copy of given car_info_t object.
35 * @return Copied car_info_t object, or NULL on error.
37 car_info_t *car_info_copy(const car_info_t *car_info);
40 * @brief Releases car_info_t.
41 * @param[in] car_info Car info struct.
43 void car_info_destroy(car_info_t *car_info);
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.
50 bool car_info_is_valid(car_info_t *car_info);
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.
59 const char *car_info_get_car_id(car_info_t *car_info);
63 * @param[in] car_info Car info struct.
64 * @param[in] car_id The car id.
65 * @return Returns 0 on success, -1 otherwise.
67 int car_info_set_car_id(car_info_t *car_info, const char *car_id);
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.
76 const char *car_info_get_car_name(car_info_t *car_info);
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.
84 int car_info_set_car_name(car_info_t *car_info, const char *car_name);
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.
93 const char *car_info_get_car_ip(car_info_t *car_info);
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.
102 int car_info_set_car_ip(car_info_t *car_info, const char *car_ip);
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.
111 const char *car_info_get_ap_mac(car_info_t *car_info);
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.
120 int car_info_set_car_ap_mac(car_info_t *car_info, const char *ap_mac);
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.
128 const char *car_info_get_ap_ssid(car_info_t *car_info);
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.
136 int car_info_set_ap_ssid(car_info_t *car_info, const char *ap_ssid);