Fix the memory leak
[platform/core/connectivity/bluetooth-frwk.git] / include / bluetooth-api.h
index 80988d1..aa5ae3b 100644 (file)
@@ -62,9 +62,7 @@ extern "C" {
 
 #define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
 
-#ifdef TIZEN_GATT_CLIENT
 #define BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX      610 /**< GATT ATT value max len */
-#endif
 
 /**
  * This is Bluetooth Connected event role
@@ -520,8 +518,10 @@ typedef enum {
  * TDS transport Type
  */
 typedef enum {
-               BLUETOOTH_TDS_TRANSPORT_BT = 0x01,      /* Transport type BR-EDR */
-               BLUETOOTH_TDS_TRANSPORT_CUSTOM, /* Transport type custom */
+               BLUETOOTH_TDS_TRANSPORT_BT = 0x01,              /* Transport type BR-EDR */
+               BLUETOOTH_TDS_TRANSPORT_CUSTOM,                 /* Transport type custom */
+               BLUETOOTH_TDS_TRANSPORT_WIFI_NAN,               /* Wi-Fi Alliance Neighbor Awareness Networking */
+               BLUETOOTH_TDS_TRANSPORT_WIFI_SVC_ADV,   /* Wi-Fi Alliance Service Advertisement */
                /* ... */
                BLUETOOTH_TDS_TRANSPORT_INVALID
 } bluetooth_tds_transport_t;
@@ -608,8 +608,8 @@ typedef struct {
 * Advertising parameters
 */
 typedef struct {
-       float interval_min;
-       float interval_max;
+       int interval_min;
+       int interval_max;
        guint8 filter_policy;
        guint8 type;
        int tx_power_level;
@@ -837,15 +837,10 @@ typedef enum {
        BLUETOOTH_EVENT_GATT_READ_DESC, /**<Gatt Read Characteristic Descriptor Value */
        BLUETOOTH_EVENT_GATT_WRITE_DESC, /**<Gatt Write Characteristic Descriptor Value */
        BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**<Gatt Char Descriptors Discovered Event*/
-#ifdef TIZEN_GATT_CLIENT
        BLUETOOTH_EVENT_GATT_SERVER_CONNECTED,/**<Local Gatt Server connected event */
        BLUETOOTH_EVENT_GATT_SERVER_DISCONNECTED, /**<Local Gatt Server Disconnected event */
        BLUETOOTH_EVENT_GATT_CLIENT_CONNECTED,/**<Local Gatt Client connected event */
        BLUETOOTH_EVENT_GATT_CLIENT_DISCONNECTED, /**<Local Gatt Client Disconnected event */
-#else
-       BLUETOOTH_EVENT_GATT_CONNECTED,/**<Gatt connected event */
-       BLUETOOTH_EVENT_GATT_DISCONNECTED, /**<Gatt Disconnected event */
-#endif
        BLUETOOTH_EVENT_GATT_ATT_MTU_CHANGED, /**<Attribute protocol MTU changed event */
        BLUETOOTH_EVENT_GATT_SERVER_ATT_MTU_CHANGED, /**<Attribute protocol Server MTU changed event */
        BLUETOOTH_EVENT_GATT_SERVER_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
@@ -1236,6 +1231,7 @@ typedef enum {
        BLUETOOTH_LE_SCAN_FILTER_FEATURE_DEVICE_NAME = 0x10,                    /**< device name */
        BLUETOOTH_LE_SCAN_FILTER_FEATURE_MANUFACTURER_DATA = 0x20,              /**< manufacturer data */
        BLUETOOTH_LE_SCAN_FILTER_FEATURE_SERVICE_DATA = 0x40,                   /**< service data */
+       BLUETOOTH_LE_SCAN_FILTER_FEATURE_RSSI_HIGH_THRESHOLD = 0x80,                    /**< rssi high threshold */
 } bluetooth_le_scan_filter_feature_t;
 
 /**
@@ -1295,6 +1291,7 @@ typedef struct {
        int manufacturer_id;                                            /**< manufacturer ID */
        bluetooth_le_advertising_data_t manufacturer_data;              /**< manufacturer data */
        bluetooth_le_advertising_data_t manufacturer_data_mask;         /**< manufacturer data mask */
+       int rssi_high_threshold;                                                        /**< rssi high threshold */
 } bluetooth_le_scan_filter_t;
 
 typedef struct {
@@ -1599,13 +1596,10 @@ typedef struct {
 typedef struct {
        int count;
        char **handle;
-#ifdef TIZEN_GATT_CLIENT
        char uuids[BLUETOOTH_MAX_SERVICES_FOR_DEVICE][BLUETOOTH_UUID_STRING_MAX];
        int inst_id[BLUETOOTH_MAX_SERVICES_FOR_DEVICE];
-#endif
 } bt_gatt_handle_info_t;
 
-#ifdef TIZEN_GATT_CLIENT
 /**
  * Structure to a most basic GATT attribute handle data
  */
@@ -1614,7 +1608,6 @@ typedef struct {
        unsigned char uuid[16];
        char address[BLUETOOTH_ADDRESS_STRING_LENGTH];
 } bt_gatt_handle_property_t;
-#endif
 
 /**
  * Structure to GATT Remote service data
@@ -1626,9 +1619,7 @@ typedef struct {
        gboolean primary;
        bt_gatt_handle_info_t include_handles;
        bt_gatt_handle_info_t char_handle;
-#ifdef TIZEN_GATT_CLIENT
        bt_gatt_handle_property_t prop; /* Added Service UUID, instance_id & associated remote device  */
-#endif
 } bt_gatt_service_property_t;
 
 /**
@@ -1667,12 +1658,10 @@ typedef struct {
        unsigned int permission;
        char *representation;
        bt_gatt_handle_info_t char_desc_handle;
-#ifdef TIZEN_GATT_CLIENT
        bt_gatt_handle_property_t prop;      /* Added Char UUID, instance_id */
        bt_gatt_handle_property_t svc_prop;  /* Added Service UUID, instance_id */
        char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX]; /* Added */
        char address[BLUETOOTH_ADDRESS_STRING_LENGTH];         /* Added */
-#endif
 } bt_gatt_char_property_t;
 
 /**
@@ -1684,13 +1673,11 @@ typedef struct {
        char *uuid;
        unsigned char *val;
        unsigned int val_len;
-#ifdef TIZEN_GATT_CLIENT
        bt_gatt_handle_property_t prop;      /* Added Descriptor UUID, instance_id */
        bt_gatt_handle_property_t char_prop; /* Added Char UUID, instance_id */
        bt_gatt_handle_property_t svc_prop;  /* Added Service UUID, instance_id */
        char value[BLUETOOTH_GATT_ATT_DATA_LENGTH_MAX];/* Added */
        char address[BLUETOOTH_ADDRESS_STRING_LENGTH];          /* Added */
-#endif
 } bt_gatt_char_descriptor_property_t;
 
 /**
@@ -1739,10 +1726,8 @@ typedef struct {
        bluetooth_device_address_t device_addr;
        char *svc_path;
        bluetooth_gatt_service_change_type_t change_type;
-#ifdef TIZEN_GATT_CLIENT
        int inst_id;
        char *uuid;
-#endif
 } bt_gatt_service_change_t;
 
 /**
@@ -5694,19 +5679,11 @@ int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty);
  */
 int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty);
 
-#ifdef TIZEN_GATT_CLIENT
 int bluetooth_connect_le(const bluetooth_device_address_t *device_address,
                                gboolean auto_connect, int client_id);
-#else
-int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect);
-#endif
 
-#ifdef TIZEN_GATT_CLIENT
 int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address,
                int client_id);
-#else
-int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address);
-#endif
 
 int bluetooth_get_gatt_data_batching_available_packets(
        int *available_packets);