Add HFP HF API : bt_hf_request_call_status_info_list()
[platform/core/connectivity/bluetooth-frwk.git] / include / bluetooth-api.h
index 2b43f87..8286f5c 100644 (file)
@@ -184,6 +184,10 @@ extern "C" {
 
 #define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION    ((int)BLUETOOTH_ERROR_BASE - 0x28)
                                                                /**< Device Policy Restricted */
+
+#define BLUETOOTH_ERROR_NO_DATA    ((int)BLUETOOTH_ERROR_BASE - 0x29)
+                                                               /**< No data */
+
 /**
 * Error codes for ATT Error response *
 */
@@ -207,17 +211,18 @@ extern "C" {
 #define BLUETOOTH_ATT_ERROR_UNSUPPORTED_GROUP_TYPE             0x10
 #define BLUETOOTH_ATT_ERROR_INSUFFICIENT_RESOURCES             0x11
 /* Common profile error codes */
-#define BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED             0x80
+#define BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED             0xFC
 #define BLUETOOTH_ATT_ERROR_CCCD_IMPROPERLY_CONFIGURED         0xFD
 #define BLUETOOTH_ATT_ERROR_PROCEDURE_ALREADY_IN_PROGRESS      0xFE
-#define BLUETOOTH_ATT_ERROR_OUT_OF_RANGE                       0xFF
+#define BLUETOOTH_ATT_ERROR_OUT_OF_RANGE       0xFF
 
 /*
  * Bluetooth ATT error codes specific to OTP
  */
-#define BLUETOOTH_ATT_ERROR_OBJECT_NOT_SELECTED                0x81
-#define BLUETOOTH_ATT_ERROR_CONCURRENCY_LIMIT_EXCEEDED 0x82
-#define BLUETOOTH_ATT_ERROR_OBJECT_NAME_EXISTS         0x83
+#define BLUETOOTH_OTP_ERROR_WRITE_REQUEST_REJECTED     0x80
+#define BLUETOOTH_OTP_ERROR_OBJECT_NOT_SELECTED        0x81
+#define BLUETOOTH_OTP_ERROR_CONCURRENCY_LIMIT_EXCEEDED 0x82
+#define BLUETOOTH_OTP_ERROR_OBJECT_NAME_EXISTS         0x83
 
 /*
  * Bluetooth OTP error codes
@@ -1320,7 +1325,9 @@ typedef enum {
        HTYPE_TRANS_GET_PROTOCOL,
        HTYPE_TRANS_SET_PROTOCOL,
        HTYPE_TRANS_DATA,
-       HTYPE_TRANS_UNKNOWN
+       HTYPE_TRANS_UNKNOWN,
+       HTYPE_TRANS_GET_IDLE = 0xF0,
+       HTYPE_TRANS_SET_IDLE = 0xF1,
 } bt_hid_header_type_t;
 
 /**
@@ -1377,13 +1384,6 @@ typedef struct {
                                              /**< device address */
 } bluetooth_rfcomm_connection_request_t;
 
-typedef struct {
-       int socket_fd;
-               /**< the socket fd */
-       bluetooth_device_address_t device_addr;
-                                             /**< device address */
-} bluetooth_hid_request_t;
-
 /**
  * HDP QOS types
  */
@@ -1642,6 +1642,15 @@ typedef struct {
 } bt_gatt_indicate_confirm_t;
 
 /**
+ * Structure for GATT response data
+ */
+typedef struct {
+       guint8 *value;
+       guint32 len;
+       gpointer user_data;
+} bt_gatt_resp_data_t;
+
+/**
  * Structure to RSSI Signal Strength Alert
  */
 
@@ -1819,18 +1828,12 @@ typedef enum {
        TRUSTED_PROFILE_PBAP = 1,
        TRUSTED_PROFILE_MAP,
        TRUSTED_PROFILE_SAP,
+       TRUSTED_PROFILE_HFP_HF,
+       TRUSTED_PROFILE_A2DP,
        TRUSTED_PROFILE_ALL = 0xFFFFFFFF,
 } bluetooth_trusted_profile_t;
 
 /**
- * Restricted Profile types
- */
-typedef enum {
-       RESTRICTED_PROFILE_HFP_HS = 1,
-       RESTRICTED_PROFILE_A2DP,
-} bluetooth_restricted_profile_t;
-
-/**
  * Structure for LE data length change params
  */
 typedef struct {
@@ -2317,6 +2320,7 @@ int bluetooth_check_adapter_le(void);
 int bluetooth_enable_adapter_le(void);
 
 int bluetooth_disable_adapter_le(void);
+int bluetooth_get_uuid_name(const char *uuid, char **name);
 
 /**
  * @fn int bluetooth_reset_adapter(void)
@@ -2631,52 +2635,6 @@ int bluetooth_get_profile_trusted(
                int profile, int *trust);
 
 /**
- * @fn int bluetooth_set_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int restricted)
- * @brief Sets a profile restricted connection for a device
- *
- * This function is used to Set a profile as restricted for a device
- *
- * This function is a synchronous call.
- *
- * @param[in]  device_address  a device address of remote bluetooth device
- * @param[in]  profile profile which is to be set as restricted[1-HFP_HS, 2-A2DP]
- * @param[in]  restricted      to set as restricted or not[1-restricted 0-permitted]
- *
- * @return     BLUETOOTH_ERROR_NONE - Success \n
- *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
- *             BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
- *             BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
- *
- * @remark      None
- */
-int bluetooth_set_profile_restricted(
-               const bluetooth_device_address_t *device_address,
-               int profile, int restricted);
-
-/**
- * @fn int bluetooth_get_profile_restricted(const bluetooth_device_address_t *device_address, int profile, int *restricted)
- * @brief Gets a restricted connection state
- *
- * This function is used to Get a profile is restricted or not for a device
- *
- * This function is a synchronous call.
- *
- * @param[in]  device_address  a device address of remote bluetooth device
- * @param[in]  profile profile whose restricted status is needed[1-HFP_HS, 2-A2DP]
- * @param[out] restricted      profile is set as restricted or not[1-restricted 0-permitted]
- *
- * @return     BLUETOOTH_ERROR_NONE - Success \n
- *             BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n
- *             BLUETOOTH_ERROR_INVALID_PARAM - Bluetooth name parameter is incorrect \n
- *             BLUETOOTH_ERROR_INTERNAL - The dbus method call is fail \n
- *
- * @remark      None
- */
-int bluetooth_get_profile_restricted(
-               const bluetooth_device_address_t *device_address,
-               int profile, int *restricted);
-
-/**
  * @fn int bluetooth_get_discoverable_mode(bluetooth_discoverable_mode_t *discoverable_mode_ptr)
  * @brief Get the visibility mode
  *
@@ -5281,7 +5239,7 @@ int bluetooth_gatt_get_service_property(const char *service_handle,
                                                bt_gatt_service_property_t *service);
 
 /**
- * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle)
+ * @fn int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name)
  *
  * @brief Register to GATT based service to receive value change notification/indication.
  *
@@ -5295,11 +5253,12 @@ int bluetooth_gatt_get_service_property(const char *service_handle,
  *
  * @exception  None
  * @param[in]  service_handle - Handle for remote service.
+ * @param[in]  service_name - Friednly name of service uuid.
  *
  * @remark     None
  * @see        None
  */
-int bluetooth_gatt_watch_characteristics(const char *service_handle);
+int bluetooth_gatt_watch_characteristics(const char *service_handle, const char *svc_name);
 
 /**
  * @fn int bluetooth_gatt_unwatch_characteristics(const char *service_handle)
@@ -5419,7 +5378,8 @@ int bluetooth_gatt_set_characteristics_value(const char *char_handle,
  * @see                None
  */
 int bluetooth_gatt_set_characteristics_value_by_type(const char *char_handle,
-                               const guint8 *value, int length, guint8 write_type);
+                                       const guint8 *value, int length,
+                                       guint8 write_type, gpointer app_data);
 
 
 /**
@@ -5464,7 +5424,7 @@ int bluetooth_gatt_set_characteristics_value_request(const char *char_handle,
  * @remark     None
  * @see        None
  */
-int bluetooth_gatt_read_characteristic_value(const char *char_handle);
+int bluetooth_gatt_read_characteristic_value(const char *char_handle, gpointer app_data);
 
 /**
  * @fn int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address,
@@ -5631,7 +5591,7 @@ int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic
  * @remark     None
  * @see        None
  */
-int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
+int bluetooth_gatt_read_descriptor_value(const char *desc_handle, gpointer app_data);
 
 /**
  * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
@@ -5655,7 +5615,7 @@ int bluetooth_gatt_read_descriptor_value(const char *desc_handle);
  * @see        None
  */
 int bluetooth_gatt_write_descriptor_value(const char *desc_handle,
-                       const guint8 *value, int length);
+                       const guint8 *value, int length, gpointer app_data);
 
 /* @fn int bluetooth_gatt_init(void)
 *
@@ -7666,7 +7626,7 @@ int bluetooth_otp_enable_notification(const char *handle);
  *
  * @remark     None
  */
-int bluetooth_otp_write_characteristics_value( const char *handle,
+int bluetooth_otp_write_characteristics_value(const char *handle,
                                        unsigned char *buf, int length);
 
 /**