#define _BLUETOOTH_API_H_
#include <stdlib.h>
+#include <stdbool.h>
#include <unistd.h>
#include <glib.h>
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
* @{
*/
+#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
#define BLUETOOTH_OOB_DATA_LENGTH 16
+#define BLUETOOTH_LE_OOB_DATA_LENGTH 100
+
#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
*/
#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
+
+#define BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH 500 /**< OTP Characteristics Value Max length */
+
/**
* This is Bluetooth error code
*/
#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 */
+
+#define BLUETOOTH_ERROR_AUTHORIZATION_REJECTED ((int)BLUETOOTH_ERROR_BASE - 0x2a)
+ /**< Authorization rejected */
+
+/**
+* Error codes for ATT Error response *
+*/
+#define BLUETOOTH_ATT_ERROR_INTERNAL -1
+#define BLUETOOTH_ATT_ERROR_NONE 0x00
+#define BLUETOOTH_ATT_ERROR_INVALID_HANDLE 0x01
+#define BLUETOOTH_ATT_ERROR_READ_NOT_PERMITTED 0x02
+#define BLUETOOTH_ATT_ERROR_WRITE_NOT_PERMITTED 0x03
+#define BLUETOOTH_ATT_ERROR_INVALID_PDU 0x04
+#define BLUETOOTH_ATT_ERROR_AUTHENTICATION 0x05
+#define BLUETOOTH_ATT_ERROR_REQUEST_NOT_SUPPORTED 0x06
+#define BLUETOOTH_ATT_ERROR_INVALID_OFFSET 0x07
+#define BLUETOOTH_ATT_ERROR_AUTHORIZATION 0x08
+#define BLUETOOTH_ATT_ERROR_PREPARE_QUEUE_FULL 0x09
+#define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_FOUND 0x0A
+#define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_LONG 0x0B
+#define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE 0x0C
+#define BLUETOOTH_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN 0x0D
+#define BLUETOOTH_ATT_ERROR_UNLIKELY 0x0E
+#define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION 0x0F
+#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 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
+
+/*
+ * Bluetooth ATT error codes specific to OTP
+ */
+#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
+ * TODO: Check error code conflict
+ */
+#define BLUETOOTH_ERROR_INVALID_DIRECTORY 0x01
+#define BLUETOOTH_ERROR_NO_OBJECTS_FOUND 0x02
+
/**
* Device disconnection reasons; received from stack
*/
#define BLUETOOTH_ERROR_AUTH_FAILURE 0x05
#define BLUETOOTH_ERROR_PIN_OR_KEY_MISSING 0x06
#define BLUETOOTH_ERROR_CONNECTION_TIMEOUT 0x08
+#define BLUETOOTH_ERROR_CONNECTION_REJECTED_DUE_TO_SECURITY_REASONS 0x0e
#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
-
-
/**
* Device disconnect reason
*/
} bluetooth_device_address_type_t;
/**
+ * This is BD Address type defined in kernel BT header
+ */
+typedef enum {
+ BLUETOOTH_BDADDR_BREDR = 0x00,
+ BLUETOOTH_BDADDR_LE_PUBLIC = 0x01,
+ BLUETOOTH_BDADDR_LE_RANDOM = 0x02
+} bluetooth_bdaddr_type_e;
+
+/**
* This is Bluetooth version
*/
typedef struct {
} bluetooth_device_pin_code_t;
/**
+ * This is data for battery usage monitoring
+ */
+
+typedef struct {
+ time_t session_start_time;
+ time_t session_end_time;
+ uint32_t tx_time;
+ uint32_t rx_time;
+ uint32_t idle_time;
+ uint16_t session_connected_time;
+ uint16_t session_scan_time;
+ GSList *atm_list;
+} bt_battery_data;
+
+typedef struct {
+ uid_t uid;
+ pid_t pid;
+ uint16_t rx_bytes;
+ uint16_t tx_bytes;
+ uint time;
+} bt_battery_app_data;
+
+/**
* Adapter state
*/
typedef enum {
/**
* Service type
+ * Service type matched to bt_profile_type_t of bt-service-common.h
*/
typedef enum {
BLUETOOTH_RFCOMM_SERVICE = 0x01,
} 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;
+
+/**
+* OTP Characteristics Value
+*/
+typedef struct {
+ int length; /**< Characteristics value length */
+ guint8 data[BLUETOOTH_OTP_CHARC_VAL_MAX_LENGTH]; /**< Characteristics data */
+} bluetooth_otp_charc_data_t;
+
+/**
+* Structure to hold the OTP response data from remote OTP server
+*/
+typedef struct {
+ char *handle; /**< Handle */
+ int data_length; /**< Data length */
+ char *data; /**< Read data */
+} bluetooth_otp_resp_info_t;
+
+/**
+* Structure to hold the OTC Channel Info
+*/
+typedef struct {
+ gboolean connected; /**< Connection Status */
+ int fd; /**< Fd */
+ char *address; /**< Remote address */
+} bluetooth_otc_info_t;
+
+/**
* Advertising parameters
*/
typedef struct {
float interval_max;
guint8 filter_policy;
guint8 type;
+ int tx_power_level;
} bluetooth_advertising_params_t;
/**
float window; /**< LE scan window */
} bluetooth_le_scan_params_t;
+/**
+* LE Scan type
+*/
+typedef enum {
+ BLUETOOTH_LE_PASSIVE_SCAN = 0x00,
+ BLUETOOTH_LE_ACTIVE_SCAN
+} bluetooth_le_scan_type_t;
+
/*
LE Connection Update
*/
/**< 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
BLUETOOTH_EVENT_ENABLED, /**< Bluetooth event adpater enabled */
BLUETOOTH_EVENT_DISABLED, /**< Bluetooth event adpater disabled */
+ BLUETOOTH_EVENT_DISABLED_BATTERY_DATA, /**< Bluetooth event adapter disabled battery data*/
BLUETOOTH_EVENT_LE_ENABLED, /**< Bluetooth event adpater enabled */
BLUETOOTH_EVENT_LE_DISABLED, /**< Bluetooth event adpater disabled */
BLUETOOTH_EVENT_LOCAL_NAME_CHANGED, /**< Bluetooth event local name changed*/
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*/
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 */
BLUETOOTH_EVENT_GATT_SERVER_READ_REQUESTED, /** <GATT Characteristic/Descriptor Read Request event */
BLUETOOTH_EVENT_GATT_SERVER_VALUE_CHANGED, /** <GATT Characteristic/Descriptor Value change event */
BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED, /** <GATT Characteristic Notification change event */
BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_COMPLETED, /** <GATT Characteristic Notification or Indication completed event */
BLUETOOTH_EVENT_GATT_CLIENT_SERVICE_CHANGED, /** <GATT Client service change event */
-
+ BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_WRITE, /** <GATT Characteristic/Descriptor Value change event */
+ BLUETOOTH_EVENT_GATT_SERVER_ACQUIRE_NOTIFY,
BLUETOOTH_EVENT_AG_CONNECTED = BLUETOOTH_EVENT_AUDIO_BASE, /**<AG service connected event*/
BLUETOOTH_EVENT_AG_DISCONNECTED, /**<AG service disconnected event*/
BLUETOOTH_EVENT_AG_SPEAKER_GAIN, /**<Speaker gain request event*/
BLUETOOTH_EVENT_AVRCP_SETTING_EQUALIZER_STATUS, /**<AVRCP service player equalizer status event*/
BLUETOOTH_EVENT_AVRCP_SETTING_REPEAT_STATUS, /**<AVRCP service player repeat status event*/
BLUETOOTH_EVENT_AVRCP_SETTING_SCAN_STATUS, /**<AVRCP service player scan status event*/
+ BLUETOOTH_EVENT_AVRCP_DELAY_CHANGED, /**<AVRCP service transport delay changed event*/
+ BLUETOOTH_EVENT_AVRCP_VOLUME_CHANGED, /**<AVRCP service transport volume changed event*/
+ BLUETOOTH_EVENT_AUDIO_AVC_STATUS, /**<Absolute Volume Control status changed event*/
BLUETOOTH_EVENT_HF_CONNECTED,
BLUETOOTH_EVENT_HF_DISCONNECTED,
BLUETOOTH_EVENT_HF_AUDIO_CONNECTED,
BLUETOOTH_EVENT_HF_CALLSETUP_DIALING,
BLUETOOTH_EVENT_HF_CALLSETUP_ALERTING,
BLUETOOTH_EVENT_HF_CIEV_DEVICE_STATUS_CHANGED,
+ BLUETOOTH_EVENT_AUDIO_AVC_MODE_CHANGED,
BLUETOOTH_HID_CONNECTED = BLUETOOTH_EVENT_HID_BASE, /**< Input connectd event*/
BLUETOOTH_HID_DISCONNECTED, /**< Input disconnectd event*/
BLUETOOTH_EVENT_IPSP_INTERFACE_INFO, /** IPSP BT Interface Info after connection */
BLUETOOTH_EVENT_LE_DATA_LENGTH_CHANGED, /** LE data length values changed */
BLUETOOTH_EVENT_PXP_PROPERTY_CHANGED, /** Proximity property changed */
+ BLUETOOTH_EVENT_TDS_ACTIVATION_REQUESTED, /** TDS activation requested */
+ BLUETOOTH_EVENT_TDS_TRANSPORT_DATA_RECEIVED, /** TDS Transport Data received */
+ BLUETOOTH_EVENT_TDS_ACTIVATION_RESULT, /** TDS Activation Result */
+ BLUETOOTH_EVENT_TDS_CONTROL_POINT_ENABLED, /** TDS CCCD enabled event */
+ BLUETOOTH_EVENT_TDS_ACTIVATION_INDICATION, /** TDS Activation Indication from Provider */
+
+ BLUETOOTH_EVENT_OTP_SERVER_STATE_CHANGED, /* OTP Server Status **/
+ BLUETOOTH_EVENT_OTP_READ_CHAR_VAL, /* OTP Read Value Response */
+ BLUETOOTH_EVENT_OTP_NOTIFICATION_ENABLED, /* OTP Notification Enabled Response */
+ BLUETOOTH_EVENT_OTP_WRITE_CHAR_VAL, /* OTP Write Value Response */
+ BLUETOOTH_EVENT_OTP_INDICATION, /* OTP Indication */
+ BLUETOOTH_EVENT_OTC_STATE_CHANGED, /* OTC Connection State Changed Event */
} bluetooth_event_type_t;
/**
BLUETOOTH_DUN_PROFILE_UUID = ((unsigned short)0x1103), /**<DUN*/
BLUETOOTH_OBEX_IR_MC_SYNC_SERVICE_UUID = ((unsigned short)0x1104), /**<OBEX IR MC SYNC*/
BLUETOOTH_OBEX_OBJECT_PUSH_SERVICE_UUID = ((unsigned short)0x1105), /**<OPP*/
+ BLUETOOTH_OBEX_MESSAGE_ACCESS_SERVICE_UUID = ((unsigned short)0x1134), /**<MAP*/
BLUETOOTH_OBEX_FILE_TRANSFER_UUID = ((unsigned short)0x1106), /**<FTP*/
BLUETOOTH_IRMC_SYNC_COMMAND_UUID = ((unsigned short)0x1107), /**<IRMC SYNC COMMAND*/
BLUETOOTH_HS_PROFILE_UUID = ((unsigned short)0x1108), /**<HS*/
bluetooth_device_address_t device_address; /**< remote device address */
bluetooth_device_name_t device_name; /**< device name */
char str_passkey[BLUETOOTH_DEVICE_PASSKEY_LENGTH_MAX]; /**< pass-key string */
+ bool incoming; /**< stores if bonding request is incoming */
} bluetooth_authentication_request_info_t;
/**
bluetooth_device_address_t device_addr;
unsigned char addr_type;
int disc_reason;
+ int rssi;
} bt_connection_info_t;
/**
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
*/
int percentage;
} bt_opc_transfer_info_t;
+/* TODO: MAP client structures, see above */
+/**
+ * Stucture to Map filter fields
+ */
+typedef struct {
+ char **fields;
+ int size;
+} bt_map_list_filter_fields_info_t;
+
/* Obex Server transfer type */
#define TRANSFER_PUT "PUT"
#define TRANSFER_GET "GET"
unsigned char randomizer256[BLUETOOTH_OOB_DATA_LENGTH];
unsigned int hash256_len;
unsigned int randomizer256_len;
+
+ unsigned char eir[BLUETOOTH_LE_OOB_DATA_LENGTH];
+ unsigned int eir_len;
} bt_oob_data_t;
/**
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
*/
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;
/**
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;
/**
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;
/**
guint32 val_len;
} bt_gatt_char_value_t;
+typedef struct {
+ unsigned char UUID[16];
+ char address[18];
+ char *val;
+ int len;
+} bt_gatt_notify_req_t ;
+
/**
* Structure to GATT Read Request
*/
char *service_handle;
char *address;
guint16 offset;
- guint8 req_id;
+ guint req_id;
} bt_gatt_read_req_t;
/**
char *att_handle;
char *service_handle;
char *address;
- guint8 req_id;
+ guint req_id;
+ gboolean response_needed;
guint16 offset;
guint8 *att_value;
guint32 val_len;
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;
/**
} bt_gatt_indicate_confirm_t;
/**
+ * Structure for GATT response data
+ */
+typedef struct {
+ char *handle;
+ 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 {
char if_name[16];
} bt_ipsp_connection_info_t;
+typedef struct {
+ char* session_path;
+ char* remote_address;
+} bt_map_client_session_info_s;
+
+typedef char* bt_map_client_message_object_t;
+
+typedef struct {
+ int16_t offset;
+ int16_t max_count;
+} bt_map_client_list_folders_filter_t;
+
+typedef struct {
+ int16_t offset;
+ int16_t max_count;
+ int8_t subject_length;
+ char *fields;
+ char *types;
+ char *period_begin;
+ char *period_end;
+ int is_read;
+ char *recipient;
+ char *sender;
+ int is_priority;
+} bt_map_client_list_messages_filter_t;
+
+typedef struct {
+ bt_map_client_message_object_t message_object;
+ char *folder;
+ char *subject;
+ char *timestamp;
+ char *sender;
+ char *sender_address;
+ char *reply_to;
+ char *recipient;
+ char *recipient_address;
+ char *type;
+ int64_t size;
+ int is_text;
+ char *status;
+ int64_t attachment_size;
+ int is_priority;
+ int is_read;
+ int is_sent;
+ int is_protected;
+} bt_map_client_message_item_t;
+
+typedef struct {
+ int is_transparent;
+ int is_retry;
+ char *charset;
+} bt_map_client_push_message_args_t;
+
+typedef struct {
+ char *folder;
+ char *subject;
+ char *timestamp;
+ char *sender;
+ char *sender_address;
+ char *reply_to;
+ char *recipient;
+ char *recipient_address;
+ char *type;
+ int64_t size;
+ char *status;
+ int is_priority;
+ int is_read;
+ int is_deleted;
+ int is_sent;
+ int is_protected;
+} bt_map_client_message_t;
+
+typedef struct {
+ char **names; // holding %size null-terminated folder names
+ int64_t size;
+} bt_map_client_folders_s;
+
+typedef struct {
+ bt_map_client_message_item_t *message_items;
+ int64_t size;
+} bt_map_client_message_items_s;
+
+typedef struct {
+ const char* target_file;
+ void* user_data;
+} bt_get_message_callback_data;
+
/**
* Callback pointer type
*/
@endcode
*/
int bluetooth_disable_adapter(void);
+int bluetooth_read_battery_data(bt_battery_data *latest);
+int bluetooth_set_battery_monitor_state(bool state);
+int bluetooth_get_battery_monitor_state(void);
int bluetooth_recover_adapter(void);
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)
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
*
*/
gboolean bluetooth_is_le_scanning(void);
-gboolean bluetooth_is_scan_filter_supported(void);
+int bluetooth_is_scan_filter_supported(gboolean *is_supported);
/**
* @fn int bluetooth_force_hcidump(int timeout)
int bluetooth_force_hcidump(int timeout);
/**
- * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id)
+ * @fn int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter)
* @brief Register scan filter.
*
* This function registers the scan filter.
* @return BLUETOOTH_ERROR_NONE - Success \n
*
* @param[in] filter scan filter to register
- * @param[out] slot_id the slot ID of scan filter
- *
- * @remark None
- */
-int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter, int *slot_id);
-
-/**
- * @fn int bluetooth_unregister_scan_filter(int slot_id)
- * @brief Register scan filter.
- *
- * This function unregisters the scan filter.
- *
- * This function is a synchronous call.
- *
- * @return BLUETOOTH_ERROR_NONE - Success \n
- *
- * @param[in] slot_id the slot ID of scan filter
- *
- * @remark None
- */
-int bluetooth_unregister_scan_filter(int slot_id);
-
-/**
- * @fn int bluetooth_unregister_all_scan_filters(void)
- * @brief Register scan filter.
- *
- * This function usregisters all scan filters.
- *
- * This function is a synchronous call.
- *
- * @return BLUETOOTH_ERROR_NONE - Success \n
*
* @remark None
*/
-int bluetooth_unregister_all_scan_filters(void);
+int bluetooth_register_scan_filter(bluetooth_le_scan_filter_t *filter);
/**
* @fn int bluetooth_enable_rssi(const bluetooth_device_address_t *remote_address,
int bluetooth_is_connectable(gboolean *is_connectable);
+int bluetooth_disconnect_device(const bluetooth_device_address_t *device_address);
+
/**
* @fn int bluetooth_bond_device(const bluetooth_device_address_t *device_address)
* @brief Initiate a bonding process
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)
/**
+ * @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_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
+ *
+ * @remark None
+ * @see bluetooth_map_client_deinit
+ */
+int bluetooth_map_client_init(void);
+
+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_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 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.
*
/**
* @fn int bluetooth_oob_add_remote_data(
* const bluetooth_device_address_t *remote_device_address,
+ * bluetooth_bdaddr_type_e address_type,
* bt_oob_data_t *oob_data)
* @brief Add/updated the remote device Hash and Randmizer.
*
*
* @exception None
* @param[in] remote_device_address - Remote device address
+ * address_type - bdaddr type
* remote_oob_data - Ponter to Hash and Randomizer oob data structure
*
* @remark None
int bluetooth_oob_add_remote_data(
const bluetooth_device_address_t *remote_device_address,
+ bluetooth_bdaddr_type_e address_type,
bt_oob_data_t *remote_oob_data);
int bluetooth_oob_remove_remote_data(
const bluetooth_device_address_t *remote_device_address);
+
/**
- * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
- * bt_gatt_handle_info_t *prim_svc);
- *
- * @brief Gets the GATT based primary services handle supported by remote device
+ * @fn int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data)
+ * @brief Read the local Hash and Randmizer.
*
* This function is a synchronous call.
- * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
*
* @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
*
- * @exception None
- * @param[in] address - Remote device address
- * @param[out] prim_svc - Structure containing remote service count and handle list.
+ * @exception None
+ * @param[in] None.
+ * @param[out] local_oob_data - Pointer to the local OOB data
*
- * @remark None
- * @see bluetooth_gatt_free_primary_services()
+ * @remark None
+ * @see None
*/
-int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
- bt_gatt_handle_info_t *prim_svc);
+int bluetooth_le_oob_read_local_data(bt_oob_data_t *local_oob_data);
/**
- * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
- *
- * @brief Discovers the characteristics of GATT based service of remote device
+ * @fn int bluetooth_le_oob_add_remote_data(
+ * const bluetooth_device_address_t *remote_device_address,
+ * bluetooth_bdaddr_type_e address_type,
+ * bt_oob_data_t *oob_data)
+ * @brief Add/updated the remote device Hash and Randmizer.
*
- * This function is an asynchronous call.
- * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
+ * This function is a synchronous call.
+ * No event for this api..
+ *
+ * @return BLUETOOTH_ERROR_NONE - Success \n
+ * BLUETOOTH_ERROR_INTERNAL - Internal Error \n
+ *
+ * @exception None
+ * @param[in] remote_device_address - Remote device address
+ * address_type - bdaddr type
+ * remote_oob_data - Ponter to Hash and Randomizer oob data structure
+ *
+ * @remark None
+ * @see None
+ */
+int bluetooth_le_oob_add_remote_data(
+ const bluetooth_device_address_t *remote_device_address,
+ bluetooth_bdaddr_type_e address_type,
+ bt_oob_data_t *remote_oob_data);
+
+/**
+ * @fn int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
+ * bt_gatt_handle_info_t *prim_svc);
+ *
+ * @brief Gets the GATT based primary services handle supported by remote device
+ *
+ * This function is a synchronous call.
+ * The output parameter needs to be freed by calling bluetooth_gatt_free_primary_services()
+ *
+ * @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
+ *
+ * @exception None
+ * @param[in] address - Remote device address
+ * @param[out] prim_svc - Structure containing remote service count and handle list.
+ *
+ * @remark None
+ * @see bluetooth_gatt_free_primary_services()
+ */
+int bluetooth_gatt_get_primary_services(const bluetooth_device_address_t *address,
+ bt_gatt_handle_info_t *prim_svc);
+
+/**
+ * @fn int bluetooth_gatt_discover_service_characteristics(const char *service_handle)
+ *
+ * @brief Discovers the characteristics of GATT based service of remote device
+ *
+ * This function is an asynchronous call.
+ * This API is responded with BLUETOOTH_EVENT_GATT_SVC_CHAR_DISCOVERED
*
* @return BLUETOOTH_ERROR_NONE - Success \n
* BLUETOOTH_ERROR_INTERNAL - Internal Error \n
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,
*/
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);
+
+int bluetooth_enable_gatt_data_batching(
+ const bluetooth_device_address_t *device_address, int packet_threshold, int timeout);
+
+int bluetooth_disable_gatt_data_batching(
+ const bluetooth_device_address_t *device_address);
/**
* @fn int bluetooth_gatt_discover_characteristic_descriptor(const char *characteristic_handle);
* @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)
*
int bluetooth_set_scan_parameters(bluetooth_le_scan_params_t *params);
/**
+ * @fn intbluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
+ *ss
+ * @brief Set scan type
+ *
+ * This function is used to set LE scan type
+ *
+ * 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] scan_type - LE scan type
+ *
+ * @remark None
+ */
+int bluetooth_set_scan_type(bluetooth_le_scan_type_t scan_type);
+
+/**
* @fn int bluetooth_is_advertising(void)
* @brief Check for the advertising is in-progress or not.
*
int bluetooth_dpm_get_data_transfer_state(bt_dpm_status_t *value);
/**
- * @fn int bluetooth_set_proximity_property(const bluetooth_device_address_t *device_address,
+ * @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.
+ * @brief Sets the Proximity alert level/properties for monitor role.
*
* This function is a synchronous call.
*
*
* @remark None
*/
-int bluetooth_set_proximity_property(const bluetooth_device_address_t *device_address,
+int bluetooth_proximity_monitor_set_property(const bluetooth_device_address_t *device_address,
bluetooth_pxp_poperty_t property, int value);
/**
- * @fn int bluetooth_get_proximity_property(const bluetooth_device_address_t *device_address,
+ * @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.
+ * @brief Reads the Proximity alert level/properties for monitor role.
*
* This function is a synchronous call.
*
*
* @remark None
*/
-int bluetooth_get_proximity_property(const bluetooth_device_address_t *device_address,
+int bluetooth_proximity_monitor_get_property(const bluetooth_device_address_t *device_address,
bluetooth_pxp_poperty_t property, int *value);
/**
- * @fn int bluetooth_get_proximity_supported_services(const bluetooth_device_address_t *device_address,
+ * @fn int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
* int *services_supported);
*
- * @brief Reads the Proximity profile supported properties/services.
+ * @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
+ * @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
*
* @remark None
*/
-int bluetooth_get_proximity_supported_services(const bluetooth_device_address_t *device_address,
+int bluetooth_proximity_monitor_get_supported_services(const bluetooth_device_address_t *device_address,
int *services_supported);
/**
- * @fn int bluetooth_register__proximity_reporter();
+ * @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
+ * @return BLUETOOTH_ERROR_NONE - Success \n
+ * BLUETOOTH_ERROR_NOT_FOUND - Cannot find the proxy\n
*
* @exception None
*
* @remark None
*/
-int bluetooth_register_proximity_reporter();
+int bluetooth_proximity_reporter_register(void);
/**
- * @fn int bluetooth_unregister__proximity_reporter();
+ * @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
+ * @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();
+
+/**
+ * @fn int bluetooth_otp_enable_notification(const char *handle);
+ *
+ * @brief Enable notification for remote OACP & OLCP characteristics.
+ *
+ * This function is a synchronous call.
+ *
+ * @return
+ *
+ * @exception None
+ * @param[in] None
+ * @param[out] None
+ *
+ * @remark None
+ */
+int bluetooth_otp_enable_notification(const char *handle);
+
+/**
+ * @fn int bluetooth_otp_write_characteristics_value( const char *handle,
+ * unsigned char *buf, int length);
+ *
+ * @brief Write value on remote characteristics.
+ *
+ * This function is a synchronous call.
+ *
+ * @return
*
* @exception None
+ * @param[in] None
+ * @param[out] None
*
* @remark None
*/
-int bluetooth_unregister_proximity_reporter();
+int bluetooth_otp_write_characteristics_value(const char *handle,
+ unsigned char *buf, int length);
+
+/**
+ * @fn int bluetooth_otp_read_characteristic_value(const char *handle);
+ *
+ * @brief Read value for remote characteristics.
+ *
+ * This function is a synchronous call.
+ *
+ * @return
+ *
+ * @exception None
+ * @param[in] None
+ * @param[out] None
+ *
+ * @remark None
+ */
+int bluetooth_otp_read_characteristic_value(const char *handle);
+
+/**
+ * @fn int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
+ *
+ * @brief Read value for remote characteristics.
+ *
+ * This function is a synchronous call.
+ *
+ * @return
+ *
+ * @exception None
+ * @param[in] None
+ * @param[out] None
+ *
+ * @remark None
+ */
+int bluetooth_otp_connect_otc(const bluetooth_device_address_t *device_address);
+
+/**
+ * @fn int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
+ *
+ * @brief Read value for remote characteristics.
+ *
+ * This function is a synchronous call.
+ *
+ * @return
+ *
+ * @exception None
+ * @param[in] None
+ * @param[out] None
+ *
+ * @remark None
+ */
+int bluetooth_otp_disconnect_otc(const bluetooth_device_address_t *device_address);
+
+/**
+ * @fn int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
+ * @brief Check if Adapter supports LE 2M PHY feature or not.
+ *
+ * This API is used to check the whether LE Adapter supports LE 2M PHY feature, which is introduced
+ * in BT 5.0 specification.
+ *
+ * This function is a synchronous call.
+ *
+ * @return BLUETOOTH_ERROR_NONE - Succeess \n
+ * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
+ * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
+ * BLUETOOTH_ERROR_INTERNAL - Internal error \n
+ * @param[out] is_supported. This boolean variable indicates whether LE 2M PHY is supported or not
+ *
+ * @remark None
+ */
+int bluetooth_is_le_2m_phy_supported(gboolean *is_supported);
+
+/**
+ * @fn int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
+ * @brief Check if Adapter supports LE 2M CODED feature or not.
+ *
+ * This API is used to check the whether LE Adapter supports LE CODED PHY feature, which is introduced
+ * in BT 5.0 specification.
+ *
+ * This function is a synchronous call.
+ *
+ * @return BLUETOOTH_ERROR_NONE - Succeess \n
+ * BLUETOOTH_ERROR_INVALID_PARAM - Invalid parameter (NULL buffer) \n
+ * BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Adapter is disabled \n
+ * BLUETOOTH_ERROR_INTERNAL - Internal error \n
+ * @param[out] is_supported. This boolean variable indicates whether LE CODED PHY is supported or not
+ *
+ * @remark None
+ */
+int bluetooth_is_le_coded_phy_supported(gboolean *is_supported);
/**
* @}