X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fbluetooth-api.h;h=8adf067b673a7142e9f9b073c284c5f45a845703;hb=759b6aa12863033f0f25d307b62597a829228160;hp=20f3a48e460c47dc7c00019e5c5c622b9523387b;hpb=36fcd5c231149275ea29c57bb7b21e741b06ca8e;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git diff --git a/include/bluetooth-api.h b/include/bluetooth-api.h index 20f3a48..8adf067 100644 --- a/include/bluetooth-api.h +++ b/include/bluetooth-api.h @@ -19,6 +19,7 @@ #define _BLUETOOTH_API_H_ #include +#include #include #include @@ -35,18 +36,21 @@ extern "C" { * @{ */ -#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 -#define BLUETOOTH_DEVICE_NAME_LENGTH_MAX 248 /**< This specifies maximum device name length */ +#define BLUETOOTH_ADDRESS_STRING_LENGTH 17 /**< 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 +#define BLUETOOTH_DEVICE_NAME_LENGTH_MAX 248 /**< This specifies maximum device name length */ #define BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX 50 /**< This specifies maximum length of the passkey */ #define BLUETOOTH_ADVERTISING_DATA_LENGTH_MAX 31 /**< This specifies maximum AD data length */ -#define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */ +#define BLUETOOTH_SCAN_RESP_DATA_LENGTH_MAX 31 /**< This specifies maximum LE Scan response data length */ #define BLUETOOTH_MANUFACTURER_DATA_LENGTH_MAX 240 /**< This specifies maximum manufacturer data length */ -#define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services +#define BLUETOOTH_MAX_SERVICES_FOR_DEVICE 40 /**< This specifies maximum number of services a device can support */ +#define BLUETOOTH_MAX_ATT_MTU 512 /**< This specifies the maximum ATT MTU Value*/ + #define BLUETOOTH_UUID_STRING_MAX 50 #define BLUETOOTH_PATH_STRING 50 @@ -74,6 +78,14 @@ extern "C" { #define BLUETOOTH_MAX_DPM_LIST 20 /**< This specifies maximum number of devices/uuids dpm shall store */ +#define BLUETOOTH_TDS_DATA_LENGTH_MAX 239 /**< This specifies maximum AD data length: 0xEF */ +#define BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX 500 /**< TDS Control Point parameter Max length */ + +/* + * < This defines the maximum size of OTP server directory name + */ +#define BLUETOOTH_MAX_OTP_SERVER_DIR_NAME 100 + /** * This is Bluetooth error code */ @@ -165,6 +177,33 @@ extern "C" { #define BLUETOOTH_ERROR_NOT_INITIALIZED ((int)BLUETOOTH_ERROR_BASE - 0x26) /**< Not initialized */ +#define BLUETOOTH_ERROR_AUTHENTICATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x27) + /**< Authentication rejected */ + +#define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28) + /**< Device Policy Restricted */ + +/** + * Device disconnection reasons; received from stack + */ +#define BLUETOOTH_ERROR_PAGE_TIMEOUT 0x04 +#define BLUETOOTH_ERROR_AUTH_FAILURE 0x05 +#define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06 +#define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08 +#define BLUETOOTH_ERROR_REMOTE_USER_TERM 0x13 +#define BLUETOOTH_ERROR_REMOTE_LOW_RESOURCES 0x14 +#define BLUETOOTH_ERROR_REMOTE_POWER_OFF 0x15 +#define BLUETOOTH_ERROR_LOCAL_HOST_TERM 0x16 +#define BLUETOOTH_ERROR_REPEATED_ATTEMPTS 0x17 +#define BLUETOOTH_ERROR_LMP_RESPONSE_TIMEOUT 0x22 +#define BLUETOOTH_ERROR_LMP_TRANSACTION_COLLISION 0x23 +#define BLUETOOTH_ERROR_INSTANT_PASSED 0x28 +#define BLUETOOTH_ERROR_INSUFFICIENT_SECURITY 0x2f +#define BLUETOOTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3d +#define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e + +#define BLUETOOTH_ERROR_INVALID_DIRECTORY 0x01 + /** * Device disconnect reason */ @@ -185,8 +224,7 @@ typedef struct { /** * This is Bluetooth device address type */ -typedef enum -{ +typedef enum { BLUETOOTH_DEVICE_PUBLIC_ADDRESS = 0x00, BLUETOOTH_DEVICE_RANDOM_ADDRESS } bluetooth_device_address_type_t; @@ -263,6 +301,7 @@ typedef enum { /** * Service type + * Service type matched to bt_profile_type_t of bt-service-common.h */ typedef enum { BLUETOOTH_RFCOMM_SERVICE = 0x01, @@ -274,16 +313,18 @@ typedef enum { BLUETOOTH_GATT_SERVICE = 0x40, BLUETOOTH_NAP_SERVER_SERVICE = 0x80, BLUETOOTH_A2DP_SINK_SERVICE = 0x100, + BLUETOOTH_PBAP_SERVICE = 0x200, } bluetooth_service_type_t; /** * Service type */ typedef enum { - BLUETOOTH_DEV_CONN_DEFAULT = 0xFF, /* represents that connection - * type can both BR/EDR and LE */ - BLUETOOTH_DEV_CONN_BREDR = 0x00, - BLUETOOTH_DEV_CONN_LE = 0x01, + BLUETOOTH_DEV_CONN_DEFAULT = 0xFF, + /* represents that connection + * type can both BR/EDR and LE */ + BLUETOOTH_DEV_CONN_BREDR = 0x00, + BLUETOOTH_DEV_CONN_LE = 0x01, } bluetooth_conn_type_t; /** @@ -337,8 +378,12 @@ typedef enum { BLUETOOTH_ADV_CONNECTABLE_DIRECT_LOW = 0x04, /* ADV_DIRECT_IND, low duty cycle */ } bluetooth_advertising_type_t; -typedef enum -{ +typedef enum { + BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_ADD = 0x01, + BLUETOOTH_GATT_SERVICE_CHANGE_TYPE_REMOVE = 0x02, +} bluetooth_gatt_service_change_type_t; + +typedef enum { BLUETOOTH_GATT_PERMISSION_READ = 0x01, BLUETOOTH_GATT_PERMISSION_WRITE = 0x02, BLUETOOTH_GATT_PERMISSION_ENCRYPT_READ = 0x04, @@ -347,8 +392,7 @@ typedef enum BLUETOOTH_GATT_PERMISSION_ENCRYPT_AUTHENTICATED_WRITE = 0x20, } bt_gatt_permission_t; -typedef enum -{ +typedef enum { BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_BROADCAST = 0x01, BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_READ = 0x02, BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_WRITE_NO_RESPONSE = 0x04, @@ -363,7 +407,7 @@ typedef enum BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_READ = 0x800, BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_ENCRYPT_AUTHENTICATED_WRITE = 0x1000, BLUETOOTH_GATT_CHARACTERISTIC_PROPERTY_EXTENDED_PROPS = 0xffff, -}bt_gatt_characteristic_property_t; +} bt_gatt_characteristic_property_t; /** * Remote device request types for attributes @@ -374,6 +418,77 @@ typedef enum { } bluetooth_gatt_att_request_tyep_t; /** + * Proximity Property Type + */ +typedef enum { + BLUETOOTH_PXP_PROPERTY_LLS = 0x01, /* Link Loss Alert Proeprty */ + BLUETOOTH_PXP_PROPERTY_IAS = 0x02, /* Immediate Alert Proeprty */ + BLUETOOTH_PXP_PROPERTY_TX_POWER = 0x04, /* TX Power */ +} bluetooth_pxp_poperty_t; + +/** + * TDS transport Type + */ +typedef enum { + BLUETOOTH_TDS_TRANSPORT_BT = 0x01, /* Transport type BR-EDR */ + BLUETOOTH_TDS_TRANSPORT_CUSTOM, /* Transport type custom */ + /* ... */ + BLUETOOTH_TDS_TRANSPORT_INVALID +} bluetooth_tds_transport_t; + +/** + * TDS transport state + */ +typedef enum { + BLUETOOTH_TDS_TRANSPORT_STATE_OFF = 0, + BLUETOOTH_TDS_TRANSPORT_STATE_ON, + BLUETOOTH_TDS_TRANSPORT_STATE_UNAVAILABLE, + BLUETOOTH_TDS_TRANSPORT_STATE_RESERVED +} bluetooth_tds_transport_state_t; + +/** +* TDS data +*/ +typedef struct { + int length; + guint8 data[BLUETOOTH_TDS_DATA_LENGTH_MAX]; +} bluetooth_tds_data_t; + +/** +* TDS activation request +*/ +typedef struct { + bluetooth_device_address_t rem_addr; + bluetooth_tds_transport_t transport; + bluetooth_tds_data_t tds_data; +} bluetooth_tds_activation_req_t; + +/** +* TDS Control Point data +*/ +typedef struct { + int length; /**< Control point data length */ + guint8 data[BLUETOOTH_TDS_CONTROL_POINT_PARAM_LENGTH_MAX]; /**< Control pint param data */ +} bluetooth_control_point_data_t; + +/** +* TDS Indication Response data +*/ +typedef struct { + bluetooth_device_address_t rem_addr; /**< Device address */ + bluetooth_control_point_data_t tds_data; /**< TDS Control Point Indication params */ +} bluetooth_tds_indication_res_t; + +/** +* Structure to hold the TDS Complete data information which is read from remote TDS provider +*/ +typedef struct { + bluetooth_device_address_t device_address; /**< Device address */ + int data_length; /**< Data length */ + char *data; /**< Complete Transport Specific data */ +} bluetooth_tds_transport_data_info_t; + +/** * Advertising parameters */ typedef struct { @@ -396,8 +511,8 @@ typedef struct { LE Connection Update */ typedef struct { - guint16 interval_min; - guint16 interval_max; + float interval_min; + float interval_max; guint16 latency; guint16 timeout; } bluetooth_le_connection_param_t; @@ -428,6 +543,18 @@ typedef struct { char *message; } bluetooth_vendor_dep_at_cmd_t; +/** + * Transfer Types + */ +typedef enum { + BLUETOOTH_TRANSFER_INBOUND, /**< Inbound Transfer Type */ + BLUETOOTH_TRANSFER_OUTBOUND, /**< Outbound Transfer Type */ +} bluetooth_opp_transfer_type_t; + +typedef struct { + gint event; + gint value; +} bluetooth_hf_ciev_device_event_t; #define BLUETOOTH_EVENT_BASE ((int)(0x0000)) /**< No event */ #define BLUETOOTH_EVENT_GAP_BASE ((int)(BLUETOOTH_EVENT_BASE + 0x0010)) @@ -459,6 +586,8 @@ typedef struct { /**< Base ID for AVRCP events */ #define BLUETOOTH_EVENT_IPSP_BASE ((int)(BLUETOOTH_EVENT_AVRCP_CONTROL_BASE + 0x0020)) /**< Base ID for IPSP events */ +#define BLUETOOTH_EVENT_MAP_BASE ((int)(BLUETOOTH_EVENT_IPSP_BASE + 0x0020)) + /**< Base ID for MAP events */ /** * Bluetooth event type @@ -479,7 +608,7 @@ typedef enum { BLUETOOTH_EVENT_DISCOVERY_FINISHED, /**< Bluetooth event discovery finished */ BLUETOOTH_EVENT_REMOTE_DEVICE_FOUND, /**< Bluetooth event remote deice found */ BLUETOOTH_EVENT_LE_DISCOVERY_STARTED, /**< Bluetooth event LE discovery started */ - BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */ + BLUETOOTH_EVENT_LE_DISCOVERY_FINISHED, /**< Bluetooth event LE discovery finished */ BLUETOOTH_EVENT_REMOTE_LE_DEVICE_FOUND, /**< Bluetooth event remote deice found (LE dev) */ BLUETOOTH_EVENT_REMOTE_DEVICE_NAME_UPDATED,/**< Bluetooth event remote device name updated*/ BLUETOOTH_EVENT_BONDING_FINISHED, /**< Bluetooth event bonding completed */ @@ -498,6 +627,8 @@ typedef enum { BLUETOOTH_EVENT_RSSI_ENABLED, /**< Bluetooth event RSSI monitoring enabled */ BLUETOOTH_EVENT_RSSI_ALERT, /**< Bluetooth event RSSI Alert */ BLUETOOTH_EVENT_RAW_RSSI, /**< Bluetooth event Raw RSSI */ + BLUETOOTH_EVENT_SUPPORTED_PROFILE_TRUSTED, /**< Bluetooth event Supported Profile Trusted */ + BLUETOOTH_EVENT_PASSKEY_NOTIFICATION, /**< Bluetooth event passkey notification */ BLUETOOTH_EVENT_SERVICE_SEARCHED = BLUETOOTH_EVENT_SDP_BASE, /**< Bluetooth event serice search base id */ @@ -531,11 +662,34 @@ typedef enum { BLUETOOTH_EVENT_OPC_CONNECTED = BLUETOOTH_EVENT_OPC_BASE, /* OPC Connected event */ - BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */ + BLUETOOTH_EVENT_OPC_DISCONNECTED, /* OPC Disonnected event */ BLUETOOTH_EVENT_OPC_TRANSFER_STARTED, /* OPC Transfer started event */ BLUETOOTH_EVENT_OPC_TRANSFER_PROGRESS, /* OPC Transfer progress event */ BLUETOOTH_EVENT_OPC_TRANSFER_COMPLETE, /* OPC Transfer Complete event */ + BLUETOOTH_EVENT_MAP_CONNECTED = BLUETOOTH_EVENT_MAP_BASE, + BLUETOOTH_EVENT_MAP_DISCONNECTED, + /* + BLUETOOTH_EVENT_MAP_SET_FOLDER_COMPLETE, + BLUETOOTH_EVENT_MAP_SET_FOLDER_INVALID_ARGUMENTS, + BLUETOOTH_EVENT_MAP_SET_FOLDER_FAILED, + BLUETOOTH_EVENT_MAP_UPDATE_INBOX_COMPLETE, + BLUETOOTH_EVENT_MAP_UPDATE_INBOX_FAILED, + */ + BLUETOOTH_EVENT_MAP_LIST_FOLDERS_COMPLETE, + BLUETOOTH_EVENT_MAP_LIST_FOLDERS_INVALID_ARGUMENTS, + BLUETOOTH_EVENT_MAP_LIST_FOLDERS_FAILED, + BLUETOOTH_EVENT_MAP_LIST_MESSAGES_COMPLETE, + BLUETOOTH_EVENT_MAP_LIST_MESSAGES_INVALID_ARGUMENTS, + BLUETOOTH_EVENT_MAP_LIST_MESSAGES_FAILED, + BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_COMPLETE, + BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_INVALID_ARGUMENTS, + BLUETOOTH_EVENT_MAP_PUSH_MESSAGE_FAILED, + BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE, + BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS, + BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED, + BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE, + BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE, /* Obex server authorize event*/ BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_STARTED, /* Obex Server transfer started event*/ @@ -557,11 +711,13 @@ typedef enum { BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED, /**= BLUETOOTH_ERROR_NONE) @@ -1758,6 +2106,7 @@ int main() { GMainLoop *main_loop = NULL; int ret = 0; + g_type_init(); main_loop = g_main_loop_new(NULL, FALSE); ret = bluetooth_register_callback(bt_event_callback, (void*)main_loop); if (ret >= BLUETOOTH_ERROR_NONE) @@ -2155,6 +2504,98 @@ int bluetooth_get_connected_link_type(const bluetooth_device_address_t *device_a bluetooth_connected_link_t *connected_link); /** + * @fn int bluetooth_set_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int trust) + * @brief Sets a profile trusted for a device + * + * This function is used to Set a profile as trusted 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 trusted[0-PBAP, 1-MAP, 2-SAP] + * @param[in] trust to set as trusted or untrusted[1-trusted 0-untrusted] + * + * @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_trusted( + const bluetooth_device_address_t *device_address, + int profile, int trust); + +/** + * @fn int bluetooth_get_profile_trusted(const bluetooth_device_address_t *device_address, int profile, int *trust) + * @brief Gets a profile is trusted for a device + * + * This function is used to Get a profile is trusted 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 trust status is needed[0-PBAP, 1-MAP, 2-SAP] + * @param[out] trust profile is set as trusted or untrusted[1-trusted 0-untrusted] + * + * @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_trusted( + const bluetooth_device_address_t *device_address, + 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 * @@ -2686,6 +3127,27 @@ is_le_scanning = bluetooth_is_le_scanning (); */ gboolean bluetooth_is_le_scanning(void); +gboolean bluetooth_is_scan_filter_supported(void); + +/** + * @fn int bluetooth_force_hcidump(int timeout) + * @brief Enable /disable force-hcidump + * + * This function control force-hcidump. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n + * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n + * + * @param[in] start To enable or disable force-hcidump[TRUE / FALSE] + * + * + * @remark None + */ +int bluetooth_force_hcidump(int timeout); + /** * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id) * @brief Register scan filter. @@ -3061,6 +3523,9 @@ void bt_get_bonded_devices(void) */ int bluetooth_get_bonded_device_list(GPtrArray **dev_list); +int bluetooth_get_profile_connected_device_list( + const char *profile_uuid, GPtrArray **addr_list); + /** * @fn int bluetooth_get_bonded_device(const bluetooth_device_address_t *device_address, * bluetooth_device_info_t *dev_info) @@ -3113,6 +3578,32 @@ 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) + * @brief Get is_alias_set property of device + * + * This API gets is_alias_set property of a bonded device. + * + * This function is a synchronous call. + * Information for is_alias_set property can be obtained only when result code is BLUETOOTH_ERROR_NONE. + * If not,there is no valid information in the is_alias_set. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_NOT_SUPPORT - Opreation not supported \n + * @remark None + @code + int ret = 0; + gboolean alias_set; + bluetooth_device_address_t device_address = {{0x00,0x1C,0x43,0x2B,0x1A,0xE5}}; + + ret = bluetooth_get_is_alias_set(&device_address, &alias_set); + @endcode + */ +int bluetooth_get_is_alias_set(const bluetooth_device_address_t *device_address, + gboolean *is_alias_set); + /** * @fn int bluetooth_set_alias(const bluetooth_device_address_t *device_address, const char *alias) * @brief set alias for bonded device @@ -3645,7 +4136,7 @@ int bluetooth_rfcomm_listen(int socket_fd, int max_pending_connection); * * @exception None * @remark None - * @see bluetooth_rfcomm_reject_connection + * @see bluetooth_rfcomm_reject_connection */ int bluetooth_rfcomm_accept_connection(int server_fd); @@ -3663,7 +4154,7 @@ int bluetooth_rfcomm_accept_connection(int server_fd); * * @exception None * @remark None - * @see bluetooth_rfcomm_accept_connection + * @see bluetooth_rfcomm_accept_connection */ int bluetooth_rfcomm_reject_connection(int server_fd); @@ -3975,7 +4466,7 @@ int bluetooth_network_server_disconnect(const bluetooth_device_address_t *device * should be HDP_QOS_ANY. * @param[out] app_handle The application handler against corresponding service * @remark None - * @see bluetooth_hdp_deactivate + * @see bluetooth_hdp_deactivate */ int bluetooth_hdp_activate(unsigned short data_type, bt_hdp_role_type_t role, @@ -3995,7 +4486,7 @@ int bluetooth_hdp_activate(unsigned short data_type, * @exception None * @param[in] app_handle The application handler against corresponding service * @remark None - * @see bluetooth_hdp_deactivate + * @see bluetooth_hdp_deactivate */ int bluetooth_hdp_deactivate(const char *app_handle); @@ -4017,7 +4508,7 @@ int bluetooth_hdp_deactivate(const char *app_handle); * @param[in] buffer The pdu buffer. * @param[in] size Size of the buffer. * @remark None - * @see bluetooth_hdp_connect + * @see bluetooth_hdp_connect */ int bluetooth_hdp_send_data(unsigned int channel_id, const char *buffer, unsigned int size); @@ -4043,7 +4534,7 @@ int bluetooth_hdp_send_data(unsigned int channel_id, * @param[in] device_address The remote device Bd address. * * @remark None - * @see bluetooth_hdp_disconnect + * @see bluetooth_hdp_disconnect */ int bluetooth_hdp_connect(const char *app_handle, bt_hdp_qos_type_t channel_type, @@ -4067,7 +4558,7 @@ int bluetooth_hdp_connect(const char *app_handle, * @param[in] device_address The remote device Bd address. * * @remark None - * @see bluetooth_hdp_connect + * @see bluetooth_hdp_connect */ int bluetooth_hdp_disconnect(unsigned int channel_id, const bluetooth_device_address_t *device_address); @@ -4089,7 +4580,7 @@ int bluetooth_hdp_disconnect(unsigned int channel_id, * @exception None * * @remark None - * @see bluetooth_opc_deinit + * @see bluetooth_opc_deinit */ int bluetooth_opc_init(void); @@ -4107,10 +4598,10 @@ int bluetooth_opc_init(void); * @exception None * * @remark None - * @see bluetooth_opc_init + * @see bluetooth_opc_init */ - int bluetooth_opc_deinit(void); +int bluetooth_opc_deinit(void); /** * @fn int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address, @@ -4133,11 +4624,11 @@ int bluetooth_opc_init(void); * @param[in] file_name_array Array of filepaths to be sent. * * @remark None - * @see bluetooth_opc_cancel_push + * @see bluetooth_opc_cancel_push */ int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address, - char **file_name_array); + char **file_name_array); /** * @fn int bluetooth_opc_cancel_push(void) @@ -4154,7 +4645,7 @@ int bluetooth_opc_push_files(bluetooth_device_address_t *remote_address, * @exception None * * @remark None - * @see bluetooth_opc_push_files + * @see bluetooth_opc_push_files */ int bluetooth_opc_cancel_push(void); @@ -4171,7 +4662,7 @@ int bluetooth_opc_cancel_push(void); * @exception None * * @remark None - * @see None + * @see None */ gboolean bluetooth_opc_session_is_exist(void); @@ -4195,6 +4686,27 @@ gboolean bluetooth_opc_session_is_exist(void); int bluetooth_opc_is_sending(gboolean *is_sending); /** + * @fn int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type, + int transfer_id, unsigned char *progress) + * @brief Gets the percentage progress for ongoing transfers. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Not enabled \n + * BLUETOOTH_ERROR_NOT_FOUND - Not found \n + * + * @exception None + * @param[in] transfer_type Transfer Type: (@c BLUETOOTH_TRANSFER_INBOUND = receiving , @c BLUETOOTH_TRANSFER_OUTBOUND = sending) + * @param[in] transfer_id Transfer ID + * @param[out] progress Percentage Progress + * @remark None + * @see None + */ +int bluetooth_opp_get_transfer_progress(bluetooth_opp_transfer_type_t transfer_type, + int transfer_id, unsigned char *progress); + +/** * @fn int bluetooth_obex_server_init(const char *dst_path) * @brief Initialize OPP and FTP server. * @@ -4210,7 +4722,7 @@ int bluetooth_opc_is_sending(gboolean *is_sending); * @exception None * @param[in] dst_path OPS destination file path. * @remark None - * @see bluetooth_obex_server_deinit + * @see bluetooth_obex_server_deinit */ int bluetooth_obex_server_init(const char *dst_path); @@ -4229,7 +4741,7 @@ int bluetooth_obex_server_init(const char *dst_path); * @exception None * * @remark None - * @see bluetooth_obex_server_init + * @see bluetooth_obex_server_init */ int bluetooth_obex_server_deinit(void); @@ -4268,7 +4780,7 @@ gboolean bluetooth_obex_server_is_activated(void); * @exception None * @param[in] dst_path OPS destination file path. * @remark None - * @see bluetooth_obex_server_deinit_without_agent + * @see bluetooth_obex_server_deinit_without_agent */ int bluetooth_obex_server_init_without_agent(const char *dst_path); @@ -4287,7 +4799,7 @@ int bluetooth_obex_server_init_without_agent(const char *dst_path); * @exception None * * @remark None - * @see bluetooth_obex_server_init_without_agent + * @see bluetooth_obex_server_init_without_agent */ int bluetooth_obex_server_deinit_without_agent(void); @@ -4305,7 +4817,7 @@ int bluetooth_obex_server_deinit_without_agent(void); * * @exception None * @remark None - * @see bluetooth_obex_server_reject_authorize + * @see bluetooth_obex_server_reject_authorize */ int bluetooth_obex_server_accept_connection(void); @@ -4323,7 +4835,7 @@ int bluetooth_obex_server_accept_connection(void); * * @exception None * @remark None - * @see bluetooth_obex_server_reject_authorize + * @see bluetooth_obex_server_reject_authorize */ int bluetooth_obex_server_reject_connection(void); @@ -4345,7 +4857,7 @@ int bluetooth_obex_server_reject_connection(void); * @param[in] filename Authorized filename. * @remark None - * @see bluetooth_obex_server_reject_authorize + * @see bluetooth_obex_server_reject_authorize */ int bluetooth_obex_server_accept_authorize(const char *filename); @@ -4365,7 +4877,7 @@ int bluetooth_obex_server_accept_authorize(const char *filename); * @exception None * @remark None - * @see bluetooth_obex_server_accept_authorize + * @see bluetooth_obex_server_accept_authorize */ int bluetooth_obex_server_reject_authorize(void); @@ -4386,7 +4898,7 @@ int bluetooth_obex_server_reject_authorize(void); * @param[in] dst_path OPS destination file path. * @remark None - * @see None + * @see None */ int bluetooth_obex_server_set_destination_path(const char *dst_path); @@ -4409,7 +4921,7 @@ int bluetooth_obex_server_set_destination_path(const char *dst_path); * @param[in] root FTS root folder. * @remark None - * @see None + * @see None */ int bluetooth_obex_server_set_root(const char *root); @@ -4434,7 +4946,7 @@ int bluetooth_obex_server_set_root(const char *root); * @param[in] transfer_id transfer ID * @remark None - * @see None + * @see None */ int bluetooth_obex_server_cancel_transfer(int transfer_id); @@ -4458,7 +4970,7 @@ int bluetooth_obex_server_cancel_transfer(int transfer_id); * @exception None * * @remark None - * @see None + * @see None */ int bluetooth_obex_server_cancel_all_transfers(void); @@ -4477,39 +4989,103 @@ int bluetooth_obex_server_cancel_all_transfers(void); * @param[out] is_receiving The receiving status: (@c TRUE = in receiving , @c false = not in receiving) * * @remark None - * @see None + * @see None */ int bluetooth_obex_server_is_receiving(gboolean *is_receiving); /** - * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data) - * @brief Read the local Hash and Randmizer. + * @fn int bluetooth_map_client_init(void) + * @brief Initialize MAP client. * * This function is a synchronous call. + * No event corresponding to this api * * @return BLUETOOTH_ERROR_NONE - Success \n - * BLUETOOTH_ERROR_INTERNAL - Internal Error \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n + * BLUETOOTH_ERROR_INTERNAL - Internal Error \n + * BLUETOOTH_ERROR_NO_RESOURCES - Not resource available \n + * BLUETOOTH_ERROR_ACCESS_DENIED -Memory allocation failed \n * - * @exception None - * @param[in] None. - * @param[out] local_oob_data - Pointer to the local OOB data + * @exception None * - * @remark None - * @see None + * @remark None + * @see bluetooth_map_client_deinit */ +int bluetooth_map_client_init(void); -int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data); +int bluetooth_map_client_deinit(void); + +int bluetooth_map_client_create_session(bt_map_client_session_info_s *session); +int bluetooth_map_client_destroy_session(bt_map_client_session_info_s *session); + +int bluetooth_map_client_set_folder(bt_map_client_session_info_s *session, const char *name); + +int bluetooth_map_client_list_folders(bt_map_client_session_info_s *session, + bt_map_client_list_folders_filter_t *filter); /** - * @fn int bluetooth_oob_add_remote_data( - * const bluetooth_device_address_t *remote_device_address, - * bt_oob_data_t *oob_data) - * @brief Add/updated the remote device Hash and Randmizer. + * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session) + * @brief Return all available fields that can be used in Fields filter. * - * This function is a synchronous call. - * No event for this api.. + * This function is a asynchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n + * BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n + * + * @exception None + * @param[in] session Information about session. + * @remark None + */ +int bluetooth_map_client_list_filter_fields(bt_map_client_session_info_s *session); + +int bluetooth_map_client_list_messages(bt_map_client_session_info_s *session, + const char *folder, + bt_map_client_list_messages_filter_t *filter); + +int bluetooth_map_client_update_inbox(bt_map_client_session_info_s *session); + +int bluetooth_map_client_push_message(bt_map_client_session_info_s *session, + const char *source_file, + const char *folder, + bt_map_client_push_message_args_t *args); + +int bluetooth_map_client_get_message(bt_map_client_session_info_s *session, + const bt_map_client_message_object_t message_object, + const char *target_file, + bool attachment); + + +/** + * @fn int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data) + * @brief Read the local Hash and Randmizer. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_INTERNAL - Internal Error \n + * + * @exception None + * @param[in] None. + * @param[out] local_oob_data - Pointer to the local OOB data + * + * @remark None + * @see None + */ + +int bluetooth_oob_read_local_data(bt_oob_data_t *local_oob_data); + + +/** + * @fn int bluetooth_oob_add_remote_data( + * const bluetooth_device_address_t *remote_device_address, + * bt_oob_data_t *oob_data) + * @brief Add/updated the remote device Hash and Randmizer. + * + * This function is a synchronous call. + * No event for this api.. * * @return BLUETOOTH_ERROR_NONE - Success \n * BLUETOOTH_ERROR_INTERNAL - Internal Error \n @@ -4542,7 +5118,7 @@ int bluetooth_oob_add_remote_data( * @param[in] remote_device_address - Remote device address * * @remark None - * @see None + * @see None */ int bluetooth_oob_remove_remote_data( @@ -4593,6 +5169,9 @@ int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *addres */ int bluetooth_gatt_discover_service_characteristics(const char *service_handle); +int bluetooth_gatt_set_service_change_watcher( + const bluetooth_device_address_t *address, gboolean enable); + /** * @fn int bluetooth_gatt_get_service_property(const char *service_handle, * bt_gatt_service_property_t *service); @@ -4634,7 +5213,7 @@ int bluetooth_gatt_get_service_property(const char *service_handle, * @param[in] service_handle - Handle for remote service. * * @remark None - * @see None + * @see None */ int bluetooth_gatt_watch_characteristics(const char *service_handle); @@ -4825,7 +5404,7 @@ int bluetooth_gatt_read_characteristic_value(const char *char_handle); * @remark None * @see None */ - int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address, +int bluetooth_gatt_get_service_from_uuid(bluetooth_device_address_t *address, const char *service_uuid, bt_gatt_service_property_t *service); @@ -4908,7 +5487,7 @@ int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty); * @remark None * @see bluetooth_gatt_get_characteristics_property() */ - int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty); +int bluetooth_gatt_free_char_property(bt_gatt_char_property_t *char_pty); /** * @fn int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty); @@ -4927,12 +5506,11 @@ int bluetooth_gatt_free_service_property(bt_gatt_service_property_t *svc_pty); * @remark None * @see bluetooth_gatt_get_char_descriptor_property() */ - int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty); +int bluetooth_gatt_free_desc_property(bt_gatt_char_descriptor_property_t *desc_pty); +int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect); - int bluetooth_connect_le(const bluetooth_device_address_t *device_address, gboolean auto_connect); - - int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address); +int bluetooth_disconnect_le(const bluetooth_device_address_t *device_address); /** * @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle); @@ -4969,7 +5547,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); /** * @fn int bluetooth_gatt_write_descriptor_value(const char *desc_handle, @@ -4992,7 +5570,7 @@ int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic * @remark None * @see None */ - int bluetooth_gatt_write_descriptor_value(const char *desc_handle, +int bluetooth_gatt_write_descriptor_value(const char *desc_handle, const guint8 *value, int length); /* @fn int bluetooth_gatt_init(void) @@ -5001,9 +5579,9 @@ int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic * * This function is a synchronous call. * @return BLUETOOTH_ERROR_NONE - Success \n -* BLUETOOTH_ERROR_INTERNAL - Internal Error \n -* BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n -* BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n +* BLUETOOTH_ERROR_INTERNAL - Internal Error \n +* BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n +* BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n * * @exception None * @remark Adapter should be enabled @@ -5017,9 +5595,9 @@ int bluetooth_gatt_init(void); * * This function is a synchronous call. * @return BLUETOOTH_ERROR_NONE - Success \n -* BLUETOOTH_ERROR_INTERNAL - Internal Error \n -* BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n -* BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n +* BLUETOOTH_ERROR_INTERNAL - Internal Error \n +* BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n +* BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n * * @exception None * @remark Adapter should be enabled @@ -5113,13 +5691,13 @@ int bluetooth_gatt_set_characteristic_value( * BLUETOOTH_ERROR_INVALID_PARAM -Invalid Parameters \n * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n * -* @exception None -* @param[in] desc_uuid Gatt descriptor uuid. -* @param[in] desc_value GATT descriptor value. -* @param[in] value_length Length of GATT descriptor value. -* @param[in] permissions descriptor permissions. -* @param[in] properties GATT descriptor properties. -* @param[in] char_path characteristics object path of the exported character. +* @exception None +* @param[in] desc_uuid Gatt descriptor uuid. +* @param[in] desc_value GATT descriptor value. +* @param[in] value_length Length of GATT descriptor value. +* @param[in] permissions descriptor permissions. +* @param[in] properties GATT descriptor properties. +* @param[in] char_path characteristics object path of the exported character. * * @remark Adapter should be enabled * @see bluetooth_gatt_add_service() @@ -5145,8 +5723,8 @@ int bluetooth_gatt_add_descriptor( * * @exception None * @param[in] desc_value GATT descriptor value. -* @param[in] value_length Length of GATT descriptor value. -* @param[in] desc_path descriptor path to which the value needs to be added. +* @param[in] value_length Length of GATT descriptor value. +* @param[in] desc_path descriptor path to which the value needs to be added. * * @remark Adapter should be enabled * @see bluetooth_gatt_add_service() @@ -5177,7 +5755,7 @@ int bluetooth_gatt_get_service(const char *svc_uuid); /* @fn int bluetooth_gatt_register_service(const char *svc_path) * -* @brief Registers the given service path with the bluez gatt server. +* @brief Registers the given service path with the library. * * This function is a synchronous call. * @@ -5652,8 +6230,7 @@ int bluetooth_clear_white_list(void); * @see bluetooth_bond_device */ int bluetooth_le_conn_update(const bluetooth_device_address_t *address, - const bluetooth_le_connection_param_t *parameters); - + const bluetooth_le_connection_param_t *parameters); /** * @fn int bluetooth_enable_le_privacy(gboolean enable_privacy); @@ -5677,6 +6254,26 @@ int bluetooth_le_conn_update(const bluetooth_device_address_t *address, int bluetooth_enable_le_privacy(gboolean enable_privacy); /** + * @fn int bluetooth_set_le_static_random_address(gboolean enable); + * + * @brief Enable/Disable LE static random address. + * + * This function is used to enable or disable LE static random address. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is not enabled \n + * BLUETOOTH_ERROR_INTERNAL - Internal IPC error \n + * + * @exception None + * @param[in] enable - The status of LE static random address to be activated/deactivated[True/False]. + * + * @remark None + */ +int bluetooth_set_le_static_random_address(gboolean enable); + +/** * @fn int bluetooth_update_le_connection_mode(bluetooth_device_address_t *address, * bluetooth_le_connection_mode_t mode) * @brief update connection paramter of LE connection. @@ -5697,6 +6294,64 @@ int bluetooth_update_le_connection_mode(const bluetooth_device_address_t *addres bluetooth_le_connection_mode_t mode); /** + * @fn int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, guint16 mtu) + * @brief Request for new ATT MTU value. + * + * This function is a asynchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_INTERNAL - Internal Error \n + * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n + * + * @exception None + * @param[in] address - remote device address value. + * @param[in] mtu - MTU value to be set. + * + * @remark None + */ +int bluetooth_request_att_mtu(const bluetooth_device_address_t *device_address, unsigned int mtu); + +/** + * @fn int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address, + * unsigned int *mtu) + * @brief Gets the xisting MTU value set for a connection. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_INTERNAL - Internal Error \n + * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n + * + * @exception None + * @param[in] address - remote device address value. + * @param[out] mtu - MTU value set for the connection. + * + * @remark None + */ +int bluetooth_get_att_mtu(const bluetooth_device_address_t *device_address, + unsigned int *mtu); + +/** + * @fn int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa, + * bluetooth_device_address_t *id_address) + * @brief Gets the Identity address of remote device. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_INTERNAL - Internal Error \n + * BLUETOOTH_ERROR_INVALID_PARAM - Parameter is not valid \n + * + * @exception None + * @param[in] device_rpa - remote Resolvable private address. + * @param[out] id_address - remote Identity device address value. + * + * @remark None + */ +int bluetooth_get_device_ida(const bluetooth_device_address_t *device_rpa, + bluetooth_device_address_t *id_address); + +/** * @fn int bluetooth_le_read_maximum_data_length() * @brief reads the maximum LE data length supported in the controller. * @@ -5769,7 +6424,8 @@ int bluetooth_pbap_phonebook_search(const bluetooth_device_address_t *address, */ int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value); -#ifdef TIZEN_DPM_VCONF_ENABLE +int bluetooth_set_passkey_notification(gboolean enable); + /** * @fn int bluetooth_dpm_is_mode_allowed(void); * @@ -5787,7 +6443,6 @@ int bluetooth_set_manufacturer_data(const bluetooth_manufacturer_data_t *value); * @remark None */ int bluetooth_dpm_is_mode_allowed(void); -#endif /** * @fn int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value); @@ -5825,10 +6480,10 @@ int bluetooth_dpm_set_allow_mode(bt_dpm_allow_t value); * @exception None * @param[in] None * @param[out] value - BT Allow value. - * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error - * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed - * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only - * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted + * BLUETOOTH_DPM_ERROR = -1, < bluetooth allowance error + * BLUETOOTH_DPM_BT_ALLOWED, < bluetooth allowance allowed + * BLUETOOTH_DPM_HANDSFREE_ONLY, < bluetooth allowance handsfree only + * BLUETOOTH_DPM_BT_RESTRICTED, < bluetooth allowance restricted * * @remark None */ @@ -5847,7 +6502,7 @@ int bluetooth_dpm_get_allow_mode(bt_dpm_allow_t *value); * * @exception None * @param[in] value - State value. - * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed. + * BLUETOOTH_DPM_ALLOWED = 0, < DPM Policy status allowed. * BLUETOOTH_DPM_RESTRICTED = 1, < DPM Policy status restricted. * * @remark None @@ -6515,6 +7170,386 @@ int bluetooth_dpm_set_data_transfer_state(bt_dpm_status_t value); int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value); /** + * @fn int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address, + * bluetooth_pxp_poperty_t property, int value); + * + * @brief Sets the Proximity alert level/properties for monitor role. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n + * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n + * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n + * + * @exception None + * @param[in] device_address remote device address + * @param[in] property proximity profile property + * @param[in] value alert level/property value to be set + * @param[out] None + * + * @remark None + */ +int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address, + bluetooth_pxp_poperty_t property, int value); + +/** + * @fn int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address, + * bluetooth_pxp_poperty_t property, int *value); + * + * @brief Reads the Proximity alert level/properties for monitor role. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n + * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n + * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n + * + * @exception None + * @param[in] device_address remote device address + * @param[in] property proximity profile property + * @param[out] value alert level/property value + * + * @remark None + */ +int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address, + bluetooth_pxp_poperty_t property, int *value); + +/** + * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address, + * int *services_supported); + * + * @brief Reads the Proximity Monitor profile supported properties/services. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n + * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n + * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n + * + * @exception None + * @param[in] device_address remote device address + * @param[out] services_supported proximity profile property/service + * + * @remark None + */ +int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address, + int *services_supported); + +/** + * @fn int bluetooth_proximity_reporter_register(); + * + * @brief Register all proximity related services in BlueZ. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n + * + * @exception None + * + * @remark None + */ +int bluetooth_proximity_reporter_register(void); + +/** + * @fn int bluetooth_proximity_reporter_unregister(); + * + * @brief Unregister all proximity related services in BlueZ. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n + * + * @exception None + * + * @remark None + */ +int bluetooth_proximity_reporter_unregister(void); + +/** + * @fn int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address, + * bluetooth_pxp_poperty_t property, int *value); + * + * @brief Reads the Proximity alert level/properties for reporter role. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n + * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n + * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n + * + * @exception None + * @param[in] device_address remote device address + * @param[in] property proximity profile property + * @param[out] value alert level/property value + * + * @remark None + */ +int bluetooth_proximity_reporter_get_property(const bluetooth_device_address_t *device_address, + bluetooth_pxp_poperty_t property, int *value); + +/** + * @fn int bluetooth_tds_provider_register(void); + * + * @brief Register Transport Discovery Provider role. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_ALREADY_INITIALIZED - Already done \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n + * BLUETOOTH_ERROR_INTERNAL - Operation failed\n + * + * @exception None + * @param[in] None + * @param[out] None + * + * @remark None + */ +int bluetooth_tds_provider_register(void); + +/** + * @fn int bluetooth_tds_provider_unregister(void); + * + * @brief Unregister Transport Discovery Provider role. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n + * BLUETOOTH_ERROR_INTERNAL - Operation failed\n + * + * @exception None + * @param[in] None + * @param[out] None + * + * @remark None + */ +int bluetooth_tds_provider_unregister(void); + +/** + * @fn int bluetooth_tds_provider_create(int transport, unsigned int handle); + * + * @brief Create Transport Discovery Provider for a transport. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n + * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n + * BLUETOOTH_ERROR_INTERNAL - Operation failed\n + * + * @exception None + * @param[in] Transport (BT, CUSTOM etc.) + * @param[in] Unique handle for TDS provider. + * @param[out] None + * + * @remark None + */ +int bluetooth_tds_provider_create(int transport, unsigned int handle); + +/** + * @fn int bluetooth_tds_provider_destroy(unsigned int handle); + * + * @brief Remove previously created Transport Discovery Provider. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n + * + * @exception None + * @param[in] Unique handle for previously created provider. + * @param[out] None + * + * @remark None + */ +int bluetooth_tds_provider_destroy(unsigned int handle); + +/** + * @fn int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length); + * + * @brief Set transport block for in advertisement and gatt db. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n + * BLUETOOTH_ERROR_INTERNAL - Operation failed\n + * + * @exception None + * @param[in] Provider specific manufacturer data. + * @param[in] Provider specific manufacturer data length. + * @param[out] None + * + * @remark None + */ +int bluetooth_set_tds_provider_manuf_data(unsigned char *buf, unsigned int length); + +/** + * @fn int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle, + * bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length); + * + * @brief Set transport block for in advertisement and gatt db. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter not enabled \n + * BLUETOOTH_ERROR_INTERNAL - Operation failed\n + * + * @exception None + * @param[in] Unique handle for TDS provider. + * @param[in] Transport state (On/Off/Not Available). + * @param[in] Transport specific data block. + * @param[in] Transport specific data block length. + * @param[out] None + * + * @remark None + */ +int bluetooth_set_tds_provider_transport_data(unsigned int tds_handle, + bluetooth_tds_transport_state_t state, unsigned char *buf, unsigned int length); + +/** + * @fn int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address, + * unsigned int tds_handle, int response, unsigned char *buf, unsigned int length); + * + * @brief Send response to TDS activation request from remoted device. + * + * This function is a synchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n + * BLUETOOTH_ERROR_NOT_INITIALIZED - Provider not registered \n + * BLUETOOTH_ERROR_INTERNAL - Operation failed\n + * + * @exception None + * @param[in] Remote device BT address. + * @param[in] Unique handle for TDS provider. + * @param[in] Response for TDS activation request. + * @param[in] Transport specific data block to be sent in activation response. + * @param[in] Data block length. + * @param[out] None + * + * @remark None + */ +int bluetooth_send_tds_activation_response(bluetooth_device_address_t *device_address, + unsigned int tds_handle, int response, unsigned char *buf, unsigned int length); + +/** + * @fn int bluetooth_tds_read_transport_data(bluetooth_device_address_t *device_address, const char *handle); + * + * @brief Reads the Complete TDS transport Blocks from Remote Provider's GATT database. + * + * This function is an asynchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n + * BLUETOOTH_ERROR_INTERNAL - Internal Error \n + * BLUETOOTH_ERROR_IN_PROGRESS - Already Read Request is pending on same provider \n + * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n + * + * @exception None + * @param[in] device_address remote device address + * @param[in] handle attribute handle + * + * @remark BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED event is sent to pplication + * when TDS data is received from Remote provider + */ +int bluetooth_tds_read_transport_data(const bluetooth_device_address_t *device_address, + const char *handle); + +/** + * @fn int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, const char *handle); + * + * @brief Enables CCCD on Remote Provider. + * + * This function is an asynchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n + * BLUETOOTH_ERROR_INTERNAL - Internal Error \n + * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n + * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n + * + * @exception None + * @param[in] device_address remote device address + * @param[in] handle attribute handle + * + * @remark BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED event is sent to application + * when Indication is enabled on Remote provider + */ +int bluetooth_tds_enable_control_point(const bluetooth_device_address_t *device_address, + const char *handle); + +/** + * @fn int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle + * unsigned char *buf, int length); + * @brief Sends activation request for Alternate Transport enable on Remote Provider + * + * This function is an asynchronous call. + * + * @return BLUETOOTH_ERROR_NONE - Success \n + * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n + * BLUETOOTH_ERROR_INTERNAL - Internal Error \n + * BLUETOOTH_ERROR_IN_PROGRESS - Already Control Point activation is ongoing to Same Provider \n + * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter \n + * + * @exception None + * @param[in] device_address remote device address + * @param[in] handle attribute handle + * @param[in] buf Control point activation param + * @param[in] param length + * + * @remark BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION event is sent to application when Indication response + * is received from remote Provider + */ +int bluetooth_tds_activate_control_point(const bluetooth_device_address_t *device_address, const char *handle, + unsigned char *buf, int length); + +/** + * @fn int bluetooth_otp_server_init(const char *directory); + * + * @brief Starts OTP server. + * + * This function is a synchronous call. + * + * @return + * + * @exception None + * @param[in] None + * @param[out] None + * + * @remark None + */ +int bluetooth_otp_server_init(const char *directory); + +/** + * @fn int bluetooth_otp_server_deinit(); + * + * @brief Stops OTP server. + * + * This function is a synchronous call. + * + * @return + * + * @exception None + * @param[in] None + * @param[out] None + * + * @remark None + */ +int bluetooth_otp_server_deinit(); + +/** * @} */