gatt client adaptation feature changes bt-api bt-service OAL
[platform/core/connectivity/bluetooth-frwk.git] / include / bluetooth-api.h
index 7c21876..e5bbe73 100644 (file)
@@ -36,7 +36,7 @@ extern "C" {
  * @{
  */
 
-#define BLUETOOTH_ADDRESS_STRING_LENGTH                17 /**< This specifies bluetooth device address length (AA:BB:CC:DD:EE:FF) */
+#define BLUETOOTH_ADDRESS_STRING_LENGTH                18 /**< This specifies bluetooth device address length (AA:BB:CC:DD:EE:FF) */
 #define BLUETOOTH_ADDRESS_LENGTH               6 /**< This specifies bluetooth device address length */
 #define BLUETOOTH_VERSION_LENGTH_MAX           30 /**< This specifies bluetooth device version length */
 #define BLUETOOTH_INTERFACE_NAME_LENGTH                16
@@ -58,6 +58,10 @@ 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
  */
@@ -786,8 +790,15 @@ 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_CHARACTERISTIC_VALUE_CHANGED, /**<Gatt Char write callback event */
        BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
@@ -1515,8 +1526,23 @@ 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
+ */
+typedef struct {
+       int instance_id;
+       unsigned char uuid[16];
+       char address[BLUETOOTH_ADDRESS_STRING_LENGTH];
+} bt_gatt_handle_property_t;
+#endif
+
 /**
  * Structure to GATT Remote service data
  */
@@ -1527,6 +1553,9 @@ 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;
 
 /**
@@ -1565,6 +1594,12 @@ 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;
 
 /**
@@ -1576,6 +1611,13 @@ 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;
 
 /**
@@ -3614,7 +3656,6 @@ void bt_get_bonded_device(void)
 int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address,
                                        bluetooth_device_info_t *dev_info);
 
-
 /**
  * @fn int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address,
  *                                     gboolean *is_alias_set)
@@ -5549,9 +5590,19 @@ 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
 
  /**
  * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);