[NonACR] removed redundant interface header file 40/218840/1
authorAbhishek Vijay <abhishek.v@samsung.com>
Thu, 28 Nov 2019 12:16:37 +0000 (17:46 +0530)
committerAbhishek Vijay <abhishek.v@samsung.com>
Thu, 28 Nov 2019 12:16:37 +0000 (17:46 +0530)
Change-Id: I7b339e2d2fb69825bf901a5bc00339a0dc537cbd
Signed-off-by: Abhishek Vijay <abhishek.v@samsung.com>
plugin/bm-bt-plugin/CMakeLists.txt
plugin/bm-bt-plugin/include/bm_bt_plugin.h
plugin/bm-bt-plugin/include/bm_plugin_interface.h [deleted file]
plugin/device-network/CMakeLists.txt
plugin/device-network/include/bm_plugin_interface.h [deleted file]
plugin/wifi/CMakeLists.txt
plugin/wifi/include/bm_plugin_interface.h [deleted file]

index b2a1d97..a6af43e 100644 (file)
@@ -27,6 +27,7 @@ SET(SOURCES
 )
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../common/include)
 
 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SOURCES})
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${${PROJECT_NAME}_LDFLAGS})
index 57e11b1..7df9a2f 100644 (file)
@@ -28,6 +28,9 @@
 extern "C" {
 #endif
 
+/* this code is commented as common interface file
+ * is placed in common/include directory (Abhishek)*/
+#ifdef REDUNDANT_CODE
 /*
  * alias for long data types
  */
@@ -60,6 +63,7 @@ typedef struct {
        GSList *atm_list;               /* application time map('app_time_map_st2') list for all active applications between start & stop */
        GSList *bt_data_list;           /* list of nodes of 'bm_bluetooth_st' for next consecutive sessions */
 } bm_bluetooth_st;
+#endif
 
 #ifdef __cplusplus
 }
