Handle GATT client app's termination
[platform/core/connectivity/bluetooth-frwk.git] / include / bt-internal-types.h
index 5e4418e..c055ded 100644 (file)
 
 #include "bluetooth-api.h"
 
+#define NUM_APP_MAX 30
+
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
+typedef struct {
+       time_t session_start_time;
+       time_t session_end_time;
+       uint16_t session_connected_time;
+       uint16_t session_scan_time;
+       int num_app;
+       bt_battery_app_data app_data[NUM_APP_MAX];
+} bt_battery_dbus_data_t;
+
+typedef void (*bt_adapter_disable_bm_data_cb)(bt_battery_data *data);
+
 typedef enum {
        BT_NO_SERVER,
        BT_NATIVE_SERVER,
@@ -175,6 +188,7 @@ typedef enum {
        BT_GET_RSSI,
        BT_IS_CONNECTABLE,
        BT_SET_CONNECTABLE,
+       BT_GET_CONNECTABLE,
        BT_GET_BONDED_DEVICES,
        BT_RESET_ADAPTER,
        BT_SET_ADVERTISING,
@@ -198,8 +212,6 @@ typedef enum {
        BT_REMOVE_WHITE_LIST,
        BT_CLEAR_WHITE_LIST,
        BT_REGISTER_SCAN_FILTER,
-       BT_UNREGISTER_SCAN_FILTER,
-       BT_UNREGISTER_ALL_SCAN_FILTERS,
        BT_IS_SCAN_FILTER_SUPPORTED,
        BT_GET_PROFILE_CONNECTED_DEVICES,
        BT_ENABLE_FORCE_HCI_DUMP,
@@ -313,6 +325,8 @@ typedef enum {
        BT_RFCOMM_REJECT_CONNECTION,
        BT_RFCOMM_CREATE_SOCKET_EX,
        BT_RFCOMM_REMOVE_SOCKET_EX,
+       BT_RFCOMM_SEND_RX_DETAILS,
+        BT_RFCOMM_SEND_TX_DETAILS,
        BT_PBAP_CONNECT = BT_FUNC_PBAP_BASE,
        BT_PBAP_DISCONNECT,
        BT_PBAP_GET_PHONEBOOK_SIZE,
@@ -512,6 +526,7 @@ typedef struct {
 
 #define BT_ENABLED "Enabled"
 #define BT_DISABLED "Disabled"
+#define BT_DISABLED_BATTERY_DATA "AdapterDisabledBatteryData"
 #define BT_LE_ENABLED "LeEnabled"
 #define BT_LE_DISABLED "LeDisabled"
 #define BT_DISCOVERABLE_MODE_CHANGED "DiscoverableModeChanged"
@@ -632,9 +647,11 @@ typedef struct {
 #define BT_GATT_CLIENT_WRITE_CHAR "GattWriteCharValue"
 #define BT_GATT_CLIENT_READ_DESC "GattReadDescriptor"
 #define BT_GATT_CLIENT_WRITE_DESC "GattWriteDescriptor"
+#define BT_GATT_CLIENT_SERVICE_CHANGED "GattServiceChanged"
 #endif
 
 #define BT_GATT_REQ_ATT_MTU_CHANGED "GattReqAttMtuChanged"
+#define BT_GATT_SERVER_ATT_MTU_CHANGED "GattServerAttMtuChanged"
 #define BT_GATT_CHAR_VAL_CHANGED "GattCharValueChanged"
 #ifdef GATT_NO_RELAY
 #define BT_GATT_BLUEZ_CHAR_VAL_CHANGED "GattValueChanged"
@@ -672,6 +689,8 @@ typedef struct {
 #define HEADED_PLUGIN_FILEPATH64 "/usr/lib64/bt-plugin-headed.so"
 #define FILEPATH_ARCH_64 "/usr/lib64"
 
+#define BT_FEATURE_COMMON "http://tizen.org/feature/network.bluetooth"
+
 struct bluetooth_headed_plugin_t {
        int (*bt_launch_dpmpopup) (char *mode);
        int (*bt_launch_system_popup)(int event_type,
@@ -720,6 +739,7 @@ extern bt_plugin_info_t *headed_plugin_info;
 
 /* Accessing system info */
 int system_info_get_platform_string(const char *key, char **value);
+bool system_info_get_platform_bool(const char *key, bool *value);
 
 void bluetooth_plugin_init();
 void bluetooth_plugin_deinit();
@@ -801,6 +821,15 @@ static inline tizen_model_t get_tizen_model(void)
        return model;
 }
 
+static inline bool get_tizen_feature_supported(char *feature)
+{
+       bool is_supported = false;
+
+       system_info_get_platform_bool(feature, &is_supported);
+
+       return is_supported ? true : false;
+}
+
 #define TIZEN_PROFILE_WEARABLE (get_tizen_profile() == _PROFILE_WEARABLE)
 #define TIZEN_PROFILE_IVI (get_tizen_profile() == _PROFILE_IVI)
 #define TIZEN_PROFILE_TV (get_tizen_profile() == _PROFILE_TV)
@@ -811,6 +840,7 @@ static inline tizen_model_t get_tizen_model(void)
 #define TIZEN_FEATURE_FLIGHTMODE_ENABLED (get_tizen_profile() & (_PROFILE_MOBILE | _PROFILE_WEARABLE))
 #define TIZEN_FEATURE_BT_USB_DONGLE (get_tizen_profile() & (_PROFILE_TV))
 #define TIZEN_FEATURE_BLUEZ_SPEAKER_REFERENCE ((get_tizen_model()) == _MODEL_RPI3 && (get_tizen_profile()) == _PROFILE_COMMON)
+#define TIZEN_FEATURE_BT_SUPPORTED (get_tizen_feature_supported(BT_FEATURE_COMMON) == true)
 
 #ifdef __cplusplus
 }