summaryrefslogtreecommitdiffstats
path: root/btif
diff options
context:
space:
mode:
authorAndre Eisenbach <andre@broadcom.com>2012-09-18 01:35:44 -0700
committerMatthew Xie <mattx@google.com>2012-09-18 10:06:32 -0700
commitcc914cffd521b2e6e1be804c82aea2388b843ebf (patch)
treea4859572083eb29c931cc5066645f9c0a2929d71 /btif
parent6ed67e2ac54c83d18701d2b4ee1b9d729e99a38c (diff)
downloadexternal_bluetooth_bluedroid-cc914cffd521b2e6e1be804c82aea2388b843ebf.zip
external_bluetooth_bluedroid-cc914cffd521b2e6e1be804c82aea2388b843ebf.tar.gz
external_bluetooth_bluedroid-cc914cffd521b2e6e1be804c82aea2388b843ebf.tar.bz2
Header file and whitespace cleanups
Also fixed file permission to remove executable bit from source files. Change-Id: I6954c2d16190bc35b1b0d38386543253696b1112
Diffstat (limited to 'btif')
-rw-r--r--[-rwxr-xr-x]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
-rw-r--r--[-rwxr-xr-x]btif/include/btif_util.h25
-rw-r--r--btif/include/uinput.h10
-rw-r--r--[-rwxr-xr-x]btif/src/btif_core.c0
-rw-r--r--[-rwxr-xr-x]btif/src/btif_dm.c2
-rw-r--r--[-rwxr-xr-x]btif/src/btif_hh.c8
-rw-r--r--[-rwxr-xr-x]btif/src/btif_hl.c0
-rw-r--r--[-rwxr-xr-x]btif/src/btif_rc.c0
-rw-r--r--[-rwxr-xr-x]btif/src/btif_storage.c0
-rw-r--r--[-rwxr-xr-x]btif/src/btif_util.c0
31 files changed, 482 insertions, 538 deletions
diff --git a/btif/co/bta_hh_co.c b/btif/co/bta_hh_co.c
index a2cbd7b..a2cbd7b 100755..100644
--- 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 7916b3d..69224d5 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,31 +62,9 @@
#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
-******************************************************************************/
-
+********************************************************************************/
/*******************************************************************************
**
@@ -97,7 +75,6 @@
** Returns bt_status_t
**
*******************************************************************************/
-
bt_status_t btif_init_bluetooth(void);
/*******************************************************************************
@@ -109,7 +86,6 @@ bt_status_t btif_init_bluetooth(void);
** Returns bt_status_t
**
*******************************************************************************/
-
bt_status_t btif_enable_bluetooth(void);
/*******************************************************************************
@@ -123,7 +99,6 @@ bt_status_t btif_enable_bluetooth(void);
** Returns void
**
*******************************************************************************/
-
bt_status_t btif_disable_bluetooth(void);
/*******************************************************************************
@@ -137,10 +112,8 @@ bt_status_t btif_disable_bluetooth(void);
** Returns void
**
*******************************************************************************/
-
bt_status_t btif_shutdown_bluetooth(void);
-
/*******************************************************************************
**
** Function btif_get_adapter_properties
@@ -150,7 +123,6 @@ bt_status_t btif_shutdown_bluetooth(void);
** Returns bt_status_t
**
*******************************************************************************/
-
bt_status_t btif_get_adapter_properties(void);
/*******************************************************************************
@@ -162,7 +134,6 @@ bt_status_t btif_get_adapter_properties(void);
** Returns bt_status_t
**
*******************************************************************************/
-
bt_status_t btif_get_adapter_property( bt_property_type_t type);
/*******************************************************************************
@@ -175,7 +146,6 @@ 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);
/*******************************************************************************
@@ -187,11 +157,9 @@ 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
@@ -201,10 +169,8 @@ 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
@@ -216,11 +182,9 @@ 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
@@ -231,13 +195,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
-******************************************************************************/
+********************************************************************************/
/*******************************************************************************
**
@@ -249,7 +213,6 @@ 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);
/*******************************************************************************
@@ -261,7 +224,6 @@ bt_status_t btif_dm_start_discovery(void);
** Returns bt_status_t
**
*******************************************************************************/
-
bt_status_t btif_dm_cancel_discovery(void);
/*******************************************************************************
@@ -273,7 +235,6 @@ 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);
/*******************************************************************************
@@ -285,7 +246,6 @@ 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);
/*******************************************************************************
@@ -297,7 +257,6 @@ 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);
/*******************************************************************************
@@ -309,7 +268,6 @@ 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);
@@ -322,7 +280,6 @@ 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);
@@ -335,7 +292,6 @@ 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);
@@ -349,7 +305,6 @@ 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);
/*******************************************************************************
@@ -361,7 +316,6 @@ 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);
@@ -401,4 +355,3 @@ 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 2c08a99..0182a80 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,14 +62,9 @@
#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 */
@@ -81,26 +76,10 @@ 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
-******************************************************************************/
+********************************************************************************/
/*******************************************************************************
**
@@ -164,4 +143,3 @@ 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 4cee7b5..2c908c7 100644
--- a/btif/include/btif_av_api.h
+++ b/btif/include/btif_av_api.h
@@ -54,6 +54,7 @@
** Bluetooth application layer for mobile phones.
**
*****************************************************************************/
+
#ifndef BTIF_AV_API_H
#define BTIF_AV_API_H
@@ -70,7 +71,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 */
@@ -93,7 +94,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 */
@@ -155,7 +156,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 */
@@ -163,7 +164,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
@@ -199,16 +200,17 @@ 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
@@ -218,10 +220,9 @@ 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 9945e8e..a446328 100644
--- a/btif/include/btif_av_co.h
+++ b/btif/include/btif_av_co.h
@@ -45,19 +45,15 @@
*
*****************************************************************************/
-/*****************************************************************************
- *
- * 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,
@@ -66,6 +62,10 @@ enum
/*******************************************************************************
+** Functions
+********************************************************************************/
+
+/*******************************************************************************
**
** Function bta_av_co_cp_is_active
**
@@ -199,5 +199,4 @@ 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 8e5c275..24eaace 100644
--- a/btif/include/btif_common.h
+++ b/btif/include/btif_common.h
@@ -45,14 +45,6 @@
*
************************************************************************************/
-/************************************************************************************
- *
- * Filename: btif_common.h
- *
- * Description:
- *
- ***********************************************************************************/
-
#ifndef BTIF_COMMON_H
#define BTIF_COMMON_H
@@ -66,21 +58,22 @@
#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 /* core */
+#define BTIF_CORE 0
#define BTIF_DM 1
#define BTIF_HFP 2
#define BTIF_AV 3
@@ -97,8 +90,10 @@ 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),
@@ -123,12 +118,13 @@ 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),
@@ -149,33 +145,38 @@ 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
@@ -189,23 +190,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 7188a0f..4bd25db 100644
--- a/btif/include/btif_config.h
+++ b/btif/include/btif_config.h
@@ -45,27 +45,37 @@
*
************************************************************************************/
-
-/************************************************************************************
+/*******************************************************************************
*
* 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);
@@ -88,6 +98,7 @@ 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 0612796..f9d0d29 100644
--- a/btif/include/btif_config_util.h
+++ b/btif/include/btif_config_util.h
@@ -45,21 +45,25 @@
*
************************************************************************************/
-
/************************************************************************************
*
* 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"
@@ -69,10 +73,17 @@ 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 71f2c5e..64af77a 100644
--- a/btif/include/btif_dm.h
+++ b/btif/include/btif_dm.h
@@ -45,28 +45,27 @@
*
************************************************************************************/
-/************************************************************************************
- *
- * Filename: btif_dm.h
- *
- * Description:
- *
- ***********************************************************************************/
-
#ifndef BTIF_DM_H
#define BTIF_DM_H
-/************************************************************************************
+/*******************************************************************************
** Functions
-************************************************************************************/
+********************************************************************************/
-/*******************************************************************************
-**
-** Description BTIF callback to switch context from bte to btif
-**
-*******************************************************************************/
+/**
+ * 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
@@ -76,7 +75,4 @@ 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 ad438f9..69b4581 100644
--- a/btif/include/btif_hh.h
+++ b/btif/include/btif_hh.h
@@ -45,15 +45,6 @@
*
*****************************************************************************/
-/*****************************************************************************
-**
-** Name: btif_hh.h
-**
-** Description:
-**
-******************************************************************************/
-
-
#ifndef BTIF_HH_H
#define BTIF_HH_H
@@ -62,6 +53,9 @@
#include <stdint.h>
#include "bta_hh_api.h"
+/*******************************************************************************
+** Constants & Macros
+********************************************************************************/
#define BTIF_HH_MAX_HID 8
#define BTIF_HH_MAX_ADDED_DEV 32
@@ -71,6 +65,22 @@
#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;
@@ -83,7 +93,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;
@@ -91,18 +101,10 @@ typedef struct
tBTA_HH_ATTR_MASK attr_mask;
} btif_hh_added_device_t;
-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
+/**
+ * BTIF-HH control block to maintain added devices and currently
+ * connected hid devices
+ */
typedef struct
{
BTIF_HH_STATUS status;
@@ -112,16 +114,18 @@ 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);
-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 bt_status_t btif_hh_virtual_unplug(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 cac6eb2..ccf9bc9 100644
--- a/btif/include/btif_hl.h
+++ b/btif/include/btif_hl.h
@@ -45,21 +45,12 @@
*
************************************************************************************/
-/************************************************************************************
- *
- * Filename: btif_hl.h
- *
- * Description:
- *
- ***********************************************************************************/
-
#ifndef BTIF_HL_H
#define BTIF_HL_H
-/************************************************************************************
-** Functions
-************************************************************************************/
-
+/*******************************************************************************
+** Constants & Macros
+********************************************************************************/
#define BTIF_HL_DATA_TYPE_NONE 0x0000
#define BTIF_HL_DATA_TYPE_PULSE_OXIMETER 0x1004 /* from BT assigned number */
@@ -72,9 +63,74 @@
#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,
+};
+
typedef struct
{
UINT8 mdep_cfg_idx;
@@ -82,7 +138,6 @@ typedef struct
tBTA_HL_MDEP_ID peer_mdep_id;
} btif_hl_extra_mdl_cfg_t;
-
typedef struct
{
tBTA_HL_MDL_CFG base;
@@ -91,123 +146,75 @@ 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;
-
-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;
+ BOOLEAN is_app_read;
+ btif_hl_nv_app_cb_t app_cb;
+ BUFFER_Q app_queue;
+} btif_hl_nv_cb_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
@@ -234,112 +241,93 @@ typedef struct
BOOLEAN cong;
btif_hl_soc_cb_t *p_scb;
int channel_id;
-}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_mdl_cb_t;
- 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;
- //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;
+ 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;
+
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
@@ -350,29 +338,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;
-
-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;
+/*******************************************************************************
+** Functions
+********************************************************************************/
#define BTIF_HL_GET_CB_PTR() &(btif_hl_cb)
#define BTIF_HL_GET_APP_CB_PTR(app_idx) &(btif_hl_cb.acb[(app_idx)])
@@ -381,6 +369,11 @@ extern btif_hl_nv_cb_t *p_ncb;
#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 9eda863..18fbaab 100644
--- a/btif/include/btif_media.h
+++ b/btif/include/btif_media.h
@@ -45,14 +45,13 @@
*
************************************************************************************/
-/************************************************************************************
+/*******************************************************************************
*
* Filename: btif_media.h
*
* Description: This is the audio module for the BTIF system.
*
- ***********************************************************************************/
-
+ *******************************************************************************/
#ifndef BTIF_MEDIA_H
#define BTIF_MEDIA_H
@@ -63,15 +62,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 */
@@ -80,14 +79,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;
@@ -123,13 +122,9 @@ typedef struct
#endif
-/*****************************************************************************
- ** Local data
- *****************************************************************************/
-
-/*****************************************************************************
- ** public functions
- *****************************************************************************/
+/*******************************************************************************
+ ** Public functions
+ *******************************************************************************/
/*******************************************************************************
**
@@ -142,7 +137,6 @@ typedef struct
*******************************************************************************/
extern int btif_media_task(void *p);
-
/*******************************************************************************
**
** Function btif_media_task_enc_init_req
@@ -166,6 +160,7 @@ 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
@@ -235,7 +230,6 @@ 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
@@ -249,7 +243,6 @@ 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
@@ -261,8 +254,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);
@@ -280,4 +273,3 @@ 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 47635d7..15d8783 100644
--- a/btif/include/btif_pan.h
+++ b/btif/include/btif_pan.h
@@ -45,20 +45,21 @@
*
************************************************************************************/
-
-/************************************************************************************
+/*******************************************************************************
*
* 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 fdd9da3..b0ad68f 100644
--- a/btif/include/btif_pan_internal.h
+++ b/btif/include/btif_pan_internal.h
@@ -45,21 +45,24 @@
*
************************************************************************************/
-
-/************************************************************************************
+/*******************************************************************************
*
* 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"
@@ -74,12 +77,19 @@
#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;
@@ -100,6 +110,12 @@ 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);
@@ -111,6 +127,7 @@ 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;
@@ -119,11 +136,12 @@ 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 8f5f013..5aa8a25 100644
--- a/btif/include/btif_profile_queue.h
+++ b/btif/include/btif_profile_queue.h
@@ -45,23 +45,22 @@
*
************************************************************************************/
-/************************************************************************************
+/*******************************************************************************
*
* Filename: btif_profile_queue.h
*
* Description: Bluetooth remote device connection queuing
*
- ***********************************************************************************/
-#ifndef BTIF_QUEUE_H
-#define BTIF_QUEUE_H
+ *******************************************************************************/
+
+#ifndef BTIF_PROFILE_QUEUE_H
+#define BTIF_PROFILE_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 fb8ddc7..c66987f 100644
--- a/btif/include/btif_sm.h
+++ b/btif/include/btif_sm.h
@@ -60,6 +60,11 @@
** 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
******************************************************************************/
@@ -68,28 +73,14 @@ 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
@@ -154,5 +145,3 @@ 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 a307255..920efe6 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 2415513..f7e0869 100644
--- a/btif/include/btif_sock_rfc.h
+++ b/btif/include/btif_sock_rfc.h
@@ -45,20 +45,23 @@
*
************************************************************************************/
-/************************************************************************************
+/*******************************************************************************
*
* 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 012e1a9..52af46e 100644
--- a/btif/include/btif_sock_sdp.h
+++ b/btif/include/btif_sock_sdp.h
@@ -45,24 +45,18 @@
*
************************************************************************************/
-/************************************************************************************
- *
- * Filename: btif_sock.h
- *
- * Description: Bluetooth socket Interface
- *
- *
- ***********************************************************************************/
+#ifndef BTIF_SOCK_SDP_H
+#define BTIF_SOCK_SDP_H
-#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 0f5212f..3678673 100644
--- a/btif/include/btif_sock_thread.h
+++ b/btif/include/btif_sock_thread.h
@@ -45,29 +45,34 @@
*
************************************************************************************/
-/************************************************************************************
- *
- * Filename: btif_sock_thread.h
- *
- * Description:
- *
- ***********************************************************************************/
-
#ifndef BTIF_SOCK_THREAD_H
#define BTIF_SOCK_THREAD_H
+
#include <hardware/bt_sock.h>
-#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
+/*******************************************************************************
+** 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);
+
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);
-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_post_cmd(int handle, int cmd_type, const unsigned char* cmd_data,
+ int data_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
+#endif
diff --git a/btif/include/btif_sock_util.h b/btif/include/btif_sock_util.h
index 7a7cff3..fe3b881 100644
--- a/btif/include/btif_sock_util.h
+++ b/btif/include/btif_sock_util.h
@@ -45,20 +45,24 @@
*
************************************************************************************/
-
-/************************************************************************************
+/*******************************************************************************
*
* 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;
@@ -66,21 +70,24 @@ 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_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 f4b2ca3..31b04fb 100644
--- a/btif/include/btif_storage.h
+++ b/btif/include/btif_storage.h
@@ -45,14 +45,6 @@
*
************************************************************************************/
-/************************************************************************************
- *
- * Filename: btif_storage.h
- *
- * Description:
- *
- ***********************************************************************************/
-
#ifndef BTIF_STORAGE_H
#define BTIF_STORAGE_H
@@ -61,23 +53,17 @@
#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
@@ -92,6 +78,7 @@
**
*******************************************************************************/
bt_status_t btif_storage_get_adapter_property(bt_property_t *property);
+
/*******************************************************************************
**
** Function btif_storage_set_adapter_property
@@ -104,6 +91,7 @@ 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
@@ -119,6 +107,7 @@ 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
@@ -132,6 +121,7 @@ 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
@@ -147,6 +137,7 @@ 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
@@ -162,6 +153,7 @@ 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
@@ -173,6 +165,7 @@ 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
@@ -184,6 +177,7 @@ 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
@@ -207,6 +201,7 @@ 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
@@ -218,6 +213,7 @@ 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
@@ -229,6 +225,7 @@ 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
@@ -240,6 +237,7 @@ 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
@@ -262,19 +260,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
**
@@ -291,7 +289,6 @@ 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);
/*******************************************************************************
@@ -316,7 +313,6 @@ bt_status_t btif_storage_load_autopair_device_list();
** FALSE otherwise
**
*******************************************************************************/
-
BOOLEAN btif_storage_is_device_autopair_blacklisted(bt_bdaddr_t *remote_dev_addr);
/*******************************************************************************
@@ -329,7 +325,6 @@ 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);
/*******************************************************************************
@@ -344,7 +339,4 @@ 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 cfa7945..6d146b8 100755..100644
--- a/btif/include/btif_util.h
+++ b/btif/include/btif_util.h
@@ -45,14 +45,6 @@
*
************************************************************************************/
-/************************************************************************************
- *
- * Filename: btif_util.h
- *
- * Description:
- *
- ***********************************************************************************/
-
#ifndef BTIF_UTIL_H
#define BTIF_UTIL_H
@@ -63,26 +55,23 @@
#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 303f4f3..0a4d928 100644
--- a/btif/include/uinput.h
+++ b/btif/include/uinput.h
@@ -44,7 +44,6 @@
* ESSENTIAL PURPOSE OF ANY LIMITED REMEDY.
*
************************************************************************************/
-/* TBD: tmp code here */
#ifndef __UINPUT_H
#define __UINPUT_H
@@ -57,6 +56,10 @@ extern "C" {
#include <sys/time.h>
#include <sys/ioctl.h>
+/*******************************************************************************
+** Constants & Macros
+********************************************************************************/
+
/* Events */
#define EV_SYN 0x00
@@ -580,6 +583,11 @@ 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 100755..100644
--- 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 b5cac5d..0558846 100755..100644
--- 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_unpug(bd_addr);
+ return btif_hh_virtual_unplug(bd_addr);
}
/*******************************************************************************
**
diff --git a/btif/src/btif_hh.c b/btif/src/btif_hh.c
index 9a599dd..1726eaf 100755..100644
--- 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_btif_hh_virtual_unpug
+** Function btif_hh_virtual_unplug
**
** 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_unpug(bt_bdaddr_t *bd_addr)
+bt_status_t btif_hh_virtual_unplug(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_btif_hh_disconnect
+** Function 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_unpug(bd_addr);
+ ret = btif_hh_virtual_unplug(bd_addr);
}
break;
diff --git a/btif/src/btif_hl.c b/btif/src/btif_hl.c
index 93f35fe..93f35fe 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- 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 100755..100644
--- a/btif/src/btif_util.c
+++ b/btif/src/btif_util.c