#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 *
*/
#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
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;
/**
/**< 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
*/
} 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
*/
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 {
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)
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
*
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.
*
*
* @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)
* @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);
/**
* @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,
* @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,
* @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)
*
*
* @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);
/**