diff --git a/plugin/bm-bt-plugin/include/bm_plugin_interface.h b/plugin/bm-bt-plugin/include/bm_plugin_interface.h
deleted file mode 100644 (file)
index 2fcae37..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef __BM_PLUGIN_INTERFACE_H__
-#define __BM_PLUGIN_INTERFACE_H__
-
-#include <stdio.h>
-#include <gmodule.h>
-#include <time.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef unsigned int   uint;
-typedef unsigned char  uchar;
-
-typedef enum {
-       BM_PLUGIN_ERROR_NONE = TIZEN_ERROR_NONE,                /**< Successful */
-       BM_PLUGIN_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA,              /**< No data */
-       BM_PLUGIN_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,  /**< Invalid parameter */
-       BM_PLUGIN_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,      /**< Out of memory */
-       BM_PLUGIN_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED,      /**< Not supported */
-       BM_PLUGIN_ERROR_SERVICE_UNAVAILABLE = TIZEN_ERROR_UNKNOWN - 1       /**< Service unavailable */
- } bm_plugin_error_e;
-
-/*
-* enum for plugin identifier
-*/
-typedef enum {
-       BM_PLUGIN_ID_BLE = 0,
-       BM_PLUGIN_ID_WIFI,
-       BM_PLUGIN_ID_CPU,
-       BM_PLUGIN_ID_DISPLAY,
-       BM_PLUGIN_ID_DEVICE_NETWORK,
-       BM_PLUGIN_ID_GPS_SENSOR,
-       BM_PLUGIN_ID_HRM_SENSOR,
-       BM_PLUGIN_ID_BATTERY,
-       BM_PLUGIN_ID_MAX
-} bm_plugin_id_e;
-
-/*
- * enum for feature data type
- */
-typedef enum {
-       BM_DATA_TYPE_BLE = 0,
-       BM_DATA_TYPE_WIFI,
-       BM_DATA_TYPE_CPU,
-       BM_DATA_TYPE_DISPLAY,
-       BM_DATA_TYPE_DEVICE_NETWORK,
-       BM_DATA_TYPE_GPS_SENSOR,
-       BM_DATA_TYPE_HRM_SENSOR,
-       BM_DATA_TYPE_BATTERY,
-       BM_DATA_TYPE_MAX
-} bm_plugin_data_type_e;
-
-/*
- * common structure for application time map.
- */
-struct {
-       char *app_id;           /* application id */
-       uint time;              /* total duration for which application as active */
-} app_time_map_st1;
-
-#ifdef ALREADY_INCLUDED_IN_PLUGIN_HEADER
-struct {
-       char *app_id;           /* application id */
-       uint time;              /* total duration for which application as active */
-       uint rx;                /* Total Bytes received by the application during runtime */
-       uint tx;                /* Total Bytes transmitted by the application during runtime */
-} app_time_map_st2;
-#endif
-
-/*
- * structure for "display" feature data.
- */
-typedef struct {
-       uint high;                      /* total time in milliseconds during which brightness intensity was high */
-       uint low;                       /* total time in milliseconds during which brightness intensity was low */
-       uint med;                       /* total time in milliseconds during which brightness intensity was medium */
-       time_t start;                   /* start time of feature data collection session */
-       time_t stop;                    /* stop time of feature data collection session */
-       GSList *atm_list;               /* application time map('app_time_map_st1') list for all active applications between start & stop */
-       GSList *display_list;           /* list of nodes of 'bm_display_st' for next consecutive sessions */
-} bm_display_st;
-
-/*
- * structure for "cpu" feature data.
- */
-typedef struct {
-       uint cpuTicks;                  /* CPU Usage during the session */
-       uint cpuTimeBackground;         /* Time spent in Background State average operating frequency will be used to calculate the power */
-       uint cpuTimeForeground;         /* Time spent in Foreground state average operating frequency will be used to calculate the power */
-       GSList *atm_list;               /* application time map('app_time_map_st1') list for all active applications between start & stop */
-       GSList *cpu_data_list;          /* list of nodes of 'bm_cpu_st' for next consecutive sessions */
-} bm_cpu_st;
-
-/*
- * structure for "device_network" feature data.
- */
-typedef struct {
-       uint time_level_0;              /* Total time in milliseconds during which signal_strength was on level 0 */
-       uint time_level_1;              /* Total time in milliseconds during which signal_strength was on level 1 */
-       uint time_level_2;              /* Total time in milliseconds during which signal_strength was on level 2 */
-       uint time_level_3;              /* Total time in milliseconds during which signal_strength was on level 3 */
-       uint time_level_4;              /* Total time in milliseconds during which signal_strength was on level 4 */
-       uint time_level_5;              /* Total time in milliseconds during which signal_strength was on level 5 */
-       uint time_level_6;              /* Total time in milliseconds during which signal_strength was on level 6 */
-       GSList *atm_list;               /* application time map('app_time_map_st2') list for all active applications between start & stop */
-       GSList *dn_data_list;           /* list of nodes of 'bm_device_network_st' for next consecutive sessions */
-} bm_device_network_st;
-
-/*
- * structure for "Wi-Fi" feature data.
- */
-typedef struct {
-       uint time_level_0;              /* Total time in milliseconds during which rssi was on level 0 */
-       uint time_level_1;              /* Total time in milliseconds during which rssi was on level 1 */
-       uint time_level_2;              /* Total time in milliseconds during which rssi was on level 2 */
-       uint time_level_3;              /* Total time in milliseconds during which rssi was on level 3 */
-       uint time_level_4;              /* Total time in milliseconds during which rssi was on level 4 */
-       time_t startTime;               /* start time of feature data collection session */
-       time_t endTime;                 /* end time of feature data collection session */
-       uint scanTime;                  /* Total time spent by the resource in (scan) mode during the session */
-       GSList *atm_list;               /* application time map('app_time_map_st2') list for all active applications between start & stop */
-       GSList *wifi_data_list;         /* list of nodes of 'bm_wifi_st' for next consecutive sessions */
-} bm_wifi_st;
-
-#ifdef ALREADY_INCLUDED_IN_PLUGIN_HEADER
-/*
- * structure for "bluetooth" feature data.
- */
-typedef struct {
-       uint scanTime;                  /* Total time spent by the resource in (scan) mode during the session */
-       uint connectedTime;             /* Total time spent by the resource in (connected) mode during the session */
-       time_t startTime;               /* start time of feature data collection session */
-       time_t stopTime;                /* stop time of feature data collection session */
-       GSList *atm_list;               /* application time map('app_time_map_st2') list for all active applications between start & stop */
-       GSList *bt_data_list;           /* list of nodes of 'bm_bluetooth_st' for next consecutive sessions */
-} bm_bluetooth_st;
-#endif
-
-/*
- * structure for "gps" feature data.
- */
-typedef struct {
-       time_t connStartTime;           /* start time of feature data collection session */
-       time_t connStopTime;            /* stop time of feature data collection session */
-       GSList *atm_list;               /* application time map('app_time_map_st1') list for all active applications between start & stop */
-       GSList *gps_data_list;          /* list of nodes of 'bm_gps_st' for next consecutive sessions */
-} bm_gps_st;
-
-/*
- * structure for "hrm-sensor" feature data.
- */
-typedef struct {
-       uint sensor_hub_wakeup_time;    /* wake-up time of sensor-hub */
-       uint sensor_hub_wakeup_count;   /* wake-up count of sensor-hub */
-       uint sensor_wakeup_time;        /* sensor wake-up time */
-       uint sensor_wakeup_count;       /* sensor wake-up count */
-       GSList *atm_list;               /* application time map('app_time_map_st1') list for all active applications between start & stop */
-       GSList *hrm_data_list;          /* list of nodes of 'bm_hrm_sensor_st' for next consecutive sessions */
-} bm_hrm_sensor_st;
-
-/*
- * structure for "battery" feature data.
- */
-typedef struct {
-       uint battery_percent;           /* Battery percent */
-       uint is_charging;               /* State of charging */
-} bm_battery_st;
-
-/* ========================================================================== */
-
-/*
- * battery-monitor data handle
- */
-typedef void *bm_data_h;
-
-/*
- * structure for plugin API's
- */
-typedef struct {
-       /*
-       * [Sync API] To initialize plugin
-       */
-       int (*init)(void);
-       /*
-       * [Sync API] To deinitialize plugin
-       */
-       int (*deinit)(void);
-       /*
-       * [Sync API] To get feature data from plugin
-       *
-       * [Param] pid - process-id for which feature data with respect
-       *       to battery consumption is provided.
-       *
-       * [Param] handle - battery-monitor data handle through which plugin
-       *       will provide data to the manager. This handle will be passed
-       *       as reference, plugin will assign a valid object which will be
-       *       set free by the manager; battery-monitor manager will typecast
-       *       the object provided through handle for each plugin and will use
-       *       it for further calculation.
-       *
-       * [Param] data_type - type of data like - BLE, Wi-Fi, CPU etc.
-       */
-       int (*get_feature_data)(bm_data_h *handle, bm_plugin_data_type_e data_type);
-} bm_api_st;
-
-/*
- * structure for plugin information
- */
-typedef struct {
-       /*
-       * Respective "identifier" of Plugin
-       */
-       int id;
-       /*
-       * Respective "name" of Plugin
-       */
-       const char *name;
-       /*
-       * Respective "author" of Plugin
-       */
-       const char *author;
-       /*
-       * Respective "version" of Plugin
-       */
-       const char *version;
-       /*
-       * Plugin init function
-       */
-       int (*init)(bm_api_st **api);
-       /*
-       * Plugin de-init function
-       */
-       int (*deinit)(void);
-} bm_plugin_st;
-
-#ifdef ADDED_FOR_ANY_FUTURE_NEEDS //for future needs
-/*
- * Callback to be invoked for any future needs
- *
- * [Param] status - Operation status Success/Fail
- */
-typedef void (*bm_bt_plugin_cb)(int status);
-
-/*
- * battery-monitor callback structure(for future)
- */
-typedef struct {
-       void (*bm_bt_plugin_cb)(int status);
-} bm_callbacks_st;
-#endif
-
-/*
- *  macro for adding plugin
- */
-#define BM_PLUGIN_ADD(id, name, author, version, init, deinit) \
-       __attribute__ ((visibility("default"))) bm_plugin_st bm_plugin = { id, name, author, version, init, deinit };
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __BM_PLUGIN_INTERFACE_H__ */
index bb87763..d754435 100644 (file)
@@ -25,6 +25,7 @@ SET(SOURCES
 )
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../common/include)
 
 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SOURCES})
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${${PROJECT_NAME}_LDFLAGS})
diff --git a/plugin/device-network/include/bm_plugin_interface.h b/plugin/device-network/include/bm_plugin_interface.h
deleted file mode 100755 (executable)
index fbd067d..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef __BM_PLUGIN_INTERFACE_H__
-#define __BM_PLUGIN_INTERFACE_H__
-
-#include <stdio.h>
-#include <gmodule.h>
-#include <time.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef unsigned int   uint;
-typedef unsigned char  uchar;
-
-#define BM_DATA_TYPE_MAX (BM_DATA_TYPE_BATTERY + 1)
-#define BM_PLUGIN_ID_MAX (BM_PLUGIN_ID_BATTERY + 1)
-#define BM_DURATION_TYPE_MAX (BM_DURATION_TYPE_1WEEK + 1)
-
-typedef enum {
-       BM_PLUGIN_ERROR_NONE = TIZEN_ERROR_NONE,                                /**< Successful */
-       BM_PLUGIN_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA,                          /**< No data */
-       BM_PLUGIN_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,      /**< Invalid parameter */
-       BM_PLUGIN_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,              /**< Out of memory */
-       BM_PLUGIN_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED,              /**< Not supported */
-       BM_PLUGIN_ERROR_SERVICE_UNAVAILABLE = TIZEN_ERROR_UNKNOWN - 1           /**< Service unavailable */
-} bm_plugin_error_e;
-
-/*
- * enum for plugin identifier
- */
-typedef enum {
-       BM_PLUGIN_ID_BLE=0,             /**< Bluetooth Low Energy */
-       BM_PLUGIN_ID_WIFI,              /**< Wi-Fi */
-       BM_PLUGIN_ID_CPU,               /**< CPU */
-       BM_PLUGIN_ID_DISPLAY,           /**< Display */
-       BM_PLUGIN_ID_DEVICE_NETWORK,    /**< Network */
-       BM_PLUGIN_ID_GPS_SENSOR,        /**< GPS */
-       BM_PLUGIN_ID_HRM_SENSOR,        /**< Heart Rate Monitor */
-       BM_PLUGIN_ID_BATTERY            /**< Battery */
-} bm_plugin_id_e;
-
-/*
- * enum for feature data collection period
- */
-typedef enum {
-       BM_DURATION_TYPE_1DAY = 0,      /**< Set the period from a day ago to now */
-       BM_DURATION_TYPE_1WEEK          /**< Set the period from a week ago to now */
-} bm_duration_type_e;
-
-/*
- * enum for feature data type
- */
-typedef enum {
-       BM_DATA_TYPE_BLE=0,             /**< Bluetooth Low Energy */
-       BM_DATA_TYPE_WIFI,              /**< Wi-Fi */
-       BM_DATA_TYPE_CPU,               /**< CPU */
-       BM_DATA_TYPE_DISPLAY,           /**< Display */
-       BM_DATA_TYPE_DEVICE_NETWORK,    /**< Network */
-       BM_DATA_TYPE_GPS_SENSOR,        /**< GPS */
-       BM_DATA_TYPE_HRM_SENSOR,        /**< Heart Rate Monitor */
-       BM_DATA_TYPE_BATTERY            /**< Battery */
-} bm_plugin_data_type_e;
-
-/*
- * common structure for application time map.
- */
-typedef struct {
-       char *app_id;           /**< application id */
-       uint time;              /**< total duration for which application as active */
-} app_time_map_st1;
-
-typedef struct {
-       char *app_id;           /**< application id */
-       uint time;              /**< total duration for which application as active */
-       uint rx;                /**< Total Bytes received by the application during runtime */
-       uint tx;                /**< Total Bytes transmitted by the application during runtime */
-} app_time_map_st2;
-
-/*
- * structure for "display" feature data.
- */
-typedef struct {
-       uint high;                      /**< total time in milliseconds during which brightness intensity was high */
-       uint low;                       /**< total time in milliseconds during which brightness intensity was low */
-       uint med;                       /**< total time in milliseconds during which brightness intensity was medium */
-       time_t start;                   /**< start time of feature data collection session */
-       time_t stop;                    /**< stop time of feature data collection session */
-       GSList *atm_list;               /**< application time map('app_time_map_st1') list for all active applications between start & stop */
-       GSList *display_list;           /**< list of nodes of 'bm_display_st' for next consecutive sessions */
-} bm_display_st;
-
-/*
- * structure for "cpu" feature data.
- */
-typedef struct {
-       uint cpuTicks;                  /**< CPU Usage during the session */
-       uint cpuTimeBackground;         /**< Time spent in Background State average operating frequency will be used to calculate the power */
-       uint cpuTimeForeground;         /**< Time spent in Foreground state average operating frequency will be used to calculate the power */
-       GSList *atm_list;               /**< application time map('app_time_map_st1') list for all active applications between start & stop */
-       GSList *cpu_data_list;          /**< list of nodes of 'bm_cpu_st' for next consecutive sessions */
-} bm_cpu_st;
-
-/*
- * structure for "device_network" feature data.
- */
-typedef struct {
-       uint time_level_0;              /**< Total time in milliseconds during which signal_strength was on level 0 */
-       uint time_level_1;              /**< Total time in milliseconds during which signal_strength was on level 1 */
-       uint time_level_2;              /**< Total time in milliseconds during which signal_strength was on level 2 */
-       uint time_level_3;              /**< Total time in milliseconds during which signal_strength was on level 3 */
-       uint time_level_4;              /**< Total time in milliseconds during which signal_strength was on level 4 */
-       uint time_level_5;              /**< Total time in milliseconds during which signal_strength was on level 5 */
-       uint time_level_6;              /**< Total time in milliseconds during which signal_strength was on level 6 */
-       GSList *atm_list;               /**< application time map('app_time_map_st2') list for all active applications between start & stop */
-       GSList *dn_data_list;           /**< list of nodes of 'bm_device_network_st' for next consecutive sessions */
-} bm_device_network_st;
-
-/*
- * structure for "Wi-Fi" feature data.
- */
-typedef struct {
-       uint time_level_0;              /**< Total time in milliseconds during which rssi was on level 0 */
-       uint time_level_1;              /**< Total time in milliseconds during which rssi was on level 1 */
-       uint time_level_2;              /**< Total time in milliseconds during which rssi was on level 2 */
-       uint time_level_3;              /**< Total time in milliseconds during which rssi was on level 3 */
-       uint time_level_4;              /**< Total time in milliseconds during which rssi was on level 4 */
-       time_t startTime;               /**< start time of feature data collection session */
-       time_t endTime;                 /**< end time of feature data collection session */
-       uint scanTime;                  /**< Total time spent by the resource in (scan) mode during the session */
-       GSList *atm_list;               /**< application time map('app_time_map_st2') list for all active applications between start & stop */
-       GSList *wifi_data_list;         /**< list of nodes of 'bm_wifi_st' for next consecutive sessions */
-} bm_wifi_st;
-
-/*
- * structure for "bluetooth" feature data.
- */
-typedef struct {
-       uint scanTime;                  /**< Total time spent by the resource in (scan) mode during the session */
-       uint connectedTime;             /**< Total time spent by the resource in (connected) mode during the session */
-       time_t startTime;               /**< start time of feature data collection session */
-       time_t stopTime;                /**< stop time of feature data collection session */
-       GSList *atm_list;               /**< application time map('app_time_map_st2') list for all active applications between start & stop */
-       GSList *bt_data_list;           /**< list of nodes of 'bm_bluetooth_st' for next consecutive sessions */
-} bm_bluetooth_st;
-
-/*
- * structure for "gps" feature data.
- */
-typedef struct {
-       time_t connStartTime;           /**< start time of feature data collection session */
-       time_t connStopTime;            /**< stop time of feature data collection session */
-       GSList *atm_list;               /**< application time map('app_time_map_st1') list for all active applications between start & stop */
-       GSList *gps_data_list;          /**< list of nodes of 'bm_gps_st' for next consecutive sessions */
-} bm_gps_st;
-
-/*
- * structure for "hrm-sensor" feature data.
- */
-typedef struct {
-       uint sensor_hub_wakeup_time;    /**< wake-up time of sensor-hub */
-       uint sensor_hub_wakeup_count;   /**< wake-up count of sensor-hub */
-       uint sensor_wakeup_time;        /**< sensor wake-up time */
-       uint sensor_wakeup_count;       /**< sensor wake-up count */
-       GSList *atm_list;               /**< application time map('app_time_map_st1') list for all active applications between start & stop */
-       GSList *hrm_data_list;          /**< list of nodes of 'bm_hrm_sensor_st' for next consecutive sessions */
-} bm_hrm_sensor_st;
-
-/*
- * structure for "battery" feature data.
- */
-typedef struct {
-       uint battery_percent;           /**< Battery percent */
-       uint is_charging;               /**< State of charging */
-} bm_battery_st;
-
-/* ========================================================================== */
-
-/*
- * battery-monitor data handle
- */
-typedef void *bm_data_h;
-
-/*
- * Callback to be invoked when service is going OFF
- *
- * [Param] handle - handle through which service will provide data
- *        to battery-monitor service daemon.
- *
- * [Param] result - the result of callback operation
- */
-typedef void (*bm_data_callback)(bm_plugin_error_e result, bm_data_h *handle);
-
-/*
- * battery-monitor callback structure
- */
-typedef struct {
-       bm_data_callback provide_feature_data;
-} bm_callbacks_st;
-
-/*
- * structure for plugin API's
- */
-typedef struct {
-       /*
-       * [Sync API] To initialize plugin
-       */
-       int (*init)(const bm_callbacks_st *callbacks);
-       /*
-       * [Sync API] To deinitialize plugin
-       */
-       int (*deinit)(void);
-       /*
-       * [Sync API] To get feature data from plugin
-       *
-       * [Param] handle - battery-monitor data handle through which plugin
-       *       will provide data to the manager. This handle will be passed
-       *       as reference, plugin will assign a valid object which will be
-       *       set free by the manager; battery-monitor manager will typecast
-       *       the object provided through handle for each plugin and will use
-       *       it for further calculation.
-       *
-       * [Param] data_type - type of data like - BLE, WiFi, CPU etc.
-       */
-       int (*get_feature_data)(bm_data_h *handle, bm_plugin_data_type_e data_type);
-} bm_api_st;
-
-/*
- * structure for plugin information
- */
-typedef struct {
-       /*
-       * Respective "identifier" of Plugin
-       */
-       int id;
-       /*
-       * Respective "name" of Plugin
-       */
-       const char *name;
-       /*
-       * Respective "author" of Plugin
-       */
-       const char *author;
-       /*
-       * Respective "version" of Plugin
-       */
-       const char *version;
-       /*
-       * Plugin init function
-       */
-       int (*init)(bm_api_st **api);
-       /*
-       * Plugin de-init function
-       */
-       int (*deinit)(void);
-} bm_plugin_st;
-
-
-/*
- *  macro for adding plugin
- */
-#define BM_PLUGIN_ADD(id, name, author, version, init, deinit) \
-               __attribute__ ((visibility("default"))) bm_plugin_st bm_plugin = \
-               { id, name, author, version, init, deinit };
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __BM_PLUGIN_INTERFACE_H__ */
index b22632e..b61b6d6 100644 (file)
@@ -25,6 +25,7 @@ SET(SOURCES
 )
 
 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../common/include)
 
 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SOURCES})
 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${${PROJECT_NAME}_LDFLAGS})
