2 * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
10 * @brief header file of System Controller internal definition
15 #ifndef _ICO_SYC_PRIVATE_H_
16 #define _ICO_SYC_PRIVATE_H_
23 #include "ico_syc_type.h"
29 /*============================================================================*/
31 /*============================================================================*/
35 #define ICO_SYC_URI (char *)"ws://127.0.0.1:18081"
36 #define ICO_SYC_PROTOCOL (char *)"ico_syc_protocol"
38 #define ICO_SYC_MAX_LEN 128
40 /*============================================================================*/
41 /* variable & table */
42 /*============================================================================*/
43 struct ico_syc_res_context {
44 char appid[ICO_SYC_MAX_LEN];
46 ico_syc_res_window_t *window;
48 ico_syc_res_sound_t *sound;
50 ico_syc_res_input_t *input;
52 /* window and sound resource type (basic or interruption) */
56 /*============================================================================*/
57 /* internal function (common) */
58 /*============================================================================*/
59 /*--------------------------------------------------------------------------*/
62 * @brief ico_syc_get_context
63 * Get the ico_uws context connected to System Controller.
66 * @retval context success
69 /*--------------------------------------------------------------------------*/
70 struct ico_uws_context *ico_syc_get_context(void);
72 /*--------------------------------------------------------------------------*/
75 * @brief ico_syc_get_id
76 * Get the ico_uws id to send message to System Controller.
82 /*--------------------------------------------------------------------------*/
83 void *ico_syc_get_id(void);
85 /*--------------------------------------------------------------------------*/
88 * @brief ico_syc_get_appid
89 * Get the application id.
92 * @retval appid success
95 /*--------------------------------------------------------------------------*/
96 char *ico_syc_get_appid(void);
98 /*============================================================================*/
99 /* internal function (winctl) */
100 /*============================================================================*/
101 /*--------------------------------------------------------------------------*/
104 * @brief ico_syc_cb_win
105 * Execute callback function. (ICO_SYC_EV_WIN_ACTIVE
106 * ICO_SYC_EV_WIN_CREATE
107 * ICO_SYC_EV_WIN_DESTROY)
109 * @param[in] callback callback function
110 * @param[in] user_data passed data on called callback function
111 * @param[in] event event code
112 * @param[in] data message data
113 * @param[in] len length of data
116 /*--------------------------------------------------------------------------*/
117 void ico_syc_cb_win(ico_syc_callback_t callback, void *user_data,
118 int event, const void *data, size_t len);
120 /*--------------------------------------------------------------------------*/
123 * @brief ico_syc_cb_win_attr
124 * Execute callback function. (ICO_SYC_EV_WIN_ATTR_CHANGE)
126 * @param[in] callback callback function
127 * @param[in] user_data passed data on called callback function
128 * @param[in] event event code
129 * @param[in] data message data
130 * @param[in] len length of data
133 /*--------------------------------------------------------------------------*/
134 void ico_syc_cb_win_attr(ico_syc_callback_t callback, void *user_data,
135 int event, const void *data, size_t len);
137 /*--------------------------------------------------------------------------*/
140 * @brief ico_syc_cb_thumb
141 * Execute callback function. (ICO_SYC_EV_THUMB_ERROR
142 * ICO_SYC_EV_THUMB_CHANGE
143 * ICO_SYC_EV_THUMB_UNMAP)
145 * @param[in] callback callback function
146 * @param[in] user_data passed data on called callback function
147 * @param[in] event event code
148 * @param[in] data message data
149 * @param[in] len length of data
152 /*--------------------------------------------------------------------------*/
153 void ico_syc_cb_thumb(ico_syc_callback_t callback, void *user_data,
154 int event, const void *data, size_t len);
156 /*--------------------------------------------------------------------------*/
159 * @brief ico_syc_cb_layer
160 * Execute callback function. (ICO_SYC_EV_LAYER_ATTR_CHANGE)
162 * @param[in] callback callback function
163 * @param[in] user_data passed data on called callback function
164 * @param[in] event event code
165 * @param[in] data message data
166 * @param[in] len length of data
169 /*--------------------------------------------------------------------------*/
170 void ico_syc_cb_layer(ico_syc_callback_t callback, void *user_data,
171 int event, const void *data, size_t len);
173 /*============================================================================*/
174 /* internal function (userctl) */
175 /*============================================================================*/
176 /*--------------------------------------------------------------------------*/
179 * @brief ico_syc_cb_auth
180 * Execute callback function. (ICO_SYC_EV_AUTH_FAIL)
182 * @param[in] callback callback function
183 * @param[in] user_data passed data on called callback function
184 * @param[in] event event code
187 /*--------------------------------------------------------------------------*/
188 void ico_syc_cb_auth(ico_syc_callback_t callback, void *user_data, int event);
190 /*--------------------------------------------------------------------------*/
193 * @brief ico_syc_cb_userlist
194 * Execute callback function. (ICO_SYC_EV_USERLIST)
196 * @param[in] callback callback function
197 * @param[in] user_data passed data on called callback function
198 * @param[in] event event code
199 * @param[in] data message data
200 * @param[in] len length of data
203 /*--------------------------------------------------------------------------*/
204 void ico_syc_cb_userlist(ico_syc_callback_t callback, void *user_data,
205 int event, const void *data, size_t len);
207 /*--------------------------------------------------------------------------*/
210 * @brief ico_syc_cb_lastinfo
211 * Execute callback function. (ICO_SYC_EV_LASTINFO)
213 * @param[in] callback callback function
214 * @param[in] user_data passed data on called callback function
215 * @param[in] event event code
216 * @param[in] data message data
217 * @param[in] len length of data
220 /*--------------------------------------------------------------------------*/
221 void ico_syc_cb_lastinfo(ico_syc_callback_t callback, void *user_data,
222 int event, const void *data, size_t len);
224 /*============================================================================*/
225 /* internal function (appresctl) */
226 /*============================================================================*/
227 /*--------------------------------------------------------------------------*/
230 * @brief ico_syc_cb_res
231 * Execute callback function. (ICO_SYC_EV_RES_ACQUIRE
232 * ICO_SYC_EV_RES_DEPRIVE
233 * ICO_SYC_EV_RES_WAITING
234 * ICO_SYC_EV_RES_REVERT
235 * ICO_SYC_EV_RES_RELEASE)
237 * @param[in] callback callback function
238 * @param[in] user_data passed data on called callback function
239 * @param[in] event event code
240 * @param[in] data message data
241 * @param[in] len length of data
244 /*--------------------------------------------------------------------------*/
245 void ico_syc_cb_res(ico_syc_callback_t callback, void *user_data,
246 int event, const void *data, size_t len);
248 /*--------------------------------------------------------------------------*/
251 * @brief ico_syc_cb_region
252 * Execute callback function. (ICO_SYC_EV_INPUT_SET
253 * ICO_SYC_EV_INPUT_UNSET)
255 * @param[in] callback callback function
256 * @param[in] user_data passed data on called callback function
257 * @param[in] event event code
258 * @param[in] data message data
259 * @param[in] len length of data
262 /*--------------------------------------------------------------------------*/
263 void ico_syc_cb_region(ico_syc_callback_t callback, void *user_data,
264 int event, const void *data, size_t len);
267 /*============================================================================*/
269 /*============================================================================*/
276 #define LOG_TAG "ICO_SYC"
277 #include <dlog/dlog.h>
279 #define _ERR(fmt, arg...) \
282 "ico_syc E: %s:%d [ "fmt" ]\n", \
286 LOGE("%s:%d " fmt, __FUNCTION__, __LINE__, ##arg); \
289 #define _WARN(fmt, arg...) \
292 "ico_syc W: %s:%d [ "fmt" ]\n", \
296 LOGW("%s:%d " fmt, __FUNCTION__, __LINE__, ##arg); \
299 #define _INFO(fmt, arg...) \
302 "ico_syc I: %s:%d [ "fmt" ]\n", \
306 LOGI("%s:%d " fmt, __FUNCTION__, __LINE__, ##arg); \
309 #define _DBG(fmt, arg...) \
311 LOGD("%s:%d " fmt, __FUNCTION__, __LINE__, ##arg); \
316 #define _ERR(fmt, arg...) \
319 "ico_syc E: %s:%d [ "fmt" ]\n", \
325 #define _WARN(fmt, arg...) \
328 "ico_syc W: %s:%d [ "fmt" ]\n", \
335 #define _INFO(fmt, arg...) \
338 "ico_syc I: %s:%d [ "fmt" ]\n", \
344 #define _DBG(fmt, arg...) \
346 if (getenv("ICO_SYC_DEBUG")) { \
348 "ico_syc D: %s:%d [ "fmt" ]\n", \
361 #endif /*_ICO_SYC_PRIVATE_H_*/
362 /* vim:set expandtab ts=4 sw=4: */