summaryrefslogtreecommitdiffstats
path: root/btif
diff options
context:
space:
mode:
Diffstat (limited to 'btif')
-rwxr-xr-x[-rw-r--r--]btif/co/bta_hh_co.c0
-rw-r--r--btif/include/btif_api.h61
-rw-r--r--btif/include/btif_av.h34
-rw-r--r--btif/include/btif_av_api.h19
-rw-r--r--btif/include/btif_av_co.h17
-rw-r--r--btif/include/btif_common.h73
-rw-r--r--btif/include/btif_config.h23
-rw-r--r--btif/include/btif_config_util.h19
-rw-r--r--btif/include/btif_dm.h32
-rw-r--r--btif/include/btif_hh.h56
-rw-r--r--btif/include/btif_hl.h369
-rw-r--r--btif/include/btif_media.h38
-rw-r--r--btif/include/btif_pan.h13
-rw-r--r--btif/include/btif_pan_internal.h32
-rw-r--r--btif/include/btif_profile_queue.h11
-rw-r--r--btif/include/btif_sm.h27
-rw-r--r--btif/include/btif_sock.h12
-rw-r--r--btif/include/btif_sock_rfc.h17
-rw-r--r--btif/include/btif_sock_sdp.h14
-rw-r--r--btif/include/btif_sock_thread.h37
-rw-r--r--btif/include/btif_sock_util.h21
-rw-r--r--btif/include/btif_storage.h50
-rwxr-xr-x[-rw-r--r--]btif/include/btif_util.h25
-rw-r--r--btif/include/uinput.h10
-rwxr-xr-x[-rw-r--r--]btif/src/btif_core.c0
-rwxr-xr-x[-rw-r--r--]btif/src/btif_dm.c2
-rwxr-xr-x[-rw-r--r--]btif/src/btif_hh.c8
-rwxr-xr-x[-rw-r--r--]btif/src/btif_hl.c0
-rwxr-xr-x[-rw-r--r--]btif/src/btif_rc.c0
-rwxr-xr-x[-rw-r--r--]btif/src/btif_storage.c0
-rwxr-xr-x[-rw-r--r--]btif/src/btif_util.c0
31 files changed, 538 insertions, 482 deletions
diff --git a/btif/co/bta_hh_co.c b/btif/co/bta_hh_co.c
index a2cbd7b..a2cbd7b 100644..100755
--- a/btif/co/bta_hh_co.c
+++ b/btif/co/bta_hh_co.c
diff --git a/btif/include/btif_api.h b/btif/include/btif_api.h
index 69224d5..7916b3d 100644
--- a/btif/include/btif_api.h
+++ b/btif/include/btif_api.h
@@ -45,7 +45,7 @@
*
*****************************************************************************/
-/*******************************************************************************
+/*****************************************************************************
*
* Filename: btif_api.h
*
@@ -54,7 +54,7 @@
* require headerfiles as they would be accessed through
* callout/callins.
*
- *******************************************************************************/
+ *****************************************************************************/
#ifndef BTIF_API_H
#define BTIF_API_H
@@ -62,9 +62,31 @@
#include "btif_common.h"
#include "btif_dm.h"
-/*******************************************************************************
+/*****************************************************************************
+** Constants & Macros
+******************************************************************************/
+
+/*****************************************************************************
+** Type definitions for callback functions
+******************************************************************************/
+
+/*****************************************************************************
+** Type definitions and return values
+******************************************************************************/
+
+/*****************************************************************************
+** Extern variables and functions
+******************************************************************************/
+
+/*****************************************************************************
+** Functions
+******************************************************************************/
+
+
+/*****************************************************************************
** BTIF CORE API
-********************************************************************************/
+******************************************************************************/
+
/*******************************************************************************
**
@@ -75,6 +97,7 @@
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_init_bluetooth(void);
/*******************************************************************************
@@ -86,6 +109,7 @@ bt_status_t btif_init_bluetooth(void);
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_enable_bluetooth(void);
/*******************************************************************************
@@ -99,6 +123,7 @@ bt_status_t btif_enable_bluetooth(void);
** Returns void
**
*******************************************************************************/
+
bt_status_t btif_disable_bluetooth(void);
/*******************************************************************************
@@ -112,8 +137,10 @@ bt_status_t btif_disable_bluetooth(void);
** Returns void
**
*******************************************************************************/
+
bt_status_t btif_shutdown_bluetooth(void);
+
/*******************************************************************************
**
** Function btif_get_adapter_properties
@@ -123,6 +150,7 @@ bt_status_t btif_shutdown_bluetooth(void);
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_get_adapter_properties(void);
/*******************************************************************************
@@ -134,6 +162,7 @@ bt_status_t btif_get_adapter_properties(void);
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_get_adapter_property( bt_property_type_t type);
/*******************************************************************************
@@ -146,6 +175,7 @@ bt_status_t btif_get_adapter_property( bt_property_type_t type);
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_set_adapter_property( const bt_property_t *property);
/*******************************************************************************
@@ -157,9 +187,11 @@ bt_status_t btif_set_adapter_property( const bt_property_t *property);
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_get_remote_device_property( bt_bdaddr_t *remote_addr,
bt_property_type_t type);
+
/*******************************************************************************
**
** Function btif_get_remote_device_properties
@@ -169,8 +201,10 @@ bt_status_t btif_get_remote_device_property( bt_bdaddr_t *remote_addr,
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_get_remote_device_properties( bt_bdaddr_t *remote_addr);
+
/*******************************************************************************
**
** Function btif_set_remote_device_property
@@ -182,9 +216,11 @@ bt_status_t btif_get_remote_device_properties( bt_bdaddr_t *remote_addr);
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_set_remote_device_property( bt_bdaddr_t *remote_addr,
const bt_property_t *property);
+
/*******************************************************************************
**
** Function btif_get_remote_service_record
@@ -195,13 +231,13 @@ bt_status_t btif_set_remote_device_property( bt_bdaddr_t *remote_addr,
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_get_remote_service_record( bt_bdaddr_t *remote_addr,
bt_uuid_t *uuid);
-
-/*******************************************************************************
+/*****************************************************************************
** BTIF DM API
-********************************************************************************/
+******************************************************************************/
/*******************************************************************************
**
@@ -213,6 +249,7 @@ bt_status_t btif_get_remote_service_record( bt_bdaddr_t *remote_addr,
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_dm_start_discovery(void);
/*******************************************************************************
@@ -224,6 +261,7 @@ bt_status_t btif_dm_start_discovery(void);
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_dm_cancel_discovery(void);
/*******************************************************************************
@@ -235,6 +273,7 @@ bt_status_t btif_dm_cancel_discovery(void);
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_dm_create_bond(const bt_bdaddr_t *bd_addr);
/*******************************************************************************
@@ -246,6 +285,7 @@ bt_status_t btif_dm_create_bond(const bt_bdaddr_t *bd_addr);
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_dm_cancel_bond(const bt_bdaddr_t *bd_addr);
/*******************************************************************************
@@ -257,6 +297,7 @@ bt_status_t btif_dm_cancel_bond(const bt_bdaddr_t *bd_addr);
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_dm_remove_bond(const bt_bdaddr_t *bd_addr);
/*******************************************************************************
@@ -268,6 +309,7 @@ bt_status_t btif_dm_remove_bond(const bt_bdaddr_t *bd_addr);
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_dm_pin_reply( const bt_bdaddr_t *bd_addr, uint8_t accept,
uint8_t pin_len, bt_pin_code_t *pin_code);
@@ -280,6 +322,7 @@ bt_status_t btif_dm_pin_reply( const bt_bdaddr_t *bd_addr, uint8_t accept,
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_dm_passkey_reply( const bt_bdaddr_t *bd_addr,
uint8_t accept, uint32_t passkey);
@@ -292,6 +335,7 @@ bt_status_t btif_dm_passkey_reply( const bt_bdaddr_t *bd_addr,
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_dm_ssp_reply( const bt_bdaddr_t *bd_addr,
bt_ssp_variant_t variant, uint8_t accept,
uint32_t passkey);
@@ -305,6 +349,7 @@ bt_status_t btif_dm_ssp_reply( const bt_bdaddr_t *bd_addr,
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_dm_get_adapter_property(bt_property_t *prop);
/*******************************************************************************
@@ -316,6 +361,7 @@ bt_status_t btif_dm_get_adapter_property(bt_property_t *prop);
** Returns bt_status_t
**
*******************************************************************************/
+
bt_status_t btif_dm_get_remote_service_record(bt_bdaddr_t *remote_addr,
bt_uuid_t *uuid);
@@ -355,3 +401,4 @@ bt_status_t btif_dut_mode_configure(uint8_t enable);
bt_status_t btif_dut_mode_send(uint16_t opcode, uint8_t *buf, uint8_t len);
#endif /* BTIF_API_H */
+
diff --git a/btif/include/btif_av.h b/btif/include/btif_av.h
index 0182a80..2c08a99 100644
--- a/btif/include/btif_av.h
+++ b/btif/include/btif_av.h
@@ -45,14 +45,14 @@
*
*****************************************************************************/
-/*******************************************************************************
+/*****************************************************************************
*
* Filename: btif_av.h
*
* Description: Main API header file for all BTIF AV functions accessed
* from internal stack.
*
- *******************************************************************************/
+ *****************************************************************************/
#ifndef BTIF_AV_H
#define BTIF_AV_H
@@ -62,9 +62,14 @@
#include "bta_av_api.h"
-/*******************************************************************************
+/*****************************************************************************
+** Constants & Macros
+******************************************************************************/
+
+/*****************************************************************************
** Type definitions for callback functions
-********************************************************************************/
+******************************************************************************/
+
typedef enum {
/* Reuse BTA_AV_XXX_EVT - No need to redefine them here */
@@ -76,10 +81,26 @@ typedef enum {
BTIF_AV_RECONFIGURE_REQ_EVT,
} btif_av_sm_event_t;
+/*****************************************************************************
+** Type definitions and return values
+******************************************************************************/
-/*******************************************************************************
+/*****************************************************************************
+** Extern variables and functions
+******************************************************************************/
+
+/*****************************************************************************
+** Functions
+******************************************************************************/
+
+
+/*****************************************************************************
+** BTIF CORE API
+******************************************************************************/
+
+/*****************************************************************************
** BTIF AV API
-********************************************************************************/
+******************************************************************************/
/*******************************************************************************
**
@@ -143,3 +164,4 @@ void btif_dispatch_sm_event(btif_av_sm_event_t event, void *p_data, int len);
bt_status_t btif_av_init(void);
#endif /* BTIF_AV_H */
+
diff --git a/btif/include/btif_av_api.h b/btif/include/btif_av_api.h
index 2c908c7..4cee7b5 100644
--- a/btif/include/btif_av_api.h
+++ b/btif/include/btif_av_api.h
@@ -54,7 +54,6 @@
** Bluetooth application layer for mobile phones.
**
*****************************************************************************/
-
#ifndef BTIF_AV_API_H
#define BTIF_AV_API_H
@@ -71,7 +70,7 @@
** Constants and data types
*****************************************************************************/
-/* Codec type */
+/* codec type */
#define BTIF_AV_CODEC_NONE 0xFF
#define BTIF_AV_CODEC_SBC A2D_MEDIA_CT_SBC /* SBC media codec type */
@@ -94,7 +93,7 @@ typedef UINT8 tBTIF_AV_CHNL;
typedef UINT8 tBTIF_AV_HNDL;
-/* Operation id list for BTIF_AvRemoteCmd */
+/* operation id list for BTIF_AvRemoteCmd */
#define BTIF_AV_ID_SELECT 0x00 /* select */
#define BTIF_AV_ID_UP 0x01 /* up */
#define BTIF_AV_ID_DOWN 0x02 /* down */
@@ -156,7 +155,7 @@ typedef UINT8 tBTIF_AV_HNDL;
typedef UINT8 tBTIF_AV_RC;
-/* State flag for pass through command */
+/* state flag for pass through command */
#define BTIF_AV_STATE_PRESS 0 /* key pressed */
#define BTIF_AV_STATE_RELEASE 1 /* key released */
@@ -164,7 +163,7 @@ typedef UINT8 tBTIF_AV_STATE;
typedef UINT8 tBTIF_AV_RC_HNDL;
-/* Command codes for BTIF_AvVendorCmd */
+/* command codes for BTIF_AvVendorCmd */
#define BTIF_AV_CMD_CTRL 0
#define BTIF_AV_CMD_STATUS 1
#define BTIF_AV_CMD_SPEC_INQ 2
@@ -200,17 +199,16 @@ typedef UINT8 tBTIF_AV_FEEDING_MODE;
#define BTIF_AV_CHANNEL_MODE_DUAL A2D_SBC_IE_CH_MD_DUAL
typedef UINT8 tBTIF_AV_CHANNEL_MODE;
-
-/**
+/*
* Structure used to configure the AV codec capabilities/config
*/
typedef struct
{
tBTIF_AV_CODEC_ID id; /* Codec ID (in terms of BTIF) */
- UINT8 info[AVDT_CODEC_SIZE]; /* Codec info (can be config or capabilities) */
+ UINT8 info[AVDT_CODEC_SIZE]; /* Codec info (can be config or capabilities) */
} tBTIF_AV_CODEC_INFO;
-/**
+/*
* Structure used to configure the AV media feeding
*/
typedef struct
@@ -220,9 +218,10 @@ typedef struct
UINT8 bit_per_sample; /* Number of bits per sample (8, 16) */
} tBTIF_AV_MEDIA_FEED_CFG_PCM;
+
typedef union
{
- tBTIF_AV_MEDIA_FEED_CFG_PCM pcm; /* Raw PCM feeding format */
+ tBTIF_AV_MEDIA_FEED_CFG_PCM pcm; /* raw PCM feeding format */
}tBTIF_AV_MEDIA_FEED_CFG;
typedef struct
diff --git a/btif/include/btif_av_co.h b/btif/include/btif_av_co.h
index a446328..9945e8e 100644
--- a/btif/include/btif_av_co.h
+++ b/btif/include/btif_av_co.h
@@ -45,15 +45,19 @@
*
*****************************************************************************/
+/*****************************************************************************
+ *
+ * Filename: btif_av_co.h
+ *
+ * Description:
+ *
+ *****************************************************************************/
+
#ifndef BTIF_AV_CO_H
#define BTIF_AV_CO_H
#include "btif_media.h"
-/*******************************************************************************
-** Constants & Macros
-********************************************************************************/
-
enum
{
BTIF_SV_AV_AA_SBC_INDEX = 0,
@@ -62,10 +66,6 @@ enum
/*******************************************************************************
-** Functions
-********************************************************************************/
-
-/*******************************************************************************
**
** Function bta_av_co_cp_is_active
**
@@ -199,4 +199,5 @@ BOOLEAN bta_av_co_peer_cp_supported(tBTA_AV_HNDL hndl);
*******************************************************************************/
BOOLEAN bta_av_co_get_remote_bitpool_pref(UINT8 *min, UINT8 *max);
+
#endif
diff --git a/btif/include/btif_common.h b/btif/include/btif_common.h
index 24eaace..8e5c275 100644
--- a/btif/include/btif_common.h
+++ b/btif/include/btif_common.h
@@ -45,6 +45,14 @@
*
************************************************************************************/
+/************************************************************************************
+ *
+ * Filename: btif_common.h
+ *
+ * Description:
+ *
+ ***********************************************************************************/
+
#ifndef BTIF_COMMON_H
#define BTIF_COMMON_H
@@ -58,22 +66,21 @@
#include <utils/Log.h>
-/*******************************************************************************
+/************************************************************************************
** Constants & Macros
-********************************************************************************/
+************************************************************************************/
-#define ASSERTC(cond, msg, val) if (!(cond)) { ALOGE( \
- "### ASSERT : %s line %d %s (%d) ###", __FILE__, __LINE__, msg, val);}
+#define ASSERTC(cond, msg, val) if (!(cond)) {ALOGE("### ASSERT : %s line %d %s (%d) ###", __FILE__, __LINE__, msg, val);}
/* Calculate start of event enumeration; id is top 8 bits of event */
#define BTIF_SIG_START(id) ((id) << 8)
-/* For upstream the MSB bit is always SET */
+/* for upstream the MSB bit is always SET */
#define BTIF_SIG_CB_BIT (0x8000)
#define BTIF_SIG_CB_START(id) (((id) << 8) | BTIF_SIG_CB_BIT)
/* BTIF sub-systems */
-#define BTIF_CORE 0
+#define BTIF_CORE 0 /* core */
#define BTIF_DM 1
#define BTIF_HFP 2
#define BTIF_AV 3
@@ -90,10 +97,8 @@ extern bt_callbacks_t *bt_hal_cbacks;
ASSERTC(0, "Callback is NULL", 0); \
}
-/**
- * BTIF events for requests that require context switch to btif task
- * on downstreams path
- */
+/* btif events for requests that require context switch to btif task
+ on downstreams path */
enum
{
BTIF_CORE_API_START = BTIF_SIG_START(BTIF_CORE),
@@ -118,13 +123,12 @@ enum
BTIF_AV_API_START = BTIF_SIG_START(BTIF_AV),
/* add here */
+
};
-/**
- * BTIF events for callbacks that require context switch to btif task
- * on upstream path - Typically these would be non-BTA events
- * that are generated by the BTIF layer.
- */
+/* btif events for callbacks that require context switch to btif task
+ on upstream path - Typically these would be non-BTA events
+ that are generated by the BTIF layer */
enum
{
BTIF_CORE_CB_START = BTIF_SIG_CB_START(BTIF_CORE),
@@ -145,38 +149,33 @@ enum
};
/* Macro definitions for BD ADDR persistence */
-
-/**
- * PROPERTY_BT_BDADDR_PATH
- * The property key stores the storage location of Bluetooth Device Address
- */
+/* PROPERTY_BT_BDADDR_PATH
+ The property key stores the storage location of Bluetooth Device Address
+*/
#ifndef PROPERTY_BT_BDADDR_PATH
#define PROPERTY_BT_BDADDR_PATH "ro.bt.bdaddr_path"
#endif
-/**
- * PERSIST_BDADDR_PROPERTY
- * If there is no valid bdaddr available from PROPERTY_BT_BDADDR_PATH,
- * generating a random BDADDR and keeping it in the PERSIST_BDADDR_DROP.
- */
+/* PERSIST_BDADDR_PROPERTY
+ If there is no valid bdaddr available from PROPERTY_BT_BDADDR_PATH,
+ generating a random BDADDR and keeping it in the PERSIST_BDADDR_DROP.
+*/
#ifndef PERSIST_BDADDR_PROPERTY
#define PERSIST_BDADDR_PROPERTY "persist.service.bdroid.bdaddr"
#endif
#define FACTORY_BT_BDADDR_STORAGE_LEN 17
-
-/*******************************************************************************
+/************************************************************************************
** Type definitions for callback functions
-********************************************************************************/
+************************************************************************************/
typedef void (tBTIF_CBACK) (UINT16 event, char *p_param);
typedef void (tBTIF_COPY_CBACK) (UINT16 event, char *p_dest, char *p_src);
-
-/*******************************************************************************
+/************************************************************************************
** Type definitions and return values
-********************************************************************************/
+************************************************************************************/
/* this type handles all btif context switches between BTU and HAL */
typedef struct
@@ -190,23 +189,23 @@ typedef struct
} tBTIF_CONTEXT_SWITCH_CBACK;
-/*******************************************************************************
+/************************************************************************************
** Functions
-********************************************************************************/
-
-bt_status_t btif_transfer_context (tBTIF_CBACK *p_cback, UINT16 event, char* p_params,
- int param_len, tBTIF_COPY_CBACK *p_copy_cback);
+************************************************************************************/
+bt_status_t btif_transfer_context (tBTIF_CBACK *p_cback, UINT16 event, char* p_params, int param_len, tBTIF_COPY_CBACK *p_copy_cback);
tBTA_SERVICE_MASK btif_get_enabled_services_mask(void);
bt_status_t btif_enable_service(tBTA_SERVICE_ID service_id);
bt_status_t btif_disable_service(tBTA_SERVICE_ID service_id);
int btif_is_enabled(void);
-/**
+/*
* BTIF_Events
*/
+
void btif_enable_bluetooth_evt(tBTA_STATUS status, BD_ADDR local_bd);
void btif_disable_bluetooth_evt(void);
void btif_adapter_properties_evt(bt_status_t status, uint32_t num_props, bt_property_t *p_props);
void btif_remote_properties_evt(bt_status_t status, bt_bdaddr_t *remote_addr,
uint32_t num_props, bt_property_t *p_props);
#endif /* BTIF_COMMON_H */
+
diff --git a/btif/include/btif_config.h b/btif/include/btif_config.h
index 4bd25db..7188a0f 100644
--- a/btif/include/btif_config.h
+++ b/btif/include/btif_config.h
@@ -45,37 +45,27 @@
*
************************************************************************************/
-/*******************************************************************************
+
+/************************************************************************************
*
* Filename: btif_config.h
*
* Description: Bluetooth configuration Interface
*
- *******************************************************************************/
-
-#ifndef BTIF_CONFIG_H
-#define BTIF_CONFIG_H
+ *
+ ***********************************************************************************/
+#ifndef btif_config_h_
+#define btif_config_h_
#ifdef __cplusplus
#include <stdint.h>
extern "C" {
#endif
-
-/*******************************************************************************
-** Constants & Macros
-********************************************************************************/
-
#define BTIF_CFG_TYPE_INVALID 0
#define BTIF_CFG_TYPE_STR 1
#define BTIF_CFG_TYPE_INT (1 << 1)
#define BTIF_CFG_TYPE_BIN (1 << 2)
#define BTIF_CFG_TYPE_VOLATILE (1 << 15)
-
-
-/*******************************************************************************
-** Functions
-********************************************************************************/
-
int btif_config_init();
int btif_config_exist(const char* section, const char* key, const char* name);
@@ -98,7 +88,6 @@ int btif_config_enum(btif_config_enum_callback cb, void* user_data);
int btif_config_save();
void btif_config_flush();
-
#ifdef __cplusplus
}
#endif
diff --git a/btif/include/btif_config_util.h b/btif/include/btif_config_util.h
index f9d0d29..0612796 100644
--- a/btif/include/btif_config_util.h
+++ b/btif/include/btif_config_util.h
@@ -45,25 +45,21 @@
*
************************************************************************************/
+
/************************************************************************************
*
* Filename: btif_config_util.h
*
* Description: Bluetooth configuration utility api
*
+ *
***********************************************************************************/
-#ifndef BTIF_CONFIG_UTIL_H
-#define BTIF_CONFIG_UTIL_H
-
+#ifndef btif_config_util_h_
+#define btif_config_util_h_
#ifdef __cplusplus
extern "C" {
#endif
-
-/*******************************************************************************
-** Constants & Macros
-********************************************************************************/
-
#define BLUEZ_PATH "/data/misc/bluetoothd/"
#define BLUEZ_PATH_BAK "/data/misc/bluetoothd_bak"
#define BLUEZ_LINKKEY "linkkeys"
@@ -73,17 +69,10 @@ extern "C" {
#define BLUEZ_TYPES "types"
#define BLUEZ_CONFIG "config"
#define BLUEZ_ALIASES "aliases"
-
-
-/*******************************************************************************
-** Functions
-********************************************************************************/
-
int btif_config_save_file(const char* file_name);
int btif_config_load_file(const char* file_name);
int load_bluez_adapter_info(char* adapter_path, int size);
int load_bluez_linkkeys(const char* adapter_path);
-
#ifdef __cplusplus
}
#endif
diff --git a/btif/include/btif_dm.h b/btif/include/btif_dm.h
index 64af77a..71f2c5e 100644
--- a/btif/include/btif_dm.h
+++ b/btif/include/btif_dm.h
@@ -45,27 +45,28 @@
*
************************************************************************************/
+/************************************************************************************
+ *
+ * Filename: btif_dm.h
+ *
+ * Description:
+ *
+ ***********************************************************************************/
+
#ifndef BTIF_DM_H
#define BTIF_DM_H
-/*******************************************************************************
+/************************************************************************************
** Functions
-********************************************************************************/
+************************************************************************************/
-/**
- * BTIF callback to switch context from bte to btif
- */
+/*******************************************************************************
+**
+** Description BTIF callback to switch context from bte to btif
+**
+*******************************************************************************/
void bte_dm_evt(tBTA_DM_SEC_EVT event, tBTA_DM_SEC *p_data);
-/**
- * Notify BT disable being initiated. DM may chose to abort
- * pending commands, like pairing
- */
-void btif_dm_on_disable(void);
-
-/**
- * Out-of-band functions
- */
#if (BTM_OOB_INCLUDED == TRUE)
void btif_dm_set_oob_for_io_req(tBTA_OOB_DATA *p_oob_data);
#ifdef BTIF_DM_OOB_TEST
@@ -75,4 +76,7 @@ BOOLEAN btif_dm_proc_rmt_oob(BD_ADDR bd_addr, BT_OCTET16 p_c, BT_OCTET16 p_r);
#endif /* BTIF_DM_OOB_TEST */
#endif /* BTM_OOB_INCLUDED */
+/* Notify BT disable being initiated. DM may chose to abort pending commands, like pairing*/
+void btif_dm_on_disable(void);
+
#endif
diff --git a/btif/include/btif_hh.h b/btif/include/btif_hh.h
index 69b4581..ad438f9 100644
--- a/btif/include/btif_hh.h
+++ b/btif/include/btif_hh.h
@@ -45,6 +45,15 @@
*
*****************************************************************************/
+/*****************************************************************************
+**
+** Name: btif_hh.h
+**
+** Description:
+**
+******************************************************************************/
+
+
#ifndef BTIF_HH_H
#define BTIF_HH_H
@@ -53,9 +62,6 @@
#include <stdint.h>
#include "bta_hh_api.h"
-/*******************************************************************************
-** Constants & Macros
-********************************************************************************/
#define BTIF_HH_MAX_HID 8
#define BTIF_HH_MAX_ADDED_DEV 32
@@ -65,22 +71,6 @@
#define BTIF_HH_KEYSTATE_MASK_CAPSLOCK 0x02
#define BTIF_HH_KEYSTATE_MASK_SCROLLLOCK 0x04
-
-/*******************************************************************************
-** Type definitions and return values
-********************************************************************************/
-
-typedef enum
-{
- BTIF_HH_DISABLED = 0,
- BTIF_HH_ENABLED,
- BTIF_HH_DISABLING,
- BTIF_HH_DEV_UNKNOWN,
- BTIF_HH_DEV_CONNECTING,
- BTIF_HH_DEV_CONNECTED,
- BTIF_HH_DEV_DISCONNECTED
-} BTIF_HH_STATUS;
-
typedef struct
{
bthh_connection_state_t dev_status;
@@ -93,7 +83,7 @@ typedef struct
BT_HDR *p_buf;
} btif_hh_device_t;
-/* Control block to maintain properties of devices */
+//Control block to maintain properties of devices
typedef struct
{
UINT8 dev_handle;
@@ -101,10 +91,18 @@ typedef struct
tBTA_HH_ATTR_MASK attr_mask;
} btif_hh_added_device_t;
-/**
- * BTIF-HH control block to maintain added devices and currently
- * connected hid devices
- */
+typedef enum
+{
+ BTIF_HH_DISABLED = 0,
+ BTIF_HH_ENABLED,
+ BTIF_HH_DISABLING,
+ BTIF_HH_DEV_UNKNOWN,
+ BTIF_HH_DEV_CONNECTING,
+ BTIF_HH_DEV_CONNECTED,
+ BTIF_HH_DEV_DISCONNECTED
+} BTIF_HH_STATUS;
+
+// BTIF-HH control block to maintain added devices and current connected hid device
typedef struct
{
BTIF_HH_STATUS status;
@@ -114,18 +112,16 @@ typedef struct
btif_hh_device_t *p_curr_dev;
} btif_hh_cb_t;
-
-/*******************************************************************************
-** Functions
-********************************************************************************/
-
extern btif_hh_cb_t btif_hh_cb;
extern btif_hh_device_t *btif_hh_find_connected_dev_by_handle(UINT8 handle);
extern void btif_hh_remove_device(bt_bdaddr_t bd_addr);
-extern bt_status_t btif_hh_virtual_unplug(bt_bdaddr_t *bd_addr);
+BOOLEAN btif_hh_add_added_dev(bt_bdaddr_t bda, tBTA_HH_ATTR_MASK attr_mask);
+extern bt_status_t btif_hh_virtual_unpug(bt_bdaddr_t *bd_addr);
extern void btif_hh_disconnect(bt_bdaddr_t *bd_addr);
BOOLEAN btif_hh_add_added_dev(bt_bdaddr_t bd_addr, tBTA_HH_ATTR_MASK attr_mask);
+
#endif
+
diff --git a/btif/include/btif_hl.h b/btif/include/btif_hl.h
index ccf9bc9..cac6eb2 100644
--- a/btif/include/btif_hl.h
+++ b/btif/include/btif_hl.h
@@ -45,12 +45,21 @@
*
************************************************************************************/
+/************************************************************************************
+ *
+ * Filename: btif_hl.h
+ *
+ * Description:
+ *
+ ***********************************************************************************/
+
#ifndef BTIF_HL_H
#define BTIF_HL_H
-/*******************************************************************************
-** Constants & Macros
-********************************************************************************/
+/************************************************************************************
+** Functions
+************************************************************************************/
+
#define BTIF_HL_DATA_TYPE_NONE 0x0000
#define BTIF_HL_DATA_TYPE_PULSE_OXIMETER 0x1004 /* from BT assigned number */
@@ -63,73 +72,8 @@
#define BTIF_HL_CCH_NUM_FILTER_ELEMS 3
#define BTIF_HL_APPLICATION_NAME_LEN 512
-#define BTIF_HL_NV_MAX_APPS 16
-
-
-/*******************************************************************************
-** Type definitions and return values
-********************************************************************************/
-
-typedef enum
-{
- BTIF_HL_SOC_STATE_IDLE,
- BTIF_HL_SOC_STATE_W4_ADD,
- BTIF_HL_SOC_STATE_W4_CONN,
- BTIF_HL_SOC_STATE_W4_READ,
- BTIF_HL_SOC_STATE_W4_REL
-} btif_hl_soc_state_t;
-
-typedef enum
-{
- BTIF_HL_STATE_DISABLED,
- BTIF_HL_STATE_DISABLING,
- BTIF_HL_STATE_ENABLED,
- BTIF_HL_STATE_ENABLING,
-} btif_hl_state_t;
-
-typedef enum
-{
- BTIF_HL_CCH_OP_NONE,
- BTIF_HL_CCH_OP_MDEP_FILTERING,
- BTIF_HL_CCH_OP_MATCHED_CTRL_PSM,
- BTIF_HL_CCH_OP_DCH_OPEN,
- BTIF_HL_CCH_OP_DCH_RECONNECT,
- BTIF_HL_CCH_OP_DCH_ECHO_TEST
-} btif_hl_cch_op_t;
-
-typedef enum
-{
- BTIF_HL_PEND_DCH_OP_NONE,
- BTIF_HL_PEND_DCH_OP_DELETE_MDL,
- BTIF_HL_PEND_DCH_OP_OPEN,
- BTIF_HL_PEND_DCH_OP_RECONNECT
-} btif_hl_pend_dch_op_t;
-
-typedef enum
-{
- BTIF_HL_DCH_OP_NONE,
- BTIF_HL_DCH_OP_DISC
-} btif_hl_dch_op_t;
-
-typedef enum
-{
- BTIF_HL_CHAN_CB_STATE_NONE,
- BTIF_HL_CHAN_CB_STATE_CONNECTING_PENDING,
- BTIF_HL_CHAN_CB_STATE_CONNECTED_PENDING,
-
- BTIF_HL_CHAN_CB_STATE_DISCONNECTING_PENDING,
- BTIF_HL_CHAN_CB_STATE_DISCONNECTED_PENDING,
- BTIF_HL_CHAN_CB_STATE_DESTROYED_PENDING,
-} btif_hl_chan_cb_state_t;
-enum
-{
- BTIF_HL_SEND_CONNECTED_CB,
- BTIF_HL_SEND_DISCONNECTED_CB,
- BTIF_HL_REG_APP,
- BTIF_HL_UNREG_APP,
- BTIF_HL_UPDATE_MDL,
-};
+#define BTIF_HL_NV_MAX_APPS 16
typedef struct
{
@@ -138,6 +82,7 @@ typedef struct
tBTA_HL_MDEP_ID peer_mdep_id;
} btif_hl_extra_mdl_cfg_t;
+
typedef struct
{
tBTA_HL_MDL_CFG base;
@@ -146,75 +91,123 @@ typedef struct
typedef struct
{
- btif_hl_mdl_cfg_t mdl_cfg[BTA_HL_NUM_MDL_CFGS];
-} btif_hl_nv_mdl_data_t;
+ btif_hl_mdl_cfg_t mdl_cfg[BTA_HL_NUM_MDL_CFGS];
+}btif_hl_nv_mdl_data_t;
+
typedef struct
{
- tBTA_HL_SUP_FEATURE sup_feature;
- tBTA_HL_DCH_CFG channel_type[BTA_HL_NUM_MDEPS];
- char srv_name[BTA_SERVICE_NAME_LEN +1];
- char srv_desp[BTA_SERVICE_DESP_LEN +1];
- char provider_name[BTA_PROVIDER_NAME_LEN +1];
- char application_name[BTIF_HL_APPLICATION_NAME_LEN +1];
-} btif_hl_nv_app_data_t;
+ tBTA_HL_SUP_FEATURE sup_feature;
+ tBTA_HL_DCH_CFG channel_type[BTA_HL_NUM_MDEPS];
+ char srv_name[BTA_SERVICE_NAME_LEN +1];
+ char srv_desp[BTA_SERVICE_DESP_LEN +1];
+ char provider_name[BTA_PROVIDER_NAME_LEN +1];
+ char application_name[BTIF_HL_APPLICATION_NAME_LEN +1];
+}btif_hl_nv_app_data_t;
+
typedef struct
{
BOOLEAN in_use;
UINT16 use_freq;
-} btif_hl_nv_app_t;
+}btif_hl_nv_app_t;
typedef struct
{
btif_hl_nv_app_t app[BTIF_HL_NV_MAX_APPS];
-} btif_hl_nv_app_cb_t;
+}btif_hl_nv_app_cb_t;
+
+
typedef struct
{
UINT8 app_nv_idx;
BOOLEAN active;
UINT8 app_idx;
- btif_hl_nv_app_data_t app_data;
-} btif_hl_app_data_t;
+ btif_hl_nv_app_data_t app_data;
+}btif_hl_app_data_t;
typedef struct
{
- BOOLEAN is_app_read;
- btif_hl_nv_app_cb_t app_cb;
- BUFFER_Q app_queue;
-} btif_hl_nv_cb_t;
+ BOOLEAN is_app_read;
+ btif_hl_nv_app_cb_t app_cb;
+ BUFFER_Q app_queue;
+}btif_hl_nv_cb_t;
+
+typedef enum
+{
+ BTIF_HL_SOC_STATE_IDLE,
+ BTIF_HL_SOC_STATE_W4_ADD,
+ BTIF_HL_SOC_STATE_W4_CONN,
+ BTIF_HL_SOC_STATE_W4_READ,
+ BTIF_HL_SOC_STATE_W4_REL
+} btif_hl_soc_state_t;
typedef struct
{
- int channel_id;
- BD_ADDR bd_addr;
- UINT8 mdep_cfg_idx;
- int max_s;
- int socket_id[2];
- UINT8 app_idx;
- UINT8 mcl_idx;
- UINT8 mdl_idx;
- btif_hl_soc_state_t state;
+ int channel_id;
+ BD_ADDR bd_addr;
+ UINT8 mdep_cfg_idx;
+ int max_s;
+ int socket_id[2];
+ UINT8 app_idx;
+ UINT8 mcl_idx;
+ UINT8 mdl_idx;
+ btif_hl_soc_state_t state;
}btif_hl_soc_cb_t;
typedef struct
{
- UINT16 data_type;
- UINT16 max_tx_apdu_size;
- UINT16 max_rx_apdu_size;
+ UINT16 data_type;
+ UINT16 max_tx_apdu_size;
+ UINT16 max_rx_apdu_size;
} btif_hl_data_type_cfg_t;
+typedef enum
+{
+ BTIF_HL_STATE_DISABLED,
+ BTIF_HL_STATE_DISABLING,
+ BTIF_HL_STATE_ENABLED,
+ BTIF_HL_STATE_ENABLING,
+
+}btif_hl_state_t;
+
+typedef enum
+{
+ BTIF_HL_CCH_OP_NONE,
+ BTIF_HL_CCH_OP_MDEP_FILTERING,
+ BTIF_HL_CCH_OP_MATCHED_CTRL_PSM,
+ BTIF_HL_CCH_OP_DCH_OPEN,
+ BTIF_HL_CCH_OP_DCH_RECONNECT,
+ BTIF_HL_CCH_OP_DCH_ECHO_TEST
+}btif_hl_cch_op_t;
+
+typedef enum
+{
+ BTIF_HL_PEND_DCH_OP_NONE,
+ BTIF_HL_PEND_DCH_OP_DELETE_MDL,
+ BTIF_HL_PEND_DCH_OP_OPEN,
+ BTIF_HL_PEND_DCH_OP_RECONNECT
+} btif_hl_pend_dch_op_t;
+
+typedef enum
+{
+ BTIF_HL_DCH_OP_NONE,
+ BTIF_HL_DCH_OP_DISC
+} btif_hl_dch_op_t;
+
+
typedef struct
{
UINT16 data_type;
tBTA_HL_MDEP_ROLE peer_mdep_role;
} btif_hl_filter_elem_t;
+
typedef struct
{
- UINT8 num_elems;
- btif_hl_filter_elem_t elem[BTIF_HL_CCH_NUM_FILTER_ELEMS];
+ UINT8 num_elems;
+ btif_hl_filter_elem_t elem[BTIF_HL_CCH_NUM_FILTER_ELEMS];
} btif_hl_cch_filter_t;
typedef struct
@@ -241,93 +234,112 @@ typedef struct
BOOLEAN cong;
btif_hl_soc_cb_t *p_scb;
int channel_id;
-} btif_hl_mdl_cb_t;
+}btif_hl_mdl_cb_t;
+
+typedef enum
+{
+ BTIF_HL_CHAN_CB_STATE_NONE,
+ BTIF_HL_CHAN_CB_STATE_CONNECTING_PENDING,
+ BTIF_HL_CHAN_CB_STATE_CONNECTED_PENDING,
+ BTIF_HL_CHAN_CB_STATE_DISCONNECTING_PENDING,
+ BTIF_HL_CHAN_CB_STATE_DISCONNECTED_PENDING,
+ BTIF_HL_CHAN_CB_STATE_DESTROYED_PENDING,
+}btif_hl_chan_cb_state_t;
typedef struct
{
- int channel_id;
- int mdep_cfg_idx;
- BOOLEAN in_use;
- btif_hl_chan_cb_state_t cb_state;
- btif_hl_pend_dch_op_t op;
- BD_ADDR bd_addr;
- BOOLEAN abort_pending;
-} btif_hl_pending_chan_cb_t;
+ int channel_id;
+ int mdep_cfg_idx;
+ BOOLEAN in_use;
+ btif_hl_chan_cb_state_t cb_state;
+ btif_hl_pend_dch_op_t op;
+ BD_ADDR bd_addr;
+ BOOLEAN abort_pending;
+}btif_hl_pending_chan_cb_t;
typedef struct
{
- btif_hl_mdl_cb_t mdl[BTA_HL_NUM_MDLS_PER_MCL];
- BOOLEAN in_use;
- BOOLEAN is_connected;
- UINT16 req_ctrl_psm;
- UINT16 ctrl_psm;
- UINT16 data_psm;
- BD_ADDR bd_addr;
- UINT16 cch_mtu;
- tBTA_SEC sec_mask;
- tBTA_HL_MCL_HANDLE mcl_handle;
- btif_hl_pending_chan_cb_t pcb;
- BOOLEAN valid_sdp_idx;
- UINT8 sdp_idx;
- tBTA_HL_SDP sdp;
- btif_hl_cch_op_t cch_oper;
- BOOLEAN cch_timer_active;
- TIMER_LIST_ENT cch_timer;
-} btif_hl_mcl_cb_t;
+ btif_hl_mdl_cb_t mdl[BTA_HL_NUM_MDLS_PER_MCL];
+ BOOLEAN in_use;
+ BOOLEAN is_connected;
+ UINT16 req_ctrl_psm;
+ UINT16 ctrl_psm;
+ UINT16 data_psm;
+ BD_ADDR bd_addr;
+ UINT16 cch_mtu;
+ tBTA_SEC sec_mask;
+ tBTA_HL_MCL_HANDLE mcl_handle;
+ btif_hl_pending_chan_cb_t pcb;
+ BOOLEAN valid_sdp_idx;
+ UINT8 sdp_idx;
+ tBTA_HL_SDP sdp;
+ btif_hl_cch_op_t cch_oper;
+ BOOLEAN cch_timer_active;
+ TIMER_LIST_ENT cch_timer;
+}btif_hl_mcl_cb_t;
typedef struct
{
- BOOLEAN active;
- UINT16 mdl_id;
- UINT8 mdep_cfg_idx;
- BD_ADDR bd_addr;
- int channel_id;
+ BOOLEAN active;
+ UINT16 mdl_id;
+ UINT8 mdep_cfg_idx;
+ BD_ADDR bd_addr;
+ int channel_id;
} btif_hl_delete_mdl_t;
typedef struct
{
- btif_hl_mcl_cb_t mcb[BTA_HL_NUM_MCLS]; /* application Control Blocks */
- BOOLEAN in_use; /* this CB is in use*/
- BOOLEAN reg_pending;
- BOOLEAN is_new_app;
- UINT8 app_nv_idx;
- UINT8 app_id;
-
- tBTA_HL_SUP_FEATURE sup_feature;
- tBTA_HL_DCH_CFG channel_type[BTA_HL_NUM_MDEPS];
- tBTA_HL_SDP_INFO_IND sdp_info_ind;
- btif_hl_cch_filter_t filter;
-
- btif_hl_mdl_cfg_t mdl_cfg[BTA_HL_NUM_MDL_CFGS];
- int mdl_cfg_channel_id[BTA_HL_NUM_MDL_CFGS];
-
- btif_hl_delete_mdl_t delete_mdl;
- tBTA_HL_DEVICE_TYPE dev_type;
- tBTA_HL_APP_HANDLE app_handle;
- UINT16 sec_mask; /* Security mask for BTM_SetSecurityLevel() */
- char srv_name[BTA_SERVICE_NAME_LEN +1]; /* service name to be used in the SDP; null terminated*/
- char srv_desp[BTA_SERVICE_DESP_LEN +1]; /* service description to be used in the SDP; null terminated */
- char provider_name[BTA_PROVIDER_NAME_LEN +1]; /* provide name to be used in the SDP; null terminated */
- char application_name[BTIF_HL_APPLICATION_NAME_LEN +1]; /* applicaiton name */
-} btif_hl_app_cb_t;
-
+ btif_hl_mcl_cb_t mcb[BTA_HL_NUM_MCLS]; /* application Control Blocks */
+ BOOLEAN in_use; /* this CB is in use*/
+ BOOLEAN reg_pending;
+ BOOLEAN is_new_app;
+ UINT8 app_nv_idx;
+ UINT8 app_id;
+ //UINT32 sdp_handle; /* SDP record handle */
+ tBTA_HL_SUP_FEATURE sup_feature;
+ tBTA_HL_DCH_CFG channel_type[BTA_HL_NUM_MDEPS];
+ tBTA_HL_SDP_INFO_IND sdp_info_ind;
+ btif_hl_cch_filter_t filter;
+
+ btif_hl_mdl_cfg_t mdl_cfg[BTA_HL_NUM_MDL_CFGS];
+ int mdl_cfg_channel_id[BTA_HL_NUM_MDL_CFGS];
+
+ btif_hl_delete_mdl_t delete_mdl;
+ tBTA_HL_DEVICE_TYPE dev_type;
+ tBTA_HL_APP_HANDLE app_handle;
+ UINT16 sec_mask; /* Security mask for BTM_SetSecurityLevel() */
+ char srv_name[BTA_SERVICE_NAME_LEN +1]; /* service name to be used in the SDP; null terminated*/
+ char srv_desp[BTA_SERVICE_DESP_LEN +1]; /* service description to be used in the SDP; null terminated */
+ char provider_name[BTA_PROVIDER_NAME_LEN +1]; /* provide name to be used in the SDP; null terminated */
+ char application_name[BTIF_HL_APPLICATION_NAME_LEN +1]; /* applicaiton name */
+
+}btif_hl_app_cb_t;
typedef struct
{
- BOOLEAN in_use;
- UINT8 app_idx;
-} btif_hl_pending_reg_cb_t;
+ BOOLEAN in_use;
+ UINT8 app_idx;
+}btif_hl_pending_reg_cb_t;
/* BTIF-HL control block */
typedef struct
{
- btif_hl_app_cb_t acb[BTA_HL_NUM_APPS]; /* HL Control Blocks */
- tBTA_HL_CTRL_CBACK *p_ctrl_cback; /* pointer to control callback function */
- UINT8 next_app_id;
- UINT16 next_channel_id;
- btif_hl_state_t state;
- btif_hl_nv_cb_t ncb;
+ btif_hl_app_cb_t acb[BTA_HL_NUM_APPS]; /* HL Control Blocks */
+ tBTA_HL_CTRL_CBACK *p_ctrl_cback; /* pointer to control callback function */
+ UINT8 next_app_id;
+ UINT16 next_channel_id;
+ btif_hl_state_t state;
+ btif_hl_nv_cb_t ncb;
} btif_hl_cb_t;
+
+enum
+{
+ BTIF_HL_SEND_CONNECTED_CB,
+ BTIF_HL_SEND_DISCONNECTED_CB,
+ BTIF_HL_REG_APP,
+ BTIF_HL_UNREG_APP,
+ BTIF_HL_UPDATE_MDL,
+};
typedef UINT8 btif_hl_evt_t;
typedef struct
@@ -338,29 +350,29 @@ typedef struct
int channel_id;
btif_hl_chan_cb_state_t cb_state;
int fd;
-} btif_hl_send_chan_state_cb_t;
+}btif_hl_send_chan_state_cb_t;
typedef struct
{
UINT8 app_idx;
-} btif_hl_reg_t;
-
+}btif_hl_reg_t;
typedef btif_hl_reg_t btif_hl_unreg_t;
typedef btif_hl_reg_t btif_hl_update_mdl_t;
typedef union
{
btif_hl_send_chan_state_cb_t chan_cb;
- btif_hl_reg_t reg;
- btif_hl_unreg_t unreg;
- btif_hl_update_mdl_t update_mdl;
-} btif_hl_evt_cb_t;
+ btif_hl_reg_t reg;
+ btif_hl_unreg_t unreg;
+ btif_hl_update_mdl_t update_mdl;
+}btif_hl_evt_cb_t;
-/*******************************************************************************
-** Functions
-********************************************************************************/
+
+extern btif_hl_cb_t btif_hl_cb;
+extern btif_hl_cb_t *p_btif_hl_cb;
+extern btif_hl_nv_cb_t *p_ncb;
#define BTIF_HL_GET_CB_PTR() &(btif_hl_cb)
#define BTIF_HL_GET_APP_CB_PTR(app_idx) &(btif_hl_cb.acb[(app_idx)])
@@ -369,11 +381,6 @@ typedef union
#define BTIF_HL_GET_PCB_PTR(app_idx, mcl_idx) &(btif_hl_cb.acb[app_idx].mcb[mcl_idx].pcb)
#define BTIF_HL_GET_MDL_CFG_PTR(app_idx, item_idx) &(btif_hl_cb.acb[(app_idx)].mdl_cfg[(item_idx)])
#define BTIF_HL_GET_MDL_CFG_CHANNEL_ID_PTR(app_idx, item_idx) &(btif_hl_cb.acb[(app_idx)].mdl_cfg_channel_id[(item_idx)])
-
-extern btif_hl_cb_t btif_hl_cb;
-extern btif_hl_cb_t *p_btif_hl_cb;
-extern btif_hl_nv_cb_t *p_ncb;
-
extern BOOLEAN btif_hl_find_mcl_idx(UINT8 app_idx, BD_ADDR p_bd_addr, UINT8 *p_mcl_idx);
extern BOOLEAN btif_hl_find_app_idx(UINT8 app_id, UINT8 *p_app_idx);
extern BOOLEAN btif_hl_find_avail_mcl_idx(UINT8 app_idx, UINT8 *p_mcl_idx);
diff --git a/btif/include/btif_media.h b/btif/include/btif_media.h
index 18fbaab..9eda863 100644
--- a/btif/include/btif_media.h
+++ b/btif/include/btif_media.h
@@ -45,13 +45,14 @@
*
************************************************************************************/
-/*******************************************************************************
+/************************************************************************************
*
* Filename: btif_media.h
*
* Description: This is the audio module for the BTIF system.
*
- *******************************************************************************/
+ ***********************************************************************************/
+
#ifndef BTIF_MEDIA_H
#define BTIF_MEDIA_H
@@ -62,15 +63,15 @@
#include "btif_av_api.h"
#include "audio_a2dp_hw.h"
-/*******************************************************************************
+/*****************************************************************************
** Constants
- *******************************************************************************/
+ *****************************************************************************/
/* Generic part */
#define BTIF_SUCCESS 0
-/**
- * AV (Audio Video source) Errors
+/*
+* AV (Audio Video source) Errors
*/
#define BTIF_ERROR_SRV_AV_NOT_ENABLED 700 /* AV is not enabled */
#define BTIF_ERROR_SRV_AV_FEEDING_NOT_SUPPORTED 701 /* Requested Feeding not supported */
@@ -79,14 +80,14 @@
#define BTIF_ERROR_SRV_AV_NOT_STARTED 704 /* AV is not started */
#define BTIF_ERROR_SRV_AV_CP_NOT_SUPPORTED 705 /* Content protection is not supported by all headsets */
-/* Transcoding definition for TxTranscoding and RxTranscoding */
+/* transcoding definition for TxTranscoding and RxTranscoding */
#define BTIF_MEDIA_TRSCD_OFF 0
#define BTIF_MEDIA_TRSCD_PCM_2_SBC 1 /* Tx */
-/*******************************************************************************
+/*****************************************************************************
** Data types
- *******************************************************************************/
+ *****************************************************************************/
typedef int tBTIF_STATUS;
@@ -122,9 +123,13 @@ typedef struct
#endif
-/*******************************************************************************
- ** Public functions
- *******************************************************************************/
+/*****************************************************************************
+ ** Local data
+ *****************************************************************************/
+
+/*****************************************************************************
+ ** public functions
+ *****************************************************************************/
/*******************************************************************************
**
@@ -137,6 +142,7 @@ typedef struct
*******************************************************************************/
extern int btif_media_task(void *p);
+
/*******************************************************************************
**
** Function btif_media_task_enc_init_req
@@ -160,7 +166,6 @@ extern BOOLEAN btif_media_task_enc_init_req(tBTIF_MEDIA_INIT_AUDIO * p_msg);
#if (BTA_AV_INCLUDED == TRUE)
extern BOOLEAN btif_media_task_enc_update_req(tBTIF_MEDIA_UPDATE_AUDIO * p_msg);
#endif
-
/*******************************************************************************
**
** Function btif_media_task_start_aa_req
@@ -230,6 +235,7 @@ extern BOOLEAN btif_media_av_writebuf(UINT8 *p_media, UINT32 media_len,
UINT32 timestamp, UINT16 seq_num);
#if (BTA_AV_INCLUDED == TRUE)
+
/*******************************************************************************
**
** Function btif_media_task_audio_feeding_init_req
@@ -243,6 +249,7 @@ extern BOOLEAN btif_media_av_writebuf(UINT8 *p_media, UINT32 media_len,
extern BOOLEAN btif_media_task_audio_feeding_init_req(tBTIF_MEDIA_INIT_AUDIO_FEEDING *p_msg);
#endif
+
/*******************************************************************************
**
** Function dump_codec_info
@@ -254,8 +261,8 @@ extern BOOLEAN btif_media_task_audio_feeding_init_req(tBTIF_MEDIA_INIT_AUDIO_FEE
*******************************************************************************/
extern void dump_codec_info(unsigned char *p_codec);
-/**
- * Local adaptation helper functions between btif and media task
+/*
+ * local adaptation helper functions between btif and media task
*/
int btif_a2dp_start_media_task(void);
@@ -273,3 +280,4 @@ void btif_a2dp_on_suspended(tBTA_AV_SUSPEND *p_av);
void btif_a2dp_set_tx_flush(BOOLEAN enable);
#endif
+
diff --git a/btif/include/btif_pan.h b/btif/include/btif_pan.h
index 15d8783..47635d7 100644
--- a/btif/include/btif_pan.h
+++ b/btif/include/btif_pan.h
@@ -45,21 +45,20 @@
*
************************************************************************************/
-/*******************************************************************************
+
+/************************************************************************************
*
* Filename: btif_pan.h
*
* Description: Bluetooth pan Interface
*
- *******************************************************************************/
-
-#ifndef BTIF_PAN_H
-#define BTIF_PAN_H
+ *
+ ***********************************************************************************/
+#ifndef btif_pan_h_
+#define btif_pan_h_
#include <hardware/bt_pan.h>
-
btpan_interface_t *btif_pan_interface();
void btif_pan_init();
void btif_pan_cleanup();
-
#endif
diff --git a/btif/include/btif_pan_internal.h b/btif/include/btif_pan_internal.h
index b0ad68f..fdd9da3 100644
--- a/btif/include/btif_pan_internal.h
+++ b/btif/include/btif_pan_internal.h
@@ -45,24 +45,21 @@
*
************************************************************************************/
-/*******************************************************************************
+
+/************************************************************************************
*
* Filename: btif_pan_internal.h
*
* Description: Bluetooth pan internal
*
- *******************************************************************************/
-
-#ifndef BTIF_PAN_INTERNAL_H
-#define BTIF_PAN_INTERNAL_H
+ *
+ ***********************************************************************************/
+#ifndef btif_pan_internal_h_
+#define btif_pan_internal_h_
#include "btif_pan.h"
#include "bt_types.h"
-/*******************************************************************************
-** Constants & Macros
-********************************************************************************/
-
#define PAN_NAP_SERVICE_NAME "Android Network Access Point"
#define PANU_SERVICE_NAME "Android Network User"
#define TAP_IF_NAME "bt-pan"
@@ -77,19 +74,12 @@
#ifndef PAN_ROLE_INACTIVE
#define PAN_ROLE_INACTIVE 0
#endif
-
-
-/*******************************************************************************
-** Type definitions and return values
-********************************************************************************/
-
typedef struct eth_hdr
{
unsigned char h_dest[ETH_ADDR_LEN];
unsigned char h_src[ETH_ADDR_LEN];
short h_proto;
} tETH_HDR;
-
typedef struct
{
int handle;
@@ -110,12 +100,6 @@ typedef struct
int open_count;
btpan_conn_t conns[MAX_PAN_CONNS];
} btpan_cb_t;
-
-
-/*******************************************************************************
-** Functions
-********************************************************************************/
-
extern btpan_cb_t btpan_cb;
btpan_conn_t *btpan_new_conn(int handle, const BD_ADDR addr, int local_role, int peer_role);
btpan_conn_t *btpan_find_conn_addr(const BD_ADDR addr);
@@ -127,7 +111,6 @@ void destroy_tap_read_thread(void);
int btpan_tap_close(int tap_fd);
int btpan_tap_send(int tap_fd, const BD_ADDR src, const BD_ADDR dst, UINT16 protocol,
const char* buff, UINT16 size, BOOLEAN ext, BOOLEAN forward);
-
static inline int is_empty_eth_addr(const BD_ADDR addr)
{
int i;
@@ -136,12 +119,11 @@ static inline int is_empty_eth_addr(const BD_ADDR addr)
return 0;
return 1;
}
-
static inline int is_valid_bt_eth_addr(const BD_ADDR addr)
{
if(is_empty_eth_addr(addr))
return 0;
- return addr[0] & 1 ? 0 : 1; /* Cannot be multicasting address */
+ return addr[0] & 1 ? 0 : 1; //cannot be multicasting address
}
#endif
diff --git a/btif/include/btif_profile_queue.h b/btif/include/btif_profile_queue.h
index 5aa8a25..8f5f013 100644
--- a/btif/include/btif_profile_queue.h
+++ b/btif/include/btif_profile_queue.h
@@ -45,22 +45,23 @@
*
************************************************************************************/
-/*******************************************************************************
+/************************************************************************************
*
* Filename: btif_profile_queue.h
*
* Description: Bluetooth remote device connection queuing
*
- *******************************************************************************/
-
-#ifndef BTIF_PROFILE_QUEUE_H
-#define BTIF_PROFILE_QUEUE_H
+ ***********************************************************************************/
+#ifndef BTIF_QUEUE_H
+#define BTIF_QUEUE_H
typedef bt_status_t (btif_connect_cb_t) (bt_bdaddr_t *bda);
bt_status_t btif_queue_connect(uint16_t uuid, const bt_bdaddr_t *bda,
btif_connect_cb_t *connect_cb);
+
void btif_queue_advance();
+
void btif_queue_release();
#endif
diff --git a/btif/include/btif_sm.h b/btif/include/btif_sm.h
index c66987f..fb8ddc7 100644
--- a/btif/include/btif_sm.h
+++ b/btif/include/btif_sm.h
@@ -60,11 +60,6 @@
** Constants & Macros
******************************************************************************/
-/* Generic Enter/Exit state machine events */
-#define BTIF_SM_ENTER_EVT 0xFFFF
-#define BTIF_SM_EXIT_EVT 0xFFFE
-
-
/*****************************************************************************
** Type definitions and return values
******************************************************************************/
@@ -73,14 +68,28 @@ typedef UINT32 btif_sm_event_t;
typedef void* btif_sm_handle_t;
typedef BOOLEAN(*btif_sm_handler_t)(btif_sm_event_t event, void *data);
+/* Generic Enter/Exit state machine events */
+#define BTIF_SM_ENTER_EVT 0xFFFF
+#define BTIF_SM_EXIT_EVT 0xFFFE
+
+/*****************************************************************************
+** Extern variables and functions
+******************************************************************************/
/*****************************************************************************
** Functions
-**
-** NOTE: THESE APIs SHOULD BE INVOKED ONLY IN THE BTIF CONTEXT
-**
******************************************************************************/
+/*
+ *
+ * ########################################################################
+ *
+ * NOTE: THESE APIs SHOULD BE INVOKED ONLY IN THE BTIF CONTEXT
+ *
+ * #######################################################################
+ *
+ */
+
/*****************************************************************************
**
** Function btif_sm_init
@@ -145,3 +154,5 @@ bt_status_t btif_sm_dispatch(btif_sm_handle_t handle, btif_sm_event_t event,
bt_status_t btif_sm_change_state(btif_sm_handle_t handle, btif_sm_state_t state);
#endif /* BTIF_SM_H */
+
+
diff --git a/btif/include/btif_sock.h b/btif/include/btif_sock.h
index 920efe6..a307255 100644
--- a/btif/include/btif_sock.h
+++ b/btif/include/btif_sock.h
@@ -45,21 +45,21 @@
*
************************************************************************************/
-/*******************************************************************************
+
+/************************************************************************************
*
* Filename: btif_sock.h
*
* Description: Bluetooth socket Interface
*
- *******************************************************************************/
-
-#ifndef BTIF_SOCK_H
-#define BTIF_SOCK_H
+ *
+ ***********************************************************************************/
+#ifndef btif_sock_h_
+#define btif_sock_h_
#include <hardware/bt_sock.h>
bt_status_t btif_sock_init();
btsock_interface_t *btif_sock_get_interface();
void btif_sock_cleanup();
-
#endif
diff --git a/btif/include/btif_sock_rfc.h b/btif/include/btif_sock_rfc.h
index f7e0869..2415513 100644
--- a/btif/include/btif_sock_rfc.h
+++ b/btif/include/btif_sock_rfc.h
@@ -45,23 +45,20 @@
*
************************************************************************************/
-/*******************************************************************************
+/************************************************************************************
*
* Filename: btif_sock.h
*
* Description: Bluetooth socket Interface
*
- *******************************************************************************/
-
-#ifndef BTIF_SOCK_RFC_H
-#define BTIF_SOCK_RFC_H
+ *
+ ***********************************************************************************/
+#ifndef btif_sock_rfc_h_
+#define btif_sock_rfc_h_
bt_status_t btsock_rfc_init(int handle);
bt_status_t btsock_rfc_cleanup();
-bt_status_t btsock_rfc_listen(const char* name, const uint8_t* uuid, int channel,
- int* sock_fd, int flags);
-bt_status_t btsock_rfc_connect(const bt_bdaddr_t *bd_addr, const uint8_t* uuid,
- int channel, int* sock_fd, int flags);
+bt_status_t btsock_rfc_listen(const char* name, const uint8_t* uuid, int channel, int* sock_fd, int flags);
+bt_status_t btsock_rfc_connect(const bt_bdaddr_t *bd_addr, const uint8_t* uuid, int channel, int* sock_fd, int flags);
void btsock_rfc_signaled(int fd, int flags, uint32_t user_id);
-
#endif
diff --git a/btif/include/btif_sock_sdp.h b/btif/include/btif_sock_sdp.h
index 52af46e..012e1a9 100644
--- a/btif/include/btif_sock_sdp.h
+++ b/btif/include/btif_sock_sdp.h
@@ -45,18 +45,24 @@
*
************************************************************************************/
-#ifndef BTIF_SOCK_SDP_H
-#define BTIF_SOCK_SDP_H
+/************************************************************************************
+ *
+ * Filename: btif_sock.h
+ *
+ * Description: Bluetooth socket Interface
+ *
+ *
+ ***********************************************************************************/
+#ifndef btif_sock_sdp_h_
+#define btif_sock_sdp_h_
static inline BOOLEAN is_uuid_empty(const uint8_t* uuid)
{
static uint8_t empty_uuid[16];
return memcmp(uuid, empty_uuid, sizeof(empty_uuid)) == 0;
}
-
int add_rfc_sdp_rec(const char* name, const uint8_t* uuid, int scn);
void del_rfc_sdp_rec(int handle);
BOOLEAN is_reserved_rfc_channel(int channel);
int get_reserved_rfc_channel(const uint8_t* uuid);
-
#endif
diff --git a/btif/include/btif_sock_thread.h b/btif/include/btif_sock_thread.h
index 3678673..0f5212f 100644
--- a/btif/include/btif_sock_thread.h
+++ b/btif/include/btif_sock_thread.h
@@ -45,34 +45,29 @@
*
************************************************************************************/
+/************************************************************************************
+ *
+ * Filename: btif_sock_thread.h
+ *
+ * Description:
+ *
+ ***********************************************************************************/
+
#ifndef BTIF_SOCK_THREAD_H
#define BTIF_SOCK_THREAD_H
-
#include <hardware/bt_sock.h>
-/*******************************************************************************
-** Constants & Macros
-********************************************************************************/
-
-#define SOCK_THREAD_FD_RD 1 /* BT socket read signal */
-#define SOCK_THREAD_FD_WR (1 << 1) /* BT socket write signal */
-#define SOCK_THREAD_FD_EXCEPTION (1 << 2) /* BT socket exception singal */
-#define SOCK_THREAD_ADD_FD_SYNC (1 << 3) /* Add BT socket fd in current socket
- poll thread context immediately */
-
-/*******************************************************************************
-** Functions
-********************************************************************************/
-
-typedef void (*btsock_signaled_cb)(int fd, int type, int flags, uint32_t user_id);
-typedef void (*btsock_cmd_cb)(int cmd_fd, int type, int size, uint32_t user_id);
-
+#define SOCK_THREAD_FD_RD 1 //bt socket read signal
+#define SOCK_THREAD_FD_WR (1 << 1) //bt socket write signal
+#define SOCK_THREAD_FD_EXCEPTION (1 << 2) //bt socket exception singal
+#define SOCK_THREAD_ADD_FD_SYNC (1 << 3) //add bt socket fd in current socket poll thread context immediately
int btsock_thread_init();
int btsock_thread_add_fd(int handle, int fd, int type, int flags, uint32_t user_id);
int btsock_thread_wakeup(int handle);
-int btsock_thread_post_cmd(int handle, int cmd_type, const unsigned char* cmd_data,
- int data_size, uint32_t user_id);
+int btsock_thread_post_cmd(int handle, int cmd_type, const unsigned char* cmd_data, int data_size, uint32_t user_id);
+typedef void (*btsock_signaled_cb)(int fd, int type, int flags, uint32_t user_id);
+typedef void (*btsock_cmd_cb)(int cmd_fd, int type, int size, uint32_t user_id);
int btsock_thread_create(btsock_signaled_cb callback, btsock_cmd_cb cmd_callback);
int btsock_thread_exit(int handle);
-
#endif
+
diff --git a/btif/include/btif_sock_util.h b/btif/include/btif_sock_util.h
index fe3b881..7a7cff3 100644
--- a/btif/include/btif_sock_util.h
+++ b/btif/include/btif_sock_util.h
@@ -45,24 +45,20 @@
*
************************************************************************************/
-/*******************************************************************************
+
+/************************************************************************************
*
* Filename: btif_sock_util.h
*
* Description: Bluetooth socket Interface Helper functions
*
- *******************************************************************************/
-
-#ifndef BTIF_SOCK_UTIL_H
-#define BTIF_SOCK_UTIL_H
+ *
+ ***********************************************************************************/
+#ifndef btif_sock_util_h_
+#define btif_sock_util_h_
#include <pthread.h>
#include <cutils/log.h>
-
-/*******************************************************************************
-** Functions
-********************************************************************************/
-
static inline void init_slot_lock( pthread_mutex_t* mutex)
{
pthread_mutexattr_t attr;
@@ -70,24 +66,21 @@ static inline void init_slot_lock( pthread_mutex_t* mutex)
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
pthread_mutex_init(mutex, &attr);
}
-
static inline void lock_slot(pthread_mutex_t* mutex)
{
if(mutex->value)
pthread_mutex_lock(mutex);
else ALOGE("mutex: %p is not initialized", mutex);
}
-
static inline void unlock_slot(pthread_mutex_t* mutex)
{
if(mutex->value)
pthread_mutex_unlock(mutex);
else ALOGE("mutex: %p is not initialized", mutex);
}
-
void dump_bin(const char* title, const char* data, int size);
-
int sock_send_fd(int sock_fd, const uint8_t* buffer, int len, int send_fd);
+
int sock_send_all(int sock_fd, const uint8_t* buf, int len);
int sock_recv_all(int sock_fd, uint8_t* buf, int len);
diff --git a/btif/include/btif_storage.h b/btif/include/btif_storage.h
index 31b04fb..f4b2ca3 100644
--- a/btif/include/btif_storage.h
+++ b/btif/include/btif_storage.h
@@ -45,6 +45,14 @@
*
************************************************************************************/
+/************************************************************************************
+ *
+ * Filename: btif_storage.h
+ *
+ * Description:
+ *
+ ***********************************************************************************/
+
#ifndef BTIF_STORAGE_H
#define BTIF_STORAGE_H
@@ -53,17 +61,23 @@
#include <utils/Log.h>
-/*******************************************************************************
+/************************************************************************************
** Constants & Macros
-********************************************************************************/
+************************************************************************************/
#define BTIF_STORAGE_FILL_PROPERTY(p_prop, t, l, p_v) \
(p_prop)->type = t;(p_prop)->len = l; (p_prop)->val = (p_v);
+/************************************************************************************
+** Type definitions for callback functions
+************************************************************************************/
+
+/************************************************************************************
+** Type definitions and return values
+************************************************************************************/
-/*******************************************************************************
+/************************************************************************************
** Functions
-********************************************************************************/
-
+************************************************************************************/
/*******************************************************************************
**
** Function btif_storage_get_adapter_property
@@ -78,7 +92,6 @@
**
*******************************************************************************/
bt_status_t btif_storage_get_adapter_property(bt_property_t *property);
-
/*******************************************************************************
**
** Function btif_storage_set_adapter_property
@@ -91,7 +104,6 @@ bt_status_t btif_storage_get_adapter_property(bt_property_t *property);
**
*******************************************************************************/
bt_status_t btif_storage_set_adapter_property(bt_property_t *property);
-
/*******************************************************************************
**
** Function btif_storage_get_remote_device_property
@@ -107,7 +119,6 @@ bt_status_t btif_storage_set_adapter_property(bt_property_t *property);
*******************************************************************************/
bt_status_t btif_storage_get_remote_device_property(bt_bdaddr_t *remote_bd_addr,
bt_property_t *property);
-
/*******************************************************************************
**
** Function btif_storage_set_remote_device_property
@@ -121,7 +132,6 @@ bt_status_t btif_storage_get_remote_device_property(bt_bdaddr_t *remote_bd_addr,
*******************************************************************************/
bt_status_t btif_storage_set_remote_device_property(bt_bdaddr_t *remote_bd_addr,
bt_property_t *property);
-
/*******************************************************************************
**
** Function btif_storage_add_remote_device
@@ -137,7 +147,6 @@ bt_status_t btif_storage_set_remote_device_property(bt_bdaddr_t *remote_bd_addr,
bt_status_t btif_storage_add_remote_device(bt_bdaddr_t *remote_bdaddr,
uint32_t num_properties,
bt_property_t *properties);
-
/*******************************************************************************
**
** Function btif_storage_add_bonded_device
@@ -153,7 +162,6 @@ bt_status_t btif_storage_add_bonded_device(bt_bdaddr_t *remote_bd_addr,
LINK_KEY link_key,
uint8_t key_type,
uint8_t pin_length);
-
/*******************************************************************************
**
** Function btif_storage_remove_bonded_device
@@ -165,7 +173,6 @@ bt_status_t btif_storage_add_bonded_device(bt_bdaddr_t *remote_bd_addr,
**
*******************************************************************************/
bt_status_t btif_storage_remove_bonded_device(bt_bdaddr_t *remote_bd_addr);
-
/*******************************************************************************
**
** Function btif_storage_remove_bonded_device
@@ -177,7 +184,6 @@ bt_status_t btif_storage_remove_bonded_device(bt_bdaddr_t *remote_bd_addr);
**
*******************************************************************************/
bt_status_t btif_storage_load_bonded_devices(void);
-
/*******************************************************************************
**
** Function btif_storage_read_hl_apps_cb
@@ -201,7 +207,6 @@ bt_status_t btif_storage_read_hl_apps_cb(char *value, int value_size);
**
*******************************************************************************/
bt_status_t btif_storage_write_hl_apps_cb(char *value, int value_size);
-
/*******************************************************************************
**
** Function btif_storage_read_hl_apps_cb
@@ -213,7 +218,6 @@ bt_status_t btif_storage_write_hl_apps_cb(char *value, int value_size);
**
*******************************************************************************/
bt_status_t btif_storage_read_hl_app_data(UINT8 app_idx, char *value, int value_size);
-
/*******************************************************************************
**
** Function btif_storage_write_hl_app_data
@@ -225,7 +229,6 @@ bt_status_t btif_storage_read_hl_app_data(UINT8 app_idx, char *value, int value_
**
*******************************************************************************/
bt_status_t btif_storage_write_hl_app_data(UINT8 app_idx, char *value, int value_size);
-
/*******************************************************************************
**
** Function btif_storage_read_hl_mdl_data
@@ -237,7 +240,6 @@ bt_status_t btif_storage_write_hl_app_data(UINT8 app_idx, char *value, int value
**
*******************************************************************************/
bt_status_t btif_storage_read_hl_mdl_data(UINT8 app_idx, char *value, int value_size);
-
/*******************************************************************************
**
** Function btif_storage_write_hl_mdl_data
@@ -260,19 +262,19 @@ bt_status_t btif_storage_write_hl_mdl_data(UINT8 app_idx, char *value, int value
** BT_STATUS_FAIL otherwise
**
*******************************************************************************/
+
bt_status_t btif_storage_add_hid_device_info(bt_bdaddr_t *remote_bd_addr,
UINT16 attr_mask, UINT8 sub_class,
UINT8 app_id, UINT16 vendor_id,
UINT16 product_id, UINT16 version,
- UINT8 ctry_code, UINT16 dl_len,
- UINT8 *dsc_list);
+ UINT8 ctry_code, UINT16 dl_len, UINT8 *dsc_list);
/*******************************************************************************
**
** Function btif_storage_load_bonded_hid_info
**
-** Description BTIF storage API - Loads hid info for all the bonded devices
-** from NVRAM and adds those devices to the BTA_HH.
+** Description BTIF storage API - Loads hid info for all the bonded devices from NVRAM
+** and adds those devices to the BTA_HH.
**
** Returns BT_STATUS_SUCCESS if successful, BT_STATUS_FAIL otherwise
**
@@ -289,6 +291,7 @@ bt_status_t btif_storage_load_bonded_hid_info(void);
** BT_STATUS_FAIL otherwise
**
*******************************************************************************/
+
bt_status_t btif_storage_remove_hid_info(bt_bdaddr_t *remote_bd_addr);
/*******************************************************************************
@@ -313,6 +316,7 @@ bt_status_t btif_storage_load_autopair_device_list();
** FALSE otherwise
**
*******************************************************************************/
+
BOOLEAN btif_storage_is_device_autopair_blacklisted(bt_bdaddr_t *remote_dev_addr);
/*******************************************************************************
@@ -325,6 +329,7 @@ BOOLEAN btif_storage_is_device_autopair_blacklisted(bt_bdaddr_t *remote_dev_add
** BT_STATUS_FAIL otherwise
**
*******************************************************************************/
+
bt_status_t btif_storage_add_device_to_autopair_blacklist(bt_bdaddr_t *remote_dev_addr);
/*******************************************************************************
@@ -339,4 +344,7 @@ bt_status_t btif_storage_add_device_to_autopair_blacklist(bt_bdaddr_t *remote_de
*******************************************************************************/
BOOLEAN btif_storage_is_fixed_pin_zeros_keyboard(bt_bdaddr_t *remote_dev_addr);
+
+
#endif /* BTIF_STORAGE_H */
+
diff --git a/btif/include/btif_util.h b/btif/include/btif_util.h
index 6d146b8..cfa7945 100644..100755
--- a/btif/include/btif_util.h
+++ b/btif/include/btif_util.h
@@ -45,6 +45,14 @@
*
************************************************************************************/
+/************************************************************************************
+ *
+ * Filename: btif_util.h
+ *
+ * Description:
+ *
+ ***********************************************************************************/
+
#ifndef BTIF_UTIL_H
#define BTIF_UTIL_H
@@ -55,23 +63,26 @@
#include "data_types.h"
#include "bt_types.h"
-/*******************************************************************************
+/************************************************************************************
** Constants & Macros
-********************************************************************************/
+************************************************************************************/
#define CASE_RETURN_STR(const) case const: return #const;
-
-/*******************************************************************************
+/************************************************************************************
** Type definitions for callback functions
-********************************************************************************/
+************************************************************************************/
typedef char bdstr_t[18];
+/************************************************************************************
+** Type definitions and return values
+************************************************************************************/
-/*******************************************************************************
+
+/************************************************************************************
** Functions
-********************************************************************************/
+************************************************************************************/
const char* dump_bt_status(bt_status_t status);
const char* dump_dm_search_event(UINT16 event);
diff --git a/btif/include/uinput.h b/btif/include/uinput.h
index 0a4d928..303f4f3 100644
--- a/btif/include/uinput.h
+++ b/btif/include/uinput.h
@@ -44,6 +44,7 @@
* ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.
*
************************************************************************************/
+/* TBD: tmp code here */
#ifndef __UINPUT_H
#define __UINPUT_H
@@ -56,10 +57,6 @@ extern "C" {
#include <sys/time.h>
#include <sys/ioctl.h>
-/*******************************************************************************
-** Constants & Macros
-********************************************************************************/
-
/* Events */
#define EV_SYN 0x00
@@ -583,11 +580,6 @@ extern "C" {
#define UINPUT_MAX_NAME_SIZE 80
-
-/*******************************************************************************
-** Type definitions and return values
-********************************************************************************/
-
struct uinput_id {
uint16_t bustype;
uint16_t vendor;
diff --git a/btif/src/btif_core.c b/btif/src/btif_core.c
index 555326a..555326a 100644..100755
--- a/btif/src/btif_core.c
+++ b/btif/src/btif_core.c
diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c
index 0558846..b5cac5d 100644..100755
--- a/btif/src/btif_dm.c
+++ b/btif/src/btif_dm.c
@@ -392,7 +392,7 @@ int remove_hid_bond(bt_bdaddr_t *bd_addr)
*/
bdstr_t bdstr;
BTIF_TRACE_DEBUG2("%s---Removing HID bond--%s", __FUNCTION__,bd2str((bt_bdaddr_t *)bd_addr, &bdstr));
- return btif_hh_virtual_unplug(bd_addr);
+ return btif_hh_virtual_unpug(bd_addr);
}
/*******************************************************************************
**
diff --git a/btif/src/btif_hh.c b/btif/src/btif_hh.c
index 1726eaf..9a599dd 100644..100755
--- a/btif/src/btif_hh.c
+++ b/btif/src/btif_hh.c
@@ -551,7 +551,7 @@ BOOLEAN btif_hh_copy_hid_info(tBTA_HH_DEV_DSCP_INFO* dest , tBTA_HH_DEV_DSCP_INF
/*******************************************************************************
**
-** Function btif_hh_virtual_unplug
+** Function btif_btif_hh_virtual_unpug
**
** Description Virtual unplug initiated from the BTIF thread context
** Special handling for HID mouse-
@@ -560,7 +560,7 @@ BOOLEAN btif_hh_copy_hid_info(tBTA_HH_DEV_DSCP_INFO* dest , tBTA_HH_DEV_DSCP_INF
**
*******************************************************************************/
-bt_status_t btif_hh_virtual_unplug(bt_bdaddr_t *bd_addr)
+bt_status_t btif_hh_virtual_unpug(bt_bdaddr_t *bd_addr)
{
BTIF_TRACE_DEBUG1("%s", __FUNCTION__);
btif_hh_device_t *p_dev;
@@ -659,7 +659,7 @@ bt_status_t btif_hh_connect(bt_bdaddr_t *bd_addr)
/*******************************************************************************
**
-** Function btif_hh_disconnect
+** Function btif_btif_hh_disconnect
**
** Description disconnection initiated from the BTIF thread context
**
@@ -1063,7 +1063,7 @@ static void btif_hh_handle_evt(UINT16 event, char *p_param)
case BTIF_HH_VUP_REQ_EVT:
{
BTIF_TRACE_EVENT2("%s: event=%d", __FUNCTION__, event);
- ret = btif_hh_virtual_unplug(bd_addr);
+ ret = btif_hh_virtual_unpug(bd_addr);
}
break;
diff --git a/btif/src/btif_hl.c b/btif/src/btif_hl.c
index 93f35fe..93f35fe 100644..100755
--- a/btif/src/btif_hl.c
+++ b/btif/src/btif_hl.c
diff --git a/btif/src/btif_rc.c b/btif/src/btif_rc.c
index 1e8a220..1e8a220 100644..100755
--- a/btif/src/btif_rc.c
+++ b/btif/src/btif_rc.c
diff --git a/btif/src/btif_storage.c b/btif/src/btif_storage.c
index d8e96d1..d8e96d1 100644..100755
--- a/btif/src/btif_storage.c
+++ b/btif/src/btif_storage.c
diff --git a/btif/src/btif_util.c b/btif/src/btif_util.c
index fb2e792..fb2e792 100644..100755
--- a/btif/src/btif_util.c
+++ b/btif/src/btif_util.c