added which sensors are available.
authorsaerome.kim <saerome.kim@samsung.com>
Fri, 18 Jan 2019 03:17:45 +0000 (12:17 +0900)
committer김새롬/Tizen Platform Lab(SR)/Staff Engineer/삼성전자 <saerome.kim@samsung.com>
Fri, 18 Jan 2019 08:45:36 +0000 (17:45 +0900)
- When TV goes into BACKGROUND SUSPEND mode by a sensor (BLE, Light,
Motion), power plugin should check which sensors are enabled then
execute PRESENCE detection with other sensors.

Then if all sensors detect PRESENCE, then wake up TV goes into NORMAL
mode as well.

Signed-off-by: saerome.kim <saerome.kim@samsung.com>
ua-daemon/src/pm/ua-power-plugin-handler.c
ua-plugins/include/ua-power-plugin.h

index 89597e6..fa6e2a8 100644 (file)
@@ -145,6 +145,17 @@ static void stop_presence_check_callback(uas_plugin_id_e ids)
        FUNC_EXIT;
 }
 
+static unsigned int get_avaliable_sensors_callback(void)
+{
+       unsigned int sensors;
+       FUNC_ENTRY;
+
+       sensors = _uam_pm_get_avaliable_sensors();
+
+       FUNC_EXIT;
+       return sensors;
+}
+
 int _uam_ppm_handler_init(void)
 {
        __uam_clear_ppm_reqs();
@@ -159,5 +170,6 @@ int _uam_ppm_handler_deinit(void)
 
 uap_callbacks_t power_cbs = {
        .check_presence_cb = do_presence_check_callback,
-       .stop_presence_cb = stop_presence_check_callback
+       .stop_presence_cb = stop_presence_check_callback,
+       .get_available_sensors_cb = get_avaliable_sensors_callback
 };
index 8f2a445..cb0bcbf 100644 (file)
@@ -67,10 +67,17 @@ typedef int (*do_presence_check)(uas_plugin_id_e ids, int timeout, presence_cb c
  */
 typedef void (*stop_presence_check)(uas_plugin_id_e ids);
 
+/*
+ * DIRECTION: power-plugin --> ua-manager
+ * Get available sensor list (bitmask)
+ */
+typedef unsigned int (*get_available_sensors)(void);
+
 /* Power plug-in callback structure */
 typedef struct {
        do_presence_check check_presence_cb;
        stop_presence_check stop_presence_cb;
+       get_available_sensors get_available_sensors_cb;
 } uap_callbacks_t;
 
 typedef struct {