#include <stdbool.h>
#include <unistd.h>
#include <glib.h>
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#define BLUETOOTH_OOB_DATA_LENGTH 16
+#define BLUETOOTH_LE_OOB_DATA_LENGTH 100
+
#define BLUETOOTH_PIN_CODE_MAX_LENGTH 16
#ifdef TIZEN_GATT_CLIENT
} bluetooth_device_pin_code_t;
/**
+ * This is data for battery usage monitoring
+ */
+
+typedef struct {
+ time_t session_start_time;
+ time_t session_end_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 {
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_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_device_address_t device_addr;
unsigned char addr_type;
int disc_reason;
+ int rssi;
} bt_connection_info_t;
/**
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;
/**
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;
/**
@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);
*/
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_oob_remove_remote_data(
const bluetooth_device_address_t *remote_device_address);
+
+/**
+ * @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.
+ *
+ * @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_le_oob_read_local_data(bt_oob_data_t *local_oob_data);
+
+/**
+ * @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 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);