diff --git a/plugin/wifi/include/bm_plugin_interface.h b/plugin/wifi/include/bm_plugin_interface.h
deleted file mode 100755 (executable)
index fbd067d..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-#ifndef __BM_PLUGIN_INTERFACE_H__
-#define __BM_PLUGIN_INTERFACE_H__
-
-#include <stdio.h>
-#include <gmodule.h>
-#include <time.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef unsigned int   uint;
-typedef unsigned char  uchar;
-
-#define BM_DATA_TYPE_MAX (BM_DATA_TYPE_BATTERY + 1)
-#define BM_PLUGIN_ID_MAX (BM_PLUGIN_ID_BATTERY + 1)
-#define BM_DURATION_TYPE_MAX (BM_DURATION_TYPE_1WEEK + 1)
-
-typedef enum {
-       BM_PLUGIN_ERROR_NONE = TIZEN_ERROR_NONE,                                /**< Successful */
-       BM_PLUGIN_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA,                          /**< No data */
-       BM_PLUGIN_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,      /**< Invalid parameter */
-       BM_PLUGIN_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,              /**< Out of memory */
-       BM_PLUGIN_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED,              /**< Not supported */
-       BM_PLUGIN_ERROR_SERVICE_UNAVAILABLE = TIZEN_ERROR_UNKNOWN - 1           /**< Service unavailable */
-} bm_plugin_error_e;
-
-/*
- * enum for plugin identifier
- */
-typedef enum {
-       BM_PLUGIN_ID_BLE=0,             /**< Bluetooth Low Energy */
-       BM_PLUGIN_ID_WIFI,              /**< Wi-Fi */
-       BM_PLUGIN_ID_CPU,               /**< CPU */
-       BM_PLUGIN_ID_DISPLAY,           /**< Display */
-       BM_PLUGIN_ID_DEVICE_NETWORK,    /**< Network */
-       BM_PLUGIN_ID_GPS_SENSOR,        /**< GPS */
-       BM_PLUGIN_ID_HRM_SENSOR,        /**< Heart Rate Monitor */
-       BM_PLUGIN_ID_BATTERY            /**< Battery */
-} bm_plugin_id_e;
-
-/*
- * enum for feature data collection period
- */
-typedef enum {
-       BM_DURATION_TYPE_1DAY = 0,      /**< Set the period from a day ago to now */
-       BM_DURATION_TYPE_1WEEK          /**< Set the period from a week ago to now */
-} bm_duration_type_e;
-
-/*
- * enum for feature data type
- */
-typedef enum {
-       BM_DATA_TYPE_BLE=0,             /**< Bluetooth Low Energy */
-       BM_DATA_TYPE_WIFI,              /**< Wi-Fi */
-       BM_DATA_TYPE_CPU,               /**< CPU */
-       BM_DATA_TYPE_DISPLAY,           /**< Display */
-       BM_DATA_TYPE_DEVICE_NETWORK,    /**< Network */
-       BM_DATA_TYPE_GPS_SENSOR,        /**< GPS */
-       BM_DATA_TYPE_HRM_SENSOR,        /**< Heart Rate Monitor */
-       BM_DATA_TYPE_BATTERY            /**< Battery */
-} bm_plugin_data_type_e;
-
-/*
- * common structure for application time map.
- */
-typedef struct {
-       char *app_id;           /**< application id */
-       uint time;              /**< total duration for which application as active */
-} app_time_map_st1;
-
-typedef struct {
-       char *app_id;           /**< application id */
-       uint time;              /**< total duration for which application as active */
-       uint rx;                /**< Total Bytes received by the application during runtime */
-       uint tx;                /**< Total Bytes transmitted by the application during runtime */
-} app_time_map_st2;
-
-/*
- * structure for "display" feature data.
- */
-typedef struct {
-       uint high;                      /**< total time in milliseconds during which brightness intensity was high */
-       uint low;                       /**< total time in milliseconds during which brightness intensity was low */
-       uint med;                       /**< total time in milliseconds during which brightness intensity was medium */
-       time_t start;                   /**< start time of feature data collection session */
-       time_t stop;                    /**< stop time of feature data collection session */
-       GSList *atm_list;               /**< application time map('app_time_map_st1') list for all active applications between start & stop */
-       GSList *display_list;           /**< list of nodes of 'bm_display_st' for next consecutive sessions */
-} bm_display_st;
-
-/*
- * structure for "cpu" feature data.
- */
-typedef struct {
-       uint cpuTicks;                  /**< CPU Usage during the session */
-       uint cpuTimeBackground;         /**< Time spent in Background State average operating frequency will be used to calculate the power */
-       uint cpuTimeForeground;         /**< Time spent in Foreground state average operating frequency will be used to calculate the power */
-       GSList *atm_list;               /**< application time map('app_time_map_st1') list for all active applications between start & stop */
-       GSList *cpu_data_list;          /**< list of nodes of 'bm_cpu_st' for next consecutive sessions */
-} bm_cpu_st;
-
-/*
- * structure for "device_network" feature data.
- */
-typedef struct {
-       uint time_level_0;              /**< Total time in milliseconds during which signal_strength was on level 0 */
-       uint time_level_1;              /**< Total time in milliseconds during which signal_strength was on level 1 */
-       uint time_level_2;              /**< Total time in milliseconds during which signal_strength was on level 2 */
-       uint time_level_3;              /**< Total time in milliseconds during which signal_strength was on level 3 */
-       uint time_level_4;              /**< Total time in milliseconds during which signal_strength was on level 4 */
-       uint time_level_5;              /**< Total time in milliseconds during which signal_strength was on level 5 */
-       uint time_level_6;              /**< Total time in milliseconds during which signal_strength was on level 6 */
-       GSList *atm_list;               /**< application time map('app_time_map_st2') list for all active applications between start & stop */
-       GSList *dn_data_list;           /**< list of nodes of 'bm_device_network_st' for next consecutive sessions */
-} bm_device_network_st;
-
-/*
- * structure for "Wi-Fi" feature data.
- */
-typedef struct {
-       uint time_level_0;              /**< Total time in milliseconds during which rssi was on level 0 */
-       uint time_level_1;              /**< Total time in milliseconds during which rssi was on level 1 */
-       uint time_level_2;              /**< Total time in milliseconds during which rssi was on level 2 */
-       uint time_level_3;              /**< Total time in milliseconds during which rssi was on level 3 */
-       uint time_level_4;              /**< Total time in milliseconds during which rssi was on level 4 */
-       time_t startTime;               /**< start time of feature data collection session */
-       time_t endTime;                 /**< end time of feature data collection session */
-       uint scanTime;                  /**< Total time spent by the resource in (scan) mode during the session */
-       GSList *atm_list;               /**< application time map('app_time_map_st2') list for all active applications between start & stop */
-       GSList *wifi_data_list;         /**< list of nodes of 'bm_wifi_st' for next consecutive sessions */
-} bm_wifi_st;
-
-/*
- * structure for "bluetooth" feature data.
- */
-typedef struct {
-       uint scanTime;                  /**< Total time spent by the resource in (scan) mode during the session */
-       uint connectedTime;             /**< Total time spent by the resource in (connected) mode during the session */
-       time_t startTime;               /**< start time of feature data collection session */
-       time_t stopTime;                /**< stop time of feature data collection session */
-       GSList *atm_list;               /**< application time map('app_time_map_st2') list for all active applications between start & stop */
-       GSList *bt_data_list;           /**< list of nodes of 'bm_bluetooth_st' for next consecutive sessions */
-} bm_bluetooth_st;
-
-/*
- * structure for "gps" feature data.
- */
-typedef struct {
-       time_t connStartTime;           /**< start time of feature data collection session */
-       time_t connStopTime;            /**< stop time of feature data collection session */
-       GSList *atm_list;               /**< application time map('app_time_map_st1') list for all active applications between start & stop */
-       GSList *gps_data_list;          /**< list of nodes of 'bm_gps_st' for next consecutive sessions */
-} bm_gps_st;
-
-/*
- * structure for "hrm-sensor" feature data.
- */
-typedef struct {
-       uint sensor_hub_wakeup_time;    /**< wake-up time of sensor-hub */
-       uint sensor_hub_wakeup_count;   /**< wake-up count of sensor-hub */
-       uint sensor_wakeup_time;        /**< sensor wake-up time */
-       uint sensor_wakeup_count;       /**< sensor wake-up count */
-       GSList *atm_list;               /**< application time map('app_time_map_st1') list for all active applications between start & stop */
-       GSList *hrm_data_list;          /**< list of nodes of 'bm_hrm_sensor_st' for next consecutive sessions */
-} bm_hrm_sensor_st;
-
-/*
- * structure for "battery" feature data.
- */
-typedef struct {
-       uint battery_percent;           /**< Battery percent */
-       uint is_charging;               /**< State of charging */
-} bm_battery_st;
-
-/* ========================================================================== */
-
-/*
- * battery-monitor data handle
- */
-typedef void *bm_data_h;
-
-/*
- * Callback to be invoked when service is going OFF
- *
- * [Param] handle - handle through which service will provide data
- *        to battery-monitor service daemon.
- *
- * [Param] result - the result of callback operation
- */
-typedef void (*bm_data_callback)(bm_plugin_error_e result, bm_data_h *handle);
-
-/*
- * battery-monitor callback structure
- */
-typedef struct {
-       bm_data_callback provide_feature_data;
-} bm_callbacks_st;
-
-/*
- * structure for plugin API's
- */
-typedef struct {
-       /*
-       * [Sync API] To initialize plugin
-       */
-       int (*init)(const bm_callbacks_st *callbacks);
-       /*
-       * [Sync API] To deinitialize plugin
-       */
-       int (*deinit)(void);
-       /*
-       * [Sync API] To get feature data from plugin
-       *
-       * [Param] handle - battery-monitor data handle through which plugin
-       *       will provide data to the manager. This handle will be passed
-       *       as reference, plugin will assign a valid object which will be
-       *       set free by the manager; battery-monitor manager will typecast
-       *       the object provided through handle for each plugin and will use
-       *       it for further calculation.
-       *
-       * [Param] data_type - type of data like - BLE, WiFi, CPU etc.
-       */
-       int (*get_feature_data)(bm_data_h *handle, bm_plugin_data_type_e data_type);
-} bm_api_st;
-
-/*
- * structure for plugin information
- */
-typedef struct {
-       /*
-       * Respective "identifier" of Plugin
-       */
-       int id;
-       /*
-       * Respective "name" of Plugin
-       */
-       const char *name;
-       /*
-       * Respective "author" of Plugin
-       */
-       const char *author;
-       /*
-       * Respective "version" of Plugin
-       */
-       const char *version;
-       /*
-       * Plugin init function
-       */
-       int (*init)(bm_api_st **api);
-       /*
-       * Plugin de-init function
-       */
-       int (*deinit)(void);
-} bm_plugin_st;
-
-
-/*
- *  macro for adding plugin
- */
-#define BM_PLUGIN_ADD(id, name, author, version, init, deinit) \
-               __attribute__ ((visibility("default"))) bm_plugin_st bm_plugin = \
-               { id, name, author, version, init, deinit };
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __BM_PLUGIN_INTERFACE_H__ */