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 Regulation controller
22 #include <sys/ioctl.h>
26 #include <wayland-client.h>
27 #include <ico_window_mgr-client-protocol.h>
28 #include <dbus/dbus.h>
32 #include "ico_syc_apc.h"
33 #include "ico_syc_apc_private.h"
35 /*==============================================================================*/
37 /*==============================================================================*/
38 /* callback function */
39 static int nregulation_cb = 0;
40 static ico_apc_regulation_cb_t regulation_cb[ICO_SYC_APC_REGULATION_LISTENERS];
41 static void *regulation_cb_user_data[ICO_SYC_APC_REGULATION_LISTENERS];
43 /* Ecore/D-Bus static valiables */
44 static Ecore_Timer *vehicle_timer = NULL;
45 static DBusConnection *dbus_connection = NULL;
46 static ico_apc_reguration_control_t control[ICO_UXF_CATEGORY_MAX];
48 /* vehicle information */
49 static const struct _vehicle_info_property {
50 int key; /* Vehicle Information key */
51 char *property; /* D-Bus property name */
52 char *path; /* D-Bus path name */
53 char *interface; /* D-Bus interface name */
55 { ICO_SYC_VEHICLEINFO_VEHICLE_SPEED, "VehicleSpeed",
56 "/org/automotive/runningstatus/vehicleSpeed", "org.automotive.vehicleSpeed" },
57 { ICO_SYC_VEHICLEINFO_SHIFT_POSITION, "ShiftPosition",
58 "/org/automotive/runningstatus/transmission", "org.automotive.transmission" },
59 #if 0 /* use LightStatus, because AMB not support access of TurnSignal by D-Bus */
60 { ICO_SYC_VEHICLEINFO_TURN_SIGNAL, "TurnSignal",
61 "/org/automotive/runningstatus/turnSignal", "org.automotive.turnSignal" },
62 #else /* use LightStatus, because AMB not support access of TurnSignal by D-Bus */
63 { ICO_SYC_VEHICLEINFO_LIGHT_LEFT, "LeftTurn",
64 "/org/automotive/runningstatus/lightStatus", "org.automotive.lightStatus" },
65 { ICO_SYC_VEHICLEINFO_LIGHT_RIGHT, "RightTurn",
66 "/org/automotive/runningstatus/lightStatus", "org.automotive.lightStatus" },
67 #endif /* use LightStatus, because AMB not support access of TurnSignal by D-Bus */
68 { 0, "\0", "\0", "\0" }
71 /* Vehicle information data */
72 static struct _vehicle_info_data {
73 int key; /* Vehicle Information key */
74 DBusPendingCall *pending;
78 } vehicle_data[ICO_UXF_REGULATION_VIC_MAX];
80 /* system configuration */
81 static Ico_Uxf_Sys_Config *confsys = NULL;
83 static Ico_Uxf_conf_category *category;
85 /*==============================================================================*/
86 /* define static function prototype */
87 /*==============================================================================*/
88 static int request_vehicle_info(void);
89 static int get_vehicle_info(void);
90 static Eina_Bool rule_engine_wake(void *user_data);
92 /*--------------------------------------------------------------------------*/
94 * @brief request_vehicle_info: request to AMB(static function)
98 * @retval ICO_SYC_EOK success
99 * @retval ICO_SYC_EIO error(D-Bus send error)
101 /*--------------------------------------------------------------------------*/
103 request_vehicle_info(void)
105 DBusMessage *dbus_message = NULL;
107 int ret = ICO_SYC_EOK;
109 for (idx = 0; vehicle_info[idx].key; idx++) {
111 /* set vehicle info key */
112 vehicle_data[idx].key = vehicle_info[idx].key;
114 if (vehicle_data[idx].pending) {
118 if (vehicle_info[idx].path[0] == 0) {
119 /* currently not support this vehicle information */
123 /* Create send message */
124 dbus_message = dbus_message_new_method_call(DBUS_SERVICE, vehicle_info[idx].path,
125 DBUS_INTERFACE, DBUS_METHOD);
126 if (! dbus_message) {
127 apfw_warn("request_vehicle_info: ERROR dbus_message_new_method_call" );
130 /* Set parameters into message */
131 else if (! dbus_message_append_args(
133 DBUS_TYPE_STRING, &vehicle_info[idx].interface,
134 DBUS_TYPE_STRING, &vehicle_info[idx].property,
135 DBUS_TYPE_INVALID)) {
136 apfw_warn("request_vehicle_info: ERROR dbus_message_append_args" );
139 /* Set destination */
140 else if (! dbus_message_set_destination(dbus_message, DBUS_SERVICE)) {
141 apfw_warn("request_vehicle_info: ERROR dbus_message_set_destination" );
145 else if (! dbus_connection_send_with_reply(
146 dbus_connection, dbus_message,
147 &vehicle_data[idx].pending, 200)) {
148 apfw_warn("request_vehicle_info: ERROR dbus_connection_send" );
149 vehicle_data[idx].pending = NULL;
153 /* Release message */
154 dbus_message_unref(dbus_message);
158 /* dispatch if data queue exist */
160 dbus_connection_read_write_dispatch(dbus_connection, 0);
161 } while (dbus_connection_get_dispatch_status(dbus_connection)
162 == DBUS_DISPATCH_DATA_REMAINS);
167 /*--------------------------------------------------------------------------*/
169 * @brief get_vehicle_info: get vercle information from AMB(static function)
172 * @return always ICO_SYC_EOK(success)
174 /*--------------------------------------------------------------------------*/
176 get_vehicle_info(void)
178 DBusMessage *dbus_message = NULL;
179 DBusMessageIter iter_head;
180 DBusMessageIter iter;
191 /* dispatch if data queue exist */
193 dbus_connection_read_write_dispatch(dbus_connection, 0);
194 } while (dbus_connection_get_dispatch_status(dbus_connection)
195 == DBUS_DISPATCH_DATA_REMAINS);
197 /* analize reply datas */
198 for (idx = 0; vehicle_info[idx].key; idx++) {
199 if (! vehicle_data[idx].pending) {
202 if (! dbus_pending_call_get_completed(vehicle_data[idx].pending)) {
206 dbus_message = dbus_pending_call_steal_reply(vehicle_data[idx].pending);
207 if (! dbus_message) {
208 apfw_trace("get_vehicle_info: (%s) NO reply", vehicle_info[idx].property);
212 if (dbus_message_get_type(dbus_message) == DBUS_MESSAGE_TYPE_ERROR) {
213 dbus_message_unref(dbus_message);
214 dbus_pending_call_unref(vehicle_data[idx].pending);
215 vehicle_data[idx].pending = NULL;
216 vehicle_data[idx].errcount ++;
217 if (vehicle_data[idx].errcount <= 5) {
218 apfw_trace("get_vehicle_info: (%s) reply error", vehicle_info[idx].property);
223 dbus_message_iter_init(dbus_message, &iter_head);
224 dbus_message_iter_recurse(&iter_head, &iter);
226 type = dbus_message_iter_get_arg_type(&iter);
228 case DBUS_TYPE_INT32:
229 dbus_message_iter_get_basic(&iter, &i32);
230 vehicle_data[idx].val = (double)i32;
232 case DBUS_TYPE_INT16:
233 dbus_message_iter_get_basic(&iter, &i16);
234 vehicle_data[idx].val = (double)i16;
236 case DBUS_TYPE_UINT32:
237 dbus_message_iter_get_basic(&iter, &u32);
238 vehicle_data[idx].val = (double)u32;
240 case DBUS_TYPE_UINT16:
241 dbus_message_iter_get_basic(&iter, &u16);
242 vehicle_data[idx].val = (double)u16;
244 case DBUS_TYPE_BOOLEAN:
245 dbus_message_iter_get_basic(&iter, &b);
246 if (b) vehicle_data[idx].val = (double)1.0;
247 else vehicle_data[idx].val = (double)0.0;
250 dbus_message_iter_get_basic(&iter, &u8);
251 vehicle_data[idx].val = (double)u8;
253 case DBUS_TYPE_DOUBLE:
254 dbus_message_iter_get_basic(&iter, &d64);
255 vehicle_data[idx].val = (double)d64;
258 apfw_warn("get_vehicle_info: (%s) illegal data type(0x%02x)",
259 vehicle_info[idx].property, ((int)type) & 0x0ff);
262 #if 0 /* too many logout, change to comment */
263 apfw_trace("get_vehicle_info: %s = %d",
264 vehicle_info[idx].property, (int)vehicle_data[idx].val);
265 #endif /* too many logout, change to comment */
267 /* free message and pending */
268 dbus_message_unref(dbus_message);
269 dbus_pending_call_unref(vehicle_data[idx].pending);
270 vehicle_data[idx].pending = NULL;
275 /*--------------------------------------------------------------------------*/
277 * @brief rule_engine_wake: judge a run regulation state(static function)
279 * @param[in] user_data user data(unused)
280 * @return always ECORE_CALLBACK_RENEW(periodic timer)
282 /*--------------------------------------------------------------------------*/
284 rule_engine_wake(void *user_data)
288 ico_apc_reguration_control_t wkcontrol[ICO_UXF_CATEGORY_MAX];
289 ico_apc_reguration_control_t change;
290 double VehicleSpeed = 0.0;
291 int ShiftPosition = ICO_SYC_APC_REGULATION_SHIFT_NEUTRALS;
292 int Blinker = ICO_SYC_APC_REGULATION_BLINKER_NONE;
294 /* call UX-FW timer */
295 ico_uxf_timer_wake(100);
297 memset(wkcontrol, 0, sizeof(ico_apc_reguration_control_t) * ncategory);
299 /* get reply (vehicle ifno) */
302 /* get vehicle info values */
303 for (idx = 0; vehicle_data[idx].key; idx++) {
304 if (vehicle_data[idx].key == ICO_SYC_VEHICLEINFO_VEHICLE_SPEED) {
305 VehicleSpeed = (double)vehicle_data[idx].val;
307 else if (vehicle_data[idx].key == ICO_SYC_VEHICLEINFO_SHIFT_POSITION) {
308 ShiftPosition = (int)vehicle_data[idx].val;
310 #if 0 /* use LightStatus, because AMB not support access of TurnSignal by D-Bus */
311 else if (vehicle_data[idx].key == ICO_SYC_VEHICLEINFO_TURN_SIGNAL) {
312 Blinker = (int)vehicle_data[idx].val;
314 #else /* use LightStatus, because AMB not support access of TurnSignal by D-Bus */
315 else if (vehicle_data[idx].key == ICO_SYC_VEHICLEINFO_LIGHT_LEFT) {
316 if (vehicle_data[idx].val == 0.0) {
317 if (Blinker == ICO_SYC_APC_REGULATION_BLINKER_LEFT) {
318 Blinker = ICO_SYC_APC_REGULATION_BLINKER_NONE;
322 Blinker = ICO_SYC_APC_REGULATION_BLINKER_LEFT;
325 else if (vehicle_data[idx].key == ICO_SYC_VEHICLEINFO_LIGHT_RIGHT) {
326 if (vehicle_data[idx].val == 0.0) {
327 if (Blinker == ICO_SYC_APC_REGULATION_BLINKER_RIGHT) {
328 Blinker = ICO_SYC_APC_REGULATION_BLINKER_NONE;
332 Blinker = ICO_SYC_APC_REGULATION_BLINKER_RIGHT;
335 #endif /* use LightStatus, because AMB not support access of TurnSignal by D-Bus */
338 /* Make control code */
339 memcpy(wkcontrol, control, sizeof(ico_apc_reguration_control_t) * ncategory);
341 /* Check Vehicle Speed */
342 for (idx = 0; idx < ncategory; idx++) {
343 switch (category[idx].view) {
344 case ICO_UXF_POLICY_ALWAYS:
345 wkcontrol[idx].display = ICO_SYC_APC_REGULATION_NOREGULATION;
347 case ICO_UXF_POLICY_RUNNING:
348 if (VehicleSpeed >= ICO_SYC_APC_REGULATION_SPEED_RUNNING)
349 wkcontrol[idx].display = ICO_SYC_APC_REGULATION_NOREGULATION;
351 wkcontrol[idx].display = ICO_SYC_APC_REGULATION_REGULATION;
353 case ICO_UXF_POLICY_PARKED:
354 if (VehicleSpeed >= ICO_SYC_APC_REGULATION_SPEED_RUNNING)
355 wkcontrol[idx].display = ICO_SYC_APC_REGULATION_REGULATION;
357 wkcontrol[idx].display = ICO_SYC_APC_REGULATION_NOREGULATION;
359 case ICO_UXF_POLICY_SHIFT_PARKING:
360 if ((VehicleSpeed < ICO_SYC_APC_REGULATION_SPEED_RUNNING) &&
361 (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_PARKING))
362 wkcontrol[idx].display = ICO_SYC_APC_REGULATION_REGULATION;
364 wkcontrol[idx].display = ICO_SYC_APC_REGULATION_NOREGULATION;
366 case ICO_UXF_POLICY_SHIFT_REVERSES:
367 if (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_REVERSES)
368 wkcontrol[idx].display = ICO_SYC_APC_REGULATION_NOREGULATION;
370 wkcontrol[idx].display = ICO_SYC_APC_REGULATION_REGULATION;
372 case ICO_UXF_POLICY_BLINKER_LEFT:
373 if ((Blinker != ICO_SYC_APC_REGULATION_BLINKER_LEFT) ||
374 (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_REVERSES))
375 wkcontrol[idx].display = ICO_SYC_APC_REGULATION_REGULATION;
377 wkcontrol[idx].display = ICO_SYC_APC_REGULATION_NOREGULATION;
379 case ICO_UXF_POLICY_BLINKER_RIGHT:
380 if ((Blinker != ICO_SYC_APC_REGULATION_BLINKER_RIGHT) ||
381 (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_REVERSES))
382 wkcontrol[idx].display = ICO_SYC_APC_REGULATION_REGULATION;
384 wkcontrol[idx].display = ICO_SYC_APC_REGULATION_NOREGULATION;
387 apfw_trace("rule_engine_wake: category(%d) has unknown view(%d)",
388 idx, category[idx].view);
392 switch (category[idx].sound) {
393 case ICO_UXF_POLICY_ALWAYS:
394 wkcontrol[idx].sound = ICO_SYC_APC_REGULATION_NOREGULATION;
396 case ICO_UXF_POLICY_RUNNING:
397 if (VehicleSpeed >= ICO_SYC_APC_REGULATION_SPEED_RUNNING)
398 wkcontrol[idx].sound = ICO_SYC_APC_REGULATION_NOREGULATION;
400 wkcontrol[idx].sound = ICO_SYC_APC_REGULATION_REGULATION;
402 case ICO_UXF_POLICY_PARKED:
403 if (VehicleSpeed >= ICO_SYC_APC_REGULATION_SPEED_RUNNING)
404 wkcontrol[idx].sound = ICO_SYC_APC_REGULATION_REGULATION;
406 wkcontrol[idx].sound = ICO_SYC_APC_REGULATION_NOREGULATION;
408 case ICO_UXF_POLICY_SHIFT_PARKING:
409 if (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_PARKING)
410 wkcontrol[idx].sound = ICO_SYC_APC_REGULATION_NOREGULATION;
412 wkcontrol[idx].sound = ICO_SYC_APC_REGULATION_REGULATION;
414 case ICO_UXF_POLICY_SHIFT_REVERSES:
415 if (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_REVERSES)
416 wkcontrol[idx].sound = ICO_SYC_APC_REGULATION_NOREGULATION;
418 wkcontrol[idx].sound = ICO_SYC_APC_REGULATION_REGULATION;
420 case ICO_UXF_POLICY_BLINKER_LEFT:
421 if ((Blinker != ICO_SYC_APC_REGULATION_BLINKER_LEFT) ||
422 (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_REVERSES))
423 wkcontrol[idx].sound = ICO_SYC_APC_REGULATION_REGULATION;
425 wkcontrol[idx].sound = ICO_SYC_APC_REGULATION_NOREGULATION;
427 case ICO_UXF_POLICY_BLINKER_RIGHT:
428 if ((Blinker != ICO_SYC_APC_REGULATION_BLINKER_RIGHT) ||
429 (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_REVERSES))
430 wkcontrol[idx].sound = ICO_SYC_APC_REGULATION_REGULATION;
432 wkcontrol[idx].sound = ICO_SYC_APC_REGULATION_NOREGULATION;
435 apfw_trace("rule_engine_wake: category(%d) has unknown sound(%d)",
436 idx, category[idx].sound);
440 switch (category[idx].input) {
441 case ICO_UXF_POLICY_ALWAYS:
442 wkcontrol[idx].input = ICO_SYC_APC_REGULATION_NOREGULATION;
444 case ICO_UXF_POLICY_RUNNING:
445 if (VehicleSpeed >= ICO_SYC_APC_REGULATION_SPEED_RUNNING)
446 wkcontrol[idx].input = ICO_SYC_APC_REGULATION_NOREGULATION;
448 wkcontrol[idx].input = ICO_SYC_APC_REGULATION_REGULATION;
450 case ICO_UXF_POLICY_PARKED:
451 if (VehicleSpeed >= ICO_SYC_APC_REGULATION_SPEED_RUNNING)
452 wkcontrol[idx].input = ICO_SYC_APC_REGULATION_REGULATION;
454 wkcontrol[idx].input = ICO_SYC_APC_REGULATION_NOREGULATION;
456 case ICO_UXF_POLICY_SHIFT_PARKING:
457 if (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_PARKING)
458 wkcontrol[idx].input = ICO_SYC_APC_REGULATION_NOREGULATION;
460 wkcontrol[idx].input = ICO_SYC_APC_REGULATION_REGULATION;
462 case ICO_UXF_POLICY_SHIFT_REVERSES:
463 if (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_REVERSES)
464 wkcontrol[idx].input = ICO_SYC_APC_REGULATION_NOREGULATION;
466 wkcontrol[idx].input = ICO_SYC_APC_REGULATION_REGULATION;
468 case ICO_UXF_POLICY_BLINKER_LEFT:
469 if ((Blinker != ICO_SYC_APC_REGULATION_BLINKER_LEFT) ||
470 (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_REVERSES))
471 wkcontrol[idx].input = ICO_SYC_APC_REGULATION_REGULATION;
473 wkcontrol[idx].input = ICO_SYC_APC_REGULATION_NOREGULATION;
475 case ICO_UXF_POLICY_BLINKER_RIGHT:
476 if ((Blinker != ICO_SYC_APC_REGULATION_BLINKER_RIGHT) ||
477 (ShiftPosition == ICO_SYC_APC_REGULATION_SHIFT_REVERSES))
478 wkcontrol[idx].input = ICO_SYC_APC_REGULATION_REGULATION;
480 wkcontrol[idx].input = ICO_SYC_APC_REGULATION_NOREGULATION;
483 apfw_trace("rule_engine_wake: category(%d) has unknown input(%d)",
484 idx, category[idx].input);
489 for (idx = 0; idx < ncategory; idx++) {
490 if ((control[idx].display != wkcontrol[idx].display) ||
491 (control[idx].sound != wkcontrol[idx].sound) ||
492 (control[idx].input != wkcontrol[idx].input)) {
493 apfw_trace("rule_engine_wake: Category.%d view.%d>%d sound.%d>%d inp.%d>%d",
494 idx, control[idx].display, wkcontrol[idx].display,
495 control[idx].sound, wkcontrol[idx].sound,
496 control[idx].input, wkcontrol[idx].input);
498 if (nregulation_cb > 0) {
499 if (control[idx].display != wkcontrol[idx].display)
500 change.display = wkcontrol[idx].display;
502 change.display = ICO_SYC_APC_REGULATION_NOCHANGE;
503 if (control[idx].sound != wkcontrol[idx].sound)
504 change.sound = wkcontrol[idx].sound;
506 change.sound = ICO_SYC_APC_REGULATION_NOCHANGE;
507 if (control[idx].input != wkcontrol[idx].input)
508 change.input = wkcontrol[idx].input;
510 change.input = ICO_SYC_APC_REGULATION_NOCHANGE;
512 for (i = 0; i < nregulation_cb; i++) {
513 (*regulation_cb[i])(idx, change, regulation_cb_user_data[i]);
516 control[idx].display = wkcontrol[idx].display;
517 control[idx].sound = wkcontrol[idx].sound;
518 control[idx].input = wkcontrol[idx].input;
521 /* send request to AMB */
522 request_vehicle_info();
524 return ECORE_CALLBACK_RENEW;
527 /*--------------------------------------------------------------------------*/
529 * @brief ico_syc_apc_regulation_init: initialize regulation control
533 * @retval ICO_SYC_EOK success
534 * @retval ICO_SYC_EIO error(D-Bus initialize error)
536 /*--------------------------------------------------------------------------*/
538 ico_syc_apc_regulation_init(void)
541 DBusError dbus_error;
543 apfw_trace("ico_syc_apc_regulation_init: Enter");
545 /* get configurations */
546 confsys = (Ico_Uxf_Sys_Config *)ico_uxf_getSysConfig();
549 apfw_trace("ico_syc_apc_regulation_init: Leave(can not read configuration)");
552 ncategory = confsys->categoryNum;
553 category = confsys->category;
555 memset(vehicle_data, 0, sizeof(vehicle_data));
556 memset(control, 0, sizeof(control));
557 for (i = 0; i <ncategory; i++) {
558 control[i].display = ICO_SYC_APC_REGULATION_NOREGULATION;
559 control[i].sound = ICO_SYC_APC_REGULATION_NOREGULATION;
560 control[i].input = ICO_SYC_APC_REGULATION_NOREGULATION;
563 /* Reset D-Bus error */
564 dbus_error_init(&dbus_error);
566 /* Get D-Bus connection */
567 dbus_connection = dbus_bus_get(DBUS_BUS_SYSTEM, &dbus_error);
568 if (! dbus_connection){
569 apfw_warn("ico_syc_apc_regulation_init: Leave(ERROR dbus_bus_get)" );
573 /* send request to AMB */
574 request_vehicle_info();
576 vehicle_timer = ecore_timer_add(0.1, rule_engine_wake, NULL);
577 if (! vehicle_timer) {
578 apfw_error("ico_syc_apc_regulation_init: Leave(Can not create Ecore timer)");
581 apfw_trace("ico_syc_apc_regulation_init: Leave(EOK)");
586 /*--------------------------------------------------------------------------*/
588 * @brief ico_syc_apc_regulation_term: terminate regulation control
591 * @return always ICO_SYC_EOK(success)
593 /*--------------------------------------------------------------------------*/
595 ico_syc_apc_regulation_term(void)
597 apfw_trace("ico_syc_apc_regulation_term: Enter");
600 apfw_trace("ico_syc_apc_regulation_term: Leave(not initialized)");
603 ecore_timer_del(vehicle_timer);
607 apfw_trace("ico_syc_apc_regulation_term: Leave(EOK)");
611 /*--------------------------------------------------------------------------*/
613 * @brief ico_syc_apc_regulation_listener: set regulation control listener
615 * @param[in] func listener function
616 * @param[in] user_data user data
619 /*--------------------------------------------------------------------------*/
621 ico_syc_apc_regulation_listener(ico_apc_regulation_cb_t func, void *user_data)
630 for (idx = 0; idx < nregulation_cb; idx++) {
631 if (regulation_cb[idx] == func) break;
633 if (idx >= nregulation_cb) {
634 if (nregulation_cb >= ICO_SYC_APC_REGULATION_LISTENERS) {
635 apfw_error("ico_syc_apc_regulation_listener: Too many listeners");
638 idx = nregulation_cb;
641 regulation_cb[idx] = func;
642 regulation_cb_user_data[idx] = user_data;
644 for (idx = 0; idx < ncategory; idx++) {
645 (*func)(idx, control[idx], user_data);
649 /*--------------------------------------------------------------------------*/
651 * @brief ico_syc_apc_regulation_app_visible: get display regulation status
653 * @param[in] category category Id
655 * @retval TRUE The application of this category can use the display
656 * @retval FALSE The application of this category can not use the display
658 /*--------------------------------------------------------------------------*/
660 ico_syc_apc_regulation_app_visible(const int category)
662 if ((category < 0) || (category >= ICO_UXF_CATEGORY_MAX)) {
663 apfw_warn("ico_syc_apc_regulation_app_visible: Illegal category(%d)", category);
666 if (control[category].display == ICO_SYC_APC_REGULATION_NOREGULATION) {
672 /*--------------------------------------------------------------------------*/
674 * @brief ico_syc_apc_regulation_app_sound: get sound reguration status
676 * @param[in] category category Id
678 * @retval TRUE The application of this category can use the sound output
679 * @retval FALSE The application of this category can not use the sound output
681 /*--------------------------------------------------------------------------*/
683 ico_syc_apc_regulation_app_sound(const int category)
685 if ((category < 0) || (category >= ICO_UXF_CATEGORY_MAX)) {
686 apfw_warn("ico_syc_apc_regulation_app_sound: Illegal category(%d)", category);
689 if (control[category].sound == ICO_SYC_APC_REGULATION_NOREGULATION) {
695 /*--------------------------------------------------------------------------*/
697 * @brief ico_syc_apc_regulation_app_input: get input switch reguration status
699 * @param[in] category category Id
701 * @retval TRUE The application of this category is available with an input
702 * @retval FALSE The application of this category is not available with an input
704 /*--------------------------------------------------------------------------*/
706 ico_syc_apc_regulation_app_input(const int category)
708 if ((category < 0) || (category >= ICO_UXF_CATEGORY_MAX)) {
709 apfw_warn("ico_syc_apc_regulation_app_input: Illegal category(%d)", category);
712 if (control[category].input == ICO_SYC_APC_REGULATION_NOREGULATION) {