am 509b2d73: Merge "TARGET_SIMULATOR is long dead."
* commit '509b2d7358545945eb22dde2449d4f8d6e3b3b09':
TARGET_SIMULATOR is long dead.
diff --git a/audio_a2dp_hw/Android.mk b/audio_a2dp_hw/Android.mk
index 172fba3..d2a8f0a 100644
--- a/audio_a2dp_hw/Android.mk
+++ b/audio_a2dp_hw/Android.mk
@@ -5,7 +5,7 @@
LOCAL_SRC_FILES:= \
audio_a2dp_hw.c
-LOCAL_C_INCLUDES+= .
+LOCAL_C_INCLUDES+= . $(LOCAL_PATH)/../utils/include
LOCAL_CFLAGS := -Wno-unused-parameter
LOCAL_SHARED_LIBRARIES := \
diff --git a/audio_a2dp_hw/audio_a2dp_hw.c b/audio_a2dp_hw/audio_a2dp_hw.c
index 4e63817..2fee588 100644
--- a/audio_a2dp_hw/audio_a2dp_hw.c
+++ b/audio_a2dp_hw/audio_a2dp_hw.c
@@ -43,6 +43,7 @@
#include <hardware/hardware.h>
#include "audio_a2dp_hw.h"
+#include "bt_utils.h"
#define LOG_TAG "audio_a2dp_hw"
/* #define LOG_NDEBUG 0 */
@@ -150,6 +151,8 @@
static struct timespec prev = {0,0};
unsigned long long now_us;
unsigned long long diff_us;
+ UNUSED(tag);
+ UNUSED(val);
clock_gettime(CLOCK_MONOTONIC, &now);
@@ -543,6 +546,7 @@
static int out_set_format(struct audio_stream *stream, audio_format_t format)
{
+ UNUSED(format);
struct a2dp_stream_out *out = (struct a2dp_stream_out *)stream;
DEBUG("setting format not yet supported (0x%x)", format);
return -ENOSYS;
@@ -551,8 +555,6 @@
static int out_standby(struct audio_stream *stream)
{
struct a2dp_stream_out *out = (struct a2dp_stream_out *)stream;
- int retval = 0;
-
int retVal = 0;
FNLOG();
@@ -570,6 +572,7 @@
static int out_dump(const struct audio_stream *stream, int fd)
{
+ UNUSED(fd);
struct a2dp_stream_out *out = (struct a2dp_stream_out *)stream;
FNLOG();
return 0;
@@ -631,6 +634,7 @@
static char * out_get_parameters(const struct audio_stream *stream, const char *keys)
{
+ UNUSED(keys);
struct a2dp_stream_out *out = (struct a2dp_stream_out *)stream;
FNLOG();
@@ -659,6 +663,10 @@
static int out_set_volume(struct audio_stream_out *stream, float left,
float right)
{
+ UNUSED(stream);
+ UNUSED(left);
+ UNUSED(right);
+
FNLOG();
/* volume controlled in audioflinger mixer (digital) */
@@ -671,18 +679,27 @@
static int out_get_render_position(const struct audio_stream_out *stream,
uint32_t *dsp_frames)
{
+ UNUSED(stream);
+ UNUSED(dsp_frames);
+
FNLOG();
return -EINVAL;
}
static int out_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
{
+ UNUSED(stream);
+ UNUSED(effect);
+
FNLOG();
return 0;
}
static int out_remove_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
{
+ UNUSED(stream);
+ UNUSED(effect);
+
FNLOG();
return 0;
}
@@ -693,54 +710,76 @@
static uint32_t in_get_sample_rate(const struct audio_stream *stream)
{
+ UNUSED(stream);
+
FNLOG();
return 8000;
}
static int in_set_sample_rate(struct audio_stream *stream, uint32_t rate)
{
+ UNUSED(stream);
+ UNUSED(rate);
+
FNLOG();
return 0;
}
static size_t in_get_buffer_size(const struct audio_stream *stream)
{
+ UNUSED(stream);
+
FNLOG();
return 320;
}
static uint32_t in_get_channels(const struct audio_stream *stream)
{
+ UNUSED(stream);
+
FNLOG();
return AUDIO_CHANNEL_IN_MONO;
}
static audio_format_t in_get_format(const struct audio_stream *stream)
{
+ UNUSED(stream);
+
FNLOG();
return AUDIO_FORMAT_PCM_16_BIT;
}
static int in_set_format(struct audio_stream *stream, audio_format_t format)
{
+ UNUSED(stream);
+ UNUSED(format);
+
FNLOG();
return 0;
}
static int in_standby(struct audio_stream *stream)
{
+ UNUSED(stream);
+
FNLOG();
return 0;
}
static int in_dump(const struct audio_stream *stream, int fd)
{
+ UNUSED(stream);
+ UNUSED(fd);
+
FNLOG();
return 0;
}
static int in_set_parameters(struct audio_stream *stream, const char *kvpairs)
{
+ UNUSED(stream);
+ UNUSED(kvpairs);
+
FNLOG();
return 0;
}
@@ -748,12 +787,18 @@
static char * in_get_parameters(const struct audio_stream *stream,
const char *keys)
{
+ UNUSED(stream);
+ UNUSED(keys);
+
FNLOG();
return strdup("");
}
static int in_set_gain(struct audio_stream_in *stream, float gain)
{
+ UNUSED(stream);
+ UNUSED(gain);
+
FNLOG();
return 0;
}
@@ -761,24 +806,36 @@
static ssize_t in_read(struct audio_stream_in *stream, void* buffer,
size_t bytes)
{
+ UNUSED(stream);
+ UNUSED(buffer);
+ UNUSED(bytes);
+
FNLOG();
return bytes;
}
static uint32_t in_get_input_frames_lost(struct audio_stream_in *stream)
{
+ UNUSED(stream);
+
FNLOG();
return 0;
}
static int in_add_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
{
+ UNUSED(stream);
+ UNUSED(effect);
+
FNLOG();
return 0;
}
static int in_remove_audio_effect(const struct audio_stream *stream, effect_handle_t effect)
{
+ UNUSED(stream);
+ UNUSED(effect);
+
FNLOG();
return 0;
@@ -796,6 +853,9 @@
struct a2dp_stream_out *out;
int ret = 0;
int i;
+ UNUSED(handle);
+ UNUSED(devices);
+ UNUSED(flags);
INFO("opening output");
@@ -908,6 +968,7 @@
const char *keys)
{
struct str_parms *parms;
+ UNUSED(dev);
FNLOG();
@@ -931,6 +992,9 @@
static int adev_set_voice_volume(struct audio_hw_device *dev, float volume)
{
+ UNUSED(dev);
+ UNUSED(volume);
+
FNLOG();
return -ENOSYS;
@@ -938,6 +1002,9 @@
static int adev_set_master_volume(struct audio_hw_device *dev, float volume)
{
+ UNUSED(dev);
+ UNUSED(volume);
+
FNLOG();
return -ENOSYS;
@@ -945,6 +1012,9 @@
static int adev_set_mode(struct audio_hw_device *dev, int mode)
{
+ UNUSED(dev);
+ UNUSED(mode);
+
FNLOG();
return 0;
@@ -952,6 +1022,9 @@
static int adev_set_mic_mute(struct audio_hw_device *dev, bool state)
{
+ UNUSED(dev);
+ UNUSED(state);
+
FNLOG();
return -ENOSYS;
@@ -959,6 +1032,9 @@
static int adev_get_mic_mute(const struct audio_hw_device *dev, bool *state)
{
+ UNUSED(dev);
+ UNUSED(state);
+
FNLOG();
return -ENOSYS;
@@ -967,6 +1043,9 @@
static size_t adev_get_input_buffer_size(const struct audio_hw_device *dev,
const struct audio_config *config)
{
+ UNUSED(dev);
+ UNUSED(config);
+
FNLOG();
return 320;
@@ -981,6 +1060,9 @@
struct a2dp_audio_device *ladev = (struct a2dp_audio_device *)dev;
struct a2dp_stream_in *in;
int ret;
+ UNUSED(handle);
+ UNUSED(devices);
+ UNUSED(config);
FNLOG();
@@ -1017,6 +1099,9 @@
static void adev_close_input_stream(struct audio_hw_device *dev,
struct audio_stream_in *in)
{
+ UNUSED(dev);
+ UNUSED(in);
+
FNLOG();
return;
@@ -1024,6 +1109,9 @@
static int adev_dump(const audio_hw_device_t *device, int fd)
{
+ UNUSED(device);
+ UNUSED(fd);
+
FNLOG();
return 0;
diff --git a/bta/Android.mk b/bta/Android.mk
index dbad921..310080d 100644
--- a/bta/Android.mk
+++ b/bta/Android.mk
@@ -96,6 +96,7 @@
$(LOCAL_PATH)/../hcis/patchram \
$(LOCAL_PATH)/../udrv/include \
$(LOCAL_PATH)/../brcm/include \
+ $(LOCAL_PATH)/../utils/include \
$(bdroid_C_INCLUDES) \
diff --git a/bta/ag/bta_ag_act.c b/bta/ag/bta_ag_act.c
index 5f72444..11fc85c 100644
--- a/bta/ag/bta_ag_act.c
+++ b/bta/ag/bta_ag_act.c
@@ -334,6 +334,8 @@
*******************************************************************************/
void bta_ag_disc_fail(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
+ UNUSED(p_data);
+
/* reopen registered servers */
bta_ag_start_servers(p_scb, p_scb->reg_services);
@@ -371,6 +373,8 @@
*******************************************************************************/
void bta_ag_rfc_fail(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
+ UNUSED(p_data);
+
/* reinitialize stuff */
p_scb->conn_handle = 0;
p_scb->conn_service = 0;
@@ -405,6 +409,7 @@
tBTA_AG_HDR close;
tBTA_SERVICE_MASK services;
int i, num_active_conn = 0;
+ UNUSED(p_data);
#ifdef _WIN32_WCE
/* The BTE RFCOMM automatically removes the connection when closed, but BTW does not */
@@ -637,6 +642,7 @@
{
UINT16 len;
char buf[BTA_AG_RFC_READ_MAX];
+ UNUSED(p_data);
memset(buf, 0, BTA_AG_RFC_READ_MAX);
@@ -796,6 +802,7 @@
void bta_ag_svc_conn_open(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
tBTA_AG_CONN evt;
+ UNUSED(p_data);
if (!p_scb->svc_conn)
{
@@ -856,6 +863,8 @@
*******************************************************************************/
void bta_ag_rcvd_slc_ready(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
+ UNUSED(p_data);
+
APPL_TRACE_DEBUG1("bta_ag_rcvd_slc_ready: handle = %d", bta_ag_scb_to_idx(p_scb));
if (bta_ag_cb.parse_mode == BTA_AG_PASS_THROUGH)
diff --git a/bta/ag/bta_ag_cmd.c b/bta/ag/bta_ag_cmd.c
index c035cf3..54cd4d3 100644
--- a/bta/ag/bta_ag_cmd.c
+++ b/bta/ag/bta_ag_cmd.c
@@ -631,6 +631,7 @@
{
UINT8 retval = 0;
INT16 idx = -1;
+ UNUSED(p_scb);
if (p_s[1] != 0)
{
@@ -1747,6 +1748,9 @@
{
APPL_TRACE_ERROR1("bta_ag_setcodec error: unsupported codec type %d", codec_type);
}
+#else
+ UNUSED(p_scb);
+ UNUSED(p_data);
#endif
}
@@ -1801,6 +1805,8 @@
*******************************************************************************/
void bta_ag_send_ring(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
+ UNUSED(p_data);
+
#if defined(BTA_AG_MULTI_RESULT_INCLUDED) && (BTA_AG_MULTI_RESULT_INCLUDED == TRUE)
tBTA_AG_MULTI_RESULT_CB m_res_cb;
diff --git a/bta/ag/bta_ag_main.c b/bta/ag/bta_ag_main.c
index 9b28067..bae992b 100644
--- a/bta/ag/bta_ag_main.c
+++ b/bta/ag/bta_ag_main.c
@@ -28,6 +28,7 @@
#include "bta_ag_co.h"
#include "bta_ag_int.h"
#include "bd.h"
+#include "utl.h"
/*****************************************************************************
** Constants and types
@@ -586,6 +587,8 @@
{
UINT16 handle;
tBTA_AG_SCB *p_scb;
+ UNUSED(status);
+ UNUSED(app_id);
/* Check if we have opening scb for the peer device. */
handle = bta_ag_idx_by_bdaddr (peer_addr);
diff --git a/bta/ag/bta_ag_rfc.c b/bta/ag/bta_ag_rfc.c
index 3575020..d6b5329 100644
--- a/bta/ag/bta_ag_rfc.c
+++ b/bta/ag/bta_ag_rfc.c
@@ -34,6 +34,7 @@
#include "rfcdefs.h"
#include "gki.h"
#include "bd.h"
+#include "utl.h"
/* Event mask for RfCOMM port callback */
#define BTA_AG_PORT_EV_MASK PORT_EV_RXCHAR
@@ -89,6 +90,7 @@
{
BT_HDR *p_buf;
tBTA_AG_SCB *p_scb;
+ UNUSED(code);
if ((p_scb = bta_ag_scb_by_idx(handle)) != NULL)
{
@@ -195,6 +197,8 @@
*******************************************************************************/
static int bta_ag_data_cback(UINT16 port_handle, void *p_data, UINT16 len, UINT16 handle)
{
+ UNUSED(port_handle);
+
/* call data call-out directly */
bta_ag_co_tx_write(handle, (UINT8 *) p_data, len);
return 0;
@@ -400,6 +404,7 @@
void bta_ag_rfc_do_close(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
tBTA_AG_RFC *p_buf;
+ UNUSED(p_data);
if (p_scb->conn_handle)
{
diff --git a/bta/ag/bta_ag_sco.c b/bta/ag/bta_ag_sco.c
index 0c811b4..87d9188 100644
--- a/bta/ag/bta_ag_sco.c
+++ b/bta/ag/bta_ag_sco.c
@@ -31,6 +31,7 @@
#include "bta_ag_int.h"
#include "btm_api.h"
#include "gki.h"
+#include "utl.h"
#ifndef BTA_AG_SCO_DEBUG
#define BTA_AG_SCO_DEBUG FALSE
@@ -1277,6 +1278,7 @@
*******************************************************************************/
void bta_ag_sco_listen(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
+ UNUSED(p_data);
bta_ag_sco_event(p_scb, BTA_AG_SCO_LISTEN_E);
}
@@ -1293,6 +1295,7 @@
void bta_ag_sco_open(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
UINT8 event;
+ UNUSED(p_data);
/* if another scb using sco, this is a transfer */
if (bta_ag_cb.sco.p_curr_scb != NULL && bta_ag_cb.sco.p_curr_scb != p_scb)
@@ -1320,6 +1323,8 @@
*******************************************************************************/
void bta_ag_sco_close(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
+ UNUSED(p_data);
+
/* if scb is in use */
#if (BTM_WBS_INCLUDED == TRUE )
/* sco_idx is not allocated in SCO_CODEC_ST, we still need to move to listening state. */
@@ -1371,6 +1376,8 @@
*******************************************************************************/
void bta_ag_sco_shutdown(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
+ UNUSED(p_data);
+
bta_ag_sco_event(p_scb, BTA_AG_SCO_SHUTDOWN_E);
}
@@ -1386,6 +1393,8 @@
*******************************************************************************/
void bta_ag_sco_conn_open(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
+ UNUSED(p_data);
+
bta_ag_sco_event(p_scb, BTA_AG_SCO_CONN_OPEN_E);
bta_sys_sco_open(BTA_ID_AG, p_scb->app_id, p_scb->peer_addr);
@@ -1416,6 +1425,7 @@
void bta_ag_sco_conn_close(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
UINT16 handle = bta_ag_scb_to_idx(p_scb);
+ UNUSED(p_data);
/* clear current scb */
bta_ag_cb.sco.p_curr_scb = NULL;
@@ -1560,6 +1570,9 @@
*******************************************************************************/
void bta_ag_ci_sco_data(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
+ UNUSED(p_scb);
+ UNUSED(p_data);
+
#if (BTM_SCO_HCI_INCLUDED == TRUE )
bta_ag_sco_event(p_scb, BTA_AG_SCO_CI_DATA_E);
#endif
diff --git a/bta/ag/bta_ag_sdp.c b/bta/ag/bta_ag_sdp.c
index d708cf2..333cb1b 100644
--- a/bta/ag/bta_ag_sdp.c
+++ b/bta/ag/bta_ag_sdp.c
@@ -31,6 +31,7 @@
#include "sdp_api.h"
#include "btm_api.h"
#include "gki.h"
+#include "utl.h"
/* Number of protocol elements in protocol element list. */
#define BTA_AG_NUM_PROTO_ELEMS 2
@@ -256,6 +257,7 @@
tBTA_SERVICE_MASK services;
tBTA_SERVICE_MASK others = 0;
int i;
+ UNUSED(p_data);
/* get services of all other registered servers */
for (i = 0; i < BTA_AG_NUM_IDX; i++, p++)
@@ -492,6 +494,8 @@
*******************************************************************************/
void bta_ag_free_db(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
+ UNUSED(p_data);
+
if (p_scb->p_disc_db != NULL)
{
GKI_freebuf(p_scb->p_disc_db);
diff --git a/bta/av/bta_av_aact.c b/bta/av/bta_av_aact.c
index a50fb80..fed838a 100644
--- a/bta/av/bta_av_aact.c
+++ b/bta/av/bta_av_aact.c
@@ -288,6 +288,7 @@
*******************************************************************************/
void bta_av_st_rc_timer(tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
+ UNUSED(p_data);
APPL_TRACE_DEBUG2("bta_av_st_rc_timer rc_handle:%d, use_rc: %d",
p_scb->rc_handle, p_scb->use_rc);
@@ -681,6 +682,7 @@
{
tBTA_AV_RS_RES switch_res = BTA_AV_RS_NONE;
tBTA_AV_API_OPEN *p_buf = &p_scb->q_info.open;
+ UNUSED(p_data);
APPL_TRACE_DEBUG1("bta_av_switch_role wait:x%x", p_scb->wait);
if (p_scb->wait & BTA_AV_WAIT_ROLE_SW_RES_START)
@@ -947,6 +949,7 @@
tBTA_AV_CONN_CHG msg;
int xx;
UINT8 role = BTA_AV_ROLE_AD_INT;
+ UNUSED(p_data);
APPL_TRACE_DEBUG0("bta_av_cleanup");
@@ -999,6 +1002,7 @@
*******************************************************************************/
void bta_av_free_sdb(tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
+ UNUSED(p_data);
utl_freebuf((void **) &p_scb->p_disc_db);
}
@@ -1017,6 +1021,7 @@
tAVDT_SEP_INFO *p_info;
tAVDT_CFG *p_evt_cfg = &p_data->str_msg.cfg;
UINT8 psc_mask = (p_evt_cfg->psc_mask | p_scb->cfg.psc_mask);
+ UNUSED(p_data);
p_scb->avdt_label = p_data->str_msg.msg.hdr.label;
memcpy(p_scb->cfg.codec_info, p_evt_cfg->codec_info, AVDT_CODEC_SIZE);
@@ -1076,6 +1081,8 @@
void bta_av_disconnect_req (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
tBTA_AV_RCB *p_rcb;
+ UNUSED(p_data);
+
APPL_TRACE_DEBUG1("bta_av_disconnect_req conn_lcb: 0x%x", bta_av_cb.conn_lcb);
bta_sys_stop_timer(&bta_av_cb.sig_tmr);
@@ -1346,6 +1353,8 @@
*******************************************************************************/
void bta_av_do_close (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
+ UNUSED(p_data);
+
/* stop stream if started */
if (p_scb->co_started)
{
@@ -1381,6 +1390,8 @@
*******************************************************************************/
void bta_av_connect_req (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
+ UNUSED(p_data);
+
utl_freebuf((void **) &p_scb->p_disc_db);
if (p_scb->coll_mask & BTA_AV_COLL_INC_TMR)
@@ -1570,6 +1581,8 @@
*******************************************************************************/
void bta_av_set_use_rc (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
+ UNUSED(p_data);
+
p_scb->use_rc = TRUE;
}
@@ -1585,6 +1598,8 @@
void bta_av_cco_close (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
UINT16 mtu;
+ UNUSED(p_data);
+
mtu = bta_av_chk_mtu(p_scb, BTA_AV_MAX_A2DP_MTU);
p_scb->p_cos->close(p_scb->hndl, p_scb->codec_type, mtu);
@@ -1742,6 +1757,8 @@
*******************************************************************************/
void bta_av_discover_req (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
+ UNUSED(p_data);
+
/* send avdtp discover request */
AVDT_DiscoverReq(p_scb->peer_addr, p_scb->sep_info, BTA_AV_NUM_SEPS, bta_av_dt_cback[p_scb->hdi]);
@@ -1997,6 +2014,7 @@
BOOLEAN new_buf = FALSE;
UINT8 m_pt = 0x60 | p_scb->codec_type;
tAVDT_DATA_OPT_MASK opt;
+ UNUSED(p_data);
if (!p_scb->cong)
{
@@ -2260,6 +2278,8 @@
*******************************************************************************/
void bta_av_start_failed (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
+ UNUSED(p_data);
+
if(p_scb->started == FALSE && p_scb->co_started == FALSE)
{
bta_sys_idle(BTA_ID_AV, bta_av_cb.audio_open_cnt, p_scb->peer_addr);
@@ -2344,6 +2364,8 @@
*******************************************************************************/
void bta_av_clr_cong (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
+ UNUSED(p_data);
+
if(p_scb->co_started)
p_scb->cong = FALSE;
}
@@ -2440,6 +2462,7 @@
void bta_av_rcfg_str_ok (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
tBTA_AV_RECONFIG evt;
+ UNUSED(p_data);
p_scb->l2c_cid = AVDT_GetL2CapChannel(p_scb->avdt_handle);
APPL_TRACE_DEBUG1("bta_av_rcfg_str_ok: l2c_cid: %d", p_scb->l2c_cid);
@@ -2514,6 +2537,8 @@
*******************************************************************************/
void bta_av_rcfg_connect (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
+ UNUSED(p_data);
+
p_scb->cong = FALSE;
p_scb->num_recfg++;
APPL_TRACE_DEBUG1("bta_av_rcfg_connect num_recfg: %d", p_scb->num_recfg);
@@ -2538,6 +2563,7 @@
void bta_av_rcfg_discntd (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
tBTA_AV_RECONFIG evt;
+ UNUSED(p_data);
APPL_TRACE_DEBUG1("bta_av_rcfg_discntd num_recfg: %d", p_scb->num_recfg);
p_scb->num_recfg++;
@@ -2655,6 +2681,8 @@
*******************************************************************************/
void bta_av_rcfg_open (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
+ UNUSED(p_data);
+
APPL_TRACE_DEBUG1("bta_av_rcfg_open, num_disc_snks = %d", p_scb->num_disc_snks);
if (p_scb->num_disc_snks == 0)
@@ -2692,6 +2720,8 @@
*******************************************************************************/
void bta_av_security_rej (tBTA_AV_SCB *p_scb, tBTA_AV_DATA *p_data)
{
+ UNUSED(p_data);
+
AVDT_SecurityRsp(p_scb->avdt_handle, p_scb->avdt_label, AVDT_ERR_BAD_STATE,
NULL, 0);
}
@@ -2711,7 +2741,7 @@
tBTA_AV_SCB *p_scbi;
int i;
BOOLEAN new_started = FALSE;
-
+ UNUSED(p_data);
if ((p_scb->chnl == BTA_AV_CHNL_AUDIO) && (bta_av_cb.audio_open_cnt >= 2))
{
diff --git a/bta/av/bta_av_act.c b/bta/av/bta_av_act.c
index ada7592..4408874 100755
--- a/bta/av/bta_av_act.c
+++ b/bta/av/bta_av_act.c
@@ -181,6 +181,7 @@
static void bta_av_avrc_sdp_cback(UINT16 status)
{
BT_HDR *p_msg;
+ UNUSED(status);
if ((p_msg = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL)
{
@@ -202,6 +203,7 @@
{
tBTA_AV_RC_CONN_CHG *p_msg;
UINT16 msg_event = 0;
+ UNUSED(result);
#if (defined(BTA_AV_MIN_DEBUG_TRACES) && BTA_AV_MIN_DEBUG_TRACES == TRUE)
APPL_TRACE_EVENT2("rc_ctrl handle: %d event=0x%x", handle, event);
@@ -688,6 +690,8 @@
*******************************************************************************/
void bta_av_rc_free_rsp (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
{
+ UNUSED(p_cb);
+
GKI_freebuf (p_data->api_meta_rsp.p_pkt);
}
@@ -702,6 +706,8 @@
*******************************************************************************/
void bta_av_rc_free_msg (tBTA_AV_CB *p_cb, tBTA_AV_DATA *p_data)
{
+ UNUSED(p_cb);
+ UNUSED(p_data);
}
@@ -1362,6 +1368,7 @@
{
BT_HDR hdr;
UINT16 xx;
+ UNUSED(p_data);
p_cb->disabling = TRUE;
@@ -1519,6 +1526,7 @@
UINT8 mask;
tBTA_AV_LCB *p_lcb = NULL;
tBTA_AV_PEND pend;
+ UNUSED(p_data);
APPL_TRACE_DEBUG0("bta_av_sig_timer");
for(xx=0; xx<BTA_AV_NUM_LINKS; xx++)
@@ -1689,6 +1697,7 @@
tBTA_AV_RC_FEAT rc_feat;
UINT8 rc_handle;
tBTA_AV_FEAT peer_features; /* peer features mask */
+ UNUSED(p_data);
APPL_TRACE_DEBUG1("bta_av_rc_disc_done disc:x%x", p_cb->disc);
if (!p_cb->disc)
diff --git a/bta/av/bta_av_cfg.c b/bta/av/bta_av_cfg.c
index c31f7a9..9eb8bd6 100755
--- a/bta/av/bta_av_cfg.c
+++ b/bta/av/bta_av_cfg.c
@@ -110,6 +110,10 @@
BTA_AV_RC_PASS_RSP_CODE,/* the default response code for pass through commands */
bta_av_meta_caps_co_ids,/* the metadata Get Capabilities response for company id */
bta_av_meta_caps_evt_ids,/* the the metadata Get Capabilities response for event id */
+ NULL, /* the action function table for VDP stream */
+ NULL, /* action function to register VDP */
+ {0}, /* Default AVRCP controller name */
+ {0}, /* Default AVRCP target name */
};
tBTA_AV_CFG *p_bta_av_cfg = (tBTA_AV_CFG *) &bta_av_cfg;
diff --git a/bta/av/bta_av_main.c b/bta/av/bta_av_main.c
index 749756d..25c40a5 100644
--- a/bta/av/bta_av_main.c
+++ b/bta/av/bta_av_main.c
@@ -392,6 +392,7 @@
tBTA_AV_STR_MSG *p_msg;
UINT16 evt = 0;
tBTA_AV_SCB *p_scb = NULL;
+ UNUSED(handle);
#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
if (event == BTA_AR_AVDT_CONN_EVT ||
@@ -450,6 +451,9 @@
static void bta_av_a2dp_report_cback(UINT8 handle, AVDT_REPORT_TYPE type,
tAVDT_REPORT_DATA *p_data)
{
+ UNUSED(handle);
+ UNUSED(type);
+ UNUSED(p_data);
/* Do not need to handle report data for now.
* This empty function is here for conformance reasons. */
}
@@ -715,9 +719,9 @@
**
*******************************************************************************/
#if (AVDT_REPORTING == TRUE)
-
static void bta_av_rpc_conn(tBTA_AV_DATA *p_data)
{
+ UNUSED(p_data);
}
#endif
@@ -832,6 +836,7 @@
tBTA_AV_ROLE_RES *p_buf;
UINT8 cur_role;
UINT8 peer_idx = 0;
+ UNUSED(status);
APPL_TRACE_DEBUG1("bta_av_sys_rs_cback: %d", bta_av_cb.rs_idx);
for(i=0; i<BTA_AV_NUM_STRS; i++)
@@ -907,6 +912,8 @@
tBTA_AV_SCB *p_scb;
int i;
tBTA_AV_API_STOP stop;
+ UNUSED(app_id);
+ UNUSED(peer_addr);
APPL_TRACE_DEBUG2("bta_av_sco_chg_cback:%d status:%d", id, status);
if(id)
@@ -1049,6 +1056,7 @@
tBTA_AV_SCB *p_scbi;
int i;
UINT8 mask;
+ UNUSED(mtu);
/* TODO_MV mess with the mtu according to the number of EDR/non-EDR headsets */
if(p_scb->chnl == BTA_AV_CHNL_AUDIO)
diff --git a/bta/av/bta_av_sbc.c b/bta/av/bta_av_sbc.c
index 1517270..a570375 100644
--- a/bta/av/bta_av_sbc.c
+++ b/bta/av/bta_av_sbc.c
@@ -26,6 +26,7 @@
#include "a2d_api.h"
#include "a2d_sbc.h"
#include "bta_av_sbc.h"
+#include "utl.h"
typedef int (tBTA_AV_SBC_ACT)(void *p_src, void *p_dst,
UINT32 src_samples, UINT32 dst_samples,
@@ -425,6 +426,7 @@
{
UINT8 status = A2D_SUCCESS;
tA2D_SBC_CIE peer_cie;
+ UNUSED(p_cap);
/* parse peer capabilities */
if ((status = A2D_ParsSbcInfo(&peer_cie, p_peer, TRUE)) != 0)
diff --git a/bta/dm/bta_dm_act.c b/bta/dm/bta_dm_act.c
index 1137349..6a72e97 100755
--- a/bta/dm/bta_dm_act.c
+++ b/bta/dm/bta_dm_act.c
@@ -23,6 +23,7 @@
*
******************************************************************************/
+#include "bt_target.h"
#include "bt_types.h"
#include "gki.h"
#include "bd.h"
@@ -40,6 +41,10 @@
#include "gap_api.h" /* For GAP_BleReadPeerPrefConnParams */
#include <string.h>
+#if (GAP_INCLUDED == TRUE)
+#include "gap_api.h"
+#endif
+
static void bta_dm_inq_results_cb (tBTM_INQ_RESULTS *p_inq, UINT8 *p_eir);
static void bta_dm_inq_cmpl_cb (void * p_result);
static void bta_dm_service_search_remname_cback (BD_ADDR bd_addr, DEV_CLASS dc, BD_NAME bd_name);
@@ -247,6 +252,7 @@
#if ( BTM_EIR_SERVER_INCLUDED == TRUE )&&(BTA_EIR_CANNED_UUID_LIST != TRUE)
static void bta_dm_app_ready_timer_cback (TIMER_LIST_ENT *p_tle)
{
+ UNUSED(p_tle);
bta_dm_set_eir (NULL);
}
#else
@@ -381,8 +387,10 @@
{
BTM_BleLoadLocalKeys(BTA_BLE_LOCAL_KEY_TYPE_ID, (tBTM_BLE_LOCAL_KEYS *)&id_key);
}
+#if ((defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE))
bta_dm_search_cb.conn_id = BTA_GATT_INVALID_CONN_ID;
#endif
+#endif
BTM_SecRegister((tBTM_APPL_INFO*)&bta_security);
BTM_SetDefaultLinkSuperTout(bta_dm_cfg.link_timeout);
@@ -454,6 +462,8 @@
*******************************************************************************/
void bta_dm_disable (tBTA_DM_MSG *p_data)
{
+ UNUSED(p_data);
+
/* Set l2cap idle timeout to 0 (so BTE immediately disconnects ACL link after last channel is closed) */
L2CA_SetIdleTimeoutByBdAddr((UINT8 *)BT_BD_ANY, 0);
@@ -505,7 +515,7 @@
*******************************************************************************/
static void bta_dm_disable_timer_cback (TIMER_LIST_ENT *p_tle)
{
-
+ UNUSED(p_tle);
UINT8 i;
APPL_TRACE_EVENT0(" bta_dm_disable_timer_cback ");
@@ -674,6 +684,11 @@
int i;
tBTA_DM_SEC sec_event;
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+ /* need to remove all pending background connection before unpair */
+ BTA_GATTC_CancelOpen(0, p_dev->bd_addr, FALSE);
+#endif
+
if (BTM_IsAclConnectionUp(p_dev->bd_addr))
{
/* Take the link down first, and mark the device for removal when disconnected */
@@ -693,6 +708,11 @@
else /* Ok to remove the device in application layer */
{
BTM_SecDeleteDevice(p_dev->bd_addr);
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+ /* remove all cached GATT information */
+ BTA_GATTC_Refresh(p_dev->bd_addr);
+#endif
+
if( bta_dm_cb.p_sec_cback )
{
bdcpy(sec_event.link_down.bd_addr, p_dev->bd_addr);
@@ -830,14 +850,14 @@
if (bta_dm_cb.p_sec_cback && (status != BTM_CMD_STARTED))
{
- p_name = BTM_SecReadDevName(p_data->bond.bd_addr);
- if (!p_name)
- p_name = "";
-
memset(&sec_event, 0, sizeof(tBTA_DM_SEC));
bdcpy(sec_event.auth_cmpl.bd_addr, p_data->bond.bd_addr);
- memcpy(sec_event.auth_cmpl.bd_name, p_name, (BD_NAME_LEN-1));
- sec_event.auth_cmpl.bd_name[BD_NAME_LEN-1] = 0;
+ p_name = BTM_SecReadDevName(p_data->bond.bd_addr);
+ if (p_name != NULL)
+ {
+ memcpy(sec_event.auth_cmpl.bd_name, p_name, (BD_NAME_LEN-1));
+ sec_event.auth_cmpl.bd_name[BD_NAME_LEN-1] = 0;
+ }
/* taken care of by memset [above]
sec_event.auth_cmpl.key_present = FALSE;
@@ -1124,6 +1144,7 @@
#if (BTM_OOB_INCLUDED == TRUE)
void bta_dm_loc_oob(tBTA_DM_MSG *p_data)
{
+ UNUSED(p_data);
BTM_ReadLocalOobData();
}
@@ -1241,7 +1262,7 @@
*******************************************************************************/
void bta_dm_search_cancel (tBTA_DM_MSG *p_data)
{
-
+ UNUSED(p_data);
tBTA_DM_MSG * p_msg;
if(BTM_IsInquiryActive())
@@ -1998,6 +2019,7 @@
*******************************************************************************/
static void bta_dm_search_timer_cback (TIMER_LIST_ENT *p_tle)
{
+ UNUSED(p_tle);
APPL_TRACE_EVENT0(" bta_dm_search_timer_cback ");
bta_dm_search_cb.wait_disc = FALSE;
@@ -2019,6 +2041,7 @@
*******************************************************************************/
void bta_dm_free_sdp_db (tBTA_DM_MSG *p_data)
{
+ UNUSED(p_data);
if(bta_dm_search_cb.p_sdp_db)
{
GKI_freebuf(bta_dm_search_cb.p_sdp_db);
@@ -2080,7 +2103,7 @@
*******************************************************************************/
void bta_dm_search_clear_queue (tBTA_DM_MSG *p_data)
{
-
+ UNUSED(p_data);
if(bta_dm_search_cb.p_search_queue)
{
GKI_freebuf(bta_dm_search_cb.p_search_queue);
@@ -2101,7 +2124,7 @@
*******************************************************************************/
void bta_dm_search_cancel_cmpl (tBTA_DM_MSG *p_data)
{
-
+ UNUSED(p_data);
if(bta_dm_search_cb.p_search_queue)
{
bta_sys_sendmsg(bta_dm_search_cb.p_search_queue);
@@ -2122,7 +2145,7 @@
*******************************************************************************/
void bta_dm_search_cancel_transac_cmpl(tBTA_DM_MSG *p_data)
{
-
+ UNUSED(p_data);
if(bta_dm_search_cb.p_sdp_db)
{
GKI_freebuf(bta_dm_search_cb.p_sdp_db);
@@ -2144,6 +2167,7 @@
*******************************************************************************/
void bta_dm_search_cancel_notify (tBTA_DM_MSG *p_data)
{
+ UNUSED(p_data);
if (bta_dm_search_cb.p_search_cback)
{
bta_dm_search_cb.p_search_cback(BTA_DM_SEARCH_CANCEL_CMPL_EVT, NULL);
@@ -2604,6 +2628,7 @@
{
tBTM_REMOTE_DEV_NAME rem_name;
tBTM_STATUS btm_status;
+ UNUSED(dc);
APPL_TRACE_DEBUG1("bta_dm_service_search_remname_cback name=<%s>", bd_name);
@@ -2699,6 +2724,8 @@
{
tBTA_DM_SEC sec_event;
UINT8 index = 1;
+ UNUSED(service_name);
+ UNUSED(is_originator);
bdcpy(sec_event.authorize.bd_addr, bd_addr);
memcpy(sec_event.authorize.dev_class, dev_class, DEV_CLASS_LEN);
@@ -2863,6 +2890,8 @@
API. If BTM doesn't have the link key in it's
data base, that's because application doesn't
it */
+ UNUSED(bd_addr);
+ UNUSED(key);
return BTM_NOT_AUTHORIZED;
}
@@ -2886,6 +2915,7 @@
tBTA_DM_SEC sec_event;
tBTA_DM_AUTH_CMPL *p_auth_cmpl;
UINT8 event;
+ UNUSED(dev_class);
memset (&sec_event, 0, sizeof(tBTA_DM_SEC));
@@ -2932,8 +2962,8 @@
*******************************************************************************/
static UINT8 bta_dm_authentication_complete_cback(BD_ADDR bd_addr, DEV_CLASS dev_class,BD_NAME bd_name, int result)
{
-
tBTA_DM_SEC sec_event;
+ UNUSED(dev_class);
if(result != BTM_SUCCESS)
{
@@ -3098,6 +3128,7 @@
static void bta_dm_local_name_cback(UINT8 *p_name)
{
tBTA_DM_SEC sec_event;
+ UNUSED(p_name);
BTM_GetLocalDeviceAddr(sec_event.enable.bd_addr);
sec_event.enable.status = BTA_SUCCESS;
@@ -3143,7 +3174,7 @@
*******************************************************************************/
static void bta_dm_signal_strength_timer_cback (TIMER_LIST_ENT *p_tle)
{
-
+ UNUSED(p_tle);
UINT8 i;
if(bta_dm_cb.signal_strength_mask & BTA_SIG_STRENGTH_RSSI_MASK)
@@ -3269,6 +3300,7 @@
*******************************************************************************/
static void bta_dm_rs_cback (tBTM_ROLE_SWITCH_CMPL *p1)
{
+ UNUSED(p1);
APPL_TRACE_WARNING1("bta_dm_rs_cback:%d", bta_dm_cb.rs_event);
if(bta_dm_cb.rs_event == BTA_DM_API_SEARCH_EVT)
{
@@ -3460,6 +3492,10 @@
if( bta_dm_cb.device_list.peer_device[i].conn_state == BTA_DM_UNPAIRING )
{
BTM_SecDeleteDevice(bta_dm_cb.device_list.peer_device[i].peer_bdaddr);
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+ /* remove all cached GATT information */
+ BTA_GATTC_Refresh(p_bda);
+#endif
issue_unpair_cb = TRUE;
}
@@ -3533,6 +3569,7 @@
*******************************************************************************/
static void bta_dm_disable_conn_down_timer_cback (TIMER_LIST_ENT *p_tle)
{
+ UNUSED(p_tle);
tBTA_SYS_HW_MSG *sys_enable_event;
/* disable the power managment module */
@@ -3730,6 +3767,7 @@
*******************************************************************************/
static void bta_dm_delay_role_switch_cback(TIMER_LIST_ENT *p_tle)
{
+ UNUSED(p_tle);
APPL_TRACE_EVENT0("bta_dm_delay_role_switch_cback: initiating Delayed RS");
bta_dm_adjust_roles (FALSE);
}
@@ -3769,6 +3807,12 @@
else
{
BTM_SecDeleteDevice (remote_bd_addr);
+#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
+ /* need to remove all pending background connection */
+ BTA_GATTC_CancelOpen(0, remote_bd_addr, FALSE);
+ /* remove all cached GATT information */
+ BTA_GATTC_Refresh(remote_bd_addr);
+#endif
}
}
@@ -4416,6 +4460,7 @@
*******************************************************************************/
void bta_dm_enable_test_mode(tBTA_DM_MSG *p_data)
{
+ UNUSED(p_data);
BTM_EnableTestMode();
}
@@ -4431,6 +4476,7 @@
*******************************************************************************/
void bta_dm_disable_test_mode(tBTA_DM_MSG *p_data)
{
+ UNUSED(p_data);
BTM_DeviceReset(NULL);
}
@@ -4467,6 +4513,7 @@
{
tBTA_STATUS bta_status = BTA_SUCCESS;
tBTA_DM_ENCRYPT_CBACK *p_callback = bta_dm_cb.p_encrypt_cback;
+ UNUSED(p_ref_data);
bta_dm_cb.p_encrypt_cback = NULL;
switch (result)
@@ -4998,6 +5045,7 @@
p_data->ble_set_adv_params.p_dir_bda,
BTA_DM_BLE_ADV_CHNL_MAP);
}
+
/*******************************************************************************
**
** Function bta_dm_ble_set_adv_config
@@ -5013,6 +5061,34 @@
(tBTM_BLE_ADV_DATA *)p_data->ble_set_adv_data.p_adv_cfg);
}
+/*******************************************************************************
+**
+** Function bta_dm_ble_set_scan_rsp
+**
+** Description This function set the customized ADV scan resp. configuration
+**
+** Parameters:
+**
+*******************************************************************************/
+void bta_dm_ble_set_scan_rsp (tBTA_DM_MSG *p_data)
+{
+ BTM_BleWriteScanRsp(p_data->ble_set_adv_data.data_mask,
+ (tBTM_BLE_ADV_DATA *)p_data->ble_set_adv_data.p_adv_cfg);
+}
+
+/*******************************************************************************
+**
+** Function bta_dm_ble_broadcast
+**
+** Description Starts or stops LE broadcasts
+**
+** Parameters:
+**
+*******************************************************************************/
+void bta_dm_ble_broadcast (tBTA_DM_MSG *p_data)
+{
+ BTM_BleBroadcast(p_data->ble_observe.start);
+}
#if ((defined BTA_GATT_INCLUDED) && (BTA_GATT_INCLUDED == TRUE))
#ifndef BTA_DM_GATT_CLOSE_DELAY_TOUT
@@ -5204,6 +5280,8 @@
*******************************************************************************/
void bta_dm_close_gatt_conn(tBTA_DM_MSG *p_data)
{
+ UNUSED(p_data);
+
if (bta_dm_search_cb.conn_id != BTA_GATT_INVALID_CONN_ID)
BTA_GATTC_Close(bta_dm_search_cb.conn_id);
diff --git a/bta/dm/bta_dm_api.c b/bta/dm/bta_dm_api.c
index 941213a..7db7f7b 100644
--- a/bta/dm/bta_dm_api.c
+++ b/bta/dm/bta_dm_api.c
@@ -31,6 +31,7 @@
#include "btm_api.h"
#include "btm_int.h"
#include <string.h>
+#include "utl.h"
/*****************************************************************************
** Constants
@@ -207,7 +208,7 @@
{
p_msg->hdr.event = BTA_DM_API_SET_NAME_EVT;
/* truncate the name if needed */
- BCM_STRNCPY_S(p_msg->name, sizeof(p_msg->name), p_name, BD_NAME_LEN-1);
+ BCM_STRNCPY_S((char *)p_msg->name, sizeof(p_msg->name), p_name, BD_NAME_LEN-1);
p_msg->name[BD_NAME_LEN-1]=0;
bta_sys_sendmsg(p_msg);
@@ -1236,6 +1237,8 @@
}
}
+#if BLE_INCLUDED == TRUE
+
/*******************************************************************************
**
** Function BTA_DmAddBleKey
@@ -1510,6 +1513,60 @@
bta_sys_sendmsg(p_msg);
}
}
+
+/*******************************************************************************
+**
+** Function BTA_DmBleSetScanRsp
+**
+** Description This function is called to override the BTA scan response.
+**
+** Parameters Pointer to User defined ADV data structure
+**
+** Returns None
+**
+*******************************************************************************/
+BTA_API extern void BTA_DmBleSetScanRsp (tBTA_BLE_AD_MASK data_mask, tBTA_BLE_ADV_DATA *p_adv_cfg)
+{
+ tBTA_DM_API_SET_ADV_CONFIG *p_msg;
+
+ if ((p_msg = (tBTA_DM_API_SET_ADV_CONFIG *) GKI_getbuf(sizeof(tBTA_DM_API_SET_ADV_CONFIG))) != NULL)
+ {
+ p_msg->hdr.event = BTA_DM_API_BLE_SET_SCAN_RSP_EVT;
+ p_msg->data_mask = data_mask;
+ p_msg->p_adv_cfg = p_adv_cfg;
+
+ bta_sys_sendmsg(p_msg);
+ }
+}
+
+/*******************************************************************************
+**
+** Function BTA_DmBleBroadcast
+**
+** Description This function starts or stops LE broadcasting.
+**
+** Parameters start: start or stop broadcast.
+**
+** Returns None
+**
+*******************************************************************************/
+BTA_API extern void BTA_DmBleBroadcast (BOOLEAN start)
+{
+ tBTA_DM_API_BLE_OBSERVE *p_msg;
+
+ APPL_TRACE_API1("BTA_DmBleBroadcast: start = %d ", start);
+
+ if ((p_msg = (tBTA_DM_API_BLE_OBSERVE *) GKI_getbuf(sizeof(tBTA_DM_API_BLE_OBSERVE))) != NULL)
+ {
+ memset(p_msg, 0, sizeof(tBTA_DM_API_BLE_OBSERVE));
+
+ p_msg->hdr.event = BTA_DM_API_BLE_BROADCAST_EVT;
+ p_msg->start = start;
+
+ bta_sys_sendmsg(p_msg);
+ }
+}
+
#endif
/*******************************************************************************
**
@@ -1588,6 +1645,11 @@
bta_sys_sendmsg(p_msg);
}
+#else
+ UNUSED(bd_addr);
+ UNUSED(p_services);
+ UNUSED(p_cback);
+ UNUSED(sdp_search);
#endif
}
@@ -1644,6 +1706,10 @@
bta_sys_sendmsg(p_msg);
}
+#else
+ UNUSED(p_dm_inq);
+ UNUSED(p_services);
+ UNUSED(p_cback);
#endif
}
@@ -1661,8 +1727,8 @@
*******************************************************************************/
void BTA_DmBleEnableRemotePrivacy(BD_ADDR bd_addr, BOOLEAN privacy_enable)
{
-#if BLE_INCLUDED == TRUE
-#endif
+ UNUSED(bd_addr);
+ UNUSED(privacy_enable);
}
@@ -1679,10 +1745,9 @@
*******************************************************************************/
void BTA_DmBleConfigLocalPrivacy(BOOLEAN privacy_enable)
{
-#if BLE_INCLUDED == TRUE
-#endif
+ UNUSED(privacy_enable);
}
-
+#endif
/*******************************************************************************
**
@@ -1757,6 +1822,7 @@
}
}
+#if BLE_INCLUDED == TRUE
/*******************************************************************************
**
** Function BTA_DmBleObserve
@@ -1794,5 +1860,4 @@
}
#endif
}
-
-
+#endif
diff --git a/bta/dm/bta_dm_cfg.c b/bta/dm/bta_dm_cfg.c
index 5caf04a..e4a1681 100644
--- a/bta/dm/bta_dm_cfg.c
+++ b/bta/dm/bta_dm_cfg.c
@@ -488,6 +488,8 @@
NULL, /* flags for EIR */
0, /* length of manufacturer specific in bytes */
NULL, /* manufacturer specific */
+ 0, /* length of additional data in bytes */
+ NULL /* additional data */
};
tBTA_DM_EIR_CONF *p_bta_dm_eir_cfg = (tBTA_DM_EIR_CONF*)&bta_dm_eir_cfg;
#endif
diff --git a/bta/dm/bta_dm_int.h b/bta/dm/bta_dm_int.h
index d87dbf3..dd3e16c 100644
--- a/bta/dm/bta_dm_int.h
+++ b/bta/dm/bta_dm_int.h
@@ -101,6 +101,8 @@
BTA_DM_API_BLE_OBSERVE_EVT,
BTA_DM_API_BLE_ADV_PARAM_EVT,
BTA_DM_API_BLE_SET_ADV_CONFIG_EVT,
+ BTA_DM_API_BLE_SET_SCAN_RSP_EVT,
+ BTA_DM_API_BLE_BROADCAST_EVT,
#endif
#if ( BTM_EIR_SERVER_INCLUDED == TRUE )&&( BTA_EIR_CANNED_UUID_LIST != TRUE )&&(BTA_EIR_SERVER_NUM_CUSTOM_UUID > 0)
@@ -996,6 +998,8 @@
extern void bta_dm_ble_observe (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_set_adv_params (tBTA_DM_MSG *p_data);
extern void bta_dm_ble_set_adv_config (tBTA_DM_MSG *p_data);
+extern void bta_dm_ble_set_scan_rsp (tBTA_DM_MSG *p_data);
+extern void bta_dm_ble_broadcast (tBTA_DM_MSG *p_data);
#endif
extern void bta_dm_set_encryption(tBTA_DM_MSG *p_data);
diff --git a/bta/dm/bta_dm_main.c b/bta/dm/bta_dm_main.c
index 50f871f..0f6b91a 100644
--- a/bta/dm/bta_dm_main.c
+++ b/bta/dm/bta_dm_main.c
@@ -98,6 +98,8 @@
bta_dm_ble_observe,
bta_dm_ble_set_adv_params, /* BTA_DM_API_BLE_SCAN_PARAM_EVT */
bta_dm_ble_set_adv_config, /* BTA_DM_API_BLE_SET_ADV_CONFIG_EVT */
+ bta_dm_ble_set_scan_rsp, /* BTA_DM_API_BLE_SET_SCAN_RSP_EVT */
+ bta_dm_ble_broadcast, /* BTA_DM_API_BLE_BROADCAST_EVT */
#endif
#if ( BTM_EIR_SERVER_INCLUDED == TRUE )&&( BTA_EIR_CANNED_UUID_LIST != TRUE )&&(BTA_EIR_SERVER_NUM_CUSTOM_UUID > 0)
diff --git a/bta/gatt/bta_gattc_act.c b/bta/gatt/bta_gattc_act.c
index f5b60fa..bc23d5d 100644
--- a/bta/gatt/bta_gattc_act.c
+++ b/bta/gatt/bta_gattc_act.c
@@ -52,13 +52,16 @@
static void bta_gattc_deregister_cmpl(tBTA_GATTC_RCB *p_clreg);
+static void bta_gattc_enc_cmpl_cback(tGATT_IF gattc_if, BD_ADDR bda);
+
static tGATT_CBACK bta_gattc_cl_cback =
{
bta_gattc_conn_cback,
bta_gattc_cmpl_cback,
bta_gattc_disc_res_cback,
bta_gattc_disc_cmpl_cback,
- NULL
+ NULL,
+ bta_gattc_enc_cmpl_cback
};
/* opcode(tGATTC_OPTYPE) order has to be comply with internal event order */
@@ -247,6 +250,8 @@
*******************************************************************************/
void bta_gattc_start_if(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_msg)
{
+ UNUSED(p_cb);
+
if (bta_gattc_cl_get_regcb(p_msg->int_start_if.client_if) !=NULL )
{
GATT_StartIf(p_msg->int_start_if.client_if);
@@ -326,6 +331,7 @@
UINT16 event = ((BT_HDR *)p_msg)->event;
tBTA_GATTC_CLCB *p_clcb = NULL;
tBTA_GATTC_RCB *p_clreg = bta_gattc_cl_get_regcb(p_msg->api_conn.client_if);
+ UNUSED(p_cb);
if (p_clreg != NULL)
{
@@ -372,6 +378,7 @@
tBTA_GATTC_CLCB *p_clcb = NULL;
tBTA_GATTC_RCB *p_clreg;
tBTA_GATTC cb_data;
+ UNUSED(p_cb);
if (p_msg->api_cancel_conn.is_direct)
{
@@ -399,6 +406,35 @@
}
}
+
+/*******************************************************************************
+**
+** Function bta_gattc_process_enc_cmpl
+**
+** Description process encryption complete message.
+**
+** Returns void
+**
+*******************************************************************************/
+void bta_gattc_process_enc_cmpl(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_msg)
+{
+ tBTA_GATTC_RCB *p_clreg;
+ tBTA_GATTC cb_data;
+ UNUSED(p_cb);
+
+ p_clreg = bta_gattc_cl_get_regcb(p_msg->enc_cmpl.client_if);
+
+ if (p_clreg && p_clreg->p_cback)
+ {
+ memset(&cb_data, 0, sizeof(tBTA_GATTC));
+
+ cb_data.enc_cmpl.client_if = p_msg->enc_cmpl.client_if;
+ bdcpy(cb_data.enc_cmpl.remote_bda, p_msg->enc_cmpl.remote_bda);
+
+ (*p_clreg->p_cback)(BTA_GATTC_ENC_CMPL_CB_EVT, &cb_data);
+ }
+}
+
/*******************************************************************************
**
** Function bta_gattc_cancel_open_error
@@ -411,6 +447,8 @@
void bta_gattc_cancel_open_error(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
{
tBTA_GATTC cb_data;
+ UNUSED(p_data);
+
cb_data.status=BTA_GATT_ERROR;
if ( p_clcb && p_clcb->p_rcb && p_clcb->p_rcb->p_cback )
@@ -428,6 +466,8 @@
*******************************************************************************/
void bta_gattc_open_error(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
{
+ UNUSED(p_data);
+
APPL_TRACE_ERROR0("Connection already opened. wrong state");
bta_gattc_send_open_cback(p_clcb->p_rcb,
@@ -446,6 +486,8 @@
*******************************************************************************/
void bta_gattc_open_fail(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
{
+ UNUSED(p_data);
+
bta_gattc_send_open_cback(p_clcb->p_rcb,
BTA_GATT_ERROR,
p_clcb->bda,
@@ -587,6 +629,7 @@
void bta_gattc_cancel_open_ok(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
{
tBTA_GATTC cb_data;
+ UNUSED(p_data);
if ( p_clcb->p_rcb->p_cback )
{
@@ -823,6 +866,8 @@
*******************************************************************************/
void bta_gattc_restart_discover(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
{
+ UNUSED(p_data);
+
p_clcb->status = BTA_GATT_CANCEL;
p_clcb->auto_update = BTA_GATTC_DISC_WAITING;
}
@@ -837,6 +882,7 @@
*******************************************************************************/
void bta_gattc_start_discover(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
{
+ UNUSED(p_data);
APPL_TRACE_DEBUG2("bta_gattc_start_discover conn_id=%d p_clcb->p_srcb->state = %d ",
p_clcb->bta_conn_id, p_clcb->p_srcb->state);
@@ -895,6 +941,8 @@
void bta_gattc_disc_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
{
tBTA_GATTC_DATA *p_q_cmd = p_clcb->p_q_cmd;
+ UNUSED(p_data);
+
APPL_TRACE_DEBUG1("bta_gattc_disc_cmpl conn_id=%d",p_clcb->bta_conn_id);
#if BLE_INCLUDED == TRUE
@@ -1373,6 +1421,8 @@
*******************************************************************************/
void bta_gattc_ignore_op_cmpl(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
{
+ UNUSED(p_clcb);
+
/* receive op complete when discovery is started, ignore the response,
and wait for discovery finish and resent */
APPL_TRACE_DEBUG1("bta_gattc_ignore_op_cmpl op = %d", p_data->hdr.layer_specific);
@@ -1429,6 +1479,8 @@
*******************************************************************************/
void bta_gattc_cache_open(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
{
+ UNUSED(p_data);
+
bta_gattc_set_discover_st(p_clcb->p_srcb);
APPL_TRACE_DEBUG1("bta_gattc_cache_open conn_id=%d",p_clcb->bta_conn_id);
@@ -1540,6 +1592,8 @@
*******************************************************************************/
void bta_gattc_ci_save(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
{
+ UNUSED(p_data);
+
APPL_TRACE_DEBUG1("bta_gattc_ci_save conn_id=%d " ,
p_clcb->bta_conn_id );
@@ -1561,6 +1615,8 @@
*******************************************************************************/
void bta_gattc_fail(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data)
{
+ UNUSED(p_data);
+
if (p_clcb->status == BTA_GATT_OK)
{
APPL_TRACE_ERROR1("operation not supported at current state [%d]", p_clcb->state);
@@ -1635,6 +1691,50 @@
/*******************************************************************************
**
+** Function bta_gattc_enc_cmpl_cback
+**
+** Description encryption complete callback function to GATT client stack.
+**
+** Returns void
+**
+*******************************************************************************/
+static void bta_gattc_enc_cmpl_cback(tGATT_IF gattc_if, BD_ADDR bda)
+{
+ tBTA_GATTC_DATA *p_buf;
+ tBTA_GATTC_CLCB *p_clcb = NULL;
+
+ if ((p_clcb = bta_gattc_find_clcb_by_cif(gattc_if, bda)) == NULL)
+ {
+ return;
+ }
+
+#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
+ /* filter this event just for BTA HH LE GATT client,
+ In the future, if we want to enable encryption complete event
+ for all GATT clients, we can remove this code */
+ if (!bta_hh_le_is_hh_gatt_if(gattc_if))
+ {
+ return;
+ }
+#endif
+
+ APPL_TRACE_DEBUG1("bta_gattc_enc_cmpl_cback: cif = %d", gattc_if);
+
+ if ((p_buf = (tBTA_GATTC_DATA *) GKI_getbuf(sizeof(tBTA_GATTC_DATA))) != NULL)
+ {
+ memset(p_buf, 0, sizeof(tBTA_GATTC_DATA));
+
+ p_buf->enc_cmpl.hdr.event = BTA_GATTC_ENC_CMPL_EVT;
+ p_buf->enc_cmpl.hdr.layer_specific = p_clcb->bta_conn_id;
+ p_buf->enc_cmpl.client_if = gattc_if;
+ bdcpy(p_buf->enc_cmpl.remote_bda, bda);
+
+ bta_sys_sendmsg(p_buf);
+ }
+}
+
+/*******************************************************************************
+**
** Function bta_gattc_process_api_refresh
**
** Description process refresh API to delete cache and start a new discovery
@@ -1649,6 +1749,7 @@
tBTA_GATTC_CLCB *p_clcb = &bta_gattc_cb.clcb[0];
BOOLEAN found = FALSE;
UINT8 i;
+ UNUSED(p_cb);
if (p_srvc_cb != NULL)
{
@@ -1999,6 +2100,8 @@
{
tBTA_GATTC_RCB *p_clreg = bta_gattc_cl_get_regcb(p_msg->api_listen.client_if);
tBTA_GATTC cb_data;
+ UNUSED(p_cb);
+
cb_data.reg_oper.status = BTA_GATT_ERROR;
cb_data.reg_oper.client_if = p_msg->api_listen.client_if;
diff --git a/bta/gatt/bta_gattc_cache.c b/bta/gatt/bta_gattc_cache.c
index bc784d7..3d603c3 100644
--- a/bta/gatt/bta_gattc_cache.c
+++ b/bta/gatt/bta_gattc_cache.c
@@ -35,6 +35,7 @@
#include "sdpdefs.h"
#include "bta_gattc_int.h"
#include "btm_api.h"
+#include "btm_ble_api.h"
static void bta_gattc_char_dscpt_disc_cmpl(UINT16 conn_id, tBTA_GATTC_SERV *p_srvc_cb);
static tBTA_GATT_STATUS bta_gattc_sdp_service_disc(UINT16 conn_id, tBTA_GATTC_SERV *p_server_cb);
@@ -689,6 +690,7 @@
tBTA_GATTC_ATTR_REC *p_rec = NULL;
UINT8 i;
BOOLEAN exist_srvc = FALSE;
+ UNUSED(uuid);
if (!GATT_HANDLE_IS_VALID(s_handle) || !GATT_HANDLE_IS_VALID(e_handle))
{
diff --git a/bta/gatt/bta_gattc_ci.c b/bta/gatt/bta_gattc_ci.c
index 212126f..533955a 100644
--- a/bta/gatt/bta_gattc_ci.c
+++ b/bta/gatt/bta_gattc_ci.c
@@ -33,6 +33,7 @@
#include "bta_gattc_ci.h"
#include "gki.h"
#include "bd.h"
+#include "utl.h"
/*******************************************************************************
**
@@ -52,6 +53,7 @@
UINT16 conn_id)
{
tBTA_GATTC_CI_EVT *p_evt;
+ UNUSED(server_bda);
if ((p_evt = (tBTA_GATTC_CI_EVT *) GKI_getbuf(sizeof(tBTA_GATTC_CI_EVT))) != NULL)
{
@@ -84,6 +86,7 @@
UINT16 conn_id)
{
tBTA_GATTC_CI_LOAD *p_evt;
+ UNUSED(server_bda);
if ((p_evt = (tBTA_GATTC_CI_LOAD *) GKI_getbuf(sizeof(tBTA_GATTC_CI_LOAD))) != NULL)
{
@@ -124,6 +127,7 @@
UINT16 conn_id)
{
tBTA_GATTC_CI_EVT *p_evt;
+ UNUSED(server_bda);
if ((p_evt = (tBTA_GATTC_CI_EVT *) GKI_getbuf(sizeof(tBTA_GATTC_CI_EVT))) != NULL)
{
diff --git a/bta/gatt/bta_gattc_int.h b/bta/gatt/bta_gattc_int.h
index c2056d4..1ff8f79 100644
--- a/bta/gatt/bta_gattc_int.h
+++ b/bta/gatt/bta_gattc_int.h
@@ -69,7 +69,8 @@
BTA_GATTC_API_REG_EVT,
BTA_GATTC_API_DEREG_EVT,
BTA_GATTC_API_LISTEN_EVT,
- BTA_GATTC_API_DISABLE_EVT
+ BTA_GATTC_API_DISABLE_EVT,
+ BTA_GATTC_ENC_CMPL_EVT
};
typedef UINT16 tBTA_GATTC_INT_EVT;
@@ -195,6 +196,13 @@
tGATT_DISCONN_REASON reason;
}tBTA_GATTC_INT_CONN;
+typedef struct
+{
+ BT_HDR hdr;
+ BD_ADDR remote_bda;
+ tBTA_GATTC_IF client_if;
+}tBTA_GATTC_ENC_CMPL;
+
typedef union
{
BT_HDR hdr;
@@ -213,6 +221,7 @@
tBTA_GATTC_CI_EVT ci_save;
tBTA_GATTC_CI_LOAD ci_load;
tBTA_GATTC_INT_CONN int_conn;
+ tBTA_GATTC_ENC_CMPL enc_cmpl;
tBTA_GATTC_INT_START_IF int_start_if;
tBTA_GATTC_INT_DEREG int_dereg;
@@ -433,6 +442,7 @@
extern void bta_gattc_process_api_open (tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA * p_msg);
extern void bta_gattc_process_api_open_cancel (tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA * p_msg);
extern void bta_gattc_deregister(tBTA_GATTC_CB *p_cb, tBTA_GATTC_RCB *p_clreg);
+extern void bta_gattc_process_enc_cmpl(tBTA_GATTC_CB *p_cb, tBTA_GATTC_DATA *p_msg);
/* function within state machine */
extern void bta_gattc_open(tBTA_GATTC_CLCB *p_clcb, tBTA_GATTC_DATA *p_data);
diff --git a/bta/gatt/bta_gattc_main.c b/bta/gatt/bta_gattc_main.c
index 9427f89..650cf5e 100644
--- a/bta/gatt/bta_gattc_main.c
+++ b/bta/gatt/bta_gattc_main.c
@@ -386,6 +386,11 @@
bta_gattc_listen(p_cb, (tBTA_GATTC_DATA *) p_msg);
break;
#endif
+
+ case BTA_GATTC_ENC_CMPL_EVT:
+ bta_gattc_process_enc_cmpl(p_cb, (tBTA_GATTC_DATA *) p_msg);
+ break;
+
default:
if (p_msg->event == BTA_GATTC_INT_CONN_EVT)
p_clcb = bta_gattc_find_int_conn_clcb((tBTA_GATTC_DATA *) p_msg);
diff --git a/bta/gatt/bta_gatts_act.c b/bta/gatt/bta_gatts_act.c
index f59b593..be03655 100644
--- a/bta/gatt/bta_gatts_act.c
+++ b/bta/gatt/bta_gatts_act.c
@@ -49,7 +49,8 @@
NULL,
NULL,
NULL,
- bta_gatts_send_request_cback
+ bta_gatts_send_request_cback,
+ NULL
};
tGATT_APPL_INFO bta_gatts_nv_cback =
@@ -266,6 +267,8 @@
*******************************************************************************/
void bta_gatts_start_if(tBTA_GATTS_CB *p_cb, tBTA_GATTS_DATA *p_msg)
{
+ UNUSED(p_cb);
+
if (bta_gatts_find_app_rcb_by_app_if(p_msg->int_start_if.server_if))
{
GATT_StartIf(p_msg->int_start_if.server_if);
@@ -576,6 +579,7 @@
{
tBTA_GATTS_RCB *p_rcb = &bta_gatts_cb.rcb[p_srvc_cb->rcb_idx];
tBTA_GATTS cb_data;
+ UNUSED(p_msg);
GATTS_StopService(p_srvc_cb->service_id);
cb_data.srvc_oper.server_if = p_rcb->gatt_if;
@@ -598,6 +602,7 @@
*******************************************************************************/
void bta_gatts_send_rsp (tBTA_GATTS_CB *p_cb, tBTA_GATTS_DATA * p_msg)
{
+ UNUSED(p_cb);
if (GATTS_SendRsp (p_msg->api_rsp.hdr.layer_specific,
p_msg->api_rsp.trans_id,
@@ -687,7 +692,7 @@
{
tBTA_GATTS_RCB *p_rcb=NULL;
tBTA_GATT_STATUS status= BTA_GATT_ERROR;
-
+ UNUSED(p_cb);
if ((p_rcb = bta_gatts_find_app_rcb_by_app_if(p_msg->api_open.server_if)) != NULL)
{
@@ -718,6 +723,7 @@
{
tBTA_GATTS_RCB *p_rcb;
tBTA_GATT_STATUS status= BTA_GATT_ERROR;
+ UNUSED(p_cb);
if ((p_rcb = bta_gatts_find_app_rcb_by_app_if(p_msg->api_cancel_open.server_if)) != NULL)
{
@@ -753,6 +759,7 @@
tBTA_GATT_STATUS status= BTA_GATT_ERROR;
tGATT_IF gatt_if;
BD_ADDR remote_bda;
+ UNUSED(p_cb);
if (GATT_GetConnectionInfor(p_msg->hdr.layer_specific, &gatt_if, remote_bda))
{
@@ -794,6 +801,8 @@
{
tBTA_GATTS_RCB *p_rcb = bta_gatts_find_app_rcb_by_app_if(p_msg->api_listen.server_if);
tBTA_GATTS cb_data;
+ UNUSED(p_cb);
+
cb_data.reg_oper.status = BTA_GATT_OK;
cb_data.reg_oper.server_if = p_msg->api_listen.server_if;
diff --git a/bta/hh/bta_hh_act.c b/bta/hh/bta_hh_act.c
index 1c83d07..8ec2698 100644
--- a/bta/hh/bta_hh_act.c
+++ b/bta/hh/bta_hh_act.c
@@ -33,6 +33,7 @@
#include "l2c_api.h"
#include "bta_hh_int.h"
#include "bta_hh_co.h"
+#include "utl.h"
/*****************************************************************************
** Constants
@@ -222,6 +223,10 @@
p_cb->app_id = 0;
}
}
+ else
+ {
+ hdl = p_cb->hid_handle;
+ }
/* else : incoming connection after SDP should update the SDP information as well */
if (p_cb->app_id != 0)
@@ -940,6 +945,8 @@
*******************************************************************************/
void bta_hh_get_dscp_act(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data)
{
+ UNUSED(p_data);
+
#if (BTA_HH_LE_INCLUDED == TRUE)
if (p_cb->is_le_device)
{
diff --git a/bta/hh/bta_hh_api.c b/bta/hh/bta_hh_api.c
index 1e71d91..df41a52 100644
--- a/bta/hh/bta_hh_api.c
+++ b/bta/hh/bta_hh_api.c
@@ -33,6 +33,7 @@
#include "bta_hh_api.h"
#include "bta_hh_int.h"
#include "l2c_api.h"
+#include "utl.h"
/*****************************************************************************
** Constants
@@ -305,12 +306,13 @@
*******************************************************************************/
void BTA_HhSendData(UINT8 dev_handle, BD_ADDR dev_bda, BT_HDR *p_data)
{
+ UNUSED(dev_bda);
#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
- if (p_data->layer_specific != BTA_HH_RPTT_OUTPUT)
- {
- APPL_TRACE_ERROR0("ERROR! Wrong report type! Write Command only valid for output report!");
- return;
- }
+ if (p_data->layer_specific != BTA_HH_RPTT_OUTPUT)
+ {
+ APPL_TRACE_ERROR0("ERROR! Wrong report type! Write Command only valid for output report!");
+ return;
+ }
#endif
bta_hh_snd_write_dev(dev_handle, HID_TRANS_DATA, (UINT8)p_data->layer_specific, 0, 0, p_data);
}
diff --git a/bta/hh/bta_hh_int.h b/bta/hh/bta_hh_int.h
index 99a8b82..1ac40da 100644
--- a/bta/hh/bta_hh_int.h
+++ b/bta/hh/bta_hh_int.h
@@ -67,6 +67,7 @@
BTA_HH_GATT_READ_DESCR_CMPL_EVT,
BTA_HH_GATT_WRITE_DESCR_CMPL_EVT,
BTA_HH_API_SCPP_UPDATE_EVT,
+ BTA_HH_GATT_ENC_CMPL_EVT,
#endif
/* not handled by execute state machine */
@@ -182,6 +183,7 @@
tBTA_HH_LE_CLOSE le_close;
tBTA_GATTC_OPEN le_open;
tBTA_HH_SCPP_UPDATE le_scpp_update;
+ tBTA_GATTC_ENC_CMPL_CB le_enc_cmpl;
#endif
} tBTA_HH_DATA;
@@ -201,7 +203,7 @@
}tBTA_HH_LE_RPT;
#ifndef BTA_HH_LE_RPT_MAX
-#define BTA_HH_LE_RPT_MAX 10
+#define BTA_HH_LE_RPT_MAX 20
#endif
typedef struct
@@ -283,6 +285,7 @@
UINT8 scps_notify; /* scan refresh supported/notification enabled */
#endif
+ BOOLEAN security_pending;
} tBTA_HH_DEV_CB;
/* key board parsing control block */
@@ -404,7 +407,7 @@
extern void bta_hh_start_security(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_buf);
extern void bta_hh_security_cmpl(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_buf);
extern void bta_hh_le_update_scpp(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_buf);
-
+extern void bta_hh_le_notify_enc_cmpl(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_data);
#if BTA_HH_DEBUG
extern void bta_hh_trace_dev_db(void);
diff --git a/bta/hh/bta_hh_le.c b/bta/hh/bta_hh_le.c
index 52de4d6..4f297ee 100644
--- a/bta/hh/bta_hh_le.c
+++ b/bta/hh/bta_hh_le.c
@@ -28,6 +28,8 @@
#include "bta_hh_co.h"
#include "bta_gatt_api.h"
#include "srvc_api.h"
+#include "btm_int.h"
+#include "utl.h"
#ifndef BTA_HH_LE_RECONN
#define BTA_HH_LE_RECONN TRUE
@@ -37,7 +39,7 @@
#define BTA_HH_LE_RPT_TYPE_VALID(x) ((x) <= BTA_LE_HID_RPT_FEATURE && (x)>=BTA_LE_HID_RPT_INPUT)
-#define BTA_HH_LE_RPT_INST_ID_MAP(s,c) (UINT8)(((s)<<4)||(c))
+#define BTA_HH_LE_RPT_INST_ID_MAP(s,c) (UINT8)(((s)<<4)|(c))
#define BTA_HH_LE_RPT_GET_SRVC_INST_ID(x) (UINT8)(x >> 4)
#define BTA_HH_LE_RPT_GET_RPT_INST_ID(x) (UINT8)(x & 0x0f)
@@ -638,6 +640,8 @@
while (p_rpt != NULL)
{
+ if (!p_rpt->in_use) break;
+
if (p_rpt->rpt_type == BTA_HH_RPTT_INPUT)
{
/* is battery report */
@@ -718,9 +722,10 @@
#endif
}
- if (p_rpt->index < BTA_HH_LE_RPT_MAX)
+ if (p_rpt->index < BTA_HH_LE_RPT_MAX - 1)
p_rpt ++;
-
+ else
+ p_rpt = NULL;
/* read next report reference descriptor */
bta_hh_le_read_rpt_ref_descr(p_dev_cb, p_rpt);
@@ -1084,7 +1089,7 @@
p_char_id->char_id.inst_id,
prop) == NULL)
{
- APPL_TRACE_ERROR0("Add report entry failed !!!")
+ APPL_TRACE_ERROR0("Add report entry failed !!!");
break;
}
@@ -1125,7 +1130,7 @@
prop) == NULL)
{
- APPL_TRACE_ERROR0("Add report entry failed !!!")
+ APPL_TRACE_ERROR0("Add report entry failed !!!");
}
return;
@@ -1209,6 +1214,7 @@
{
UINT8 idx = bta_hh_find_cb(bd_addr);
tBTA_HH_DEV_CB *p_dev_cb;
+ UNUSED(p_ref_data);
APPL_TRACE_ERROR0("bta_hh_le_encrypt_cback");
@@ -1235,6 +1241,8 @@
*******************************************************************************/
void bta_hh_security_cmpl(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_buf)
{
+ UNUSED(p_buf);
+
if (p_cb->status == BTA_HH_OK)
{
/* discovery has been done for HID service */
@@ -1257,6 +1265,28 @@
bta_hh_le_api_disc_act(p_cb);
}
+
+/*******************************************************************************
+**
+** Function bta_hh_le_notify_enc_cmpl
+**
+** Description process GATT encryption complete event
+**
+** Returns
+**
+*******************************************************************************/
+void bta_hh_le_notify_enc_cmpl(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_buf)
+{
+ if (p_cb == NULL || p_cb->security_pending == FALSE ||
+ p_buf == NULL || p_buf->le_enc_cmpl.client_if != bta_hh_cb.gatt_if)
+ {
+ return;
+ }
+
+ p_cb->security_pending = FALSE;
+ bta_hh_start_security(p_cb, NULL);
+}
+
/*******************************************************************************
**
** Function bta_hh_start_security
@@ -1269,6 +1299,20 @@
void bta_hh_start_security(tBTA_HH_DEV_CB *p_cb, tBTA_HH_DATA *p_buf)
{
UINT8 sec_flag=0;
+ tBTM_SEC_DEV_REC *p_dev_rec;
+ UNUSED(p_buf);
+
+ p_dev_rec = btm_find_dev(p_cb->addr);
+ if (p_dev_rec)
+ {
+ if (p_dev_rec->sec_state == BTM_SEC_STATE_ENCRYPTING ||
+ p_dev_rec->sec_state == BTM_SEC_STATE_AUTHENTICATING)
+ {
+ /* if security collision happened, wait for encryption done */
+ p_cb->security_pending = TRUE;
+ return;
+ }
+ }
/* verify bond */
BTM_GetSecurityFlags(p_cb->addr, &sec_flag);
@@ -1372,7 +1416,7 @@
p_buf->reason = p_data->reason;
p_dev_cb->conn_id = BTA_GATT_INVALID_CONN_ID;
-
+ p_dev_cb->security_pending = FALSE;
bta_sys_sendmsg(p_buf);
}
}
@@ -1601,6 +1645,9 @@
*******************************************************************************/
void bta_hh_read_battery_level_cmpl(UINT8 status, tBTA_HH_DEV_CB *p_dev_cb, tBTA_GATTC_READ *p_data)
{
+ UNUSED(status);
+ UNUSED(p_data);
+
p_dev_cb->hid_srvc[p_dev_cb->cur_srvc_index].expl_incl_srvc = TRUE;
bta_hh_le_srvc_expl_srvc(p_dev_cb);
}
@@ -2593,6 +2640,8 @@
*******************************************************************************/
UINT8 bta_hh_le_add_device(tBTA_HH_DEV_CB *p_cb, tBTA_HH_MAINT_DEV *p_dev_info)
{
+ p_cb->hid_handle = BTA_HH_GET_LE_DEV_HDL(p_cb->index);
+ bta_hh_cb.le_cb_index[BTA_HH_GET_LE_CB_IDX(p_cb->hid_handle)] = p_cb->index;
/* update DI information */
bta_hh_update_di_info(p_cb,
@@ -2709,7 +2758,9 @@
case BTA_GATTC_OPEN_EVT: /* 2 */
p_dev_cb = bta_hh_le_find_dev_cb_by_bda(p_data->open.remote_bda);
- bta_hh_sm_execute(p_dev_cb, BTA_HH_GATT_OPEN_EVT, (tBTA_HH_DATA *)&p_data->open);
+ if (p_dev_cb) {
+ bta_hh_sm_execute(p_dev_cb, BTA_HH_GATT_OPEN_EVT, (tBTA_HH_DATA *)&p_data->open);
+ }
break;
case BTA_GATTC_READ_CHAR_EVT: /* 3 */
@@ -2751,6 +2802,15 @@
case BTA_GATTC_NOTIF_EVT: /* 10 */
bta_hh_le_input_rpt_notify(&p_data->notify);
break;
+
+ case BTA_GATTC_ENC_CMPL_CB_EVT: /* 17 */
+ p_dev_cb = bta_hh_le_find_dev_cb_by_bda(p_data->enc_cmpl.remote_bda);
+ if (p_dev_cb) {
+ bta_hh_sm_execute(p_dev_cb, BTA_HH_GATT_ENC_CMPL_EVT,
+ (tBTA_HH_DATA *)&p_data->enc_cmpl);
+ }
+ break;
+
default:
break;
}
diff --git a/bta/hh/bta_hh_main.c b/bta/hh/bta_hh_main.c
index bf54e57..c2554c1 100644
--- a/bta/hh/bta_hh_main.c
+++ b/bta/hh/bta_hh_main.c
@@ -66,7 +66,7 @@
BTA_HH_START_SEC,
BTA_HH_SEC_CMPL,
BTA_HH_LE_UPDATE_SCPP,
-
+ BTA_HH_GATT_ENC_CMPL,
#endif
BTA_HH_NUM_ACTIONS
};
@@ -106,6 +106,7 @@
,bta_hh_start_security
,bta_hh_security_cmpl
,bta_hh_le_update_scpp
+ ,bta_hh_le_notify_enc_cmpl
#endif
};
@@ -140,6 +141,7 @@
/* READ_DESCR_CMPL_EVT */ ,{BTA_HH_IGNORE, BTA_HH_IDLE_ST }
/* WRITE_DESCR_CMPL_EVT */ ,{BTA_HH_IGNORE, BTA_HH_IDLE_ST }
/* SCPP_UPDATE_EVT */ ,{BTA_HH_IGNORE, BTA_HH_IDLE_ST }
+/* BTA_HH_GATT_ENC_CMPL_EVT */ ,{BTA_HH_IGNORE, BTA_HH_IDLE_ST }
#endif
};
@@ -170,6 +172,7 @@
/* READ_DESCR_CMPL_EVT */ ,{BTA_HH_W4_LE_READ_DESCR, BTA_HH_W4_CONN_ST }
/* WRITE_DESCR_CMPL_EVT */ ,{BTA_HH_WRITE_DESCR, BTA_HH_W4_CONN_ST }
/* SCPP_UPDATE_EVT */ ,{BTA_HH_IGNORE, BTA_HH_W4_CONN_ST }
+/* BTA_HH_GATT_ENC_CMPL_EVT */ ,{BTA_HH_IGNORE, BTA_HH_W4_CONN_ST }
#endif
};
@@ -199,6 +202,7 @@
/* READ_DESCR_CMPL_EVT */ ,{BTA_HH_LE_READ_DESCR, BTA_HH_CONN_ST } /* do not currently read any descr when connection up */
/* WRITE_DESCR_CMPL_EVT */ ,{BTA_HH_WRITE_DESCR, BTA_HH_CONN_ST } /* do not currently write any descr when connection up */
/* SCPP_UPDATE_EVT */ ,{BTA_HH_LE_UPDATE_SCPP, BTA_HH_CONN_ST }
+/* BTA_HH_GATT_ENC_CMPL_EVT */ ,{BTA_HH_IGNORE, BTA_HH_CONN_ST }
#endif
};
#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
@@ -226,6 +230,7 @@
/* READ_DESCR_CMPL_EVT */ {BTA_HH_IGNORE, BTA_HH_W4_SEC },
/* WRITE_DESCR_CMPL_EVT */ {BTA_HH_IGNORE, BTA_HH_W4_SEC }
/* SCPP_UPDATE_EVT */ ,{BTA_HH_IGNORE, BTA_HH_W4_SEC }
+/* BTA_HH_GATT_ENC_CMPL_EVT */ ,{BTA_HH_GATT_ENC_CMPL, BTA_HH_W4_SEC }
};
#endif
diff --git a/bta/hh/bta_hh_utils.c b/bta/hh/bta_hh_utils.c
index 0c67513..6130a88 100644
--- a/bta/hh/bta_hh_utils.c
+++ b/bta/hh/bta_hh_utils.c
@@ -165,6 +165,8 @@
p_cb->dscp_info.version = version;
#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
p_cb->dscp_info.flag = flag;
+#else
+ UNUSED(flag);
#endif
}
/*******************************************************************************
@@ -335,7 +337,7 @@
APPL_TRACE_DEBUG1("found keycode %02x ", this_report[xx]);
#endif
p_data->caps_lock = p_kb->caps_lock;
- p_kb->num_lock = p_kb->num_lock;
+ p_data->num_lock = p_kb->num_lock;
}
memset (p_kb->last_report, 0, BTA_HH_MAX_RPT_CHARS);
diff --git a/bta/hl/bta_hl_act.c b/bta/hl/bta_hl_act.c
index 8e16146..01528aa 100644
--- a/bta/hl/bta_hl_act.c
+++ b/bta/hl/bta_hl_act.c
@@ -121,6 +121,7 @@
tBTA_HL_APP_CB *p_acb = BTA_HL_GET_APP_CB_PTR(app_idx);
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
tBTA_HL_MDL_CB *p_dcb = BTA_HL_GET_MDL_CB_PTR(app_idx, mcl_idx, mdl_idx);
+ UNUSED(p_data);
#if (BTA_HL_DEBUG == TRUE)
APPL_TRACE_DEBUG0("bta_hl_dch_echo_test");
diff --git a/bta/hl/bta_hl_main.c b/bta/hl/bta_hl_main.c
index f229c10..7b15585 100644
--- a/bta/hl/bta_hl_main.c
+++ b/bta/hl/bta_hl_main.c
@@ -770,9 +770,9 @@
*******************************************************************************/
static void bta_hl_api_deregister(tBTA_HL_CB *p_cb, tBTA_HL_DATA *p_data)
{
-
UINT8 app_idx;
tBTA_HL_APP_CB *p_acb;
+ UNUSED(p_cb);
if (bta_hl_find_app_idx_using_handle(p_data->api_dereg.app_handle, &app_idx))
{
@@ -802,6 +802,7 @@
UINT8 app_idx, mcl_idx;
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb;
+ UNUSED(p_cb);
if (bta_hl_find_app_idx_using_handle(p_data->api_cch_open.app_handle, &app_idx))
{
@@ -900,6 +901,7 @@
UINT8 app_idx, mcl_idx;
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb;
+ UNUSED(p_cb);
if (bta_hl_find_mcl_idx_using_handle(p_data->api_cch_close.mcl_handle, &app_idx, &mcl_idx))
{
@@ -961,10 +963,11 @@
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
UINT8 app_idx, mcl_idx, mdl_idx;
tBTA_HL_APP_CB *p_acb;
- tBTA_HL_MCL_CB *p_mcb;
+ tBTA_HL_MCL_CB *p_mcb = NULL;
tBTA_HL_MDL_CB *p_dcb;
tBTA_HL_MDEP_CFG *p_mdep_cfg;
UINT8 mdep_cfg_idx;
+ UNUSED(p_cb);
if (bta_hl_find_mcl_idx_using_handle(p_data->api_dch_open.mcl_handle, &app_idx, &mcl_idx))
{
@@ -1116,7 +1119,7 @@
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb;
tBTA_HL_MDL_CB *p_dcb;
-
+ UNUSED(p_cb);
if (bta_hl_find_mdl_idx_using_handle(p_data->api_dch_close.mdl_handle, &app_idx, &mcl_idx, &mdl_idx ))
{
@@ -1183,11 +1186,12 @@
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
UINT8 app_idx, mcl_idx, mdl_idx;
tBTA_HL_APP_CB *p_acb;
- tBTA_HL_MCL_CB *p_mcb;
+ tBTA_HL_MCL_CB *p_mcb = NULL;
tBTA_HL_MDL_CB *p_dcb;
UINT8 mdep_cfg_idx;
UINT8 mdl_cfg_idx;
tBTA_HL_MDEP_CFG *p_mdep_cfg;
+ UNUSED(p_cb);
if (bta_hl_find_mcl_idx_using_handle(p_data->api_dch_reconnect.mcl_handle, &app_idx, &mcl_idx))
{
@@ -1323,10 +1327,10 @@
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
UINT8 app_idx, mcl_idx, mdl_idx;
tBTA_HL_APP_CB *p_acb;
- tBTA_HL_MCL_CB *p_mcb;
+ tBTA_HL_MCL_CB *p_mcb = NULL;
tBTA_HL_MDL_CB *p_dcb;
tBTA_HL_ECHO_CFG *p_echo_cfg;
-
+ UNUSED(p_cb);
if (bta_hl_find_mcl_idx_using_handle(p_data->api_dch_echo_test.mcl_handle, &app_idx, &mcl_idx))
{
@@ -1457,7 +1461,7 @@
UINT8 app_idx, mcl_idx;
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb;
-
+ UNUSED(p_cb);
if (bta_hl_find_app_idx_using_handle(p_data->api_sdp_query.app_handle, &app_idx))
{
@@ -1564,6 +1568,7 @@
tBTA_HL_SDP_OPER sdp_oper;
UINT16 event;
BOOLEAN release_sdp_buf=FALSE;
+ UNUSED(p_cb);
event = p_data->hdr.event;
sdp_oper = p_mcb->sdp_oper;
@@ -1638,6 +1643,7 @@
UINT8 app_idx, mcl_idx;
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb;
+ UNUSED(p_cb);
if (bta_hl_find_mcl_idx_using_handle(p_data->api_delete_mdl.mcl_handle, &app_idx, &mcl_idx ))
{
@@ -1728,6 +1734,7 @@
tBTA_HL_MCL_CB *p_mcb;
BOOLEAN send_cfm_evt = TRUE;
tBTA_HL_APP_CB *p_acb;
+ UNUSED(p_cb);
if (bta_hl_find_mcl_idx_using_handle(p_data->mca_evt.mcl_handle, &app_idx, &mcl_idx))
{
@@ -1805,8 +1812,9 @@
tMCA_EVT_HDR *p_delete_ind = &p_data->mca_evt.mca_data.delete_ind;
tBTA_HL_MCL_CB *p_mcb;
tBTA_HL_MDL_CB *p_dcb;
- BOOLEAN send_ind_evt = TRUE;
+ BOOLEAN send_ind_evt = FALSE;
tBTA_HL_APP_CB *p_acb;
+ UNUSED(p_cb);
if (bta_hl_find_mcl_idx_using_handle(p_data->mca_evt.mcl_handle, &app_idx, &mcl_idx) )
{
@@ -1862,14 +1870,13 @@
*******************************************************************************/
static void bta_hl_api_dch_abort(tBTA_HL_CB *p_cb, tBTA_HL_DATA *p_data)
{
-
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
UINT8 app_idx, mcl_idx, mdl_idx;
tBTA_HL_APP_CB *p_acb;
tBTA_HL_MCL_CB *p_mcb;
tBTA_HL_MDL_CB *p_dcb;
tBTA_HL evt_data;
-
+ UNUSED(p_cb);
if (bta_hl_find_mcl_idx_using_handle(p_data->api_dch_abort.mcl_handle, &app_idx, &mcl_idx ))
{
diff --git a/bta/hl/bta_hl_sdp.c b/bta/hl/bta_hl_sdp.c
index 22dd70a..43d22d2 100644
--- a/bta/hl/bta_hl_sdp.c
+++ b/bta/hl/bta_hl_sdp.c
@@ -23,7 +23,7 @@
#include "sdp_api.h"
#include "bta_hl_int.h"
-
+#include "utl.h"
/*******************************************************************************
**
@@ -164,11 +164,7 @@
**
** Purpose: Register an HDP application with SDP
**
-** Parameters: p_cb - Pointer to MA instance control block
-** p_service_name - MA server name
-** inst_id - MAS instance ID
-** msg_type - Supported message type(s)
-**
+** Parameters:
**
** Returns: void
**
@@ -189,6 +185,7 @@
tBTA_HL_APP_CB *p_cb = BTA_HL_GET_APP_CB_PTR(0);
BOOLEAN result = TRUE;
tBTA_HL_STATUS status = BTA_HL_STATUS_OK;
+ UNUSED(app_id);
if ((p_cb->sup_feature.app_role_mask == BTA_HL_MDEP_ROLE_MASK_SOURCE) &&
(!p_cb->sup_feature.advertize_source_sdp))
diff --git a/bta/hl/bta_hl_utils.c b/bta/hl/bta_hl_utils.c
index 2fc6a6f..6a08b74 100644
--- a/bta/hl/bta_hl_utils.c
+++ b/bta/hl/bta_hl_utils.c
@@ -53,6 +53,7 @@
{
tBTA_HL_MCL_CB *p_mcb = BTA_HL_GET_MCL_CB_PTR(app_idx, mcl_idx);
BOOLEAN success = TRUE, update_ctrl_psm = FALSE;
+ UNUSED(mdl_idx);
if (p_mcb->sdp.num_recs)
{
@@ -1353,7 +1354,7 @@
**
** Function bta_hl_find_mdl_cfg_idx
**
-** Description This function finds an available MDL configiration index
+** Description This function finds an available MDL configuration index
**
** Returns BOOLEAN - TRUE found
** FALSE not found
@@ -1367,7 +1368,7 @@
BOOLEAN found=FALSE;
UINT8 first_mdl_cfg_idx, second_mdl_cfg_idx, older_mdl_cfg_idx;
BOOLEAN done;
-
+ UNUSED(mcl_idx);
for (i=0; i< BTA_HL_NUM_MDL_CFGS; i++)
{
diff --git a/bta/include/bta_api.h b/bta/include/bta_api.h
index e52e699..4345fbf 100644
--- a/bta/include/bta_api.h
+++ b/bta/include/bta_api.h
@@ -1884,7 +1884,7 @@
*******************************************************************************/
BTA_API extern void BTA_DmSetAfhChannelAssessment (BOOLEAN enable_or_disable);
-#if BLE_INCLUDE == TRUE
+#if BLE_INCLUDED == TRUE
// btla-specific --
/*******************************************************************************
**
@@ -1927,6 +1927,34 @@
*******************************************************************************/
BTA_API extern void BTA_DmBleSetAdvConfig (tBTA_BLE_AD_MASK data_mask,
tBTA_BLE_ADV_DATA *p_adv_cfg);
+
+/*******************************************************************************
+**
+** Function BTA_DmBleSetScanRsp
+**
+** Description This function is called to override the BTA scan response.
+**
+** Parameters Pointer to User defined ADV data structure
+**
+** Returns None
+**
+*******************************************************************************/
+BTA_API extern void BTA_DmBleSetScanRsp (tBTA_BLE_AD_MASK data_mask,
+ tBTA_BLE_ADV_DATA *p_adv_cfg);
+
+/*******************************************************************************
+**
+** Function BTA_DmBleBroadcast
+**
+** Description This function starts or stops LE broadcasting.
+**
+** Parameters start: start or stop broadcast.
+**
+** Returns None
+**
+*******************************************************************************/
+BTA_API extern void BTA_DmBleBroadcast (BOOLEAN start);
+
#endif
#ifdef __cplusplus
diff --git a/bta/include/bta_gatt_api.h b/bta/include/bta_gatt_api.h
index 93eadd5..969a0d3 100644
--- a/bta/include/bta_gatt_api.h
+++ b/bta/include/bta_gatt_api.h
@@ -29,10 +29,10 @@
#include "gatt_api.h"
#ifndef BTA_GATT_INCLUDED
+#warning BTA_GATT_INCLUDED not defined
#define BTA_GATT_INCLUDED FALSE
#endif
-
#if ((BLE_INCLUDED == FALSE) && (BTA_GATT_INCLUDED == TRUE))
#undef BTA_GATT_INCLUDED
#define BTA_GATT_INCLUDED FALSE
@@ -115,6 +115,7 @@
#define BTA_GATTC_CANCEL_OPEN_EVT 14 /* cancel open event */
#define BTA_GATTC_SRVC_CHG_EVT 15 /* service change event */
#define BTA_GATTC_LISTEN_EVT 16 /* listen event */
+#define BTA_GATTC_ENC_CMPL_CB_EVT 17 /* encryption complete callback event */
typedef UINT8 tBTA_GATTC_EVT;
@@ -349,6 +350,12 @@
}tBTA_GATTC_OPEN_CLOSE;
// btla-specific --
+typedef struct
+{
+ tBTA_GATTC_IF client_if;
+ BD_ADDR remote_bda;
+}tBTA_GATTC_ENC_CMPL_CB;
+
typedef union
{
tBTA_GATT_STATUS status;
@@ -362,6 +369,7 @@
tBTA_GATTC_WRITE write; /* write complete data */
tBTA_GATTC_EXEC_CMPL exec_cmpl; /* execute complete */
tBTA_GATTC_NOTIFY notify; /* notification/indication event data */
+ tBTA_GATTC_ENC_CMPL_CB enc_cmpl;
BD_ADDR remote_bda; /* service change event */
} tBTA_GATTC;
diff --git a/bta/include/utl.h b/bta/include/utl.h
index df08b5a..e26cded 100644
--- a/bta/include/utl.h
+++ b/bta/include/utl.h
@@ -25,6 +25,7 @@
#define UTL_H
#include "data_types.h"
+#include "bt_utils.h"
/*****************************************************************************
** Constants
diff --git a/bta/jv/bta_jv_act.c b/bta/jv/bta_jv_act.c
index 71a2c0c..ab51071 100644
--- a/bta/jv/bta_jv_act.c
+++ b/bta/jv/bta_jv_act.c
@@ -379,6 +379,7 @@
*******************************************************************************/
tBTA_JV_STATUS bta_jv_free_l2c_cb(tBTA_JV_L2C_CB *p_cb)
{
+ UNUSED(p_cb);
#if 0
tBTA_JV_STATUS status = BTA_JV_SUCCESS;
@@ -754,6 +755,8 @@
*******************************************************************************/
void bta_jv_disable (tBTA_JV_MSG *p_data)
{
+ UNUSED(p_data);
+
APPL_TRACE_ERROR0("bta_jv_disable not used");
#if 0
int i;
@@ -844,6 +847,8 @@
*******************************************************************************/
void bta_jv_get_local_device_addr(tBTA_JV_MSG *p_data)
{
+ UNUSED(p_data);
+
BTM_ReadLocalDeviceAddr((tBTM_CMPL_CB *)bta_jv_get_local_device_addr_cback);
}
@@ -860,6 +865,7 @@
{
tBTA_JV evt_data;
char *name;
+ UNUSED(p_data);
BTM_ReadLocalDeviceName(&name);
evt_data.p_name = (UINT8*)name;
@@ -917,6 +923,8 @@
*******************************************************************************/
static void bta_jv_sec_cback (BD_ADDR bd_addr, void *p_ref_data, tBTM_STATUS result)
{
+ UNUSED(p_ref_data);
+
tBTA_JV_SET_ENCRYPTION set_enc;
if(bta_jv_cb.p_dm_cback)
{
@@ -953,6 +961,7 @@
*******************************************************************************/
void bta_jv_get_scn(tBTA_JV_MSG *p_data)
{
+ UNUSED(p_data);
#if 0
UINT8 scn;
scn = BTM_AllocateSCN();
@@ -988,7 +997,7 @@
static uint8_t bt_base_uuid[] =
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB };
- logu("in, uuid:", u);
+ logu("in, uuid:", u->uu.uuid128);
APPL_TRACE_DEBUG1("uuid len:%d", u->len);
if(u->len == 16)
{
@@ -1165,6 +1174,7 @@
*******************************************************************************/
void bta_jv_get_services_length(tBTA_JV_MSG *p_data)
{
+ UNUSED(p_data);
#if 0
tBTA_JV_SERVICES_LEN evt_data;
UINT8 *p, *np, *op, type;
@@ -1222,6 +1232,7 @@
*******************************************************************************/
void bta_jv_service_select(tBTA_JV_MSG *p_data)
{
+ UNUSED(p_data);
#if 0
tBTA_JV_SERVICE_SEL serv_sel;
tSDP_DISC_REC *p_rec, *p_tmp;
@@ -1304,6 +1315,7 @@
*******************************************************************************/
void bta_jv_update_record(tBTA_JV_MSG *p_data)
{
+ UNUSED(p_data);
#if 0
tBTA_JV_API_UPDATE_RECORD *ur = &(p_data->update_record);
tBTA_JV_UPDATE_RECORD evt_data;
@@ -1367,6 +1379,7 @@
*******************************************************************************/
void bta_jv_add_attribute(tBTA_JV_MSG *p_data)
{
+ UNUSED(p_data);
#if 0
tBTA_JV_API_ADD_ATTRIBUTE *aa = &(p_data->add_attr);
tBTA_JV_ADD_ATTR evt_data;
@@ -1413,6 +1426,7 @@
*******************************************************************************/
void bta_jv_delete_attribute(tBTA_JV_MSG *p_data)
{
+ UNUSED(p_data);
#if 0
tBTA_JV_API_ADD_ATTRIBUTE *da = &(p_data->add_attr);
tBTA_JV_DELETE_ATTR evt_data;
@@ -1465,6 +1479,8 @@
*******************************************************************************/
static void bta_jv_l2cap_client_cback(UINT16 gap_handle, UINT16 event)
{
+ UNUSED(gap_handle);
+ UNUSED(event);
#if 0
tBTA_JV_L2C_CB *p_cb = &bta_jv_cb.l2c_cb[gap_handle];
tBTA_JV evt_data;
@@ -1594,6 +1610,7 @@
*******************************************************************************/
void bta_jv_l2cap_connect(tBTA_JV_MSG *p_data)
{
+ UNUSED(p_data);
#if 0
tBTA_JV_L2C_CB *p_cb;
tBTA_JV_L2CAP_CL_INIT evt_data;
@@ -1669,6 +1686,7 @@
*******************************************************************************/
void bta_jv_l2cap_close(tBTA_JV_MSG *p_data)
{
+ UNUSED(p_data);
#if 0
tBTA_JV_L2CAP_CLOSE evt_data;
tBTA_JV_API_L2CAP_CLOSE *cc = &(p_data->l2cap_close);
@@ -1696,6 +1714,8 @@
*******************************************************************************/
static void bta_jv_l2cap_server_cback(UINT16 gap_handle, UINT16 event)
{
+ UNUSED(gap_handle);
+ UNUSED(event);
#if 0
tBTA_JV_L2C_CB *p_cb = &bta_jv_cb.l2c_cb[gap_handle];
tBTA_JV evt_data;
@@ -1755,6 +1775,7 @@
*******************************************************************************/
void bta_jv_l2cap_start_server(tBTA_JV_MSG *p_data)
{
+ UNUSED(p_data);
#if 0
tBTA_JV_L2C_CB *p_cb;
UINT8 sec_id;
@@ -1821,6 +1842,7 @@
*******************************************************************************/
void bta_jv_l2cap_stop_server(tBTA_JV_MSG *p_data)
{
+ UNUSED(p_data);
#if 0
tBTA_JV_L2C_CB *p_cb;
tBTA_JV_L2CAP_CLOSE evt_data;
@@ -1855,6 +1877,7 @@
*******************************************************************************/
void bta_jv_l2cap_read(tBTA_JV_MSG *p_data)
{
+ UNUSED(p_data);
#if 0
tBTA_JV_L2CAP_READ evt_data;
tBTA_JV_API_L2CAP_READ *rc = &(p_data->l2cap_read);
@@ -1898,6 +1921,7 @@
*******************************************************************************/
void bta_jv_l2cap_write(tBTA_JV_MSG *p_data)
{
+ UNUSED(p_data);
#if 0
tBTA_JV_L2CAP_WRITE evt_data;
tBTA_JV_API_L2CAP_WRITE *ls = &(p_data->l2cap_write);
diff --git a/bta/jv/bta_jv_api.c b/bta/jv/bta_jv_api.c
index 1ee9924..16ab2d5 100644
--- a/bta/jv/bta_jv_api.c
+++ b/bta/jv/bta_jv_api.c
@@ -31,6 +31,7 @@
#include <string.h>
#include "port_api.h"
#include "sdp_api.h"
+#include "utl.h"
/*****************************************************************************
** Constants
@@ -714,6 +715,8 @@
*******************************************************************************/
INT32 BTA_JvGetServicesResult(BOOLEAN inc_hdr, UINT8 **TLVs)
{
+ UNUSED(inc_hdr);
+ UNUSED(TLVs);
#if 0
INT32 num_services = -1;
UINT8 *p, *np, *op, type;
@@ -860,6 +863,11 @@
tBTA_JV_STATUS BTA_JvUpdateRecord(UINT32 handle, UINT16 *p_ids,
UINT8 **p_values, INT32 *p_value_sizes, INT32 array_len)
{
+ UNUSED(handle);
+ UNUSED(p_ids);
+ UNUSED(p_values);
+ UNUSED(p_value_sizes);
+ UNUSED(array_len);
#if 0
tBTA_JV_STATUS status = BTA_JV_FAILURE;
tBTA_JV_API_UPDATE_RECORD *p_msg;
@@ -1145,6 +1153,11 @@
*******************************************************************************/
tBTA_JV_STATUS BTA_JvL2capRead(UINT32 handle, UINT32 req_id, UINT8 *p_data, UINT16 len)
{
+ UNUSED(handle);
+ UNUSED(req_id);
+ UNUSED(p_data);
+ UNUSED(len);
+
#if 0
tBTA_JV_STATUS status = BTA_JV_FAILURE;
#if SDP_FOR_JV_INCLUDED == TRUE
@@ -1208,6 +1221,10 @@
*******************************************************************************/
tBTA_JV_STATUS BTA_JvL2capReceive(UINT32 handle, UINT32 req_id, UINT8 *p_data, UINT16 len)
{
+ UNUSED(handle);
+ UNUSED(req_id);
+ UNUSED(p_data);
+ UNUSED(len);
#if 0
tBTA_JV_STATUS status = BTA_JV_FAILURE;
tBTA_JV_L2CAP_RECEIVE evt_data;
@@ -1256,6 +1273,8 @@
*******************************************************************************/
tBTA_JV_STATUS BTA_JvL2capReady(UINT32 handle, UINT32 *p_data_size)
{
+ UNUSED(handle);
+ UNUSED(p_data_size);
#if 0
tBTA_JV_STATUS status = BTA_JV_FAILURE;
diff --git a/bta/pan/bta_pan_act.c b/bta/pan/bta_pan_act.c
index b29920f..b01e95a 100644
--- a/bta/pan/bta_pan_act.c
+++ b/bta/pan/bta_pan_act.c
@@ -35,6 +35,7 @@
#include "bta_pan_int.h"
#include "bta_pan_co.h"
#include <string.h>
+#include "utl.h"
/* RX and TX data flow mask */
@@ -476,6 +477,7 @@
void bta_pan_api_close (tBTA_PAN_SCB *p_scb, tBTA_PAN_DATA *p_data)
{
tBTA_PAN_CONN * p_buf;
+ UNUSED(p_data);
PAN_Disconnect (p_scb->handle);
@@ -586,6 +588,8 @@
*******************************************************************************/
void bta_pan_rx_path(tBTA_PAN_SCB *p_scb, tBTA_PAN_DATA *p_data)
{
+ UNUSED(p_data);
+
/* if data path configured for rx pull */
if ((bta_pan_cb.flow_mask & BTA_PAN_RX_MASK) == BTA_PAN_RX_PULL)
{
@@ -615,8 +619,9 @@
*******************************************************************************/
void bta_pan_tx_path(tBTA_PAN_SCB *p_scb, tBTA_PAN_DATA *p_data)
{
-
BT_HDR * p_buf;
+ UNUSED(p_data);
+
/* if data path configured for tx pull */
if ((bta_pan_cb.flow_mask & BTA_PAN_TX_MASK) == BTA_PAN_TX_PULL)
{
@@ -720,6 +725,7 @@
*******************************************************************************/
void bta_pan_free_buf(tBTA_PAN_SCB *p_scb, tBTA_PAN_DATA *p_data)
{
+ UNUSED(p_scb);
GKI_freebuf(p_data);
diff --git a/bta/pan/bta_pan_main.c b/bta/pan/bta_pan_main.c
index add1c7c..5ed545f 100644
--- a/bta/pan/bta_pan_main.c
+++ b/bta/pan/bta_pan_main.c
@@ -34,6 +34,7 @@
#include "bta_pan_api.h"
#include "bta_pan_int.h"
#include "bd.h"
+#include "utl.h"
/*****************************************************************************
** Constants and types
@@ -265,6 +266,8 @@
*******************************************************************************/
static void bta_pan_api_disable(tBTA_PAN_DATA *p_data)
{
+ UNUSED(p_data);
+
bta_pan_disable();
}
diff --git a/bta/sys/bta_sys_conn.c b/bta/sys/bta_sys_conn.c
index b495085..a5d1017 100644
--- a/bta/sys/bta_sys_conn.c
+++ b/bta/sys/bta_sys_conn.c
@@ -26,7 +26,7 @@
#include "bta_sys.h"
#include "bta_sys_int.h"
#include "gki.h"
-
+#include "utl.h"
/*******************************************************************************
**
@@ -349,6 +349,8 @@
*******************************************************************************/
void bta_sys_sco_use(UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
{
+ UNUSED(id);
+
/* AV streaming need to be suspended before SCO is connected. */
if(bta_sys_cb.p_sco_cb)
{
@@ -370,6 +372,7 @@
void bta_sys_sco_unuse(UINT8 id, UINT8 app_id, BD_ADDR peer_addr)
{
UINT8 num_sco_links;
+ UNUSED(id);
if((bta_sys_cb.p_sco_cb))
{
diff --git a/bta/sys/bta_sys_main.c b/bta/sys/bta_sys_main.c
index 59fbdd7..a440f52 100644
--- a/bta/sys/bta_sys_main.c
+++ b/bta/sys/bta_sys_main.c
@@ -44,6 +44,7 @@
#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
#include "bta_ar_api.h"
#endif
+#include "utl.h"
/* protocol timer update period, in milliseconds */
#ifndef BTA_SYS_TIMER_PERIOD
@@ -295,8 +296,8 @@
*******************************************************************************/
void bta_sys_hw_error(tBTA_SYS_HW_MSG *p_sys_hw_msg)
{
-
UINT8 module_index;
+ UNUSED(p_sys_hw_msg);
APPL_TRACE_DEBUG1("%s", __FUNCTION__);
@@ -455,7 +456,7 @@
**
** Function bta_sys_hw_event_stack_enabled
**
-** Description we receive this event from once the SW side is ready ( stack, FW download,... ),
+** Description we receive this event once the SW side is ready ( stack, FW download,... ),
** i.e. we can really start using the device. So notify the app.
**
** Returns success or failure
@@ -464,6 +465,7 @@
void bta_sys_hw_evt_stack_enabled(tBTA_SYS_HW_MSG *p_sys_hw_msg)
{
UINT8 hw_module_index;
+ UNUSED(p_sys_hw_msg);
APPL_TRACE_DEBUG0(" bta_sys_hw_evt_stack_enabled!notify the callers");
diff --git a/btif/co/bta_ag_co.c b/btif/co/bta_ag_co.c
index cd969f8..9c6de7d 100644
--- a/btif/co/bta_ag_co.c
+++ b/btif/co/bta_ag_co.c
@@ -21,6 +21,7 @@
#include "bta_ag_api.h"
#include "bta_ag_co.h"
#include "bte_appl.h"
+#include "bt_utils.h"
#define LOG_TAG "BTA_AG_CO: "
@@ -74,6 +75,7 @@
*******************************************************************************/
void bta_ag_co_audio_state(UINT16 handle, UINT8 app_id, UINT8 state)
{
+ UNUSED(app_id);
BTIF_TRACE_DEBUG2("bta_ag_co_audio_state: handle %d, state %d", handle, state);
}
@@ -127,6 +129,7 @@
*******************************************************************************/
void bta_ag_co_tx_write(UINT16 handle, UINT8 * p_data, UINT16 len)
{
- BTIF_TRACE_DEBUG2( "bta_ag_co_tx_write: handle: %d, len: %d", handle, len );
+ UNUSED(p_data);
+ BTIF_TRACE_DEBUG2( "bta_ag_co_tx_write: handle: %d, len: %d", handle, len );
}
diff --git a/btif/co/bta_av_co.c b/btif/co/bta_av_co.c
index 6089532..fecf621 100644
--- a/btif/co/bta_av_co.c
+++ b/btif/co/bta_av_co.c
@@ -35,6 +35,7 @@
#include "btif_media.h"
#include "sbc_encoder.h"
#include "btif_av_co.h"
+#include "btif_util.h"
/*****************************************************************************
@@ -516,6 +517,8 @@
UINT8 status = A2D_SUCCESS;
UINT8 category = A2D_SUCCESS;
BOOLEAN recfg_needed = FALSE;
+ UNUSED(seid);
+ UNUSED(addr);
FUNC_TRACE();
@@ -645,6 +648,7 @@
UINT16 mtu)
{
tBTA_AV_CO_PEER *p_peer;
+ UNUSED(p_codec_info);
FUNC_TRACE();
@@ -678,6 +682,8 @@
{
tBTA_AV_CO_PEER *p_peer;
+ UNUSED(codec_type);
+ UNUSED(mtu);
FUNC_TRACE();
@@ -713,6 +719,11 @@
BTA_API void bta_av_co_audio_start(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type,
UINT8 *p_codec_info, BOOLEAN *p_no_rtp_hdr)
{
+ UNUSED(hndl);
+ UNUSED(codec_type);
+ UNUSED(p_codec_info);
+ UNUSED(p_no_rtp_hdr);
+
FUNC_TRACE();
APPL_TRACE_DEBUG0("bta_av_co_audio_start");
@@ -732,6 +743,9 @@
*******************************************************************************/
BTA_API extern void bta_av_co_audio_stop(tBTA_AV_HNDL hndl, tBTA_AV_CODEC codec_type)
{
+ UNUSED(hndl);
+ UNUSED(codec_type);
+
FUNC_TRACE();
APPL_TRACE_DEBUG0("bta_av_co_audio_stop");
@@ -751,6 +765,8 @@
UINT32 *p_timestamp)
{
BT_HDR *p_buf;
+ UNUSED(p_len);
+
FUNC_TRACE();
p_buf = btif_media_aa_readbuf();
diff --git a/btif/co/bta_dm_co.c b/btif/co/bta_dm_co.c
index fd91817..13a5c8f 100644
--- a/btif/co/bta_dm_co.c
+++ b/btif/co/bta_dm_co.c
@@ -22,6 +22,7 @@
#include "bta_sys.h"
#include "bta_dm_co.h"
#include "bta_dm_ci.h"
+#include "bt_utils.h"
#if (BTM_OOB_INCLUDED == TRUE)
#include "btif_dm.h"
#endif
@@ -46,6 +47,9 @@
*******************************************************************************/
BOOLEAN bta_dm_co_get_compress_memory(tBTA_SYS_ID id, UINT8 **memory_p, UINT32 *memory_size)
{
+ UNUSED(id);
+ UNUSED(memory_p);
+ UNUSED(memory_size);
return TRUE;
}
@@ -67,6 +71,7 @@
void bta_dm_co_io_req(BD_ADDR bd_addr, tBTA_IO_CAP *p_io_cap, tBTA_OOB_DATA *p_oob_data,
tBTA_AUTH_REQ *p_auth_req, BOOLEAN is_orig)
{
+ UNUSED(bd_addr);
#if (BTM_OOB_INCLUDED == TRUE)
btif_dm_set_oob_for_io_req(p_oob_data);
#endif
@@ -94,6 +99,10 @@
void bta_dm_co_io_rsp(BD_ADDR bd_addr, tBTA_IO_CAP io_cap,
tBTA_OOB_DATA oob_data, tBTA_AUTH_REQ auth_req)
{
+ UNUSED(bd_addr);
+ UNUSED(io_cap);
+ UNUSED(oob_data);
+ UNUSED(auth_req);
}
/*******************************************************************************
@@ -111,6 +120,8 @@
*******************************************************************************/
void bta_dm_co_lk_upgrade(BD_ADDR bd_addr, BOOLEAN *p_upgrade )
{
+ UNUSED(bd_addr);
+ UNUSED(p_upgrade);
}
#if (BTM_OOB_INCLUDED == TRUE)
@@ -334,6 +345,7 @@
tBTA_LE_KEY_TYPE *p_init_key,
tBTA_LE_KEY_TYPE *p_resp_key )
{
+ UNUSED(bd_addr);
BTIF_TRACE_ERROR0("##################################");
BTIF_TRACE_ERROR0("bta_dm_co_le_io_key_req: only setting max size to 16");
BTIF_TRACE_ERROR0("##################################");
@@ -389,6 +401,7 @@
tBTA_LE_KEY_TYPE *p_init_key,
tBTA_LE_KEY_TYPE *p_resp_key )
{
+ UNUSED(bd_addr);
/* if OOB is not supported, this call-out function does not need to do anything
* otherwise, look for the OOB data associated with the address and set *p_oob_data accordingly
* If the answer can not be obtained right away,
diff --git a/btif/co/bta_fs_co.c b/btif/co/bta_fs_co.c
index ffc146b..958fef5 100644
--- a/btif/co/bta_fs_co.c
+++ b/btif/co/bta_fs_co.c
@@ -30,6 +30,7 @@
#include "bta_fs_co.h"
#include "bta_fs_ci.h"
#include <inttypes.h>
+#include "bt_utils.h"
#ifndef AID_SYSTEM
#define AID_SYSTEM 1000
@@ -248,12 +249,12 @@
*******************************************************************************/
static int btapp_fs_check_space( const char *p_path, const UINT32 size, const UINT8 app_id )
{
-
unsigned long long max_space;
struct statfs fs_buffer;
int err = 0;
char *p_dir;
char *p_end;
+ UNUSED(app_id);
if(size==BTA_FS_LEN_UNKNOWN)
return 0;
@@ -455,6 +456,7 @@
tBTA_FS_CO_STATUS status = BTA_FS_CO_OK;
INT32 num_read;
int err;
+ UNUSED(ssn);
if ((num_read = read (fd, p_buf, nbytes)) < 0)
{
@@ -500,6 +502,8 @@
tBTA_FS_CO_STATUS status = BTA_FS_CO_OK;
INT32 num_written;
int err=0;
+ UNUSED(ssn);
+ UNUSED(app_id);
if ((num_written = write (fd, p_buf, nbytes)) < 0)
{
@@ -528,6 +532,7 @@
*******************************************************************************/
void bta_fs_co_seek (int fd, INT32 offset, INT16 origin, UINT8 app_id)
{
+ UNUSED(app_id);
lseek(fd, offset, origin);
}
@@ -559,6 +564,7 @@
int os_mode = 0;
tBTA_FS_CO_STATUS status = BTA_FS_CO_OK;
struct stat buffer;
+ UNUSED(app_id);
#if (TRUE==BTA_FS_DEBUG)
LOGI("***********CHECKING ACCESS TO = %s", p_path);
@@ -776,6 +782,7 @@
tBTA_FS_CO_STATUS status = BTA_FS_CO_OK;
char *dirName, *tmp=NULL;
struct stat buffer;
+ UNUSED(app_id);
if(! p_path)
return BTA_FS_CO_FAIL;
@@ -856,6 +863,7 @@
struct dirent *dirent;
struct stat buf;
char fullname[500];
+ UNUSED(app_id);
BTIF_TRACE_DEBUG0("Entered bta_fs_co_getdirentry");
@@ -978,6 +986,9 @@
*******************************************************************************/
void bta_fs_co_setdir(const char *p_path, UINT8 app_id)
{
+ UNUSED(p_path);
+ UNUSED(app_id);
+
BTIF_TRACE_DEBUG2("Entered %s. New path: %s", __FUNCTION__, p_path);
}
@@ -1006,6 +1017,9 @@
*******************************************************************************/
void bta_fs_co_resume(UINT16 evt, UINT8 app_id)
{
+ UNUSED(evt);
+ UNUSED(app_id);
+
BTIF_TRACE_WARNING0("[CO] bta_fs_co_resume - NOT implemented");
}
@@ -1031,6 +1045,11 @@
*******************************************************************************/
void bta_fs_co_set_perms(const char *p_src_path, UINT8 *p_perms, UINT16 evt, UINT8 app_id)
{
+ UNUSED(p_src_path);
+ UNUSED(p_perms);
+ UNUSED(evt);
+ UNUSED(app_id);
+
BTIF_TRACE_WARNING0("[CO] bta_fs_co_set_perms - NOT implemented");
}
@@ -1057,6 +1076,12 @@
*******************************************************************************/
void bta_fs_co_rename(const char *p_src_path, const char *p_dest_path, UINT8 *p_perms, UINT16 evt, UINT8 app_id)
{
+ UNUSED(p_src_path);
+ UNUSED(p_dest_path);
+ UNUSED(p_perms);
+ UNUSED(evt);
+ UNUSED(app_id);
+
BTIF_TRACE_WARNING0("[CO] bta_fs_co_rename - NOT implemented");
}
@@ -1085,6 +1110,12 @@
*******************************************************************************/
void bta_fs_co_copy(const char *p_src_path, const char *p_dest_path, UINT8 *p_perms, UINT16 evt, UINT8 app_id)
{
+ UNUSED(p_src_path);
+ UNUSED(p_dest_path);
+ UNUSED(p_perms);
+ UNUSED(evt);
+ UNUSED(app_id);
+
BTIF_TRACE_WARNING0("[CO] bta_fs_co_copy - NOT implemented");
}
@@ -1106,6 +1137,10 @@
*******************************************************************************/
void bta_fs_co_resume_op(UINT32 offset, UINT16 evt, UINT8 app_id)
{
+ UNUSED(offset);
+ UNUSED(evt);
+ UNUSED(app_id);
+
BTIF_TRACE_WARNING0("[CO] bta_fs_co_resume_op - NOT implemented");
}
@@ -1129,6 +1164,14 @@
void bta_fs_co_session_info(BD_ADDR bd_addr, UINT8 *p_sess_info, UINT8 ssn,
tBTA_FS_CO_SESS_ST new_st, char *p_path, UINT8 *p_info, UINT8 app_id)
{
+ UNUSED(bd_addr);
+ UNUSED(p_sess_info);
+ UNUSED(ssn);
+ UNUSED(new_st);
+ UNUSED(p_path);
+ UNUSED(p_info);
+ UNUSED(app_id);
+
BTIF_TRACE_WARNING0("[CO] bta_fs_co_session_info - NOT implemented");
}
@@ -1154,6 +1197,14 @@
void bta_fs_co_suspend(BD_ADDR bd_addr, UINT8 *p_sess_info, UINT8 ssn,
UINT32 *p_timeout, UINT32 *p_offset, UINT8 info, UINT8 app_id)
{
+ UNUSED(bd_addr);
+ UNUSED(p_sess_info);
+ UNUSED(ssn);
+ UNUSED(p_timeout);
+ UNUSED(p_offset);
+ UNUSED(info);
+ UNUSED(app_id);
+
BTIF_TRACE_WARNING0("[CO] bta_fs_co_suspend - NOT implemented");
}
@@ -1176,6 +1227,10 @@
*******************************************************************************/
void bta_fs_co_sess_ssn(int fd, UINT8 ssn, UINT8 app_id)
{
+ UNUSED(fd);
+ UNUSED(ssn);
+ UNUSED(app_id);
+
BTIF_TRACE_WARNING0("[CO] bta_fs_co_suspend - NOT implemented");
}
diff --git a/btif/co/bta_gattc_co.c b/btif/co/bta_gattc_co.c
index 1a71d69..29fbb09 100644
--- a/btif/co/bta_gattc_co.c
+++ b/btif/co/bta_gattc_co.c
@@ -20,6 +20,7 @@
#include "gki.h"
#include "bta_gattc_co.h"
#include "bta_gattc_ci.h"
+#include "btif_util.h"
#if( defined BLE_INCLUDED ) && (BLE_INCLUDED == TRUE)
#if( defined BTA_GATT_INCLUDED ) && (BTA_GATT_INCLUDED == TRUE)
@@ -47,6 +48,7 @@
void bta_gattc_co_cache_open(BD_ADDR server_bda, UINT16 evt, UINT16 conn_id, BOOLEAN to_save)
{
tBTA_GATT_STATUS status = BTA_GATT_OK;
+ UNUSED(to_save);
/* open NV cache and send call in */
bta_gattc_ci_cache_open(server_bda, evt, status, conn_id);
@@ -72,6 +74,7 @@
UINT16 num_attr = 0;
tBTA_GATTC_NV_ATTR attr[BTA_GATTC_NV_LOAD_MAX];
tBTA_GATT_STATUS status = BTA_GATT_MORE;
+ UNUSED(start_index);
bta_gattc_ci_cache_load(server_bda, evt, num_attr, attr, status, conn_id);
}
@@ -95,6 +98,9 @@
tBTA_GATTC_NV_ATTR *p_attr_list, UINT16 attr_index, UINT16 conn_id)
{
tBTA_GATT_STATUS status = BTA_GATT_OK;
+ UNUSED(num_attr);
+ UNUSED(p_attr_list);
+ UNUSED(attr_index);
bta_gattc_ci_cache_save(server_bda, evt, status, conn_id);
}
@@ -114,6 +120,8 @@
*******************************************************************************/
void bta_gattc_co_cache_close(BD_ADDR server_bda, UINT16 conn_id)
{
+ UNUSED(server_bda);
+ UNUSED(conn_id);
/* close NV when server cache is done saving or loading,
does not need to do anything for now on Insight */
}
@@ -132,6 +140,7 @@
*******************************************************************************/
void bta_gattc_co_cache_reset(BD_ADDR server_bda)
{
+ UNUSED(server_bda);
}
#endif
diff --git a/btif/co/bta_gatts_co.c b/btif/co/bta_gatts_co.c
index 16b0450..d030075 100644
--- a/btif/co/bta_gatts_co.c
+++ b/btif/co/bta_gatts_co.c
@@ -25,6 +25,7 @@
#include "gki.h"
#include "bd.h"
#include "bta_gatts_co.h"
+#include "btif_util.h"
/*****************************************************************************
** Local type definitions
@@ -202,6 +203,8 @@
*******************************************************************************/
void bta_gatts_co_update_handle_range(BOOLEAN is_add, tBTA_GATTS_HNDL_RANGE *p_hndl_range)
{
+ UNUSED(is_add);
+ UNUSED(p_hndl_range);
}
/*******************************************************************************
@@ -225,6 +228,10 @@
tBTA_GATTS_SRV_CHG_REQ *p_req,
tBTA_GATTS_SRV_CHG_RSP *p_rsp)
{
+ UNUSED(cmd);
+ UNUSED(p_req);
+ UNUSED(p_rsp);
+
return FALSE;
}
@@ -243,7 +250,10 @@
BOOLEAN bta_gatts_co_load_handle_range(UINT8 index,
tBTA_GATTS_HNDL_RANGE *p_handle_range)
{
- return FALSE;
+ UNUSED(index);
+ UNUSED(p_handle_range);
+
+ return FALSE;
}
#endif
#endif
diff --git a/btif/co/bta_hh_co.c b/btif/co/bta_hh_co.c
index 51edcd4..b393099 100644
--- a/btif/co/bta_hh_co.c
+++ b/btif/co/bta_hh_co.c
@@ -30,7 +30,7 @@
#include "btif_hh.h"
#include "bta_api.h"
#include "bta_hh_api.h"
-
+#include "btif_util.h"
const char *dev_path = "/dev/uhid";
@@ -365,6 +365,7 @@
UINT8 sub_class, UINT8 ctry_code, BD_ADDR peer_addr, UINT8 app_id)
{
btif_hh_device_t *p_dev;
+ UNUSED(peer_addr);
APPL_TRACE_DEBUG6("%s: dev_handle = %d, subclass = 0x%02X, mode = %d, "
"ctry_code = %d, app_id = %d",
@@ -419,6 +420,11 @@
memset(&ev, 0, sizeof(ev));
ev.type = UHID_CREATE;
strncpy((char*)ev.u.create.name, dev_name, sizeof(ev.u.create.name) - 1);
+ snprintf((char*)ev.u.create.uniq, sizeof(ev.u.create.uniq),
+ "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
+ p_dev->bd_addr.address[5], p_dev->bd_addr.address[4],
+ p_dev->bd_addr.address[3], p_dev->bd_addr.address[2],
+ p_dev->bd_addr.address[1], p_dev->bd_addr.address[0]);
ev.u.create.rd_size = dscp_len;
ev.u.create.rd_data = p_dscp;
ev.u.create.bus = BUS_BLUETOOTH;
diff --git a/btif/co/bta_hl_co.c b/btif/co/bta_hl_co.c
index 2713da1..1432974 100644
--- a/btif/co/bta_hl_co.c
+++ b/btif/co/bta_hl_co.c
@@ -42,7 +42,7 @@
#include "bta_hl_co.h"
#include "bta_hl_ci.h"
#include "btif_hl.h"
-
+#include "btif_util.h"
/*****************************************************************************
@@ -427,6 +427,9 @@
UINT16 buf_size, UINT8 *p_buf, UINT16 evt)
{
tBTA_HL_STATUS status = BTA_HL_STATUS_FAIL;
+ UNUSED(app_id);
+ UNUSED(buf_size);
+ UNUSED(p_buf);
BTIF_TRACE_ERROR1("%s not supported",__FUNCTION__);
bta_hl_ci_get_echo_data(mcl_handle, status, evt);
@@ -453,6 +456,9 @@
UINT16 data_size, UINT8 *p_data, UINT16 evt)
{
tBTA_HL_STATUS status = BTA_HL_STATUS_FAIL;
+ UNUSED(app_id);
+ UNUSED(data_size);
+ UNUSED(p_data);
BTIF_TRACE_ERROR1("%s not supported",__FUNCTION__);
bta_hl_ci_put_echo_data(mcl_handle, status, evt);
diff --git a/btif/co/bta_pan_co.c b/btif/co/bta_pan_co.c
index c6310d4..1dcce8e 100644
--- a/btif/co/bta_pan_co.c
+++ b/btif/co/bta_pan_co.c
@@ -35,7 +35,7 @@
#include "btif_pan_internal.h"
#include "bd.h"
#include <string.h>
-
+#include "btif_util.h"
/*******************************************************************************
**
@@ -218,6 +218,9 @@
*******************************************************************************/
void bta_pan_co_rx_path(UINT16 handle, UINT8 app_id)
{
+ UNUSED(handle);
+ UNUSED(app_id);
+
BTIF_TRACE_API0("bta_pan_co_rx_path not used");
}
@@ -238,7 +241,17 @@
UINT16 protocol, UINT8 *p_data,
UINT16 len, BOOLEAN ext, BOOLEAN forward)
{
- BTIF_TRACE_API0("bta_pan_co_tx_write not used");
+ UNUSED(handle);
+ UNUSED(app_id);
+ UNUSED(src);
+ UNUSED(dst);
+ UNUSED(protocol);
+ UNUSED(p_data);
+ UNUSED(len);
+ UNUSED(ext);
+ UNUSED(forward);
+
+ BTIF_TRACE_API0("bta_pan_co_tx_write not used");
}
/*******************************************************************************
@@ -258,6 +271,15 @@
BD_ADDR dst, UINT16 protocol, BT_HDR *p_buf,
BOOLEAN ext, BOOLEAN forward)
{
+ UNUSED(handle);
+ UNUSED(app_id);
+ UNUSED(src);
+ UNUSED(dst);
+ UNUSED(protocol);
+ UNUSED(p_buf);
+ UNUSED(ext);
+ UNUSED(forward);
+
BTIF_TRACE_API0("bta_pan_co_tx_writebuf not used");
}
@@ -277,6 +299,10 @@
*******************************************************************************/
void bta_pan_co_rx_flow(UINT16 handle, UINT8 app_id, BOOLEAN enable)
{
+ UNUSED(handle);
+ UNUSED(app_id);
+ UNUSED(enable);
+
BTIF_TRACE_API1("bta_pan_co_rx_flow, enabled:%d, not used", enable);
}
@@ -292,6 +318,12 @@
void bta_pan_co_pfilt_ind(UINT16 handle, BOOLEAN indication, tBTA_PAN_STATUS result,
UINT16 len, UINT8 *p_filters)
{
+ UNUSED(handle);
+ UNUSED(indication);
+ UNUSED(result);
+ UNUSED(len);
+ UNUSED(p_filters);
+
BTIF_TRACE_API0("bta_pan_co_pfilt_ind");
}
@@ -307,6 +339,12 @@
void bta_pan_co_mfilt_ind(UINT16 handle, BOOLEAN indication, tBTA_PAN_STATUS result,
UINT16 len, UINT8 *p_filters)
{
+ UNUSED(handle);
+ UNUSED(indication);
+ UNUSED(result);
+ UNUSED(len);
+ UNUSED(p_filters);
+
BTIF_TRACE_API0("bta_pan_co_mfilt_ind");
}
diff --git a/btif/include/btif_storage.h b/btif/include/btif_storage.h
index 41507fb..632fc53 100644
--- a/btif/include/btif_storage.h
+++ b/btif/include/btif_storage.h
@@ -236,7 +236,8 @@
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 ssr_max_latency,
+ UINT16 ssr_min_tout, UINT16 dl_len, UINT8 *dsc_list);
/*******************************************************************************
**
diff --git a/btif/include/btif_util.h b/btif/include/btif_util.h
index 30bff69..95969dd 100755
--- a/btif/include/btif_util.h
+++ b/btif/include/btif_util.h
@@ -26,6 +26,7 @@
#include "data_types.h"
#include "bt_types.h"
+#include "bt_utils.h"
/*******************************************************************************
** Constants & Macros
diff --git a/btif/src/bluetooth.c b/btif/src/bluetooth.c
index 476aaba..44644de 100755
--- a/btif/src/bluetooth.c
+++ b/btif/src/bluetooth.c
@@ -82,8 +82,10 @@
extern bthl_interface_t *btif_hl_get_interface();
/*pan*/
extern btpan_interface_t *btif_pan_get_interface();
+#if BLE_INCLUDED == TRUE
/* gatt */
extern btgatt_interface_t *btif_gatt_get_interface();
+#endif
/* avrc */
extern btrc_interface_t *btif_rc_get_interface();
@@ -155,7 +157,6 @@
return;
btif_shutdown_bluetooth();
- bt_utils_cleanup();
/* hal callbacks reset upon shutdown complete callback */
@@ -424,13 +425,16 @@
static int close_bluetooth_stack(struct hw_device_t* device)
{
+ UNUSED(device);
cleanup();
return 0;
}
static int open_bluetooth_stack (const struct hw_module_t* module, char const* name,
-struct hw_device_t** abstraction)
+ struct hw_device_t** abstraction)
{
+ UNUSED(name);
+
bluetooth_device_t *stack = malloc(sizeof(bluetooth_device_t) );
memset(stack, 0, sizeof(bluetooth_device_t) );
stack->common.tag = HARDWARE_DEVICE_TAG;
diff --git a/btif/src/btif_av.c b/btif/src/btif_av.c
index f173f6a..3c0c293 100755
--- a/btif/src/btif_av.c
+++ b/btif/src/btif_av.c
@@ -201,6 +201,7 @@
static void btif_initiate_av_open_tmr_hdlr(TIMER_LIST_ENT *tle)
{
BD_ADDR peer_addr;
+ UNUSED(tle);
/* is there at least one RC connection - There should be */
if (btif_rc_get_connected_peer(peer_addr)) {
diff --git a/btif/src/btif_config.c b/btif/src/btif_config.c
index 8b36a11..e7809a7 100644
--- a/btif/src/btif_config.c
+++ b/btif/src/btif_config.c
@@ -49,6 +49,7 @@
#include "btif_config_util.h"
#include "btif_sock_thread.h"
#include "btif_sock_util.h"
+#include "btif_util.h"
//#define UNIT_TEST
#define CFG_PATH "/data/misc/bluedroid/"
@@ -781,6 +782,10 @@
}
static void cfg_cmd_callback(int cmd_fd, int type, int size, uint32_t user_id)
{
+ UNUSED(cmd_fd);
+ UNUSED(size);
+ UNUSED(user_id);
+
//bdld("cmd type:%d, size:%d", type, size);
switch(type)
{
diff --git a/btif/src/btif_config_util.cpp b/btif/src/btif_config_util.cpp
index 885f5c2..0cc2b36 100644
--- a/btif/src/btif_config_util.cpp
+++ b/btif/src/btif_config_util.cpp
@@ -470,6 +470,8 @@
{
error("open_file_map fail, fd:%d, path:%s, size:%d", fd, path, size);
//debug("out");
+ if (fd >= 0)
+ close(fd);
return FALSE;
}
//get local bt device name from bluez config
@@ -539,6 +541,8 @@
{
error("open_file_map fail, fd:%d, path:%s, size:%d", fd, path, size);
//debug("out");
+ if (fd >= 0)
+ close(fd);
return FALSE;
}
int line_size = 0;
@@ -597,6 +601,8 @@
{
error("open_file_map fail, fd:%d, path:%s, size:%d", fd, path, size);
//debug("out");
+ if (fd >= 0)
+ close(fd);
return FALSE;
}
int pos = 0;
diff --git a/btif/src/btif_core.c b/btif/src/btif_core.c
index 40f19d0..7d17ebf 100644
--- a/btif/src/btif_core.c
+++ b/btif/src/btif_core.c
@@ -37,6 +37,7 @@
#define LOG_TAG "BTIF_CORE"
#include "btif_api.h"
+#include "bt_utils.h"
#include "bta_api.h"
#include "gki.h"
#include "btu.h"
@@ -274,6 +275,7 @@
{
UINT16 event;
BT_HDR *p_msg;
+ UNUSED(params);
BTIF_TRACE_DEBUG0("btif task starting");
@@ -737,6 +739,14 @@
{
BTIF_TRACE_DEBUG1("%s", __FUNCTION__);
+ if (btif_core_state == BTIF_CORE_STATE_DISABLING)
+ {
+ BTIF_TRACE_WARNING0("shutdown during disabling");
+ /* shutdown called before disabling is done */
+ btif_shutdown_pending = 1;
+ return BT_STATUS_NOT_READY;
+ }
+
if (btif_is_enabled())
{
BTIF_TRACE_WARNING0("shutdown while still enabled, initiate disable");
@@ -765,6 +775,8 @@
btif_dut_mode = 0;
+ bt_utils_cleanup();
+
BTIF_TRACE_DEBUG1("%s done", __FUNCTION__);
return BT_STATUS_SUCCESS;
@@ -810,6 +822,7 @@
*******************************************************************************/
static void btif_dut_mode_cback( tBTM_VSC_CMPL *p )
{
+ UNUSED(p);
/* For now nothing to be done. */
}
diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c
index b2e80d3..cd75b3e 100644
--- a/btif/src/btif_dm.c
+++ b/btif/src/btif_dm.c
@@ -1936,6 +1936,25 @@
/*******************************************************************************
**
+** Function btif_dm_hh_open_failed
+**
+** Description informs the upper layers if the HH have failed during bonding
+**
+** Returns none
+**
+*******************************************************************************/
+
+void btif_dm_hh_open_failed(bt_bdaddr_t *bdaddr)
+{
+ if (pairing_cb.state == BT_BOND_STATE_BONDING &&
+ bdcmp(bdaddr->address, pairing_cb.bd_addr) == 0)
+ {
+ bond_state_changed(BT_STATUS_FAIL, bdaddr, BT_BOND_STATE_NONE);
+ }
+}
+
+/*******************************************************************************
+**
** Function btif_dm_remove_bond
**
** Description Removes bonding with the specified device
@@ -2010,11 +2029,12 @@
** 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)
{
+ UNUSED(passkey);
+
if (variant == BT_SSP_VARIANT_PASSKEY_ENTRY)
{
/* This is not implemented in the stack.
diff --git a/btif/src/btif_gatt_client.c b/btif/src/btif_gatt_client.c
index ce51ce2..10332b4 100644
--- a/btif/src/btif_gatt_client.c
+++ b/btif/src/btif_gatt_client.c
@@ -104,8 +104,8 @@
typedef struct
{
- tBTM_BLE_AD_MASK mask;
- tBTM_BLE_ADV_DATA data;
+ tBTA_BLE_AD_MASK mask;
+ tBTA_BLE_ADV_DATA data;
} btgatt_adv_data;
typedef struct
@@ -819,17 +819,46 @@
break;
case BTIF_GATTC_LISTEN:
+#if (defined(BLE_PERIPHERAL_MODE_SUPPORT) && (BLE_PERIPHERAL_MODE_SUPPORT == TRUE))
BTA_GATTC_Listen(p_cb->client_if, p_cb->start, NULL);
+#else
+ BTA_DmBleBroadcast(p_cb->start);
+#endif
break;
case BTIF_GATTC_SET_ADV_DATA:
{
if (p_cb->start == 0)
- BTM_BleWriteAdvData(p_cb->adv_data.mask, &p_cb->adv_data.data);
+ BTA_DmBleSetAdvConfig(p_cb->adv_data.mask, &p_cb->adv_data.data);
else
- BTM_BleWriteScanRsp(p_cb->adv_data.mask, &p_cb->adv_data.data);
+ BTA_DmBleSetScanRsp(p_cb->adv_data.mask, &p_cb->adv_data.data);
+
+ // Cleanup ...
+
+ // ... manufacturer data
if (p_cb->adv_data.data.manu.p_val != NULL)
GKI_freebuf(p_cb->adv_data.data.manu.p_val);
+
+ // ... service data
+ if (p_cb->adv_data.data.p_proprietary != NULL)
+ {
+ int i = 0;
+ tBTA_BLE_PROP_ELEM *p_elem = p_cb->adv_data.data.p_proprietary->p_elem;
+ while (i++ != p_cb->adv_data.data.p_proprietary->num_elem && p_elem)
+ {
+ if (p_elem->p_val != NULL)
+ GKI_freebuf(p_elem->p_val);
+ ++p_elem;
+ }
+ if (p_cb->adv_data.data.p_proprietary->p_elem != NULL)
+ GKI_freebuf(p_cb->adv_data.data.p_proprietary->p_elem);
+ GKI_freebuf(p_cb->adv_data.data.p_proprietary);
+ }
+
+ // ... service list
+ if (p_cb->adv_data.data.services.p_uuid != NULL)
+ GKI_freebuf(p_cb->adv_data.data.services.p_uuid);
+
break;
}
@@ -904,7 +933,9 @@
static bt_status_t btif_gattc_set_adv_data(int client_if, bool set_scan_rsp, bool include_name,
bool include_txpower, int min_interval, int max_interval, int appearance,
- uint16_t manufacturer_len, char* manufacturer_data)
+ uint16_t manufacturer_len, char* manufacturer_data,
+ uint16_t service_data_len, char* service_data,
+ uint16_t service_uuid_len, char* service_uuid)
{
CHECK_BTGATT_INIT();
btif_gattc_cb_t btif_cb;
@@ -950,6 +981,116 @@
}
}
+ tBTA_BLE_PROP_ELEM *p_elem_service_data = NULL;
+ tBTA_BLE_PROP_ELEM *p_elem_service_128 = NULL;
+
+ if (service_data_len > 0 && service_data != NULL)
+ {
+ p_elem_service_data = GKI_getbuf(sizeof(tBTA_BLE_PROP_ELEM));
+ if (p_elem_service_data != NULL)
+ {
+ p_elem_service_data->p_val = GKI_getbuf(service_data_len);
+ if (p_elem_service_data->p_val != NULL)
+ {
+ p_elem_service_data->adv_type = BTM_BLE_AD_TYPE_SERVICE_DATA;
+ p_elem_service_data->len = service_data_len;
+ memcpy(p_elem_service_data->p_val, service_data, service_data_len);
+
+ } else {
+ GKI_freebuf(p_elem_service_data);
+ p_elem_service_data = NULL;
+ }
+ }
+ }
+
+ if (service_uuid_len > 0 && service_uuid != NULL)
+ {
+ btif_cb.adv_data.data.services.list_cmpl = FALSE;
+ btif_cb.adv_data.data.services.num_service = 0;
+
+ btif_cb.adv_data.data.services.p_uuid =
+ GKI_getbuf(service_uuid_len / LEN_UUID_128 * LEN_UUID_16);
+ if (btif_cb.adv_data.data.services.p_uuid != NULL)
+ {
+ UINT16 *p_uuid_out = btif_cb.adv_data.data.services.p_uuid;
+ while (service_uuid_len >= LEN_UUID_128)
+ {
+ bt_uuid_t uuid;
+ memset(&uuid, 0, sizeof(bt_uuid_t));
+ memcpy(&uuid.uu, service_uuid, LEN_UUID_128);
+
+ tBT_UUID bt_uuid;
+ memset(&bt_uuid, 0, sizeof(tBT_UUID));
+ btif_to_bta_uuid(&bt_uuid, &uuid);
+
+ if (bt_uuid.len == LEN_UUID_16)
+ {
+ btif_cb.adv_data.mask |= BTM_BLE_AD_BIT_SERVICE;
+ ++btif_cb.adv_data.data.services.num_service;
+ *p_uuid_out++ = bt_uuid.uu.uuid16;
+
+ } else if (bt_uuid.len == LEN_UUID_128 && p_elem_service_128 == NULL) {
+ /* Currently, only one 128-bit UUID is supported */
+ p_elem_service_128 = GKI_getbuf(sizeof(tBTA_BLE_PROP_ELEM));
+ if (p_elem_service_128 != NULL)
+ {
+ p_elem_service_128->p_val = GKI_getbuf(LEN_UUID_128);
+ if (p_elem_service_128->p_val != NULL)
+ {
+ p_elem_service_128->adv_type = BTM_BLE_AD_TYPE_128SRV_PART;
+ p_elem_service_128->len = LEN_UUID_128;
+ memcpy(p_elem_service_128->p_val, bt_uuid.uu.uuid128, LEN_UUID_128);
+
+ } else {
+ GKI_freebuf(p_elem_service_128);
+ p_elem_service_128 = NULL;
+ }
+ }
+ }
+
+ service_uuid += LEN_UUID_128;
+ service_uuid_len -= LEN_UUID_128;
+ }
+ }
+ }
+
+ if (p_elem_service_data != NULL || p_elem_service_128 != NULL)
+ {
+ btif_cb.adv_data.data.p_proprietary = GKI_getbuf(sizeof(tBTA_BLE_PROPRIETARY));
+ if (btif_cb.adv_data.data.p_proprietary != NULL)
+ {
+ tBTA_BLE_PROPRIETARY *p_prop = btif_cb.adv_data.data.p_proprietary;
+ tBTA_BLE_PROP_ELEM *p_elem = NULL;
+ p_prop->num_elem = 0;
+ btif_cb.adv_data.mask |= BTM_BLE_AD_BIT_PROPRIETARY;
+
+ if (p_elem_service_128 != NULL)
+ ++p_prop->num_elem;
+
+ if (p_elem_service_data != NULL)
+ ++p_prop->num_elem;
+
+ p_prop->p_elem = GKI_getbuf(sizeof(tBTA_BLE_PROP_ELEM) * p_prop->num_elem);
+ p_elem = p_prop->p_elem;
+
+ if (p_elem_service_128 != NULL)
+ {
+ memcpy(p_elem++, p_elem_service_128, sizeof(tBTA_BLE_PROP_ELEM));
+ GKI_freebuf(p_elem_service_128);
+ }
+
+ if (p_elem_service_data != NULL)
+ {
+ memcpy(p_elem++, p_elem_service_data, sizeof(tBTA_BLE_PROP_ELEM));
+ GKI_freebuf(p_elem_service_data);
+ }
+ }
+ }
+
+#if (defined(BLE_PERIPHERAL_ADV_NAME) && (BLE_PERIPHERAL_ADV_NAME == TRUE))
+ btif_cb.adv_data.mask |= BTM_BLE_AD_BIT_DEV_NAME;
+#endif
+
return btif_transfer_context(btgattc_handle_event, BTIF_GATTC_SET_ADV_DATA,
(char*) &btif_cb, sizeof(btif_gattc_cb_t), NULL);
}
diff --git a/btif/src/btif_gatt_test.c b/btif/src/btif_gatt_test.c
index 8c23d56..a2cca6a 100644
--- a/btif/src/btif_gatt_test.c
+++ b/btif/src/btif_gatt_test.c
@@ -103,6 +103,10 @@
static void btif_test_connect_cback(tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_id,
BOOLEAN connected, tGATT_DISCONN_REASON reason)
{
+ UNUSED(gatt_if);
+ UNUSED(bda);
+ UNUSED(reason);
+
ALOGD("%s: conn_id=%d, connected=%d", __FUNCTION__, conn_id, connected);
test_cb.conn_id = connected ? conn_id : 0;
}
@@ -137,6 +141,7 @@
tGATT_DISC_RES *p_data)
{
char str_buf[50];
+ UNUSED(conn_id);
ALOGD("------ GATT Discovery result %-22s -------", disc_name[disc_type]);
ALOGD(" Attribute handle: 0x%04x (%d)", p_data->handle, p_data->handle);
@@ -188,6 +193,8 @@
tGATT_DISC_TYPE disc_type,
tGATT_STATUS status)
{
+ UNUSED(conn_id);
+ UNUSED(disc_type);
ALOGD("%s: status=%d", __FUNCTION__, status);
}
@@ -197,6 +204,7 @@
btif_test_command_complete_cback,
btif_test_discovery_result_cback,
btif_test_discovery_complete_cback,
+ NULL,
NULL
};
diff --git a/btif/src/btif_hf.c b/btif/src/btif_hf.c
index 7688e68..b4ade0d 100644
--- a/btif/src/btif_hf.c
+++ b/btif/src/btif_hf.c
@@ -452,6 +452,8 @@
*******************************************************************************/
static void btif_in_hf_generic_evt(UINT16 event, char *p_param)
{
+ UNUSED(p_param);
+
BTIF_TRACE_EVENT2("%s: event=%d", __FUNCTION__, event);
switch (event) {
case BTIF_HFP_CB_AUDIO_CONNECTING:
diff --git a/btif/src/btif_hh.c b/btif/src/btif_hh.c
index 1c64e3e..50cfb8a 100644
--- a/btif/src/btif_hh.c
+++ b/btif/src/btif_hh.c
@@ -159,6 +159,7 @@
extern void btif_dm_cb_remove_bond(bt_bdaddr_t *bd_addr);
extern BOOLEAN check_cod_hid(const bt_bdaddr_t *remote_bdaddr, uint32_t cod);
extern int scru_ascii_2_hex(char *p_ascii, int len, UINT8 *p_hex);
+extern void btif_dm_hh_open_failed(bt_bdaddr_t *bdaddr);
/*****************************************************************************
** Local Function prototypes
@@ -533,6 +534,9 @@
return;
}
+ /* need to notify up-layer device is disconnected to avoid state out of sync with up-layer */
+ HAL_CBACK(bt_hh_callbacks, connection_state_cb, &(p_dev->bd_addr), BTHH_CONN_STATE_DISCONNECTED);
+
p_dev->dev_status = BTHH_CONN_STATE_UNKNOWN;
p_dev->dev_handle = BTA_HH_INVALID_HANDLE;
if (btif_hh_cb.device_num > 0) {
@@ -842,6 +846,7 @@
}
else {
bt_bdaddr_t *bdaddr = (bt_bdaddr_t*)p_data->conn.bda;
+ btif_dm_hh_open_failed(bdaddr);
HAL_CBACK(bt_hh_callbacks, connection_state_cb, (bt_bdaddr_t*) &p_data->conn.bda,BTHH_CONN_STATE_DISCONNECTED);
btif_hh_cb.status = BTIF_HH_DEV_DISCONNECTED;
}
@@ -852,12 +857,6 @@
p_dev = btif_hh_find_connected_dev_by_handle(p_data->dev_status.handle);
if (p_dev != NULL) {
BTIF_TRACE_DEBUG2("%s: uhid fd = %d", __FUNCTION__, p_dev->fd);
- if (p_dev->fd >= 0){
- UINT8 hidreport[9];
- memset(hidreport,0,9);
- hidreport[0]=1;
- bta_hh_co_write(p_dev->fd , hidreport, sizeof(hidreport));
- }
if(p_dev->vup_timer_active)
{
btif_hh_stop_vup_timer(&(p_dev->bd_addr));
@@ -873,14 +872,28 @@
BTIF_TRACE_WARNING1("Error: cannot find device with handle %d", p_data->dev_status.handle);
}
break;
- case BTA_HH_GET_RPT_EVT:
+ case BTA_HH_GET_RPT_EVT: {
+ BT_HDR *hdr = p_data->hs_data.rsp_data.p_rpt_data;
+ UINT8 *data = NULL;
+ UINT16 len = 0;
+
BTIF_TRACE_DEBUG2("BTA_HH_GET_RPT_EVT: status = %d, handle = %d",
p_data->hs_data.status, p_data->hs_data.handle);
- p_dev = btif_hh_find_connected_dev_by_handle(p_data->conn.handle);
- HAL_CBACK(bt_hh_callbacks, get_report_cb,(bt_bdaddr_t*) &(p_dev->bd_addr), (bthh_status_t) p_data->hs_data.status,
- (uint8_t*) p_data->hs_data.rsp_data.p_rpt_data, BT_HDR_SIZE);
+ /* p_rpt_data in HANDSHAKE response case */
+ if (hdr) {
+ data = (UINT8 *)(hdr + 1) + hdr->offset;
+ len = hdr->len;
+ }
+ p_dev = btif_hh_find_connected_dev_by_handle(p_data->hs_data.handle);
+ if (p_dev) {
+ HAL_CBACK(bt_hh_callbacks, get_report_cb,
+ (bt_bdaddr_t*) &(p_dev->bd_addr),
+ (bthh_status_t) p_data->hs_data.status, data, len);
+ } else {
+ BTIF_TRACE_WARNING1("Error: cannot find device with handle %d", p_data->hs_data.handle);
+ }
break;
-
+ }
case BTA_HH_SET_RPT_EVT:
BTIF_TRACE_DEBUG2("BTA_HH_SET_RPT_EVT: status = %d, handle = %d",
p_data->dev_status.status, p_data->dev_status.handle);
@@ -935,9 +948,18 @@
}
{
char *cached_name = NULL;
- char name[] = "Broadcom Bluetooth HID";
- if (cached_name == NULL) {
- cached_name = name;
+ bt_bdname_t bdname;
+ bt_property_t prop_name;
+ BTIF_STORAGE_FILL_PROPERTY(&prop_name, BT_PROPERTY_BDNAME,
+ sizeof(bt_bdname_t), &bdname);
+ if (btif_storage_get_remote_device_property(
+ &p_dev->bd_addr, &prop_name) == BT_STATUS_SUCCESS)
+ {
+ cached_name = (char *)bdname.name;
+ }
+ else
+ {
+ cached_name = "Bluetooth HID";
}
BTIF_TRACE_WARNING2("%s: name = %s", __FUNCTION__, cached_name);
@@ -961,6 +983,7 @@
ret = btif_storage_add_hid_device_info(&(p_dev->bd_addr), p_dev->attr_mask,p_dev->sub_class,p_dev->app_id,
p_data->dscp_info.vendor_id, p_data->dscp_info.product_id,
p_data->dscp_info.version, p_data->dscp_info.ctry_code,
+ p_data->dscp_info.ssr_max_latency, p_data->dscp_info.ssr_min_tout,
len, p_data->dscp_info.descriptor.dsc_list);
ASSERTC(ret == BT_STATUS_SUCCESS, "storing hid info failed", ret);
@@ -1414,6 +1437,8 @@
*******************************************************************************/
static bt_status_t set_idle_time (bt_bdaddr_t *bd_addr, uint8_t idle_time)
{
+ UNUSED(idle_time);
+
CHECK_BTHH_INIT();
btif_hh_device_t *p_dev;
BD_ADDR* bda = (BD_ADDR*) bd_addr;
@@ -1452,6 +1477,7 @@
CHECK_BTHH_INIT();
btif_hh_device_t *p_dev;
BD_ADDR* bda = (BD_ADDR*) bd_addr;
+ UNUSED(protocolMode);
BTIF_TRACE_DEBUG6(" addr = %02X:%02X:%02X:%02X:%02X:%02X",
(*bda)[0], (*bda)[1], (*bda)[2], (*bda)[3], (*bda)[4], (*bda)[5]);
@@ -1463,6 +1489,7 @@
p_dev = btif_hh_find_connected_dev_by_bda(bd_addr);
if (p_dev != NULL) {
+
BTA_HhGetProtoMode(p_dev->dev_handle);
}
else {
@@ -1620,7 +1647,6 @@
//TODO
hex_bytes_filled = ascii_2_hex(report, len, hexbuf);
ALOGI("Hex bytes filled, hex value: %d", hex_bytes_filled);
-
if (hex_bytes_filled) {
UINT8* pbuf_data;
pbuf_data = (UINT8*) (p_dev->p_buf + 1) + p_dev->p_buf->offset;
diff --git a/btif/src/btif_hl.c b/btif/src/btif_hl.c
index 28a1461..e80a0b9 100644
--- a/btif/src/btif_hl.c
+++ b/btif/src/btif_hl.c
@@ -1857,21 +1857,22 @@
UINT8 *p_app_idx){
btif_hl_app_cb_t *p_acb;
BOOLEAN found=FALSE;
- UINT8 i,j;
+ UINT8 i;
for (i=0; i<BTA_HL_NUM_APPS; i++)
{
p_acb =BTIF_HL_GET_APP_CB_PTR(i);
- if (p_acb->delete_mdl.active)
- BTIF_TRACE_DEBUG3("btif_hl_find_app_idx_using_deleted_mdl_id: app_idx=%d,"
- "mcl_idx =%d mcl_handle=%d",i,j,p_acb->mcb[j].mcl_handle);
- if (p_acb->delete_mdl.active &&
- (p_acb->delete_mdl.mdl_id == mdl_id))
- {
- found = TRUE;
- *p_app_idx = i;
- break;
- }
+ if (p_acb->delete_mdl.active) {
+ BTIF_TRACE_DEBUG3("btif_hl_find_app_idx_using_deleted_mdl_id: app_idx=%d,"
+ "mdl_id=%d mcl_handle=%d",i,mdl_id,p_acb->mcb[i].mcl_handle);
+ }
+ if (p_acb->delete_mdl.active &&
+ (p_acb->delete_mdl.mdl_id == mdl_id))
+ {
+ found = TRUE;
+ *p_app_idx = i;
+ break;
+ }
}
BTIF_TRACE_DEBUG3("%s found=%d app_idx=%d",__FUNCTION__,
found, i);
@@ -2823,7 +2824,7 @@
btif_hl_app_cb_t *p_acb;
btif_hl_mcl_cb_t *p_mcb;
btif_hl_mdl_cb_t *p_dcb;
- UINT8 app_idx,orig_app_idx, mcl_idx, mdl_idx, mdep_cfg_idx;
+ UINT8 orig_app_idx, mcl_idx, mdl_idx, mdep_cfg_idx;
UINT8 dc_cfg;
BOOLEAN close_dch = FALSE;
@@ -2856,7 +2857,7 @@
if(btif_hl_find_channel_id_using_mdl_id(orig_app_idx,p_dcb->mdl_id , &p_dcb->channel_id))
{
BTIF_TRACE_DEBUG4(" app_idx=%d mcl_idx=%d mdl_idx=%d channel_id=%d",
- app_idx, mcl_idx, mdl_idx, p_dcb->channel_id );
+ orig_app_idx, mcl_idx, mdl_idx, p_dcb->channel_id );
if (!btif_hl_create_socket(orig_app_idx, mcl_idx, mdl_idx))
{
BTIF_TRACE_ERROR0("Unable to create socket");
@@ -3262,6 +3263,7 @@
tBTA_HL_STATUS status){
UINT8 app_idx,mcl_idx, mdl_idx;
btif_hl_mdl_cb_t *p_dcb;
+ UNUSED(status);
BTIF_TRACE_DEBUG1("%s", __FUNCTION__);
if (btif_hl_find_mdl_idx_using_handle(mdl_handle,
@@ -3301,7 +3303,7 @@
/*******************************************************************************
**
-** Function btif_hl_proc_cb_evt
+** Function btif_hl_proc_reg_request
**
** Description Process registration request
**
@@ -3314,6 +3316,8 @@
bt_status_t status= BT_STATUS_SUCCESS;
UINT8 i;
btif_hl_app_data_t *p_data;
+ UNUSED(p_cback);
+
BTIF_TRACE_DEBUG3("%s app_idx=%d app_id=%d", __FUNCTION__, app_idx, app_id);
if(reg_counter >1)
@@ -4929,6 +4933,7 @@
btif_hl_soc_cb_t *p_scb = NULL;
btif_hl_mdl_cb_t *p_dcb = NULL;
int r;
+ UNUSED(p_org_set);
BTIF_TRACE_DEBUG1("entering %s",__FUNCTION__);
@@ -5131,6 +5136,7 @@
static void *btif_hl_select_thread(void *arg){
fd_set org_set, curr_set;
int r, max_curr_s, max_org_s;
+ UNUSED(arg);
BTIF_TRACE_DEBUG0("entered btif_hl_select_thread");
FD_ZERO(&org_set);
diff --git a/btif/src/btif_media_task.c b/btif/src/btif_media_task.c
index ff9f92c..0b9b613 100755
--- a/btif/src/btif_media_task.c
+++ b/btif/src/btif_media_task.c
@@ -66,7 +66,6 @@
#include "btif_av.h"
#include "btif_sm.h"
#include "btif_util.h"
-#include "bt_utils.h"
/*****************************************************************************
** Constants
@@ -88,6 +87,7 @@
#define BTIF_MEDIA_TASK_CMD_MBOX TASK_MBOX_0 /* cmd mailbox */
#define BTIF_MEDIA_TASK_DATA_MBOX TASK_MBOX_1 /* data mailbox */
+
/* BTIF media cmd event definition : BTIF_MEDIA_TASK_CMD */
enum
{
@@ -120,6 +120,7 @@
(1000/TICKS_PER_SEC) (10) */
#define BTIF_MEDIA_TIME_TICK (20 * BTIF_MEDIA_NUM_TICK)
+#define A2DP_DATA_READ_POLL_MS (BTIF_MEDIA_TIME_TICK / 2)
/* buffer pool */
#define BTIF_MEDIA_AA_POOL_ID GKI_POOL_ID_3
@@ -175,8 +176,11 @@
but due to link flow control or thread preemption in lower
layers we might need to temporarily buffer up data */
-/* 24 frames is equivalent to 6.89*24*2.9 ~= 480 ms @ 44.1 khz, 20 ms mediatick */
-#define MAX_OUTPUT_A2DP_FRAME_QUEUE_SZ 24
+/* 18 frames is equivalent to 6.89*18*2.9 ~= 360 ms @ 44.1 khz, 20 ms mediatick */
+#define MAX_OUTPUT_A2DP_FRAME_QUEUE_SZ 18
+#define A2DP_PACKET_COUNT_LOW_WATERMARK 5
+#define MAX_PCM_FRAME_NUM_PER_TICK 40
+#define RESET_RATE_COUNTER_THRESHOLD_MS 2000
//#define BTIF_MEDIA_VERBOSE_ENABLED
@@ -199,6 +203,10 @@
INT32 aa_feed_residue;
UINT32 counter;
UINT32 bytes_per_tick; /* pcm bytes read each media task tick */
+ UINT32 max_counter_exit;
+ UINT32 max_counter_enter;
+ UINT32 overflow_count;
+ BOOLEAN overflow;
} tBTIF_AV_MEDIA_FEEDINGS_PCM_STATE;
@@ -517,6 +525,8 @@
static void btif_a2dp_ctrl_cb(tUIPC_CH_ID ch_id, tUIPC_EVENT event)
{
+ UNUSED(ch_id);
+
APPL_TRACE_DEBUG1("A2DP-CTRL-CHANNEL EVENT %s", dump_uipc_event(event));
switch(event)
@@ -544,6 +554,8 @@
static void btif_a2dp_data_cb(tUIPC_CH_ID ch_id, tUIPC_EVENT event)
{
+ UNUSED(ch_id);
+
APPL_TRACE_DEBUG1("BTIF MEDIA (A2DP-DATA) EVENT %s", dump_uipc_event(event));
switch(event)
@@ -553,7 +565,8 @@
/* read directly from media task from here on (keep callback for
connection events */
UIPC_Ioctl(UIPC_CH_ID_AV_AUDIO, UIPC_REG_REMOVE_ACTIVE_READSET, NULL);
-
+ UIPC_Ioctl(UIPC_CH_ID_AV_AUDIO, UIPC_SET_READ_POLL_TMO,
+ (void *)A2DP_DATA_READ_POLL_MS);
/* Start the media task to encode SBC */
btif_media_task_start_aa_req();
@@ -1105,6 +1118,7 @@
{
UINT16 event;
BT_HDR *p_msg;
+ UNUSED(p);
VERBOSE("================ MEDIA TASK STARTING ================");
@@ -1428,6 +1442,8 @@
*******************************************************************************/
static void btif_media_task_aa_tx_flush(BT_HDR *p_msg)
{
+ UNUSED(p_msg);
+
/* Flush all enqueued GKI music buffers (encoded) */
APPL_TRACE_DEBUG0("btif_media_task_aa_tx_flush");
@@ -1772,6 +1788,11 @@
*******************************************************************************/
static void btif_media_task_feeding_state_reset(void)
{
+ APPL_TRACE_WARNING3("overflow %d, enter %d, exit %d",
+ btif_media_cb.media_feeding_state.pcm.overflow_count,
+ btif_media_cb.media_feeding_state.pcm.max_counter_enter,
+ btif_media_cb.media_feeding_state.pcm.max_counter_exit);
+
/* By default, just clear the entire state */
memset(&btif_media_cb.media_feeding_state, 0, sizeof(btif_media_cb.media_feeding_state));
@@ -1852,7 +1873,7 @@
*******************************************************************************/
static UINT8 btif_get_num_aa_frame(void)
{
- UINT8 result=0;
+ UINT32 result=0;
switch (btif_media_cb.TxTranscoding)
{
@@ -1865,11 +1886,24 @@
btif_media_cb.media_feeding_state.pcm.counter +=
btif_media_cb.media_feeding_state.pcm.bytes_per_tick;
+ if ((!btif_media_cb.media_feeding_state.pcm.overflow) ||
+ (btif_media_cb.TxAaQ.count < A2DP_PACKET_COUNT_LOW_WATERMARK)) {
+ if (btif_media_cb.media_feeding_state.pcm.overflow) {
+ btif_media_cb.media_feeding_state.pcm.overflow = FALSE;
- /* calculate nbr of frames pending for this media tick */
- result = btif_media_cb.media_feeding_state.pcm.counter/pcm_bytes_per_frame;
- btif_media_cb.media_feeding_state.pcm.counter -= result*pcm_bytes_per_frame;
-
+ if (btif_media_cb.media_feeding_state.pcm.counter >
+ btif_media_cb.media_feeding_state.pcm.max_counter_exit) {
+ btif_media_cb.media_feeding_state.pcm.max_counter_exit =
+ btif_media_cb.media_feeding_state.pcm.counter;
+ }
+ }
+ /* calculate nbr of frames pending for this media tick */
+ result = btif_media_cb.media_feeding_state.pcm.counter/pcm_bytes_per_frame;
+ if (result > MAX_PCM_FRAME_NUM_PER_TICK) result = MAX_PCM_FRAME_NUM_PER_TICK;
+ btif_media_cb.media_feeding_state.pcm.counter -= result*pcm_bytes_per_frame;
+ } else {
+ result = 0;
+ }
VERBOSE("WRITE %d FRAMES", result);
}
break;
@@ -1885,7 +1919,7 @@
APPL_TRACE_DEBUG1("btif_get_num_aa_frame returns %d", result);
#endif
- return result;
+ return (UINT8)result;
}
/*******************************************************************************
@@ -2182,6 +2216,32 @@
{
GKI_freebuf(p_buf);
}
+
+ if (btif_media_cb.TxAaQ.count >= MAX_OUTPUT_A2DP_FRAME_QUEUE_SZ) {
+ UINT32 reset_rate_bytes = btif_media_cb.media_feeding_state.pcm.bytes_per_tick *
+ (RESET_RATE_COUNTER_THRESHOLD_MS / BTIF_MEDIA_TIME_TICK);
+ btif_media_cb.media_feeding_state.pcm.overflow = TRUE;
+ btif_media_cb.media_feeding_state.pcm.counter += nb_frame *
+ btif_media_cb.encoder.s16NumOfSubBands *
+ btif_media_cb.encoder.s16NumOfBlocks *
+ btif_media_cb.media_feeding.cfg.pcm.num_channel *
+ btif_media_cb.media_feeding.cfg.pcm.bit_per_sample / 8;
+
+ btif_media_cb.media_feeding_state.pcm.overflow_count++;
+ if (btif_media_cb.media_feeding_state.pcm.counter >
+ btif_media_cb.media_feeding_state.pcm.max_counter_enter) {
+ btif_media_cb.media_feeding_state.pcm.max_counter_enter =
+ btif_media_cb.media_feeding_state.pcm.counter;
+ }
+
+ if (btif_media_cb.media_feeding_state.pcm.counter > reset_rate_bytes) {
+ btif_media_cb.media_feeding_state.pcm.counter = 0;
+ APPL_TRACE_WARNING0("btif_media_aa_prep_sbc_2_send:reset rate counter");
+ }
+
+ /* no more pcm to read */
+ nb_frame = 0;
+ }
}
}
@@ -2201,13 +2261,6 @@
VERBOSE("btif_media_aa_prep_2_send : %d frames (queue %d)", nb_frame,
btif_media_cb.TxAaQ.count);
- while (btif_media_cb.TxAaQ.count >= MAX_OUTPUT_A2DP_FRAME_QUEUE_SZ)
- {
- APPL_TRACE_WARNING1("btif_media_aa_prep_2_send congestion buf count %d",
- btif_media_cb.TxAaQ.count);
- GKI_freebuf(GKI_dequeue(&(btif_media_cb.TxAaQ)));
- }
-
switch (btif_media_cb.TxTranscoding)
{
case BTIF_MEDIA_TRSCD_PCM_2_SBC:
@@ -2237,8 +2290,10 @@
/* get the number of frame to send */
nb_frame_2_send = btif_get_num_aa_frame();
- /* format and Q buffer to send */
- btif_media_aa_prep_2_send(nb_frame_2_send);
+ if (nb_frame_2_send != 0) {
+ /* format and Q buffer to send */
+ btif_media_aa_prep_2_send(nb_frame_2_send);
+ }
/* send it */
VERBOSE("btif_media_send_aa_frame : send %d frames", nb_frame_2_send);
diff --git a/btif/src/btif_pan.c b/btif/src/btif_pan.c
index 633f6ef..4824627 100644
--- a/btif/src/btif_pan.c
+++ b/btif/src/btif_pan.c
@@ -389,6 +389,8 @@
int btpan_tap_send(int tap_fd, const BD_ADDR src, const BD_ADDR dst, UINT16 proto, const char* buf,
UINT16 len, BOOLEAN ext, BOOLEAN forward)
{
+ UNUSED(ext);
+ UNUSED(forward);
if(tap_fd != -1)
{
tETH_HDR eth_hdr;
@@ -606,6 +608,9 @@
{
char packet[MAX_PACKET_SIZE];
tETH_HDR eth_hdr;
+ UNUSED(type);
+ UNUSED(user_id);
+
if(flags & SOCK_THREAD_FD_EXCEPTION)
{
BTIF_TRACE_ERROR1("pan tap fd:%d exception", fd);
diff --git a/btif/src/btif_rc.c b/btif/src/btif_rc.c
index d4ac0f1..b2cd335 100755
--- a/btif/src/btif_rc.c
+++ b/btif/src/btif_rc.c
@@ -764,6 +764,8 @@
/* clear the queued PLAY command. if bSend is TRUE, forward to app */
void btif_rc_check_handle_pending_play (BD_ADDR peer_addr, BOOLEAN bSendToApp)
{
+ UNUSED(peer_addr);
+
BTIF_TRACE_DEBUG2("%s: bSendToApp=%d", __FUNCTION__, bSendToApp);
if (btif_rc_cb.rc_pending_play)
{
diff --git a/btif/src/btif_sock_rfc.c b/btif/src/btif_sock_rfc.c
index 2de1cd4..24bc546 100644
--- a/btif/src/btif_sock_rfc.c
+++ b/btif/src/btif_sock_rfc.c
@@ -638,6 +638,7 @@
}
static void on_rfc_close(tBTA_JV_RFCOMM_CLOSE * p_close, uint32_t id)
{
+ UNUSED(p_close);
lock_slot(&slot_lock);
rfc_slot_t* rs = find_rfc_slot_by_id(id);
if(rs)
@@ -653,6 +654,8 @@
}
static void on_rfc_write_done(tBTA_JV_RFCOMM_WRITE *p, uint32_t id)
{
+ UNUSED(p);
+
lock_slot(&slot_lock);
rfc_slot_t* rs = find_rfc_slot_by_id(id);
if(rs && !rs->f.outgoing_congest)
diff --git a/btif/src/btif_storage.c b/btif/src/btif_storage.c
index f566df4..e73e9a2 100644
--- a/btif/src/btif_storage.c
+++ b/btif/src/btif_storage.c
@@ -1361,7 +1361,8 @@
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 ssr_max_latency,
+ UINT16 ssr_min_tout, UINT16 dl_len, UINT8 *dsc_list)
{
bdstr_t bdstr;
BTIF_TRACE_DEBUG0("btif_storage_add_hid_device_info:");
@@ -1373,6 +1374,8 @@
btif_config_set_int("Remote", bdstr, "HidProductId", product_id);
btif_config_set_int("Remote", bdstr, "HidVersion", version);
btif_config_set_int("Remote", bdstr, "HidCountryCode", ctry_code);
+ btif_config_set_int("Remote", bdstr, "HidSSRMaxLatency", ssr_max_latency);
+ btif_config_set_int("Remote", bdstr, "HidSSRMinTimeout", ssr_min_tout);
if(dl_len > 0)
btif_config_set("Remote", bdstr, "HidDescriptor", (const char*)dsc_list, dl_len,
BTIF_CFG_TYPE_BIN);
@@ -1433,6 +1436,14 @@
btif_config_get_int("Remote", kname, "HidCountryCode", &value);
dscp_info.ctry_code = (uint8_t) value;
+ value = 0;
+ btif_config_get_int("Remote", kname, "HidSSRMaxLatency", &value);
+ dscp_info.ssr_max_latency = (uint16_t) value;
+
+ value = 0;
+ btif_config_get_int("Remote", kname, "HidSSRMinTimeout", &value);
+ dscp_info.ssr_min_tout = (uint16_t) value;
+
int len = 0;
int type;
btif_config_get("Remote", kname, "HidDescriptor", NULL, &len, &type);
@@ -1479,6 +1490,8 @@
btif_config_remove("Remote", bdstr, "HidProductId");
btif_config_remove("Remote", bdstr, "HidVersion");
btif_config_remove("Remote", bdstr, "HidCountryCode");
+ btif_config_remove("Remote", bdstr, "HidSSRMaxLatency");
+ btif_config_remove("Remote", bdstr, "HidSSRMinTimeout");
btif_config_remove("Remote", bdstr, "HidDescriptor");
btif_config_save();
return BT_STATUS_SUCCESS;
@@ -1501,7 +1514,7 @@
if (!btif_config_exist("Local", BTIF_STORAGE_HL_APP, BTIF_STORAGE_HL_APP_CB))
{
- memset(value, value_size, 0);
+ memset(value, 0, value_size);
if (!btif_config_set("Local", BTIF_STORAGE_HL_APP,BTIF_STORAGE_HL_APP_CB,
value, value_size, BTIF_CFG_TYPE_BIN))
{
@@ -1686,8 +1699,9 @@
char input_value [20];
bd2str(remote_bd_addr, &bdstr);
- strncpy(input_value, (char*)bdstr, 20);
- strncat(input_value,BTIF_AUTO_PAIR_CONF_VALUE_SEPARATOR, 20);
+ strlcpy(input_value, (char*)bdstr, sizeof(input_value));
+ strlcat(input_value,BTIF_AUTO_PAIR_CONF_VALUE_SEPARATOR, sizeof(input_value));
+
int line_size = sizeof(linebuf);
if(btif_config_get_str("Local", BTIF_STORAGE_PATH_AUTOPAIR_BLACKLIST,
BTIF_STORAGE_KEY_AUTOPAIR_DYNAMIC_BLACKLIST_ADDR, linebuf, &line_size))
diff --git a/gki/ulinux/gki_ulinux.c b/gki/ulinux/gki_ulinux.c
index e414864..d03eb05 100755
--- a/gki/ulinux/gki_ulinux.c
+++ b/gki/ulinux/gki_ulinux.c
@@ -247,6 +247,8 @@
struct sched_param param;
int policy, ret = 0;
pthread_attr_t attr1;
+ UNUSED(stack);
+ UNUSED(stacksize);
GKI_TRACE( "GKI_create_task %x %d %s %x %d", (int)task_entry, (int)task_id,
(char*) taskname, (int) stack, (int)stacksize);
@@ -617,6 +619,7 @@
int restart;
tGKI_OS *p_os = &gki_cb.os;
int *p_run_cond = &p_os->no_timer_suspend;
+ (void)arg;
/* Indicate that tick is just starting */
restart = 1;
@@ -783,11 +786,12 @@
**
*******************************************************************************/
-void GKI_run (void *p_task_id)
+void GKI_run (void * p_task_id)
{
struct timespec delay;
int err;
volatile int * p_run_cond = &gki_cb.os.no_timer_suspend;
+ UNUSED(p_task_id);
#ifndef GKI_NO_TICK_STOP
/* adjust btld scheduling scheme now */
@@ -1404,9 +1408,9 @@
*******************************************************************************/
UINT8 GKI_suspend_task (UINT8 task_id)
{
+ UNUSED(task_id);
GKI_TRACE("GKI_suspend_task %d - NOT implemented", task_id);
-
GKI_TRACE("GKI_suspend_task %d done", task_id);
return (GKI_SUCCESS);
@@ -1430,9 +1434,9 @@
*******************************************************************************/
UINT8 GKI_resume_task (UINT8 task_id)
{
+ UNUSED(task_id);
GKI_TRACE("GKI_resume_task %d - NOT implemented", task_id);
-
GKI_TRACE("GKI_resume_task %d done", task_id);
return (GKI_SUCCESS);
diff --git a/hci/src/bt_hci_bdroid.c b/hci/src/bt_hci_bdroid.c
index 25ad194..ed98b37 100644
--- a/hci/src/bt_hci_bdroid.c
+++ b/hci/src/bt_hci_bdroid.c
@@ -125,6 +125,7 @@
*******************************************************************************/
static void epilog_wait_timeout(union sigval arg)
{
+ UNUSED(arg);
ALOGI("...epilog_wait_timeout...");
bthc_signal_event(HC_EVENT_EXIT);
}
@@ -299,9 +300,10 @@
}
-/** Called prio to stack initialization */
+/** Called prior to stack initialization */
static void preload(TRANSAC transac)
{
+ UNUSED(transac);
BTHCDBG("preload");
bthc_signal_event(HC_EVENT_PRELOAD);
}
@@ -310,14 +312,17 @@
/** Called post stack initialization */
static void postload(TRANSAC transac)
{
+ UNUSED(transac);
BTHCDBG("postload");
bthc_signal_event(HC_EVENT_POSTLOAD);
}
/** Transmit frame */
-static int transmit_buf(TRANSAC transac, char *p_buf, int len)
+static int transmit_buf(TRANSAC transac, char * p_buf, int len)
{
+ UNUSED(p_buf);
+ UNUSED(len);
utils_enqueue(&tx_q, (void *) transac);
bthc_signal_event(HC_EVENT_TX);
@@ -427,6 +432,7 @@
{
uint16_t events;
HC_BT_HDR *p_msg, *p_next_msg;
+ UNUSED(arg);
ALOGI("bt_hc_worker_thread started");
prctl(PR_SET_NAME, (unsigned long)"bt_hc_worker", 0, 0, 0);
@@ -506,7 +512,7 @@
utils_lock();
p_next_msg = tx_q.p_first;
while (p_next_msg && sending_msg_count <
- (int)sizeof(sending_msg_que)/sizeof(sending_msg_que[0]))
+ (int)(sizeof(sending_msg_que)/sizeof(sending_msg_que[0])))
{
if ((p_next_msg->event & MSG_EVT_MASK)==MSG_STACK_TO_HC_HCI_CMD)
{
diff --git a/hci/src/bt_hw.c b/hci/src/bt_hw.c
index 5265dce..898a6ed 100644
--- a/hci/src/bt_hw.c
+++ b/hci/src/bt_hw.c
@@ -33,6 +33,7 @@
#include "bt_hci_bdroid.h"
#include "hci.h"
#include "userial.h"
+#include "bt_utils.h"
/******************************************************************************
** Externs
@@ -87,6 +88,7 @@
******************************************************************************/
static void scocfg_cb(bt_vendor_op_result_t result)
{
+ UNUSED(result);
/* Continue rest of postload process*/
p_hci_if->get_acl_max_len();
}
@@ -178,6 +180,7 @@
******************************************************************************/
static void epilog_cb(bt_vendor_op_result_t result)
{
+ UNUSED(result);
bthc_signal_event(HC_EVENT_EXIT);
}
diff --git a/hci/src/btsnoop.c b/hci/src/btsnoop.c
index 4807df8..c6556d6 100755
--- a/hci/src/btsnoop.c
+++ b/hci/src/btsnoop.c
@@ -55,6 +55,7 @@
#include "bt_hci_bdroid.h"
#include "utils.h"
+#include "bt_utils.h"
#ifndef BTSNOOP_DBG
#define BTSNOOP_DBG FALSE
@@ -66,6 +67,11 @@
#define SNOOPDBG(param, ...) {}
#endif
+#define HCIT_TYPE_COMMAND 1
+#define HCIT_TYPE_ACL_DATA 2
+#define HCIT_TYPE_SCO_DATA 3
+#define HCIT_TYPE_EVENT 4
+
/* file descriptor of the BT snoop file (by default, -1 means disabled) */
int hci_btsnoop_fd = -1;
@@ -117,6 +123,7 @@
#define BTSNOOP_EPOCH_HI 0x00dcddb3U
#define BTSNOOP_EPOCH_LO 0x0f2f8000U
+
/*******************************************************************************
**
** Function tv_to_btsnoop_ts
@@ -252,6 +259,46 @@
}
/*******************************************************************************
+ ** Function btsnoop_write
+ **
+ ** Description Function used to write the actual data to the log
+ **
+ ** Returns none
+*******************************************************************************/
+
+void btsnoop_write(uint8_t *p, uint32_t flags, const uint8_t *ptype, uint32_t len)
+{
+ uint32_t value, value_hi;
+ struct timeval tv;
+ struct iovec io[3];
+ uint32_t header[6];
+
+ /* store the length in both original and included fields */
+ header[0] = l_to_be(len + 1);
+ header[1] = header[0];
+ /* flags: data can be sent or received */
+ header[2] = l_to_be(flags);
+ /* drops: none */
+ header[3] = 0;
+ /* time */
+ gettimeofday(&tv, NULL);
+ tv_to_btsnoop_ts(&header[5], &header[4], &tv);
+ header[4] = l_to_be(header[4]);
+ header[5] = l_to_be(header[5]);
+
+ io[0].iov_base = header;
+ io[0].iov_len = sizeof(header);
+
+ io[1].iov_base = (void*)ptype;
+ io[1].iov_len = 1;
+
+ io[2].iov_base = p;
+ io[2].iov_len = len;
+
+ (void) writev(hci_btsnoop_fd, io, 3);
+}
+
+/*******************************************************************************
**
** Function btsnoop_hci_cmd
**
@@ -261,42 +308,14 @@
*******************************************************************************/
void btsnoop_hci_cmd(uint8_t *p)
{
+ const uint8_t cmd = HCIT_TYPE_COMMAND;
+ int plen;
SNOOPDBG("btsnoop_hci_cmd: fd = %d", hci_btsnoop_fd);
-
- if (hci_btsnoop_fd != -1)
- {
- uint32_t value, value_hi;
- struct timeval tv;
-
- /* since these display functions are called from different contexts */
- utils_lock();
-
- /* store the length in both original and included fields */
- value = l_to_be(p[2] + 4);
- write(hci_btsnoop_fd, &value, 4);
- write(hci_btsnoop_fd, &value, 4);
- /* flags: command sent from the host */
- value = l_to_be(2);
- write(hci_btsnoop_fd, &value, 4);
- /* drops: none */
- value = 0;
- write(hci_btsnoop_fd, &value, 4);
- /* time */
- gettimeofday(&tv, NULL);
- tv_to_btsnoop_ts(&value, &value_hi, &tv);
- value_hi = l_to_be(value_hi);
- value = l_to_be(value);
- write(hci_btsnoop_fd, &value_hi, 4);
- write(hci_btsnoop_fd, &value, 4);
- /* data */
- write(hci_btsnoop_fd, "\x1", 1);
- write(hci_btsnoop_fd, p, p[2] + 3);
-
- /* since these display functions are called from different contexts */
- utils_unlock();
- }
+ plen = (int) p[2] + 3;
+ btsnoop_write(p, 2, &cmd, plen);
}
+
/*******************************************************************************
**
** Function btsnoop_hci_evt
@@ -307,40 +326,12 @@
*******************************************************************************/
void btsnoop_hci_evt(uint8_t *p)
{
+ const uint8_t evt = HCIT_TYPE_EVENT;
+ int plen;
SNOOPDBG("btsnoop_hci_evt: fd = %d", hci_btsnoop_fd);
+ plen = (int) p[1] + 2;
- if (hci_btsnoop_fd != -1)
- {
- uint32_t value, value_hi;
- struct timeval tv;
-
- /* since these display functions are called from different contexts */
- utils_lock();
-
- /* store the length in both original and included fields */
- value = l_to_be(p[1] + 3);
- write(hci_btsnoop_fd, &value, 4);
- write(hci_btsnoop_fd, &value, 4);
- /* flags: event received in the host */
- value = l_to_be(3);
- write(hci_btsnoop_fd, &value, 4);
- /* drops: none */
- value = 0;
- write(hci_btsnoop_fd, &value, 4);
- /* time */
- gettimeofday(&tv, NULL);
- tv_to_btsnoop_ts(&value, &value_hi, &tv);
- value_hi = l_to_be(value_hi);
- value = l_to_be(value);
- write(hci_btsnoop_fd, &value_hi, 4);
- write(hci_btsnoop_fd, &value, 4);
- /* data */
- write(hci_btsnoop_fd, "\x4", 1);
- write(hci_btsnoop_fd, p, p[1] + 2);
-
- /* since these display functions are called from different contexts */
- utils_unlock();
- }
+ btsnoop_write(p, 3, &evt, plen);
}
/*******************************************************************************
@@ -353,40 +344,12 @@
*******************************************************************************/
void btsnoop_sco_data(uint8_t *p, uint8_t is_rcvd)
{
+ const uint8_t sco = HCIT_TYPE_SCO_DATA;
+ int plen;
SNOOPDBG("btsnoop_sco_data: fd = %d", hci_btsnoop_fd);
+ plen = (int) p[2] + 3;
- if (hci_btsnoop_fd != -1)
- {
- uint32_t value, value_hi;
- struct timeval tv;
-
- /* since these display functions are called from different contexts */
- utils_lock();
-
- /* store the length in both original and included fields */
- value = l_to_be(p[2] + 4);
- write(hci_btsnoop_fd, &value, 4);
- write(hci_btsnoop_fd, &value, 4);
- /* flags: data can be sent or received */
- value = l_to_be(is_rcvd?1:0);
- write(hci_btsnoop_fd, &value, 4);
- /* drops: none */
- value = 0;
- write(hci_btsnoop_fd, &value, 4);
- /* time */
- gettimeofday(&tv, NULL);
- tv_to_btsnoop_ts(&value, &value_hi, &tv);
- value_hi = l_to_be(value_hi);
- value = l_to_be(value);
- write(hci_btsnoop_fd, &value_hi, 4);
- write(hci_btsnoop_fd, &value, 4);
- /* data */
- write(hci_btsnoop_fd, "\x3", 1);
- write(hci_btsnoop_fd, p, p[2] + 3);
-
- /* since these display functions are called from different contexts */
- utils_unlock();
- }
+ btsnoop_write(p, is_rcvd, &sco, plen);
}
/*******************************************************************************
@@ -399,42 +362,16 @@
*******************************************************************************/
void btsnoop_acl_data(uint8_t *p, uint8_t is_rcvd)
{
+ const uint8_t acl = HCIT_TYPE_ACL_DATA;
+ int plen;
+
SNOOPDBG("btsnoop_acl_data: fd = %d", hci_btsnoop_fd);
- if (hci_btsnoop_fd != -1)
- {
- uint32_t value, value_hi;
- struct timeval tv;
- /* since these display functions are called from different contexts */
- utils_lock();
+ plen = (((int) p[3]) << 8) + ((int) p[2]) +4;
- /* store the length in both original and included fields */
- value = l_to_be((p[3]<<8) + p[2] + 5);
- write(hci_btsnoop_fd, &value, 4);
- write(hci_btsnoop_fd, &value, 4);
- /* flags: data can be sent or received */
- value = l_to_be(is_rcvd?1:0);
- write(hci_btsnoop_fd, &value, 4);
- /* drops: none */
- value = 0;
- write(hci_btsnoop_fd, &value, 4);
- /* time */
- gettimeofday(&tv, NULL);
- tv_to_btsnoop_ts(&value, &value_hi, &tv);
- value_hi = l_to_be(value_hi);
- value = l_to_be(value);
- write(hci_btsnoop_fd, &value_hi, 4);
- write(hci_btsnoop_fd, &value, 4);
- /* data */
- write(hci_btsnoop_fd, "\x2", 1);
- write(hci_btsnoop_fd, p, (p[3]<<8) + p[2] + 4);
-
- /* since these display functions are called from different contexts */
- utils_unlock();
- }
+ btsnoop_write(p, is_rcvd, &acl, plen);
}
-
/********************************************************************************
** API allow external realtime parsing of output using e.g hcidump
*********************************************************************************/
@@ -542,6 +479,7 @@
static void interruptFn (int sig)
{
+ UNUSED(sig);
ALOGD("interruptFn");
pthread_exit(0);
}
@@ -553,6 +491,7 @@
sigset_t sigSet;
sigemptyset (&sigSet);
sigaddset (&sigSet, sig);
+ UNUSED(param);
ALOGD("ext_parser_thread");
@@ -619,11 +558,6 @@
}
-#define HCIT_TYPE_COMMAND 1
-#define HCIT_TYPE_ACL_DATA 2
-#define HCIT_TYPE_SCO_DATA 3
-#define HCIT_TYPE_EVENT 4
-
void btsnoop_capture(HC_BT_HDR *p_buf, uint8_t is_rcvd)
{
uint8_t *p = (uint8_t *)(p_buf + 1) + p_buf->offset;
diff --git a/hci/src/lpm.c b/hci/src/lpm.c
index fb6f837..b8cfdce 100644
--- a/hci/src/lpm.c
+++ b/hci/src/lpm.c
@@ -31,6 +31,7 @@
#include <time.h>
#include "bt_hci_bdroid.h"
#include "bt_vendor_lib.h"
+#include "bt_utils.h"
/******************************************************************************
** Constants & Macros
@@ -109,6 +110,7 @@
*******************************************************************************/
static void lpm_idle_timeout(union sigval arg)
{
+ UNUSED(arg);
BTLPMDBG("..lpm_idle_timeout..");
if ((bt_lpm_cb.state == LPM_ENABLED) && \
diff --git a/hci/src/userial.c b/hci/src/userial.c
index 426810f..5dc4f84 100644
--- a/hci/src/userial.c
+++ b/hci/src/userial.c
@@ -241,6 +241,7 @@
int rx_length = 0;
HC_BT_HDR *p_buf = NULL;
uint8_t *p;
+ UNUSED(arg);
USERIALDBG("Entering userial_read_thread()");
prctl(PR_SET_NAME, (unsigned long)"userial_read", 0, 0, 0);
@@ -432,6 +433,7 @@
uint16_t total_len = 0;
uint16_t copy_len = 0;
uint8_t *p_data = NULL;
+ UNUSED(msg_id);
do
{
@@ -484,6 +486,7 @@
uint16_t userial_write(uint16_t msg_id, uint8_t *p_data, uint16_t len)
{
int ret, total = 0;
+ UNUSED(msg_id);
while(len != 0)
{
@@ -546,6 +549,8 @@
*******************************************************************************/
void userial_ioctl(userial_ioctl_op_t op, void *p_data)
{
+ UNUSED(p_data);
+
switch(op)
{
case USERIAL_OP_RXFLOW_ON:
diff --git a/include/bt_target.h b/include/bt_target.h
index a106773..23e4fdb 100644
--- a/include/bt_target.h
+++ b/include/bt_target.h
@@ -263,10 +263,6 @@
#define BTA_JV_INCLUDED FALSE
#endif
-#ifndef BTA_GATT_INCLUDED
-#define BTA_GATT_INCLUDED TRUE
-#endif
-
#ifndef BTA_DISABLE_DELAY
#define BTA_DISABLE_DELAY 200 /* in milliseconds */
#endif
@@ -1416,6 +1412,18 @@
** ATT/GATT Protocol/Profile Settings
**
******************************************************************************/
+#ifndef BTA_GATT_INCLUDED
+#if BLE_INCLUDED == TRUE
+#define BTA_GATT_INCLUDED TRUE
+#else
+#define BTA_GATT_INCLUDED FALSE
+#endif
+#endif
+
+#if BTA_GATT_INCLUDED == TRUE && BLE_INCLUDED == FALSE
+#error "can't have GATT without BLE"
+#endif
+
#ifndef ATT_INCLUDED
#define ATT_INCLUDED TRUE
#endif
@@ -1432,6 +1440,18 @@
#define GATT_CLIENT_ENABLED TRUE
#endif
+#ifndef BLE_PERIPHERAL_MODE_SUPPORT
+#define BLE_PERIPHERAL_MODE_SUPPORT FALSE
+#endif
+
+#ifndef BLE_PERIPHERAL_DISPLAYONLY
+#define BLE_PERIPHERAL_DISPLAYONLY FALSE
+#endif
+
+#ifndef BLE_PERIPHERAL_ADV_NAME
+#define BLE_PERIPHERAL_ADV_NAME FALSE
+#endif
+
#ifndef GATT_MAX_SR_PROFILES
#define GATT_MAX_SR_PROFILES 32 /* max is 32 */
#endif
@@ -1465,7 +1485,15 @@
**
******************************************************************************/
#ifndef SMP_INCLUDED
+#if BLE_INCLUDED == TRUE
#define SMP_INCLUDED TRUE
+#else
+#define SMP_INCLUDED FALSE
+#endif
+#endif
+
+#if SMP_INCLUDED == TRUE && BLE_INCLUDED == FALSE
+#error "can't have SMP without BLE"
#endif
#ifndef SMP_DEBUG
diff --git a/main/bte_conf.c b/main/bte_conf.c
index e001d59..ddad0c7 100644
--- a/main/bte_conf.c
+++ b/main/bte_conf.c
@@ -35,6 +35,7 @@
#include "bt_target.h"
#include "bta_api.h"
+#include "bt_utils.h"
/******************************************************************************
** Externs
@@ -130,6 +131,7 @@
int device_name_cfg(char *p_conf_name, char *p_conf_value)
{
+ UNUSED(p_conf_name);
strcpy((char *)local_device_default_name, p_conf_value);
return 0;
}
@@ -138,6 +140,7 @@
{
char *p_token;
unsigned int x;
+ UNUSED(p_conf_name);
p_token = strtok(p_conf_value, CONF_COD_DELIMITERS);
sscanf(p_token, "%x", &x);
@@ -154,6 +157,7 @@
int logging_cfg_onoff(char *p_conf_name, char *p_conf_value)
{
+ UNUSED(p_conf_name);
if (strcmp(p_conf_value, "true") == 0)
hci_logging_enabled = TRUE;
else
@@ -163,12 +167,14 @@
int logging_set_filepath(char *p_conf_name, char *p_conf_value)
{
+ UNUSED(p_conf_name);
strcpy(hci_logfile, p_conf_value);
return 0;
}
int trace_cfg_onoff(char *p_conf_name, char *p_conf_value)
{
+ UNUSED(p_conf_name);
trace_conf_enabled = (strcmp(p_conf_value, "true") == 0) ? TRUE : FALSE;
return 0;
}
diff --git a/main/bte_main.c b/main/bte_main.c
index 62c6b6b..cf21456 100644
--- a/main/bte_main.c
+++ b/main/bte_main.c
@@ -36,6 +36,7 @@
#include "bte.h"
#include "bta_api.h"
#include "bt_hci_lib.h"
+#include "bt_utils.h"
/*******************************************************************************
** Constants & Macros
@@ -337,6 +338,8 @@
*******************************************************************************/
static void preload_wait_timeout(union sigval arg)
{
+ UNUSED(arg);
+
APPL_TRACE_ERROR2("...preload_wait_timeout (retried:%d/max-retry:%d)...",
preload_retry_cb.retry_counts,
PRELOAD_MAX_RETRY_ATTEMPTS);
@@ -559,8 +562,9 @@
******************************************************************************/
static void preload_cb(TRANSAC transac, bt_hc_preload_result_t result)
{
- APPL_TRACE_EVENT1("HC preload_cb %d [0:SUCCESS 1:FAIL]", result);
+ UNUSED(transac);
+ APPL_TRACE_EVENT1("HC preload_cb %d [0:SUCCESS 1:FAIL]", result);
if (result == BT_HC_PRELOAD_SUCCESS)
{
@@ -583,6 +587,8 @@
******************************************************************************/
static void postload_cb(TRANSAC transac, bt_hc_postload_result_t result)
{
+ UNUSED(transac);
+
APPL_TRACE_EVENT1("HC postload_cb %d", result);
}
@@ -663,6 +669,8 @@
******************************************************************************/
static int dealloc(TRANSAC transac, char *p_buf)
{
+ UNUSED(p_buf);
+
GKI_freebuf(transac);
return BT_HC_STATUS_SUCCESS;
}
@@ -690,6 +698,8 @@
static int data_ind(TRANSAC transac, char *p_buf, int len)
{
BT_HDR *p_msg = (BT_HDR *) transac;
+ UNUSED(p_buf);
+ UNUSED(len);
/*
APPL_TRACE_DEBUG2("HC data_ind event=0x%04X (len=%d)", p_msg->event, len);
@@ -719,9 +729,9 @@
** Returns bt_hc_status_t
**
******************************************************************************/
-static int tx_result(TRANSAC transac, char *p_buf, \
- bt_hc_transmit_result_t result)
+static int tx_result(TRANSAC transac, char *p_buf, bt_hc_transmit_result_t result)
{
+ UNUSED(p_buf);
/*
APPL_TRACE_DEBUG2("HC tx_result %d (event=%04X)", result, \
((BT_HDR *)transac)->event);
diff --git a/stack/avct/avct_api.c b/stack/avct/avct_api.c
index 7e37a90..d590cb5 100644
--- a/stack/avct/avct_api.c
+++ b/stack/avct/avct_api.c
@@ -25,6 +25,7 @@
#include <string.h>
#include "data_types.h"
#include "bt_target.h"
+#include "bt_utils.h"
#include "gki.h"
#include "l2c_api.h"
#include "l2cdefs.h"
@@ -53,6 +54,8 @@
*******************************************************************************/
void AVCT_Register(UINT16 mtu, UINT16 mtu_br, UINT8 sec_mask)
{
+ UNUSED(mtu_br);
+
AVCT_TRACE_API0("AVCT_Register");
/* register PSM with L2CAP */
@@ -289,6 +292,8 @@
return result;
#else
+ UNUSED(handle);
+ UNUSED(role);
return AVCT_NO_RESOURCES;
#endif
}
@@ -326,6 +331,7 @@
}
return result;
#else
+ UNUSED(handle);
return AVCT_NO_RESOURCES;
#endif
}
@@ -350,6 +356,8 @@
{
peer_mtu = p_ccb->p_bcb->peer_mtu;
}
+#else
+ UNUSED(handle);
#endif
return peer_mtu;
}
diff --git a/stack/avct/avct_l2c.c b/stack/avct/avct_l2c.c
index ef0f5fc..aabcd0e 100644
--- a/stack/avct/avct_l2c.c
+++ b/stack/avct/avct_l2c.c
@@ -25,6 +25,7 @@
#include <string.h>
#include "data_types.h"
#include "bt_target.h"
+#include "bt_utils.h"
#include "avct_api.h"
#include "avct_int.h"
#include "l2c_api.h"
@@ -105,6 +106,7 @@
tAVCT_LCB *p_lcb;
UINT16 result = L2CAP_CONN_OK;
tL2CAP_CFG_INFO cfg;
+ UNUSED(psm);
/* do we already have a channel for this peer? */
if ((p_lcb = avct_lcb_by_bd(bd_addr)) == NULL)
diff --git a/stack/avct/avct_lcb.c b/stack/avct/avct_lcb.c
index bb3f447..6bc7e51 100644
--- a/stack/avct/avct_lcb.c
+++ b/stack/avct/avct_lcb.c
@@ -26,6 +26,7 @@
#include <string.h>
#include "data_types.h"
#include "bt_target.h"
+#include "bt_utils.h"
#include "avct_api.h"
#include "avct_int.h"
#include "gki.h"
@@ -351,6 +352,7 @@
tAVCT_CCB *p_ccb = &avct_cb.ccb[0];
BOOLEAN found = FALSE;
int i;
+ UNUSED(p_data);
AVCT_TRACE_DEBUG1("avct_lcb_dealloc %d", p_lcb->allocated);
diff --git a/stack/avct/avct_lcb_act.c b/stack/avct/avct_lcb_act.c
index b883517..2fc9217 100644
--- a/stack/avct/avct_lcb_act.c
+++ b/stack/avct/avct_lcb_act.c
@@ -25,6 +25,7 @@
#include <string.h>
#include "data_types.h"
#include "bt_target.h"
+#include "bt_utils.h"
#include "avct_api.h"
#include "avct_int.h"
#include "gki.h"
@@ -170,6 +171,7 @@
void avct_lcb_chnl_open(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
{
UINT16 result = AVCT_RESULT_FAIL;
+ UNUSED(p_data);
BTM_SetOutService(p_lcb->peer_addr, BTM_SEC_SERVICE_AVCTP, 0);
/* call l2cap connect req */
@@ -193,6 +195,8 @@
*******************************************************************************/
void avct_lcb_unbind_disc(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
{
+ UNUSED(p_lcb);
+
avct_ccb_dealloc(p_data->p_ccb, AVCT_DISCONNECT_CFM_EVT, 0, NULL);
}
@@ -290,6 +294,7 @@
{
tAVCT_CCB *p_ccb = &avct_cb.ccb[0];
int i;
+ UNUSED(p_data);
for (i = 0; i < AVCT_NUM_CONN; i++, p_ccb++)
{
@@ -416,6 +421,8 @@
*******************************************************************************/
void avct_lcb_chnl_disc(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
{
+ UNUSED(p_data);
+
L2CA_DisconnectReq(p_lcb->ch_lcid);
}
@@ -432,6 +439,8 @@
*******************************************************************************/
void avct_lcb_bind_fail(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
{
+ UNUSED(p_lcb);
+
avct_ccb_dealloc(p_data->p_ccb, AVCT_CONNECT_CFM_EVT, AVCT_RESULT_FAIL, NULL);
}
@@ -488,6 +497,8 @@
*******************************************************************************/
void avct_lcb_discard_msg(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
{
+ UNUSED(p_lcb);
+
AVCT_TRACE_WARNING0("Dropping msg");
GKI_freebuf(p_data->ul_msg.p_buf);
@@ -623,6 +634,8 @@
*******************************************************************************/
void avct_lcb_free_msg_ind(tAVCT_LCB *p_lcb, tAVCT_LCB_EVT *p_data)
{
+ UNUSED(p_lcb);
+
if (p_data)
GKI_freebuf(p_data->p_buf);
return;
diff --git a/stack/avdt/avdt_ad.c b/stack/avdt/avdt_ad.c
index 92f429a..7fe665c 100644
--- a/stack/avdt/avdt_ad.c
+++ b/stack/avdt/avdt_ad.c
@@ -25,6 +25,7 @@
#include <string.h>
#include "data_types.h"
#include "bt_target.h"
+#include "bt_utils.h"
#include "avdt_api.h"
#include "avdtc_api.h"
#include "avdt_int.h"
@@ -322,6 +323,7 @@
tAVDT_CCB *p_ccb;
tAVDT_SCB *p_scb;
tAVDT_SCB_TC_CLOSE close;
+ UNUSED(reason);
close.old_tc_state = p_tbl->state;
/* clear avdt_ad_tc_tbl entry */
diff --git a/stack/avdt/avdt_ccb.c b/stack/avdt/avdt_ccb.c
index f238c69..c2ef2f4 100644
--- a/stack/avdt/avdt_ccb.c
+++ b/stack/avdt/avdt_ccb.c
@@ -26,6 +26,7 @@
#include <string.h>
#include "data_types.h"
#include "bt_target.h"
+#include "bt_utils.h"
#include "avdt_api.h"
#include "avdtc_api.h"
#include "avdt_int.h"
@@ -415,6 +416,8 @@
*******************************************************************************/
void avdt_ccb_dealloc(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
{
+ UNUSED(p_data);
+
AVDT_TRACE_DEBUG1("avdt_ccb_dealloc %d", avdt_ccb_to_idx(p_ccb));
btu_stop_timer(&p_ccb->timer_entry);
memset(p_ccb, 0, sizeof(tAVDT_CCB));
diff --git a/stack/avdt/avdt_ccb_act.c b/stack/avdt/avdt_ccb_act.c
index 12c11b4..1249c63 100644
--- a/stack/avdt/avdt_ccb_act.c
+++ b/stack/avdt/avdt_ccb_act.c
@@ -26,6 +26,7 @@
#include <string.h>
#include "data_types.h"
#include "bt_target.h"
+#include "bt_utils.h"
#include "avdt_api.h"
#include "avdtc_api.h"
#include "avdt_int.h"
@@ -86,6 +87,8 @@
*******************************************************************************/
void avdt_ccb_chan_open(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
{
+ UNUSED(p_data);
+
BTM_SetOutService(p_ccb->peer_addr, BTM_SEC_SERVICE_AVDTP, AVDT_CHAN_SIG);
avdt_ad_open_req(AVDT_CHAN_SIG, p_ccb, NULL, AVDT_INT);
}
@@ -103,6 +106,8 @@
*******************************************************************************/
void avdt_ccb_chan_close(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
{
+ UNUSED(p_data);
+
/* close the transport channel used by this CCB */
avdt_ad_close_req(AVDT_CHAN_SIG, p_ccb, NULL);
}
@@ -122,6 +127,7 @@
{
int i;
tAVDT_SCB *p_scb = &avdt_cb.scb[0];
+ UNUSED(p_data);
/* see if there are any active scbs associated with this ccb */
for (i = 0; i < AVDT_NUM_SEPS; i++, p_scb++)
@@ -666,6 +672,7 @@
int i;
tAVDT_SCB *p_scb = &avdt_cb.scb[0];
UINT8 err_code = AVDT_ERR_CONNECT;
+ UNUSED(p_data);
/* clear the ccb */
avdt_ccb_clear_ccb(p_ccb);
@@ -754,6 +761,8 @@
*******************************************************************************/
void avdt_ccb_free_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
{
+ UNUSED(p_data);
+
if (p_ccb->p_curr_cmd != NULL)
{
GKI_freebuf(p_ccb->p_curr_cmd);
@@ -838,6 +847,7 @@
void avdt_ccb_snd_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
{
BT_HDR *p_msg;
+ UNUSED(p_data);
/* do we have commands to send? send next command; make sure we're clear;
** not congested, not sending fragment, not waiting for response
@@ -870,6 +880,7 @@
void avdt_ccb_snd_msg(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
{
BT_HDR *p_msg;
+ UNUSED(p_data);
/* if not congested */
if (!p_ccb->cong)
@@ -911,6 +922,8 @@
*******************************************************************************/
void avdt_ccb_set_reconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
{
+ UNUSED(p_data);
+
p_ccb->reconn = TRUE;
}
@@ -926,6 +939,8 @@
*******************************************************************************/
void avdt_ccb_clr_reconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
{
+ UNUSED(p_data);
+
p_ccb->reconn = FALSE;
}
@@ -944,6 +959,7 @@
void avdt_ccb_chk_reconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
{
UINT8 err_code = AVDT_ERR_CONNECT;
+ UNUSED(p_data);
if (p_ccb->reconn)
{
@@ -977,6 +993,8 @@
*******************************************************************************/
void avdt_ccb_chk_timer(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
{
+ UNUSED(p_data);
+
if (p_ccb->timer_entry.event == BTU_TTYPE_AVDT_CCB_IDLE)
{
btu_stop_timer(&p_ccb->timer_entry);
@@ -1036,6 +1054,8 @@
*******************************************************************************/
void avdt_ccb_do_disconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data)
{
+ UNUSED(p_data);
+
/* clear any pending commands */
avdt_ccb_clear_cmds(p_ccb, NULL);
@@ -1058,6 +1078,7 @@
tAVDT_CTRL_CBACK *p_cback;
BD_ADDR bd_addr;
tAVDT_CTRL avdt_ctrl;
+ UNUSED(p_data);
/* clear any pending commands */
avdt_ccb_clear_cmds(p_ccb, NULL);
diff --git a/stack/avdt/avdt_l2c.c b/stack/avdt/avdt_l2c.c
index 20979b4..2256a90 100644
--- a/stack/avdt/avdt_l2c.c
+++ b/stack/avdt/avdt_l2c.c
@@ -25,6 +25,7 @@
#include <string.h>
#include "data_types.h"
#include "bt_target.h"
+#include "bt_utils.h"
#include "avdt_api.h"
#include "avdtc_api.h"
#include "avdt_int.h"
@@ -74,6 +75,7 @@
tAVDT_CCB *p_ccb = NULL;
tL2CAP_CFG_INFO cfg;
tAVDT_TC_TBL *p_tbl;
+ UNUSED(p_ref_data);
AVDT_TRACE_DEBUG1("avdt_sec_check_complete_term res: %d", res);
if (!bd_addr)
@@ -130,6 +132,7 @@
tAVDT_CCB *p_ccb = NULL;
tL2CAP_CFG_INFO cfg;
tAVDT_TC_TBL *p_tbl;
+ UNUSED(p_ref_data);
AVDT_TRACE_DEBUG1("avdt_sec_check_complete_orig res: %d", res);
if (bd_addr)
@@ -174,6 +177,7 @@
UINT16 result;
tL2CAP_CFG_INFO cfg;
tBTM_STATUS rc;
+ UNUSED(psm);
/* do we already have a control channel for this peer? */
if ((p_ccb = avdt_ccb_by_bd(bd_addr)) == NULL)
diff --git a/stack/avdt/avdt_msg.c b/stack/avdt/avdt_msg.c
index 5d9c2fb..7b18424 100644
--- a/stack/avdt/avdt_msg.c
+++ b/stack/avdt/avdt_msg.c
@@ -29,6 +29,7 @@
#include <string.h>
#include "data_types.h"
#include "bt_target.h"
+#include "bt_utils.h"
#include "avdt_api.h"
#include "avdtc_api.h"
#include "avdt_int.h"
@@ -373,6 +374,8 @@
*******************************************************************************/
static void avdt_msg_bld_none(UINT8 **p, tAVDT_MSG *p_msg)
{
+ UNUSED(p);
+ UNUSED(p_msg);
return;
}
@@ -688,8 +691,12 @@
/* verify length */
AVDT_TRACE_WARNING2("psc_mask=0x%x elem_len=%d", p_cfg->psc_mask, elem_len);
if( ((0 == (p_cfg->psc_mask & (AVDT_PSC_RECOV|AVDT_PSC_REPORT))) && (elem_len != 3))
- || ((p_cfg->psc_mask & AVDT_PSC_RECOV) && (elem_len != 7))
- || ((p_cfg->psc_mask & AVDT_PSC_REPORT) && (elem_len != 5)) )
+ || (((p_cfg->psc_mask & AVDT_PSC_REPORT) && !(p_cfg->psc_mask & AVDT_PSC_RECOV))
+ && (elem_len != 5))
+ || ((!(p_cfg->psc_mask & AVDT_PSC_REPORT) && (p_cfg->psc_mask & AVDT_PSC_RECOV))
+ && (elem_len != 5))
+ || (((p_cfg->psc_mask & AVDT_PSC_REPORT) && (p_cfg->psc_mask & AVDT_PSC_RECOV))
+ && (elem_len != 7)) )
{
err = AVDT_ERR_MUX_FMT;
break;
@@ -771,6 +778,9 @@
*******************************************************************************/
static UINT8 avdt_msg_prs_none(tAVDT_MSG *p_msg, UINT8 *p, UINT16 len)
{
+ UNUSED(p_msg);
+ UNUSED(p);
+ UNUSED(len);
return 0;
}
diff --git a/stack/avdt/avdt_scb.c b/stack/avdt/avdt_scb.c
index 0536d91..d0c9e0f 100644
--- a/stack/avdt/avdt_scb.c
+++ b/stack/avdt/avdt_scb.c
@@ -26,6 +26,7 @@
#include <string.h>
#include "data_types.h"
#include "bt_target.h"
+#include "bt_utils.h"
#include "avdt_api.h"
#include "avdtc_api.h"
#include "avdt_int.h"
@@ -647,6 +648,7 @@
#if AVDT_MULTIPLEXING == TRUE
void *p_buf;
#endif
+ UNUSED(p_data);
AVDT_TRACE_DEBUG1("avdt_scb_dealloc hdl=%d", avdt_scb_to_hdl(p_scb));
btu_stop_timer(&p_scb->timer_entry);
diff --git a/stack/avdt/avdt_scb_act.c b/stack/avdt/avdt_scb_act.c
index 66f9b7d..8175b96 100644
--- a/stack/avdt/avdt_scb_act.c
+++ b/stack/avdt/avdt_scb_act.c
@@ -26,6 +26,7 @@
#include <string.h>
#include "data_types.h"
#include "bt_target.h"
+#include "bt_utils.h"
#include "avdt_api.h"
#include "avdtc_api.h"
#include "avdt_int.h"
@@ -103,6 +104,8 @@
*******************************************************************************/
void avdt_scb_hdl_abort_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
+ UNUSED(p_scb);
+ UNUSED(p_data);
return;
}
@@ -167,6 +170,8 @@
*******************************************************************************/
void avdt_scb_hdl_getconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
+ UNUSED(p_scb);
+ UNUSED(p_data);
return;
}
@@ -215,6 +220,8 @@
*******************************************************************************/
void avdt_scb_hdl_open_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
+ UNUSED(p_data);
+
/* initiate opening of trans channels for this SEID */
p_scb->role = AVDT_OPEN_INT;
avdt_ad_open_req(AVDT_CHAN_MEDIA, p_scb->p_ccb, p_scb, AVDT_INT);
@@ -668,6 +675,8 @@
*******************************************************************************/
void avdt_scb_drop_pkt(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
+ UNUSED(p_scb);
+
GKI_freebuf(p_data->p_pkt);
AVDT_TRACE_WARNING0("Dropped incoming media packet");
}
@@ -874,6 +883,7 @@
void avdt_scb_hdl_setconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
tAVDT_EVT_HDR single;
+ UNUSED(p_data);
if (p_scb->p_ccb != NULL)
{
@@ -898,6 +908,8 @@
*******************************************************************************/
void avdt_scb_hdl_start_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
+ UNUSED(p_data);
+
(*p_scb->cs.p_ctrl_cback)(avdt_scb_to_hdl(p_scb),
p_scb->p_ccb ? p_scb->p_ccb->peer_addr : NULL,
AVDT_START_IND_EVT,
@@ -934,6 +946,8 @@
*******************************************************************************/
void avdt_scb_hdl_suspend_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
+ UNUSED(p_data);
+
(*p_scb->cs.p_ctrl_cback)(avdt_scb_to_hdl(p_scb),
p_scb->p_ccb ? p_scb->p_ccb->peer_addr : NULL,
AVDT_SUSPEND_IND_EVT,
@@ -1344,6 +1358,7 @@
void avdt_scb_snd_abort_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
tAVDT_EVT_HDR hdr;
+ UNUSED(p_data);
if (p_scb->p_ccb != NULL)
{
@@ -1366,6 +1381,8 @@
*******************************************************************************/
void avdt_scb_snd_abort_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
+ UNUSED(p_scb);
+
avdt_msg_send_rsp(avdt_ccb_by_idx(p_data->msg.hdr.ccb_idx), AVDT_SIG_ABORT,
&p_data->msg);
}
@@ -1382,6 +1399,7 @@
void avdt_scb_snd_close_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
tAVDT_EVT_HDR hdr;
+ UNUSED(p_data);
p_scb->role = AVDT_CLOSE_INT;
@@ -1452,6 +1470,7 @@
void avdt_scb_snd_getconfig_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
tAVDT_EVT_HDR hdr;
+ UNUSED(p_data);
hdr.seid = p_scb->peer_seid;
@@ -1484,6 +1503,7 @@
void avdt_scb_snd_open_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
tAVDT_EVT_HDR hdr;
+ UNUSED(p_data);
hdr.seid = p_scb->peer_seid;
@@ -1696,6 +1716,8 @@
*******************************************************************************/
void avdt_scb_snd_tc_close(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
+ UNUSED(p_data);
+
#if AVDT_REPORTING == TRUE
if(p_scb->curr_cfg.psc_mask & AVDT_PSC_REPORT)
avdt_ad_close_req(AVDT_CHAN_REPORT, p_scb->p_ccb, p_scb);
@@ -1716,6 +1738,7 @@
void avdt_scb_cb_err(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
tAVDT_CTRL avdt_ctrl;
+ UNUSED(p_data);
/* set error code and parameter */
avdt_ctrl.hdr.err_code = AVDT_ERR_BAD_STATE;
@@ -1755,6 +1778,8 @@
*******************************************************************************/
void avdt_scb_rej_state(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
+ UNUSED(p_scb);
+
p_data->msg.hdr.err_code = AVDT_ERR_BAD_STATE;
p_data->msg.hdr.err_param = 0;
avdt_msg_send_rej(avdt_ccb_by_idx(p_data->msg.hdr.ccb_idx),
@@ -1773,6 +1798,8 @@
*******************************************************************************/
void avdt_scb_rej_in_use(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
+ UNUSED(p_scb);
+
p_data->msg.hdr.err_code = AVDT_ERR_IN_USE;
p_data->msg.hdr.err_param = 0;
avdt_msg_send_rej(avdt_ccb_by_idx(p_data->msg.hdr.ccb_idx),
@@ -1791,6 +1818,8 @@
*******************************************************************************/
void avdt_scb_rej_not_in_use(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
+ UNUSED(p_scb);
+
p_data->msg.hdr.err_code = AVDT_ERR_NOT_IN_USE;
p_data->msg.hdr.err_param = 0;
avdt_msg_send_rej(avdt_ccb_by_idx(p_data->msg.hdr.ccb_idx),
@@ -1808,6 +1837,8 @@
*******************************************************************************/
void avdt_scb_set_remove(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
+ UNUSED(p_data);
+
p_scb->remove = TRUE;
}
@@ -1866,6 +1897,7 @@
#if AVDT_MULTIPLEXING == TRUE
BT_HDR *p_frag;
#endif
+ UNUSED(p_data);
/* set error code and parameter */
avdt_ctrl.hdr.err_code = AVDT_ERR_BAD_STATE;
@@ -1930,6 +1962,7 @@
UINT8 res = AVDT_AD_SUCCESS;
tAVDT_SCB_EVT data;
#endif
+ UNUSED(p_data);
avdt_ctrl.hdr.err_code = 0;
@@ -2003,6 +2036,8 @@
*******************************************************************************/
void avdt_scb_tc_timer(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
+ UNUSED(p_data);
+
btu_start_timer(&p_scb->timer_entry, BTU_TTYPE_AVDT_SCB_TC, AVDT_SCB_TC_DISC_TOUT);
}
@@ -2017,6 +2052,8 @@
*******************************************************************************/
void avdt_scb_clr_vars(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data)
{
+ UNUSED(p_data);
+
p_scb->in_use = FALSE;
p_scb->p_ccb = NULL;
p_scb->peer_seid = 0;
diff --git a/stack/avrc/avrc_bld_tg.c b/stack/avrc/avrc_bld_tg.c
index d201b9d..6fe645a 100755
--- a/stack/avrc/avrc_bld_tg.c
+++ b/stack/avrc/avrc_bld_tg.c
@@ -21,6 +21,7 @@
#include "avrc_api.h"
#include "avrc_defs.h"
#include "avrc_int.h"
+#include "bt_utils.h"
/*****************************************************************************
** Global data
@@ -276,6 +277,9 @@
*******************************************************************************/
static tAVRC_STS avrc_bld_set_app_setting_value_rsp (tAVRC_RSP *p_rsp, BT_HDR *p_pkt)
{
+ UNUSED(p_rsp);
+ UNUSED(p_pkt);
+
/* nothing to be added. */
AVRC_TRACE_API0("avrc_bld_set_app_setting_value_rsp");
return AVRC_STS_NO_ERROR;
@@ -401,6 +405,9 @@
*******************************************************************************/
static tAVRC_STS avrc_bld_inform_charset_rsp (tAVRC_RSP *p_rsp, BT_HDR *p_pkt)
{
+ UNUSED(p_rsp);
+ UNUSED(p_pkt);
+
/* nothing to be added. */
AVRC_TRACE_API0("avrc_bld_inform_charset_rsp");
return AVRC_STS_NO_ERROR;
@@ -419,6 +426,9 @@
*******************************************************************************/
static tAVRC_STS avrc_bld_inform_battery_status_rsp (tAVRC_RSP *p_rsp, BT_HDR *p_pkt)
{
+ UNUSED(p_rsp);
+ UNUSED(p_pkt);
+
/* nothing to be added. */
AVRC_TRACE_API0("avrc_bld_inform_battery_status_rsp");
return AVRC_STS_NO_ERROR;
@@ -653,6 +663,9 @@
*******************************************************************************/
static tAVRC_STS avrc_bld_next_rsp (tAVRC_RSP *p_rsp, BT_HDR *p_pkt)
{
+ UNUSED(p_rsp);
+ UNUSED(p_pkt);
+
/* nothing to be added. */
AVRC_TRACE_API0("avrc_bld_next_rsp");
return AVRC_STS_NO_ERROR;
@@ -800,6 +813,7 @@
tAVRC_STS status = AVRC_STS_BAD_PARAM;
BT_HDR *p_pkt;
BOOLEAN alloc = FALSE;
+ UNUSED(handle);
if (!p_rsp || !pp_pkt)
{
diff --git a/stack/avrc/avrc_pars_ct.c b/stack/avrc/avrc_pars_ct.c
index 85a9233..f3b4af5 100755
--- a/stack/avrc/avrc_pars_ct.c
+++ b/stack/avrc/avrc_pars_ct.c
@@ -21,6 +21,7 @@
#include "avrc_api.h"
#include "avrc_defs.h"
#include "avrc_int.h"
+#include "bt_utils.h"
/*****************************************************************************
** Global data
@@ -39,7 +40,7 @@
** Otherwise, the error code defined by AVRCP 1.4
**
*******************************************************************************/
-static tAVRC_STS avrc_pars_vendor_rsp(tAVRC_MSG_VENDOR *p_msg, tAVRC_RESPONSE *p_result, UINT8 *p_buf, UINT16 buf_len)
+static tAVRC_STS avrc_pars_vendor_rsp(tAVRC_MSG_VENDOR *p_msg, tAVRC_RESPONSE *p_result)
{
tAVRC_STS status = AVRC_STS_NO_ERROR;
UINT8 *p = p_msg->p_vendor_data;
@@ -117,13 +118,15 @@
{
tAVRC_STS status = AVRC_STS_INTERNAL_ERR;
UINT16 id;
+ UNUSED(p_buf);
+ UNUSED(buf_len);
if (p_msg && p_result)
{
switch (p_msg->hdr.opcode)
{
case AVRC_OP_VENDOR: /* 0x00 Vendor-dependent commands */
- status = avrc_pars_vendor_rsp(&p_msg->vendor, p_result, p_buf, buf_len);
+ status = avrc_pars_vendor_rsp(&p_msg->vendor, p_result);
break;
case AVRC_OP_PASS_THRU: /* 0x7C panel subunit opcode */
@@ -139,7 +142,7 @@
break;
}
p_result->rsp.opcode = p_msg->hdr.opcode;
- p_result->rsp.status = status;
+ p_result->rsp.status = status;
}
return status;
}
diff --git a/stack/avrc/avrc_utils.c b/stack/avrc/avrc_utils.c
index 939a26f..01254fa 100755
--- a/stack/avrc/avrc_utils.c
+++ b/stack/avrc/avrc_utils.c
@@ -114,8 +114,7 @@
break;
}
- if (attrib >= AVRC_PLAYER_SETTING_LOW_MENU_EXT &&
- attrib <= AVRC_PLAYER_SETTING_HIGH_MENU_EXT)
+ if (attrib >= AVRC_PLAYER_SETTING_LOW_MENU_EXT)
result = TRUE;
if (!result)
@@ -140,7 +139,7 @@
BOOLEAN result=FALSE;
if ( (attr >= AVRC_PLAYER_SETTING_EQUALIZER && attr <= AVRC_PLAYER_SETTING_SCAN) ||
- (attr >= AVRC_PLAYER_SETTING_LOW_MENU_EXT && attr <= AVRC_PLAYER_SETTING_HIGH_MENU_EXT) )
+ (attr >= AVRC_PLAYER_SETTING_LOW_MENU_EXT) )
{
result = TRUE;
}
diff --git a/stack/bnep/bnep_main.c b/stack/bnep/bnep_main.c
index 12c9da0..45d3b14 100644
--- a/stack/bnep/bnep_main.c
+++ b/stack/bnep/bnep_main.c
@@ -41,6 +41,7 @@
#include "bnep_api.h"
#include "bnep_int.h"
+#include "bt_utils.h"
/********************************************************************************/
@@ -120,6 +121,7 @@
static void bnep_connect_ind (BD_ADDR bd_addr, UINT16 l2cap_cid, UINT16 psm, UINT8 l2cap_id)
{
tBNEP_CONN *p_bcb = bnepu_find_bcb_by_bd_addr (bd_addr);
+ UNUSED(psm);
/* If we are not acting as server, or already have a connection, or have */
/* no more resources to handle the connection, reject the connection. */
diff --git a/stack/bnep/bnep_utils.c b/stack/bnep/bnep_utils.c
index 205eeeb..0a8fd6d 100644
--- a/stack/bnep/bnep_utils.c
+++ b/stack/bnep/bnep_utils.c
@@ -29,6 +29,7 @@
#include "bnep_int.h"
#include "btu.h"
#include "btm_int.h"
+#include "bt_utils.h"
/********************************************************************************/
@@ -1213,6 +1214,7 @@
tBNEP_CONN *p_bcb = (tBNEP_CONN *)p_ref_data;
UINT16 resp_code = BNEP_SETUP_CONN_OK;
BOOLEAN is_role_change;
+ UNUSED(bd_addr);
BNEP_TRACE_EVENT1 ("BNEP security callback returned result %d", result);
if (p_bcb->con_flags & BNEP_FLAGS_CONN_COMPLETED)
diff --git a/stack/btm/btm_acl.c b/stack/btm/btm_acl.c
index 72efb8e..68ac35f 100644
--- a/stack/btm/btm_acl.c
+++ b/stack/btm/btm_acl.c
@@ -37,7 +37,7 @@
#include "btm_int.h"
#include "l2c_int.h"
#include "hcidefs.h"
-#include "bd.h" /* bdcmp, bdcpy */
+#include "bd.h"
static void btm_establish_continue (tACL_CONN *p_acl_cb);
static void btm_read_remote_features (UINT16 handle);
diff --git a/stack/btm/btm_ble.c b/stack/btm/btm_ble.c
index 6f2f454..6a933bf 100644
--- a/stack/btm/btm_ble.c
+++ b/stack/btm/btm_ble.c
@@ -22,6 +22,9 @@
* security functions.
*
******************************************************************************/
+#include "bt_target.h"
+
+#if BLE_INCLUDED == TRUE
#include <string.h>
@@ -33,6 +36,7 @@
#include "smp_api.h"
#include "l2c_int.h"
#include "gap_api.h"
+#include "bt_utils.h"
#if SMP_INCLUDED == TRUE
extern BOOLEAN AES_CMAC ( BT_OCTET16 key, UINT8 *input, UINT16 length, UINT16 tlen, UINT8 *p_signature);
@@ -63,7 +67,6 @@
BOOLEAN BTM_SecAddBleDevice (BD_ADDR bd_addr, BD_NAME bd_name, tBT_DEVICE_TYPE dev_type,
tBLE_ADDR_TYPE addr_type)
{
-#if BLE_INCLUDED == TRUE
tBTM_SEC_DEV_REC *p_dev_rec;
UINT8 i = 0;
tBTM_INQ_INFO *p_info=NULL;
@@ -132,7 +135,6 @@
p_info->results.device_type, p_info->results.ble_addr_type);
}
-#endif
return(TRUE);
}
@@ -153,7 +155,7 @@
*******************************************************************************/
BOOLEAN BTM_SecAddBleKey (BD_ADDR bd_addr, tBTM_LE_KEY_VALUE *p_le_key, tBTM_LE_KEY_TYPE key_type)
{
-#if (BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE)
+#if SMP_INCLUDED == TRUE
tBTM_SEC_DEV_REC *p_dev_rec;
BTM_TRACE_DEBUG0 ("BTM_SecAddBleKey");
p_dev_rec = btm_find_dev (bd_addr);
@@ -200,7 +202,6 @@
*******************************************************************************/
void BTM_BleLoadLocalKeys(UINT8 key_type, tBTM_BLE_LOCAL_KEYS *p_key)
{
-#if BLE_INCLUDED == TRUE
tBTM_DEVCB *p_devcb = &btm_cb.devcb;
BTM_TRACE_DEBUG0 ("BTM_BleLoadLocalKeys");
if (p_key != NULL)
@@ -220,7 +221,6 @@
break;
}
}
-#endif
}
/*******************************************************************************
@@ -238,9 +238,7 @@
{
BTM_TRACE_DEBUG0 ("BTM_GetDeviceEncRoot");
-#if BLE_INCLUDED == TRUE
memcpy (er, btm_cb.devcb.er, BT_OCTET16_LEN);
-#endif
}
/*******************************************************************************
@@ -258,9 +256,7 @@
{
BTM_TRACE_DEBUG0 ("BTM_GetDeviceIDRoot ");
-#if BLE_INCLUDED == TRUE
memcpy (irk, btm_cb.devcb.id_keys.irk, BT_OCTET16_LEN);
-#endif
}
/*******************************************************************************
@@ -275,10 +271,8 @@
*******************************************************************************/
void BTM_GetDeviceDHK (BT_OCTET16 dhk)
{
-#if BLE_INCLUDED == TRUE
BTM_TRACE_DEBUG0 ("BTM_GetDeviceDHK");
memcpy (dhk, btm_cb.devcb.id_keys.dhk, BT_OCTET16_LEN);
-#endif
}
/*******************************************************************************
@@ -293,7 +287,6 @@
*******************************************************************************/
void BTM_ReadConnectionAddr (BD_ADDR remote_bda, BD_ADDR local_conn_addr, tBLE_ADDR_TYPE *p_addr_type)
{
-#if BLE_INCLUDED == TRUE
tACL_CONN *p_acl = btm_bda_to_acl(remote_bda);
if (p_acl == NULL)
@@ -306,9 +299,8 @@
BTM_TRACE_DEBUG2 ("BTM_ReadConnectionAddr address type: %d addr: 0x%02x",
p_acl->conn_addr_type, p_acl->conn_addr[0]);
-
-#endif
}
+
/*******************************************************************************
**
** Function BTM_IsBleConnection
@@ -321,7 +313,6 @@
*******************************************************************************/
BOOLEAN BTM_IsBleConnection (UINT16 conn_handle)
{
-#if (BLE_INCLUDED == TRUE)
UINT8 xx;
tACL_CONN *p;
@@ -334,9 +325,6 @@
p = &btm_cb.acl_db[xx];
return(p->is_le_link);
-#else
- return FALSE;
-#endif
}
/*******************************************************************************
@@ -352,7 +340,6 @@
BOOLEAN BTM_ReadRemoteConnectionAddr(BD_ADDR pseudo_addr, BD_ADDR conn_addr, tBLE_ADDR_TYPE *p_addr_type)
{
BOOLEAN st = TRUE;
-#if BLE_INCLUDED == TRUE
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev(pseudo_addr);
memcpy(conn_addr, pseudo_addr, BD_ADDR_LEN);
@@ -360,7 +347,6 @@
{
*p_addr_type = p_dev_rec->ble.ble_addr_type;
}
-#endif
return st;
}
/*******************************************************************************
@@ -378,7 +364,7 @@
*******************************************************************************/
void BTM_SecurityGrant(BD_ADDR bd_addr, UINT8 res)
{
-#if (BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE)
+#if SMP_INCLUDED == TRUE
tSMP_STATUS res_smp = (res == BTM_SUCCESS) ? SMP_SUCCESS : SMP_REPEATED_ATTEMPTS;
BTM_TRACE_DEBUG0 ("BTM_SecurityGrant");
SMP_SecurityGrant(bd_addr, res_smp);
@@ -401,7 +387,7 @@
*******************************************************************************/
void BTM_BlePasskeyReply (BD_ADDR bd_addr, UINT8 res, UINT32 passkey)
{
-#if (BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE)
+#if SMP_INCLUDED == TRUE
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (bd_addr);
tSMP_STATUS res_smp = (res == BTM_SUCCESS) ? SMP_SUCCESS : SMP_PASSKEY_ENTRY_FAIL;
@@ -431,7 +417,7 @@
*******************************************************************************/
void BTM_BleOobDataReply(BD_ADDR bd_addr, UINT8 res, UINT8 len, UINT8 *p_data)
{
-#if (BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE)
+#if SMP_INCLUDED == TRUE
tSMP_STATUS res_smp = (res == BTM_SUCCESS) ? SMP_SUCCESS : SMP_OOB_FAIL;
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (bd_addr);
@@ -462,7 +448,7 @@
*******************************************************************************/
void BTM_BleSetConnScanParams (UINT16 scan_interval, UINT16 scan_window)
{
-#if (BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE)
+#if SMP_INCLUDED == TRUE
tBTM_BLE_CB *p_ble_cb = &btm_cb.ble_ctr_cb;
BOOLEAN new_param = FALSE;
@@ -516,7 +502,6 @@
UINT16 min_conn_int, UINT16 max_conn_int,
UINT16 slave_latency, UINT16 supervision_tout)
{
-#if BLE_INCLUDED == TRUE
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (bd_addr);
BTM_TRACE_API4 ("BTM_BleSetPrefConnParams min: %u max: %u latency: %u \
@@ -565,7 +550,6 @@
{
BTM_TRACE_ERROR0("Illegal Connection Parameters");
}
-#endif /* BLE_INCLUDED */
}
/*******************************************************************************
@@ -582,7 +566,6 @@
*******************************************************************************/
void BTM_ReadDevInfo (BD_ADDR remote_bda, tBT_DEVICE_TYPE *p_dev_type, tBLE_ADDR_TYPE *p_addr_type)
{
-#if BLE_INCLUDED == TRUE
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (remote_bda);
tBTM_INQ_INFO *p_inq_info = BTM_InqDbRead(remote_bda);
@@ -615,13 +598,8 @@
}
BTM_TRACE_DEBUG2 ("btm_find_dev_type - device_type = %d addr_type = %d", *p_dev_type , *p_addr_type);
-#endif
-
- return;
}
-#if BLE_INCLUDED == TRUE
-
/*******************************************************************************
**
** Function BTM_BleReceiverTest
@@ -683,13 +661,9 @@
}
}
-#endif
-
/*******************************************************************************
** Internal Functions
*******************************************************************************/
-#if BLE_INCLUDED == TRUE
-
void btm_ble_test_command_complete(UINT8 *p)
{
tBTM_CMPL_CB *p_cb = btm_cb.devcb.p_le_test_cmd_cmpl_cb;
@@ -714,13 +688,11 @@
*******************************************************************************/
BOOLEAN BTM_IsBleLink (BD_ADDR bd_addr)
{
-#if (BLE_INCLUDED == TRUE)
tACL_CONN *p;
BTM_TRACE_DEBUG0 ("BTM_IsBleLink");
if ((p = btm_bda_to_acl(bd_addr)) != NULL)
return p->is_le_link;
else
-#endif
return FALSE;
}
/*******************************************************************************
@@ -741,9 +713,7 @@
if ((p = btm_bda_to_acl(bd_addr)) != NULL)
{
-#if (BLE_INCLUDED == TRUE)
use_le = (p->is_le_link);
-#endif
}
else
{
@@ -1507,6 +1477,7 @@
{
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (bda);
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
+ UNUSED(addr_matched);
BTM_TRACE_EVENT0 ("btm_ble_connected");
@@ -1568,6 +1539,7 @@
BD_ADDR bda;
UINT16 conn_interval, conn_latency, conn_timeout;
BOOLEAN match = FALSE;
+ UNUSED(evt_len);
STREAM_TO_UINT8 (status, p);
STREAM_TO_UINT16 (handle, p);
@@ -1701,8 +1673,6 @@
}
#endif /* SMP_INCLUDED */
-#endif /* BLE_INCLUDED */
-
/*******************************************************************************
**
@@ -1724,7 +1694,7 @@
BLE_SIGNATURE signature)
{
BOOLEAN ret = FALSE;
-#if (BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE)
+#if SMP_INCLUDED == TRUE
tBTM_SEC_DEV_REC *p_rec = btm_find_dev (bd_addr);
UINT8 *p_buf, *pp;
@@ -1823,7 +1793,7 @@
}
}
}
-#endif /* BLE_INCLUDED */
+#endif /* SMP_INCLUDED */
return ret;
}
@@ -1846,7 +1816,7 @@
UINT8 *p_comp)
{
BOOLEAN verified = FALSE;
-#if (BLE_INCLUDED == TRUE && SMP_INCLUDED == TRUE)
+#if SMP_INCLUDED == TRUE
tBTM_SEC_DEV_REC *p_rec = btm_find_dev (bd_addr);
UINT8 p_mac[BTM_CMAC_TLEN_SIZE];
@@ -1875,11 +1845,10 @@
}
}
}
-#endif /* BLE_INCLUDED */
+#endif /* SMP_INCLUDED */
return verified;
}
-#if BLE_INCLUDED == TRUE
/*******************************************************************************
** Utility functions for LE device IR/ER generation
*******************************************************************************/
@@ -2218,5 +2187,4 @@
}
#endif /* BTM_BLE_CONFORMANCE_TESTING */
-
#endif /* BLE_INCLUDED */
diff --git a/stack/btm/btm_ble_addr.c b/stack/btm/btm_ble_addr.c
index 9ae37f9..a3f6a7e 100644
--- a/stack/btm/btm_ble_addr.c
+++ b/stack/btm/btm_ble_addr.c
@@ -28,10 +28,10 @@
#include "hcimsgs.h"
#include "btu.h"
#include "btm_int.h"
-#include "btm_ble_int.h"
#include "gap_api.h"
#if (defined BLE_INCLUDED && BLE_INCLUDED == TRUE)
+#include "btm_ble_int.h"
#include "smp_api.h"
#define BTM_BLE_PRIVATE_ADDR_INT 900 /* 15 minutes minimum for
random address refreshing */
diff --git a/stack/btm/btm_ble_bgconn.c b/stack/btm/btm_ble_bgconn.c
index 727390c..96d35c4 100644
--- a/stack/btm/btm_ble_bgconn.c
+++ b/stack/btm/btm_ble_bgconn.c
@@ -29,7 +29,7 @@
#include "btm_int.h"
#include "l2c_int.h"
#include "hcimsgs.h"
-
+#include "bt_utils.h"
#ifndef BTM_BLE_SCAN_PARAM_TOUT
#define BTM_BLE_SCAN_PARAM_TOUT 50 /* 50 seconds */
@@ -73,6 +73,7 @@
BOOLEAN started = FALSE;
BD_ADDR dummy_bda = {0};
tBT_DEVICE_TYPE dev_type;
+ UNUSED(attr);
if (p_dev_rec != NULL &&
p_dev_rec->device_type == BT_DEVICE_TYPE_BLE)
@@ -227,6 +228,8 @@
{
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
UINT8 status;
+ UNUSED(evt_len);
+
BTM_TRACE_EVENT0 ("btm_ble_clear_white_list_complete");
STREAM_TO_UINT8 (status, p_data);
@@ -259,6 +262,8 @@
void btm_ble_remove_from_white_list_complete(UINT8 *p, UINT16 evt_len)
{
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
+ UNUSED(evt_len);
+
BTM_TRACE_EVENT0 ("btm_ble_remove_from_white_list_complete");
if (*p == HCI_SUCCESS)
{
@@ -299,6 +304,7 @@
tBTM_LE_BG_CONN_DEV *p_bg_dev = &p_cb->bg_dev_list[0], *p_next, *p_cur;
UINT8 i, j;
BOOLEAN ret = FALSE;
+ UNUSED(p_attr_tag);
BTM_TRACE_EVENT0 ("btm_update_bg_conn_list");
diff --git a/stack/btm/btm_ble_gap.c b/stack/btm/btm_ble_gap.c
index 47ee8cf..5e5b5db 100644
--- a/stack/btm/btm_ble_gap.c
+++ b/stack/btm/btm_ble_gap.c
@@ -27,6 +27,7 @@
#include <stddef.h>
#include "bt_types.h"
+#include "bt_utils.h"
#include "btu.h"
#include "btm_int.h"
#include "hcimsgs.h"
@@ -85,7 +86,10 @@
*******************************************************************************/
BOOLEAN BTM_BleUpdateAdvWhitelist(BOOLEAN add_remove, BD_ADDR remote_bda)
{
- return FALSE;
+ UNUSED(add_remove);
+ UNUSED(remote_bda);
+
+ return FALSE;
}
/*******************************************************************************
@@ -279,6 +283,8 @@
tBTM_BLE_CB *p_cb = &btm_cb.ble_ctr_cb;
p_cb->p_scan_req_cback = p_scan_req_cback;
}
+#else
+ UNUSED(p_scan_req_cback);
#endif
}
@@ -1391,6 +1397,7 @@
tBTM_BLE_INQ_CB *p_le_inq_cb = &btm_cb.ble_ctr_cb.inq_var;
UINT8 *p_cache;
UINT8 length;
+ UNUSED(p_cur);
/* cache adv report/scan response data */
if (evt_type != BTM_BLE_SCAN_RSP_EVT)
@@ -1518,6 +1525,7 @@
UINT8 data_len, rssi;
tBTM_BLE_INQ_CB *p_le_inq_cb = &btm_cb.ble_ctr_cb.inq_var;
UINT8 *p1;
+ UINT8 *p_uuid16;
STREAM_TO_UINT8 (data_len, p);
@@ -1562,6 +1570,26 @@
p_cur->flag = * p_flag;
}
+ if (p_le_inq_cb->adv_len != 0)
+ {
+ if ((p_uuid16 = BTM_CheckAdvData(p_le_inq_cb->adv_data_cache,
+ BTM_BLE_AD_TYPE_16SRV_CMPL, &len)) != NULL)
+ {
+ UINT8 i;
+ for (i = 0; i + 2 <= len; i = i + 2)
+ {
+ /* if this BLE device support HID over LE, set HID Major in class of device */
+ if ((p_uuid16[i] | (p_uuid16[i+1] << 8)) == UUID_SERVCLASS_LE_HID)
+ {
+ p_cur->dev_class[0] = 0;
+ p_cur->dev_class[1] = BTM_COD_MAJOR_PERIPHERAL;
+ p_cur->dev_class[2] = 0;
+ break;
+ }
+ }
+ }
+ }
+
/* if BR/EDR not supported is not set, assume is a DUMO device */
if ((p_cur->flag & BTM_BLE_BREDR_NOT_SPT) == 0 &&
evt_type != BTM_BLE_CONNECT_DIR_EVT)
@@ -1598,6 +1626,7 @@
{
UINT8 data_len, len;
UINT8 *p_dev_name, remname[31] = {0};
+ UNUSED(addr_type);
if (btm_cb.ble_ctr_cb.p_select_cback == NULL ||
/* non-connectable device */
@@ -2011,6 +2040,8 @@
tACL_CONN *pa = &btm_cb.acl_db[0];
UINT16 xx;
UINT8 dev_role = link_role;
+ UNUSED(bd_addr);
+ UNUSED(conn_cancel);
BTM_TRACE_DEBUG1("btm_ble_update_mode_operation adv_mode = %d", btm_cb.ble_ctr_cb.inq_var.adv_mode );
diff --git a/stack/btm/btm_ble_int.h b/stack/btm/btm_ble_int.h
index 4aeab19..7ce4f16 100644
--- a/stack/btm/btm_ble_int.h
+++ b/stack/btm/btm_ble_int.h
@@ -289,6 +289,7 @@
extern BOOLEAN btm_get_local_div (BD_ADDR bd_addr, UINT16 *p_div);
extern BOOLEAN btm_ble_get_enc_key_type(BD_ADDR bd_addr, UINT8 *p_key_types);
+extern void btm_ble_test_command_complete(UINT8 *p);
extern void btm_ble_rand_enc_complete (UINT8 *p, UINT16 op_code, tBTM_RAND_ENC_CB *p_enc_cplt_cback);
extern void btm_sec_save_le_key(BD_ADDR bd_addr, tBTM_LE_KEY_TYPE key_type, tBTM_LE_KEY_VALUE *p_keys, BOOLEAN pass_to_application);
extern void btm_ble_update_sec_key_size(BD_ADDR bd_addr, UINT8 enc_key_size);
diff --git a/stack/btm/btm_devctl.c b/stack/btm/btm_devctl.c
index 49e05b4..240bd2f 100644
--- a/stack/btm/btm_devctl.c
+++ b/stack/btm/btm_devctl.c
@@ -29,6 +29,7 @@
#include <stddef.h>
#include "bt_types.h"
+#include "bt_utils.h"
#include "hcimsgs.h"
#include "btu.h"
#include "btm_int.h"
@@ -729,6 +730,7 @@
UINT16 lm_num_acl_bufs;
UINT16 lm_num_sco_bufs;
UINT16 acl_buf_size;
+ UNUSED(evt_len);
STREAM_TO_UINT8 (status, p);
if (status == HCI_SUCCESS)
@@ -790,8 +792,9 @@
{
UINT8 status;
UINT16 lm_num_le_bufs;
+ UNUSED(evt_len);
- BTM_TRACE_DEBUG0("btm_read_ble_buf_size_complete ");
+ BTM_TRACE_DEBUG0("btm_read_ble_buf_size_complete ");
STREAM_TO_UINT8 (status, p);
if (status == HCI_SUCCESS)
{
@@ -823,6 +826,7 @@
void btm_read_ble_local_supported_features_complete (UINT8 *p, UINT16 evt_len)
{
UINT8 status;
+ UNUSED(evt_len);
BTM_TRACE_DEBUG0("btm_read_ble_local_supported_features_complete ");
@@ -860,8 +864,9 @@
void btm_read_white_list_size_complete(UINT8 *p, UINT16 evt_len)
{
UINT8 status;
+ UNUSED(evt_len);
- BTM_TRACE_DEBUG0("btm_read_white_list_size_complete ");
+ BTM_TRACE_DEBUG0("btm_read_white_list_size_complete ");
STREAM_TO_UINT8 (status, p);
if (status == HCI_SUCCESS)
@@ -888,6 +893,7 @@
{
tBTM_VERSION_INFO *p_vi = &btm_cb.devcb.local_version;
UINT8 status;
+ UNUSED(evt_len);
#ifdef BTA_PRM_CHECK_FW_VER
if(BTA_PRM_CHECK_FW_VER(p))
@@ -1120,7 +1126,7 @@
btu_stop_timer (&btm_cb.devcb.reset_timer);
/* find the highest feature page number which contains non-zero bits */
- for (i = HCI_EXT_FEATURES_PAGE_MAX; i >= 0; i--)
+ for (i = HCI_EXT_FEATURES_PAGE_MAX; ; i--)
{
for (j = 0; j < HCI_FEATURE_BYTES_PER_PAGE; j++)
{
@@ -1326,6 +1332,7 @@
{
tBTM_DEVCB *p_devcb = &btm_cb.devcb;
UINT8 status;
+ UNUSED(evt_len);
btu_stop_timer (&p_devcb->reset_timer);
@@ -1369,6 +1376,7 @@
UINT8 status;
UINT8 page_number;
UINT8 page_number_max;
+ UNUSED(evt_len);
btu_stop_timer (&btm_cb.devcb.reset_timer);
@@ -1644,6 +1652,7 @@
{
tBTM_CMPL_CB *p_cb = btm_cb.devcb.p_rln_cmpl_cb;
UINT8 status;
+ UNUSED(evt_len);
btu_stop_timer (&btm_cb.devcb.rln_timer);
@@ -1708,6 +1717,7 @@
void btm_read_local_addr_complete (UINT8 *p, UINT16 evt_len)
{
UINT8 status;
+ UNUSED(evt_len);
STREAM_TO_UINT8 (status, p);
diff --git a/stack/btm/btm_int.h b/stack/btm/btm_int.h
index 16a02e6..b030c2a 100644
--- a/stack/btm/btm_int.h
+++ b/stack/btm/btm_int.h
@@ -488,8 +488,6 @@
UINT32 local_counter; /* local sign counter for sending signed write cmd*/
}tBTM_SEC_BLE_KEYS;
-#endif /* BLE_INCLUDED */
-
typedef struct
{
tBLE_ADDR_TYPE ble_addr_type; /* LE device type: public or random address */
@@ -502,6 +500,8 @@
#endif
} tBTM_SEC_BLE;
+#endif /* BLE_INCLUDED */
+
/*
** Define structure for Security Device Record.
** A record exists for each device authenticated with this device
@@ -939,6 +939,7 @@
extern void btm_inq_db_init (void);
extern void btm_process_inq_results (UINT8 *p, UINT8 inq_res_mode);
extern void btm_process_inq_complete (UINT8 status, UINT8 mode);
+extern void btm_process_cancel_complete(UINT8 status, UINT8 mode);
extern void btm_event_filter_complete (UINT8 *p);
extern void btm_inq_stop_on_ssp(void);
extern void btm_inq_clear_ssp(void);
@@ -1123,7 +1124,7 @@
#if BLE_INCLUDED == TRUE
extern void btm_sec_clear_ble_keys (tBTM_SEC_DEV_REC *p_dev_rec);
-extern BOOLEAN btm_sec_find_bonded_dev (UINT8 start_idx, UINT8 *p_found_idx, tBTM_SEC_DEV_REC *p_rec);
+extern BOOLEAN btm_sec_find_bonded_dev (UINT8 start_idx, UINT8 *p_found_idx, tBTM_SEC_DEV_REC **p_rec);
extern BOOLEAN btm_sec_is_a_bonded_dev (BD_ADDR bda);
extern BOOLEAN btm_sec_is_le_capable_dev (BD_ADDR bda);
#endif /* BLE_INCLUDED */
diff --git a/stack/btm/btm_pm.c b/stack/btm/btm_pm.c
index 19b90d3..02e3a6a 100644
--- a/stack/btm/btm_pm.c
+++ b/stack/btm/btm_pm.c
@@ -40,7 +40,7 @@
#include "btm_int.h"
#include "l2c_int.h"
#include "hcidefs.h"
-
+#include "bt_utils.h"
#if BTM_PWR_MGR_INCLUDED == TRUE
@@ -369,8 +369,6 @@
cb = btm_cb.pm_reg_db[btm_cb.pm_pend_id].cback;
}
- /* no command pending */
- btm_cb.pm_pend_link = MAX_L2CAP_LINKS;
/* clear the register record */
for(xx=0; xx<BTM_MAX_PM_RECORDS; xx++)
@@ -378,8 +376,11 @@
btm_cb.pm_reg_db[xx].mask = BTM_PM_REC_NOT_USED;
}
- if(cb != NULL)
+ if(cb != NULL && btm_cb.pm_pend_link < MAX_L2CAP_LINKS)
(*cb)(btm_cb.acl_db[btm_cb.pm_pend_link].remote_addr, BTM_PM_STS_ERROR, BTM_DEV_RESET, 0);
+
+ /* no command pending */
+ btm_cb.pm_pend_link = MAX_L2CAP_LINKS;
}
/*******************************************************************************
@@ -922,6 +923,7 @@
tBTM_PM_MCB *p_cb;
tACL_CONN *p_acl=NULL;
UINT16 use_ssr = TRUE;
+ UNUSED(evt_len);
STREAM_TO_UINT8 (status, p);
diff --git a/stack/btm/btm_sco.c b/stack/btm/btm_sco.c
index 3eb010c..2200b71 100644
--- a/stack/btm/btm_sco.c
+++ b/stack/btm/btm_sco.c
@@ -33,6 +33,7 @@
#include "btm_api.h"
#include "btm_int.h"
#include "hcidefs.h"
+#include "bt_utils.h"
#if BTM_SCO_INCLUDED == TRUE
@@ -93,7 +94,11 @@
GKI_freebuf (p_buf);
}
}
+#else
+ UNUSED(sco_inx);
#endif
+#else
+ UNUSED(sco_inx);
#endif
}
/*******************************************************************************
@@ -382,6 +387,8 @@
return (status);
#else
+ UNUSED(sco_inx);
+ UNUSED(p_buf);
return (BTM_NO_RESOURCES);
#endif
}
diff --git a/stack/btm/btm_sec.c b/stack/btm/btm_sec.c
index 8bcf435..09f41b7 100644
--- a/stack/btm/btm_sec.c
+++ b/stack/btm/btm_sec.c
@@ -28,6 +28,7 @@
#include "btu.h"
#include "btm_int.h"
#include "l2c_int.h"
+#include "bt_utils.h"
#if (BT_USE_TRACES == TRUE && BT_TRACE_VERBOSE == FALSE)
/* needed for sprintf() */
@@ -432,6 +433,13 @@
return(btm_sec_set_security_level (conn_type, p_name, service_id,
sec_level, psm, mx_proto_id, mx_chan_id));
#else
+ UNUSED(is_originator);
+ UNUSED(p_name);
+ UNUSED(service_id);
+ UNUSED(sec_level);
+ UNUSED(psm);
+ UNUSED(mx_proto_id);
+ UNUSED(mx_chan_id);
return FALSE;
#endif
}
@@ -842,6 +850,7 @@
return(num_cleared);
#else
+ UNUSED(service_id);
return(0);
#endif
}
@@ -4039,6 +4048,7 @@
static void btm_sec_connect_after_reject_timeout (TIMER_LIST_ENT *p_tle)
{
tBTM_SEC_DEV_REC *p_dev_rec = btm_cb.p_collided_dev_rec;
+ UNUSED(p_tle);
BTM_TRACE_EVENT0 ("btm_sec_connect_after_reject_timeout()");
btm_cb.sec_collision_tle.param = 0;
@@ -4655,6 +4665,7 @@
#endif
#endif
UINT8 name[2];
+ UNUSED(p_tle);
p_cb->pairing_tle.param = 0;
/* Coverity: FALSE-POSITIVE error from Coverity tool. Please do NOT remove following comment. */
@@ -5357,6 +5368,7 @@
static void btm_sec_collision_timeout (TIMER_LIST_ENT *p_tle)
{
tBTM_STATUS status;
+ UNUSED(p_tle);
BTM_TRACE_EVENT0 ("btm_sec_collision_timeout()");
btm_cb.sec_collision_tle.param = 0;
@@ -5772,7 +5784,7 @@
** Returns TRUE - found a bonded device
**
*******************************************************************************/
-BOOLEAN btm_sec_find_bonded_dev (UINT8 start_idx, UINT8 *p_found_idx, tBTM_SEC_DEV_REC *p_rec)
+BOOLEAN btm_sec_find_bonded_dev (UINT8 start_idx, UINT8 *p_found_idx, tBTM_SEC_DEV_REC **p_rec)
{
BOOLEAN found= FALSE;
@@ -5791,7 +5803,7 @@
if (p_dev_rec->ble.key_type || (p_dev_rec->sec_flags & BTM_SEC_LINK_KEY_KNOWN))
{
*p_found_idx = i;
- p_rec = p_dev_rec;
+ *p_rec = p_dev_rec;
break;
}
}
diff --git a/stack/btu/btu_hcif.c b/stack/btu/btu_hcif.c
index ab0a0cc..cef5096 100644
--- a/stack/btu/btu_hcif.c
+++ b/stack/btu/btu_hcif.c
@@ -63,64 +63,64 @@
/********************************************************************************/
/* L O C A L F U N C T I O N P R O T O T Y P E S */
/********************************************************************************/
-static void btu_hcif_inquiry_comp_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_inquiry_result_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_inquiry_rssi_result_evt (UINT8 *p, UINT16 evt_len);
+static void btu_hcif_inquiry_comp_evt (UINT8 *p);
+static void btu_hcif_inquiry_result_evt (UINT8 *p);
+static void btu_hcif_inquiry_rssi_result_evt (UINT8 *p);
#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
-static void btu_hcif_extended_inquiry_result_evt (UINT8 *p, UINT16 evt_len);
+static void btu_hcif_extended_inquiry_result_evt (UINT8 *p);
#endif
-static void btu_hcif_connection_comp_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_connection_request_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_disconnection_comp_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_authentication_comp_evt (UINT8 *p, UINT16 evt_len);
+static void btu_hcif_connection_comp_evt (UINT8 *p);
+static void btu_hcif_connection_request_evt (UINT8 *p);
+static void btu_hcif_disconnection_comp_evt (UINT8 *p);
+static void btu_hcif_authentication_comp_evt (UINT8 *p);
static void btu_hcif_rmt_name_request_comp_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_encryption_change_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_change_conn_link_key_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_master_link_key_comp_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_read_rmt_features_comp_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_read_rmt_ext_features_comp_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_read_rmt_version_comp_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_qos_setup_comp_evt (UINT8 *p, UINT16 evt_len);
+static void btu_hcif_encryption_change_evt (UINT8 *p);
+static void btu_hcif_change_conn_link_key_evt (UINT8 *p);
+static void btu_hcif_master_link_key_comp_evt (UINT8 *p);
+static void btu_hcif_read_rmt_features_comp_evt (UINT8 *p);
+static void btu_hcif_read_rmt_ext_features_comp_evt (UINT8 *p);
+static void btu_hcif_read_rmt_version_comp_evt (UINT8 *p);
+static void btu_hcif_qos_setup_comp_evt (UINT8 *p);
static void btu_hcif_command_complete_evt (UINT8 controller_id, UINT8 *p, UINT16 evt_len);
-static void btu_hcif_command_status_evt (UINT8 controller_id, UINT8 *p, UINT16 evt_len);
-static void btu_hcif_hardware_error_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_flush_occured_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_role_change_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_num_compl_data_pkts_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_mode_change_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_return_link_keys_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_pin_code_request_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_link_key_request_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_link_key_notification_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_loopback_command_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_data_buf_overflow_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_max_slots_changed_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_read_clock_off_comp_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_conn_pkt_type_change_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_qos_violation_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_page_scan_mode_change_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_page_scan_rep_mode_chng_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_esco_connection_comp_evt(UINT8 *p, UINT16 evt_len);
-static void btu_hcif_esco_connection_chg_evt(UINT8 *p, UINT16 evt_len);
+static void btu_hcif_command_status_evt (UINT8 controller_id, UINT8 *p);
+static void btu_hcif_hardware_error_evt (UINT8 *p);
+static void btu_hcif_flush_occured_evt (void);
+static void btu_hcif_role_change_evt (UINT8 *p);
+static void btu_hcif_num_compl_data_pkts_evt (UINT8 *p);
+static void btu_hcif_mode_change_evt (UINT8 *p);
+static void btu_hcif_return_link_keys_evt (UINT8 *p);
+static void btu_hcif_pin_code_request_evt (UINT8 *p);
+static void btu_hcif_link_key_request_evt (UINT8 *p);
+static void btu_hcif_link_key_notification_evt (UINT8 *p);
+static void btu_hcif_loopback_command_evt (void);
+static void btu_hcif_data_buf_overflow_evt (void);
+static void btu_hcif_max_slots_changed_evt (void);
+static void btu_hcif_read_clock_off_comp_evt (UINT8 *p);
+static void btu_hcif_conn_pkt_type_change_evt (void);
+static void btu_hcif_qos_violation_evt (UINT8 *p);
+static void btu_hcif_page_scan_mode_change_evt (void);
+static void btu_hcif_page_scan_rep_mode_chng_evt (void);
+static void btu_hcif_esco_connection_comp_evt(UINT8 *p);
+static void btu_hcif_esco_connection_chg_evt(UINT8 *p);
/* Simple Pairing Events */
-static void btu_hcif_host_support_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_io_cap_request_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_io_cap_response_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_user_conf_request_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_user_passkey_request_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_user_passkey_notif_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_keypress_notif_evt (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_link_super_tout_evt (UINT8 *p, UINT16 evt_len);
+static void btu_hcif_host_support_evt (UINT8 *p);
+static void btu_hcif_io_cap_request_evt (UINT8 *p);
+static void btu_hcif_io_cap_response_evt (UINT8 *p);
+static void btu_hcif_user_conf_request_evt (UINT8 *p);
+static void btu_hcif_user_passkey_request_evt (UINT8 *p);
+static void btu_hcif_user_passkey_notif_evt (UINT8 *p);
+static void btu_hcif_keypress_notif_evt (UINT8 *p);
+static void btu_hcif_link_super_tout_evt (UINT8 *p);
#if BTM_OOB_INCLUDED == TRUE
-static void btu_hcif_rem_oob_request_evt (UINT8 *p, UINT16 evt_len);
+static void btu_hcif_rem_oob_request_evt (UINT8 *p);
#endif
-static void btu_hcif_simple_pair_complete_evt (UINT8 *p, UINT16 evt_len);
+static void btu_hcif_simple_pair_complete_evt (UINT8 *p);
#if L2CAP_NON_FLUSHABLE_PB_INCLUDED == TRUE
-static void btu_hcif_enhanced_flush_complete_evt (UINT8 *p, UINT16 evt_len);
+static void btu_hcif_enhanced_flush_complete_evt (void);
#endif
#if (BTM_SSR_INCLUDED == TRUE)
@@ -134,11 +134,11 @@
#if BLE_INCLUDED == TRUE
static void btu_ble_ll_conn_complete_evt (UINT8 *p, UINT16 evt_len);
-static void btu_ble_process_adv_pkt (UINT8 *p, UINT16 evt_len);
-static void btu_ble_read_remote_feat_evt (UINT8 *p, UINT16 evt_len);
-static void btu_ble_ll_conn_param_upd_evt (UINT8 *p, UINT16 evt_len);
-static void btu_ble_proc_ltk_req (UINT8 *p, UINT16 evt_len);
-static void btu_hcif_encyption_key_refresh_cmpl_evt (UINT8 *p, UINT16 evt_len);
+static void btu_ble_process_adv_pkt (UINT8 *p);
+static void btu_ble_read_remote_feat_evt (UINT8 *p);
+static void btu_ble_ll_conn_param_upd_evt (UINT8 *p);
+static void btu_ble_proc_ltk_req (UINT8 *p);
+static void btu_hcif_encryption_key_refresh_cmpl_evt (UINT8 *p);
#endif
/*******************************************************************************
**
@@ -240,122 +240,122 @@
switch (hci_evt_code)
{
case HCI_INQUIRY_COMP_EVT:
- btu_hcif_inquiry_comp_evt (p, hci_evt_len);
+ btu_hcif_inquiry_comp_evt (p);
break;
case HCI_INQUIRY_RESULT_EVT:
- btu_hcif_inquiry_result_evt (p, hci_evt_len);
+ btu_hcif_inquiry_result_evt (p);
break;
case HCI_INQUIRY_RSSI_RESULT_EVT:
- btu_hcif_inquiry_rssi_result_evt (p, hci_evt_len);
+ btu_hcif_inquiry_rssi_result_evt (p);
break;
#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
case HCI_EXTENDED_INQUIRY_RESULT_EVT:
- btu_hcif_extended_inquiry_result_evt (p, hci_evt_len);
+ btu_hcif_extended_inquiry_result_evt (p);
break;
#endif
case HCI_CONNECTION_COMP_EVT:
- btu_hcif_connection_comp_evt (p, hci_evt_len);
+ btu_hcif_connection_comp_evt (p);
break;
case HCI_CONNECTION_REQUEST_EVT:
- btu_hcif_connection_request_evt (p, hci_evt_len);
+ btu_hcif_connection_request_evt (p);
break;
case HCI_DISCONNECTION_COMP_EVT:
- btu_hcif_disconnection_comp_evt (p, hci_evt_len);
+ btu_hcif_disconnection_comp_evt (p);
break;
case HCI_AUTHENTICATION_COMP_EVT:
- btu_hcif_authentication_comp_evt (p, hci_evt_len);
+ btu_hcif_authentication_comp_evt (p);
break;
case HCI_RMT_NAME_REQUEST_COMP_EVT:
btu_hcif_rmt_name_request_comp_evt (p, hci_evt_len);
break;
case HCI_ENCRYPTION_CHANGE_EVT:
- btu_hcif_encryption_change_evt (p, hci_evt_len);
+ btu_hcif_encryption_change_evt (p);
break;
#if BLE_INCLUDED == TRUE
case HCI_ENCRYPTION_KEY_REFRESH_COMP_EVT:
- btu_hcif_encyption_key_refresh_cmpl_evt(p, hci_evt_len);
+ btu_hcif_encryption_key_refresh_cmpl_evt(p);
break;
#endif
case HCI_CHANGE_CONN_LINK_KEY_EVT:
- btu_hcif_change_conn_link_key_evt (p, hci_evt_len);
+ btu_hcif_change_conn_link_key_evt (p);
break;
case HCI_MASTER_LINK_KEY_COMP_EVT:
- btu_hcif_master_link_key_comp_evt (p, hci_evt_len);
+ btu_hcif_master_link_key_comp_evt (p);
break;
case HCI_READ_RMT_FEATURES_COMP_EVT:
- btu_hcif_read_rmt_features_comp_evt (p, hci_evt_len);
+ btu_hcif_read_rmt_features_comp_evt (p);
break;
case HCI_READ_RMT_EXT_FEATURES_COMP_EVT:
- btu_hcif_read_rmt_ext_features_comp_evt (p, hci_evt_len);
+ btu_hcif_read_rmt_ext_features_comp_evt (p);
break;
case HCI_READ_RMT_VERSION_COMP_EVT:
- btu_hcif_read_rmt_version_comp_evt (p, hci_evt_len);
+ btu_hcif_read_rmt_version_comp_evt (p);
break;
case HCI_QOS_SETUP_COMP_EVT:
- btu_hcif_qos_setup_comp_evt (p, hci_evt_len);
+ btu_hcif_qos_setup_comp_evt (p);
break;
case HCI_COMMAND_COMPLETE_EVT:
btu_hcif_command_complete_evt (controller_id, p, hci_evt_len);
break;
case HCI_COMMAND_STATUS_EVT:
- btu_hcif_command_status_evt (controller_id, p, hci_evt_len);
+ btu_hcif_command_status_evt (controller_id, p);
break;
case HCI_HARDWARE_ERROR_EVT:
- btu_hcif_hardware_error_evt (p, hci_evt_len);
+ btu_hcif_hardware_error_evt (p);
break;
case HCI_FLUSH_OCCURED_EVT:
- btu_hcif_flush_occured_evt (p, hci_evt_len);
+ btu_hcif_flush_occured_evt ();
break;
case HCI_ROLE_CHANGE_EVT:
- btu_hcif_role_change_evt (p, hci_evt_len);
+ btu_hcif_role_change_evt (p);
break;
case HCI_NUM_COMPL_DATA_PKTS_EVT:
- btu_hcif_num_compl_data_pkts_evt (p, hci_evt_len);
+ btu_hcif_num_compl_data_pkts_evt (p);
break;
case HCI_MODE_CHANGE_EVT:
- btu_hcif_mode_change_evt (p, hci_evt_len);
+ btu_hcif_mode_change_evt (p);
break;
case HCI_RETURN_LINK_KEYS_EVT:
- btu_hcif_return_link_keys_evt (p, hci_evt_len);
+ btu_hcif_return_link_keys_evt (p);
break;
case HCI_PIN_CODE_REQUEST_EVT:
- btu_hcif_pin_code_request_evt (p, hci_evt_len);
+ btu_hcif_pin_code_request_evt (p);
break;
case HCI_LINK_KEY_REQUEST_EVT:
- btu_hcif_link_key_request_evt (p, hci_evt_len);
+ btu_hcif_link_key_request_evt (p);
break;
case HCI_LINK_KEY_NOTIFICATION_EVT:
- btu_hcif_link_key_notification_evt (p, hci_evt_len);
+ btu_hcif_link_key_notification_evt (p);
break;
case HCI_LOOPBACK_COMMAND_EVT:
- btu_hcif_loopback_command_evt (p, hci_evt_len);
+ btu_hcif_loopback_command_evt ();
break;
case HCI_DATA_BUF_OVERFLOW_EVT:
- btu_hcif_data_buf_overflow_evt (p, hci_evt_len);
+ btu_hcif_data_buf_overflow_evt ();
break;
case HCI_MAX_SLOTS_CHANGED_EVT:
- btu_hcif_max_slots_changed_evt (p, hci_evt_len);
+ btu_hcif_max_slots_changed_evt ();
break;
case HCI_READ_CLOCK_OFF_COMP_EVT:
- btu_hcif_read_clock_off_comp_evt (p, hci_evt_len);
+ btu_hcif_read_clock_off_comp_evt (p);
break;
case HCI_CONN_PKT_TYPE_CHANGE_EVT:
- btu_hcif_conn_pkt_type_change_evt (p, hci_evt_len);
+ btu_hcif_conn_pkt_type_change_evt ();
break;
case HCI_QOS_VIOLATION_EVT:
- btu_hcif_qos_violation_evt (p, hci_evt_len);
+ btu_hcif_qos_violation_evt (p);
break;
case HCI_PAGE_SCAN_MODE_CHANGE_EVT:
- btu_hcif_page_scan_mode_change_evt (p, hci_evt_len);
+ btu_hcif_page_scan_mode_change_evt ();
break;
case HCI_PAGE_SCAN_REP_MODE_CHNG_EVT:
- btu_hcif_page_scan_rep_mode_chng_evt (p, hci_evt_len);
+ btu_hcif_page_scan_rep_mode_chng_evt ();
break;
case HCI_ESCO_CONNECTION_COMP_EVT:
- btu_hcif_esco_connection_comp_evt (p, hci_evt_len);
+ btu_hcif_esco_connection_comp_evt (p);
break;
case HCI_ESCO_CONNECTION_CHANGED_EVT:
- btu_hcif_esco_connection_chg_evt (p, hci_evt_len);
+ btu_hcif_esco_connection_chg_evt (p);
break;
#if (BTM_SSR_INCLUDED == TRUE)
case HCI_SNIFF_SUB_RATE_EVT:
@@ -363,40 +363,40 @@
break;
#endif /* BTM_SSR_INCLUDED == TRUE */
case HCI_RMT_HOST_SUP_FEAT_NOTIFY_EVT:
- btu_hcif_host_support_evt (p, hci_evt_len);
+ btu_hcif_host_support_evt (p);
break;
case HCI_IO_CAPABILITY_REQUEST_EVT:
- btu_hcif_io_cap_request_evt (p, hci_evt_len);
+ btu_hcif_io_cap_request_evt (p);
break;
case HCI_IO_CAPABILITY_RESPONSE_EVT:
- btu_hcif_io_cap_response_evt (p, hci_evt_len);
+ btu_hcif_io_cap_response_evt (p);
break;
case HCI_USER_CONFIRMATION_REQUEST_EVT:
- btu_hcif_user_conf_request_evt (p, hci_evt_len);
+ btu_hcif_user_conf_request_evt (p);
break;
case HCI_USER_PASSKEY_REQUEST_EVT:
- btu_hcif_user_passkey_request_evt (p, hci_evt_len);
+ btu_hcif_user_passkey_request_evt (p);
break;
#if BTM_OOB_INCLUDED == TRUE
case HCI_REMOTE_OOB_DATA_REQUEST_EVT:
- btu_hcif_rem_oob_request_evt (p, hci_evt_len);
+ btu_hcif_rem_oob_request_evt (p);
break;
#endif
case HCI_SIMPLE_PAIRING_COMPLETE_EVT:
- btu_hcif_simple_pair_complete_evt (p, hci_evt_len);
+ btu_hcif_simple_pair_complete_evt (p);
break;
case HCI_USER_PASSKEY_NOTIFY_EVT:
- btu_hcif_user_passkey_notif_evt (p, hci_evt_len);
+ btu_hcif_user_passkey_notif_evt (p);
break;
case HCI_KEYPRESS_NOTIFY_EVT:
- btu_hcif_keypress_notif_evt (p, hci_evt_len);
+ btu_hcif_keypress_notif_evt (p);
break;
case HCI_LINK_SUPER_TOUT_CHANGED_EVT:
- btu_hcif_link_super_tout_evt (p, hci_evt_len);
+ btu_hcif_link_super_tout_evt (p);
break;
#if L2CAP_NON_FLUSHABLE_PB_INCLUDED == TRUE
case HCI_ENHANCED_FLUSH_COMPLETE_EVT:
- btu_hcif_enhanced_flush_complete_evt (p, hci_evt_len);
+ btu_hcif_enhanced_flush_complete_evt ();
break;
#endif
@@ -410,19 +410,19 @@
switch (ble_sub_code)
{
case HCI_BLE_ADV_PKT_RPT_EVT: /* result of inquiry */
- btu_ble_process_adv_pkt(p, hci_evt_len);
+ btu_ble_process_adv_pkt(p);
break;
case HCI_BLE_CONN_COMPLETE_EVT:
btu_ble_ll_conn_complete_evt(p, hci_evt_len);
break;
case HCI_BLE_LL_CONN_PARAM_UPD_EVT:
- btu_ble_ll_conn_param_upd_evt(p, hci_evt_len);
+ btu_ble_ll_conn_param_upd_evt(p);
break;
case HCI_BLE_READ_REMOTE_FEAT_CMPL_EVT:
- btu_ble_read_remote_feat_evt(p, hci_evt_len);
+ btu_ble_read_remote_feat_evt(p);
break;
case HCI_BLE_LTK_REQ_EVT: /* received only at slave device */
- btu_ble_proc_ltk_req(p, hci_evt_len);
+ btu_ble_proc_ltk_req(p);
break;
}
break;
@@ -563,7 +563,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_inquiry_comp_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_inquiry_comp_evt (UINT8 *p)
{
UINT8 status;
@@ -583,7 +583,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_inquiry_result_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_inquiry_result_evt (UINT8 *p)
{
/* Store results in the cache */
btm_process_inq_results (p, BTM_INQ_RESULT_STANDARD);
@@ -598,7 +598,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_inquiry_rssi_result_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_inquiry_rssi_result_evt (UINT8 *p)
{
/* Store results in the cache */
btm_process_inq_results (p, BTM_INQ_RESULT_WITH_RSSI);
@@ -614,7 +614,7 @@
**
*******************************************************************************/
#if (BTM_EIR_CLIENT_INCLUDED == TRUE)
-static void btu_hcif_extended_inquiry_result_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_extended_inquiry_result_evt (UINT8 *p)
{
/* Store results in the cache */
btm_process_inq_results (p, BTM_INQ_RESULT_EXTENDED);
@@ -630,7 +630,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_connection_comp_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_connection_comp_evt (UINT8 *p)
{
UINT8 status;
UINT16 handle;
@@ -676,7 +676,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_connection_request_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_connection_request_evt (UINT8 *p)
{
BD_ADDR bda;
DEV_CLASS dc;
@@ -710,7 +710,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_disconnection_comp_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_disconnection_comp_evt (UINT8 *p)
{
UINT8 status;
UINT16 handle;
@@ -743,7 +743,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_authentication_comp_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_authentication_comp_evt (UINT8 *p)
{
UINT8 status;
UINT16 handle;
@@ -789,7 +789,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_encryption_change_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_encryption_change_evt (UINT8 *p)
{
UINT8 status;
UINT16 handle;
@@ -813,7 +813,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_change_conn_link_key_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_change_conn_link_key_evt (UINT8 *p)
{
UINT8 status;
UINT16 handle;
@@ -834,7 +834,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_master_link_key_comp_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_master_link_key_comp_evt (UINT8 *p)
{
UINT8 status;
UINT16 handle;
@@ -857,7 +857,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_read_rmt_features_comp_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_read_rmt_features_comp_evt (UINT8 *p)
{
btm_read_remote_features_complete(p);
}
@@ -871,7 +871,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_read_rmt_ext_features_comp_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_read_rmt_ext_features_comp_evt (UINT8 *p)
{
UINT8 *p_cur = p;
UINT8 status;
@@ -897,7 +897,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_read_rmt_version_comp_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_read_rmt_version_comp_evt (UINT8 *p)
{
btm_read_remote_version_complete (p);
}
@@ -912,7 +912,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_qos_setup_comp_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_qos_setup_comp_evt (UINT8 *p)
{
UINT8 status;
UINT16 handle;
@@ -940,7 +940,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_esco_connection_comp_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_esco_connection_comp_evt (UINT8 *p)
{
#if BTM_SCO_INCLUDED == TRUE
tBTM_ESCO_DATA data;
@@ -974,7 +974,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_esco_connection_chg_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_esco_connection_chg_evt (UINT8 *p)
{
#if BTM_SCO_INCLUDED == TRUE
UINT16 handle;
@@ -1007,7 +1007,7 @@
**
*******************************************************************************/
static void btu_hcif_hdl_command_complete (UINT16 opcode, UINT8 *p, UINT16 evt_len,
- void *p_cplt_cback, UINT8 ctr_id)
+ void *p_cplt_cback)
{
switch (opcode)
{
@@ -1245,7 +1245,7 @@
}
/* handle event */
- btu_hcif_hdl_command_complete (cc_opcode, p, evt_len, p_cplt_cback, controller_id);
+ btu_hcif_hdl_command_complete (cc_opcode, p, evt_len, p_cplt_cback);
/* see if we can send more commands */
btu_hcif_send_cmd (controller_id, NULL);
@@ -1262,7 +1262,7 @@
**
*******************************************************************************/
static void btu_hcif_hdl_command_status (UINT16 opcode, UINT8 status, UINT8 *p_cmd,
- void *p_vsc_status_cback, UINT8 controller_id)
+ void *p_vsc_status_cback)
{
BD_ADDR bd_addr;
UINT16 handle;
@@ -1427,7 +1427,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_command_status_evt (UINT8 controller_id, UINT8 *p, UINT16 evt_len)
+static void btu_hcif_command_status_evt (UINT8 controller_id, UINT8 *p)
{
tHCI_CMD_CB * p_hci_cmd_cb = &(btu_cb.hci_cmd_cb[controller_id]);
UINT8 status;
@@ -1498,7 +1498,7 @@
}
/* handle command */
- btu_hcif_hdl_command_status (opcode, status, p_data, p_vsc_status_cback, controller_id);
+ btu_hcif_hdl_command_status (opcode, status, p_data, p_vsc_status_cback);
/* free stored command */
if (p_cmd != NULL)
@@ -1624,7 +1624,7 @@
case HCI_SETUP_ESCO_CONNECTION:
#endif
/* fake a command status */
- btu_hcif_hdl_command_status (opcode, HCI_ERR_UNSPECIFIED, p, NULL, controller_id);
+ btu_hcif_hdl_command_status (opcode, HCI_ERR_UNSPECIFIED, p, NULL);
break;
default:
@@ -1646,7 +1646,7 @@
/* fake a command complete; first create a fake event */
event = HCI_ERR_UNSPECIFIED;
- btu_hcif_hdl_command_complete (opcode, (UINT8 *)&event, 1, p_cplt_cback, controller_id);
+ btu_hcif_hdl_command_complete (opcode, (UINT8 *)&event, 1, p_cplt_cback);
break;
}
@@ -1686,7 +1686,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_hardware_error_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_hardware_error_evt (UINT8 *p)
{
BT_TRACE_1 (TRACE_LAYER_HCI, TRACE_TYPE_ERROR, "Ctlr H/w error event - code:0x%x", *p);
@@ -1708,7 +1708,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_flush_occured_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_flush_occured_evt (void)
{
}
@@ -1722,7 +1722,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_role_change_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_role_change_evt (UINT8 *p)
{
UINT8 status;
BD_ADDR bda;
@@ -1746,7 +1746,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_num_compl_data_pkts_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_num_compl_data_pkts_evt (UINT8 *p)
{
/* Process for L2CAP and SCO */
l2c_link_process_num_completed_pkts (p);
@@ -1764,7 +1764,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_mode_change_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_mode_change_evt (UINT8 *p)
{
UINT8 status;
UINT16 handle;
@@ -1819,7 +1819,7 @@
**
*******************************************************************************/
-static void btu_hcif_return_link_keys_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_return_link_keys_evt (UINT8 *p)
{
UINT8 num_keys;
tBTM_RETURN_LINK_KEYS_EVT *result;
@@ -1849,7 +1849,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_pin_code_request_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_pin_code_request_evt (UINT8 *p)
{
BD_ADDR bda;
@@ -1872,7 +1872,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_link_key_request_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_link_key_request_evt (UINT8 *p)
{
BD_ADDR bda;
@@ -1890,7 +1890,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_link_key_notification_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_link_key_notification_evt (UINT8 *p)
{
BD_ADDR bda;
LINK_KEY key;
@@ -1913,7 +1913,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_loopback_command_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_loopback_command_evt (void)
{
}
@@ -1927,7 +1927,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_data_buf_overflow_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_data_buf_overflow_evt (void)
{
}
@@ -1941,7 +1941,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_max_slots_changed_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_max_slots_changed_evt (void)
{
}
@@ -1955,7 +1955,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_read_clock_off_comp_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_read_clock_off_comp_evt (UINT8 *p)
{
UINT8 status;
UINT16 handle;
@@ -1986,7 +1986,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_conn_pkt_type_change_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_conn_pkt_type_change_evt (void)
{
}
@@ -2000,7 +2000,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_qos_violation_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_qos_violation_evt (UINT8 *p)
{
UINT16 handle;
@@ -2022,7 +2022,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_page_scan_mode_change_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_page_scan_mode_change_evt (void)
{
}
@@ -2036,7 +2036,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_page_scan_rep_mode_chng_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_page_scan_rep_mode_chng_evt (void)
{
}
@@ -2053,7 +2053,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_host_support_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_host_support_evt (UINT8 *p)
{
btm_sec_rmt_host_support_feat_evt(p);
}
@@ -2067,7 +2067,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_io_cap_request_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_io_cap_request_evt (UINT8 *p)
{
btm_io_capabilities_req(p);
}
@@ -2082,7 +2082,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_io_cap_response_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_io_cap_response_evt (UINT8 *p)
{
btm_io_capabilities_rsp(p);
}
@@ -2097,7 +2097,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_user_conf_request_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_user_conf_request_evt (UINT8 *p)
{
btm_proc_sp_req_evt(BTM_SP_CFM_REQ_EVT, p);
}
@@ -2112,7 +2112,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_user_passkey_request_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_user_passkey_request_evt (UINT8 *p)
{
btm_proc_sp_req_evt(BTM_SP_KEY_REQ_EVT, p);
}
@@ -2126,7 +2126,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_user_passkey_notif_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_user_passkey_notif_evt (UINT8 *p)
{
btm_proc_sp_req_evt(BTM_SP_KEY_NOTIF_EVT, p);
}
@@ -2140,7 +2140,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_keypress_notif_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_keypress_notif_evt (UINT8 *p)
{
btm_keypress_notif_evt(p);
}
@@ -2154,7 +2154,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_link_super_tout_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_link_super_tout_evt (UINT8 *p)
{
UINT16 handle, timeout;
STREAM_TO_UINT16 (handle, p);
@@ -2173,7 +2173,7 @@
**
*******************************************************************************/
#if BTM_OOB_INCLUDED == TRUE
-static void btu_hcif_rem_oob_request_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_rem_oob_request_evt (UINT8 *p)
{
btm_rem_oob_req(p);
}
@@ -2188,7 +2188,7 @@
** Returns void
**
*******************************************************************************/
-static void btu_hcif_simple_pair_complete_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_simple_pair_complete_evt (UINT8 *p)
{
btm_simple_pair_complete(p);
}
@@ -2227,7 +2227,7 @@
**
*******************************************************************************/
#if L2CAP_NON_FLUSHABLE_PB_INCLUDED == TRUE
-static void btu_hcif_enhanced_flush_complete_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_enhanced_flush_complete_evt (void)
{
/* This is empty until an upper layer cares about returning event */
}
@@ -2241,7 +2241,7 @@
** BLE Events
***********************************************/
#if (defined BLE_INCLUDED) && (BLE_INCLUDED == TRUE)
-static void btu_hcif_encyption_key_refresh_cmpl_evt (UINT8 *p, UINT16 evt_len)
+static void btu_hcif_encryption_key_refresh_cmpl_evt (UINT8 *p)
{
UINT8 status;
UINT8 enc_enable = 0;
@@ -2255,7 +2255,7 @@
btm_sec_encrypt_change (handle, status, enc_enable);
}
-static void btu_ble_process_adv_pkt (UINT8 *p, UINT16 evt_len)
+static void btu_ble_process_adv_pkt (UINT8 *p)
{
BT_TRACE_0 (TRACE_LAYER_HCI, TRACE_TYPE_EVENT, "btu_ble_process_adv_pkt");
@@ -2267,17 +2267,26 @@
btm_ble_conn_complete(p, evt_len);
}
-static void btu_ble_ll_conn_param_upd_evt (UINT8 *p, UINT16 evt_len)
+static void btu_ble_ll_conn_param_upd_evt (UINT8 *p)
{
-/* This is empty until an upper layer cares about returning event */
+ /* LE connection update has completed successfully as a master. */
+ /* We can enable the update request if the result is a success. */
+ /* extract the HCI handle first */
+ UINT8 status;
+ UINT16 handle;
+ BT_TRACE_0(TRACE_LAYER_HCI, TRACE_TYPE_EVENT, "btu_ble_ll_conn_param_upd_evt");
+
+ STREAM_TO_UINT8 (status, p);
+ STREAM_TO_UINT16 (handle, p);
+ L2CA_HandleConnUpdateEvent(handle, status);
}
-static void btu_ble_read_remote_feat_evt (UINT8 *p, UINT16 evt_len)
+static void btu_ble_read_remote_feat_evt (UINT8 *p)
{
btm_ble_read_remote_features_complete(p);
}
-static void btu_ble_proc_ltk_req (UINT8 *p, UINT16 evt_len)
+static void btu_ble_proc_ltk_req (UINT8 *p)
{
UINT16 ediv, handle;
UINT8 *pp;
diff --git a/stack/btu/btu_task.c b/stack/btu/btu_task.c
index da9a54d..9c09214 100644
--- a/stack/btu/btu_task.c
+++ b/stack/btu/btu_task.c
@@ -166,6 +166,7 @@
UINT8 i;
UINT16 mask;
BOOLEAN handled;
+ UNUSED(param);
#if (defined(HCISU_H4_INCLUDED) && HCISU_H4_INCLUDED == TRUE)
/* wait an event that HCISU is ready */
diff --git a/stack/gap/gap_api.c b/stack/gap/gap_api.c
index d17895d..fb90d03 100644
--- a/stack/gap/gap_api.c
+++ b/stack/gap/gap_api.c
@@ -19,6 +19,7 @@
#include <string.h>
#include "bt_target.h"
+#include "bt_utils.h"
#include "gap_int.h"
#include "btm_int.h"
#include "gki.h"
@@ -683,6 +684,10 @@
UINT16 GAP_ReadLocalDeviceInfo(UINT8 *name, BD_ADDR *addr, tGAP_LMP_VERSION *verinfo,
tGAP_LMP_FEATURES *features)
{
+ UNUSED(name);
+ UNUSED(addr);
+ UNUSED(verinfo);
+ UNUSED(features);
return (GAP_UNSUPPORTED);
}
diff --git a/stack/gap/gap_ble.c b/stack/gap/gap_ble.c
index 6e3afeb..d44577d 100644
--- a/stack/gap/gap_ble.c
+++ b/stack/gap/gap_ble.c
@@ -19,6 +19,7 @@
#if (defined BLE_INCLUDED && BLE_INCLUDED == TRUE)
+#include "bt_utils.h"
#include <string.h>
#include "gap_int.h"
#include "gap_api.h"
@@ -65,7 +66,8 @@
gap_ble_c_cmpl_cback,
NULL,
NULL,
- gap_ble_s_attr_request_cback
+ gap_ble_s_attr_request_cback,
+ NULL
};
@@ -344,6 +346,7 @@
tGATT_STATUS gap_proc_read (tGATTS_REQ_TYPE type, tGATT_READ_REQ *p_data, tGATTS_RSP *p_rsp)
{
tGATT_STATUS status = GATT_NO_RESOURCES;
+ UNUSED(type);
if (p_data->is_long)
p_rsp->attr_value.offset = p_data->offset;
@@ -380,6 +383,7 @@
{
tGAP_ATTR *p_db_attr = gap_cb.gatt_attr;
UINT8 i;
+ UNUSED(type);
for (i = 0; i < GAP_MAX_CHAR_NUM; i ++, p_db_attr ++)
{
@@ -612,6 +616,7 @@
{
tGAP_CLCB *p_clcb = gap_find_clcb_by_bd_addr (bda);
UINT16 cl_op_uuid;
+ UNUSED(gatt_if);
GAP_TRACE_EVENT5 ("gap_ble_c_connect_cback: from %08x%04x connected:%d conn_id=%d reason = 0x%04x",
(bda[0]<<24)+(bda[1]<<16)+(bda[2]<<8)+bda[3],
diff --git a/stack/gap/gap_conn.c b/stack/gap/gap_conn.c
index 43765b7..44bb5ec 100644
--- a/stack/gap/gap_conn.c
+++ b/stack/gap/gap_conn.c
@@ -18,6 +18,7 @@
#include "bt_target.h"
+#include "bt_utils.h"
#include "btu.h"
#include "gap_int.h"
#include "l2cdefs.h"
@@ -801,6 +802,7 @@
static void gap_sec_check_complete (BD_ADDR bd_addr, void *p_ref_data, UINT8 res)
{
tGAP_CCB *p_ccb = (tGAP_CCB *)p_ref_data;
+ UNUSED(bd_addr);
GAP_TRACE_EVENT3 ("gap_sec_check_complete conn_state:%d, conn_flags:0x%x, status:%d",
p_ccb->con_state, p_ccb->con_flags, res);
diff --git a/stack/gap/gap_utils.c b/stack/gap/gap_utils.c
index d253a99..866ad7a 100644
--- a/stack/gap/gap_utils.c
+++ b/stack/gap/gap_utils.c
@@ -18,6 +18,7 @@
#include <string.h>
#include "bt_target.h"
+#include "bt_utils.h"
#include "gap_int.h"
/*****************************************************************************/
@@ -116,6 +117,7 @@
{
tGAP_INFO *p_cb;
UINT8 index;
+ UNUSED(p_eir);
GAP_TRACE_EVENT6 ("GAP Inquiry Results Callback (bdaddr [%02x%02x%02x%02x%02x%02x])",
p_results->remote_bd_addr[0], p_results->remote_bd_addr[1],
@@ -305,6 +307,8 @@
return (GAP_EOINQDB);
#else
+ UNUSED(devname);
+ UNUSED(bd_addr);
/* No data available because we are not automatically saving the data */
return (GAP_NO_DATA_AVAIL);
#endif
diff --git a/stack/gatt/att_protocol.c b/stack/gatt/att_protocol.c
index 9c715af..3348599 100644
--- a/stack/gatt/att_protocol.c
+++ b/stack/gatt/att_protocol.c
@@ -495,7 +495,7 @@
/* do not enq cmd if handle value confirmation or set request */
if (cmd_code != GATT_HANDLE_VALUE_CONF && cmd_code != GATT_CMD_WRITE)
{
- gatt_start_rsp_timer (p_tcb);
+ gatt_start_rsp_timer (clcb_idx);
gatt_cmd_enq(p_tcb, clcb_idx, FALSE, cmd_code, NULL);
}
}
diff --git a/stack/gatt/gatt_api.c b/stack/gatt/gatt_api.c
index a96c58a..54ea0f0 100644
--- a/stack/gatt/gatt_api.c
+++ b/stack/gatt/gatt_api.c
@@ -1285,6 +1285,7 @@
(p_clcb->p_reg->gatt_if == gatt_if) &&
(p_clcb->p_tcb->tcb_idx == p_tcb->tcb_idx))
{
+ btu_stop_timer(&p_clcb->rsp_timer_ent);
gatt_clcb_dealloc (p_clcb);
break;
}
@@ -1294,7 +1295,9 @@
gatt_deregister_bgdev_list(gatt_if);
/* update the listen mode */
+#if (defined(BLE_PERIPHERAL_MODE_SUPPORT) && (BLE_PERIPHERAL_MODE_SUPPORT == TRUE))
GATT_Listen(gatt_if, FALSE, NULL);
+#endif
memset (p_reg, 0, sizeof(tGATT_REG));
}
diff --git a/stack/gatt/gatt_attr.c b/stack/gatt/gatt_attr.c
index 459580e..1ee4ae3 100644
--- a/stack/gatt/gatt_attr.c
+++ b/stack/gatt/gatt_attr.c
@@ -24,6 +24,7 @@
******************************************************************************/
#include "bt_target.h"
+#include "bt_utils.h"
#include "gatt_api.h"
#include "gatt_int.h"
@@ -48,7 +49,8 @@
NULL,
NULL,
NULL,
- gatt_profile_request_cback
+ gatt_profile_request_cback,
+ NULL
} ;
/*******************************************************************************
@@ -215,6 +217,8 @@
static void gatt_profile_connect_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_id,
BOOLEAN connected, tGATT_DISCONN_REASON reason)
{
+ UNUSED(gatt_if);
+
GATT_TRACE_EVENT5 ("gatt_profile_connect_cback: from %08x%04x connected:%d conn_id=%d reason = 0x%04x",
(bda[0]<<24)+(bda[1]<<16)+(bda[2]<<8)+bda[3],
(bda[4]<<8)+bda[5], connected, conn_id, reason);
diff --git a/stack/gatt/gatt_auth.c b/stack/gatt/gatt_auth.c
index 504b7d8..7dc99e1 100644
--- a/stack/gatt/gatt_auth.c
+++ b/stack/gatt/gatt_auth.c
@@ -22,6 +22,7 @@
*
******************************************************************************/
#include "bt_target.h"
+#include "bt_utils.h"
#if BLE_INCLUDED == TRUE
#include <string.h>
@@ -163,6 +164,7 @@
BOOLEAN status = FALSE;
tGATT_PENDING_ENC_CLCB *p_buf;
UINT16 count;
+ UNUSED(p_ref_data);
GATT_TRACE_DEBUG0("gatt_enc_cmpl_cback");
if ((p_tcb = gatt_find_tcb_by_addr(bd_addr)) != NULL)
@@ -228,9 +230,18 @@
tGATT_TCB *p_tcb;
tGATT_PENDING_ENC_CLCB *p_buf;
UINT16 count;
+ UINT8 i = 0;
if ((p_tcb = gatt_find_tcb_by_addr(bd_addr)) != NULL)
{
+ for (i = 0; i < GATT_MAX_APPS; i++)
+ {
+ if (gatt_cb.cl_rcb[i].in_use && gatt_cb.cl_rcb[i].app_cb.p_enc_cmpl_cb)
+ {
+ (*gatt_cb.cl_rcb[i].app_cb.p_enc_cmpl_cb)(gatt_cb.cl_rcb[i].gatt_if, bd_addr);
+ }
+ }
+
if (gatt_get_sec_act(p_tcb) == GATT_SEC_ENC_PENDING)
{
gatt_set_sec_act(p_tcb, GATT_SEC_NONE);
diff --git a/stack/gatt/gatt_cl.c b/stack/gatt/gatt_cl.c
index b173be9..e8c41fc 100644
--- a/stack/gatt/gatt_cl.c
+++ b/stack/gatt/gatt_cl.c
@@ -402,7 +402,7 @@
** Returns void
**
*******************************************************************************/
-void gatt_process_find_type_value_rsp (tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT16 len, UINT8 *p_data)
+static void gatt_process_find_type_value_rsp (tGATT_CLCB *p_clcb, UINT16 len, UINT8 *p_data)
{
tGATT_DISC_RES result;
UINT8 *p = p_data;
@@ -445,8 +445,7 @@
** Returns void
**
*******************************************************************************/
-void gatt_process_read_info_rsp(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 op_code,
- UINT16 len, UINT8 *p_data)
+static void gatt_process_read_info_rsp(tGATT_CLCB *p_clcb, UINT16 len, UINT8 *p_data)
{
tGATT_DISC_RES result;
UINT8 *p = p_data, uuid_len = 0, type;
@@ -501,8 +500,7 @@
** Returns void.
**
*******************************************************************************/
-void gatt_proc_disc_error_rsp(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 opcode,
- UINT16 handle, UINT8 reason)
+static void gatt_proc_disc_error_rsp(tGATT_CLCB *p_clcb, UINT8 opcode, UINT8 reason)
{
tGATT_STATUS status = (tGATT_STATUS) reason;
@@ -538,8 +536,7 @@
** Returns void
**
*******************************************************************************/
-void gatt_process_error_rsp(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 op_code,
- UINT16 len, UINT8 *p_data)
+static void gatt_process_error_rsp(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 *p_data)
{
UINT8 opcode, reason, * p= p_data;
UINT16 handle;
@@ -552,7 +549,7 @@
if (p_clcb->operation == GATTC_OPTYPE_DISCOVERY)
{
- gatt_proc_disc_error_rsp(p_tcb, p_clcb, opcode, handle, reason);
+ gatt_proc_disc_error_rsp(p_clcb, opcode, reason);
}
else
{
@@ -924,8 +921,8 @@
** Returns void
**
*******************************************************************************/
-void gatt_process_read_rsp(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb, UINT8 op_code,
- UINT16 len, UINT8 *p_data)
+static void gatt_process_read_rsp(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb,
+ UINT16 len, UINT8 *p_data)
{
UINT16 offset = p_clcb->counter;
UINT8 * p= p_data;
@@ -1096,7 +1093,7 @@
/* dequeue the request if is write command or sign write */
if (p_cmd->op_code != GATT_CMD_WRITE && p_cmd->op_code != GATT_SIGN_CMD_WRITE)
{
- gatt_start_rsp_timer (p_tcb);
+ gatt_start_rsp_timer (p_cmd->clcb_idx);
}
else
{
@@ -1153,7 +1150,10 @@
return;
}
else
- btu_stop_timer (&p_tcb->rsp_timer_ent);
+ {
+ btu_stop_timer (&p_clcb->rsp_timer_ent);
+ p_clcb->retry_count = 0;
+ }
}
/* the size of the message may not be bigger than the local max PDU size*/
/* The message has to be smaller than the agreed MTU, len does not count op_code */
@@ -1169,7 +1169,7 @@
switch (op_code)
{
case GATT_RSP_ERROR:
- gatt_process_error_rsp(p_tcb, p_clcb, op_code, len, p_data);
+ gatt_process_error_rsp(p_tcb, p_clcb, p_data);
break;
case GATT_RSP_MTU: /* 2 bytes mtu */
@@ -1177,7 +1177,7 @@
break;
case GATT_RSP_FIND_INFO:
- gatt_process_read_info_rsp(p_tcb, p_clcb, op_code, len, p_data);
+ gatt_process_read_info_rsp(p_clcb, len, p_data);
break;
case GATT_RSP_READ_BY_TYPE:
@@ -1188,11 +1188,11 @@
case GATT_RSP_READ:
case GATT_RSP_READ_BLOB:
case GATT_RSP_READ_MULTI:
- gatt_process_read_rsp(p_tcb, p_clcb, op_code, len, p_data);
+ gatt_process_read_rsp(p_tcb, p_clcb, len, p_data);
break;
case GATT_RSP_FIND_TYPE_VALUE: /* disc service with UUID */
- gatt_process_find_type_value_rsp(p_tcb, p_clcb, len, p_data);
+ gatt_process_find_type_value_rsp(p_clcb, len, p_data);
break;
case GATT_RSP_WRITE:
diff --git a/stack/gatt/gatt_db.c b/stack/gatt/gatt_db.c
index fa636fb..3afda56 100644
--- a/stack/gatt/gatt_db.c
+++ b/stack/gatt/gatt_db.c
@@ -114,7 +114,6 @@
**
*******************************************************************************/
static tGATT_STATUS gatts_check_attr_readability(tGATT_ATTR16 *p_attr,
- UINT16 offset,
BOOLEAN read_long,
tGATT_SEC_FLAG sec_flag,
UINT8 key_size)
@@ -223,7 +222,7 @@
offset,
read_long);
- status = gatts_check_attr_readability((tGATT_ATTR16 *)p_attr, offset, read_long, sec_flag, key_size);
+ status = gatts_check_attr_readability((tGATT_ATTR16 *)p_attr, read_long, sec_flag, key_size);
if (p_attr16->uuid_type == GATT_ATTR_UUID_TYPE_16)
uuid16 = p_attr16->uuid;
@@ -672,7 +671,7 @@
{
if (p_attr->handle == handle)
{
- status = gatts_check_attr_readability (p_attr, 0,
+ status = gatts_check_attr_readability (p_attr,
is_long,
sec_flag, key_size);
break;
diff --git a/stack/gatt/gatt_int.h b/stack/gatt/gatt_int.h
index 48278c2..1f81d63 100644
--- a/stack/gatt/gatt_int.h
+++ b/stack/gatt/gatt_int.h
@@ -78,6 +78,8 @@
/* wait for ATT cmd response timeout value */
#define GATT_WAIT_FOR_RSP_TOUT 30
+#define GATT_WAIT_FOR_DISC_RSP_TOUT 5
+#define GATT_REQ_RETRY_LIMIT 2
/* characteristic descriptor type */
#define GATT_DESCR_EXT_DSCPTOR 1 /* Characteristic Extended Properties */
@@ -360,7 +362,6 @@
UINT8 ind_count;
tGATT_CMD_Q cl_cmd_q[GATT_CL_MAX_LCB];
- TIMER_LIST_ENT rsp_timer_ent; /* peer response timer */
TIMER_LIST_ENT ind_ack_timer_ent; /* local app confirm to indication timer */
UINT8 pending_cl_req;
UINT8 next_slot_inq; /* index of next available slot in queue */
@@ -397,6 +398,8 @@
BOOLEAN first_read_blob_after_read;
tGATT_READ_INC_UUID128 read_uuid128;
BOOLEAN in_use;
+ TIMER_LIST_ENT rsp_timer_ent; /* peer response timer */
+ UINT8 retry_count;
} tGATT_CLCB;
typedef struct
@@ -556,7 +559,7 @@
extern UINT8 gatt_build_uuid_to_stream(UINT8 **p_dst, tBT_UUID uuid);
extern BOOLEAN gatt_uuid_compare(tBT_UUID src, tBT_UUID tar);
extern void gatt_sr_get_sec_info(BD_ADDR rem_bda, BOOLEAN le_conn, UINT8 *p_sec_flag, UINT8 *p_key_size);
-extern void gatt_start_rsp_timer(tGATT_TCB *p_tcb);
+extern void gatt_start_rsp_timer(UINT16 clcb_idx);
extern void gatt_start_conf_timer(tGATT_TCB *p_tcb);
extern void gatt_rsp_timeout(TIMER_LIST_ENT *p_tle);
extern void gatt_ind_ack_timeout(TIMER_LIST_ENT *p_tle);
diff --git a/stack/gatt/gatt_main.c b/stack/gatt/gatt_main.c
index 07c2c5e..d5e017b 100644
--- a/stack/gatt/gatt_main.c
+++ b/stack/gatt/gatt_main.c
@@ -31,6 +31,7 @@
#include "l2c_api.h"
#include "btm_int.h"
#include "btm_ble_int.h"
+#include "bt_utils.h"
/* Configuration flags. */
#define GATT_L2C_CFG_IND_DONE (1<<0)
@@ -66,6 +67,7 @@
gatt_l2cif_disconnect_cfm_cback,
NULL,
gatt_l2cif_data_ind_cback,
+ NULL,
NULL
} ;
@@ -507,6 +509,7 @@
UINT8 result = L2CAP_CONN_OK;
tL2CAP_CFG_INFO cfg;
tGATT_TCB *p_tcb = gatt_find_tcb_by_addr(bd_addr);
+ UNUSED(psm);
GATT_TRACE_ERROR1("Connection indication cid = %d", lcid);
/* new connection ? */
@@ -766,6 +769,7 @@
{
tGATT_TCB *p_tcb;
UINT16 reason;
+ UNUSED(result);
/* look up clcb for this channel */
if ((p_tcb = gatt_find_tcb_by_cid(lcid)) != NULL)
diff --git a/stack/gatt/gatt_sr.c b/stack/gatt/gatt_sr.c
index 6817283..88040fe 100644
--- a/stack/gatt/gatt_sr.c
+++ b/stack/gatt/gatt_sr.c
@@ -23,6 +23,7 @@
******************************************************************************/
#include "bt_target.h"
+#include "bt_utils.h"
#if BLE_INCLUDED == TRUE
#include <string.h>
@@ -262,6 +263,7 @@
tGATT_STATUS status, tGATTS_RSP *p_msg)
{
tGATT_STATUS ret_code = GATT_SUCCESS;
+ UNUSED(trans_id);
GATT_TRACE_DEBUG1("gatt_sr_process_app_rsp gatt_if=%d", gatt_if);
@@ -326,7 +328,7 @@
** Returns void
**
*******************************************************************************/
-void gatt_process_exec_write_req (tGATT_TCB *p_tcb, UINT8 op_code, UINT16 len, UINT8 *p_data)
+static void gatt_process_exec_write_req (tGATT_TCB *p_tcb, UINT8 op_code, UINT8 *p_data)
{
UINT8 *p = p_data, flag, i = 0;
UINT32 trans_id = 0;
@@ -525,7 +527,7 @@
*******************************************************************************/
static tGATT_STATUS gatt_build_primary_service_rsp (BT_HDR *p_msg, tGATT_TCB *p_tcb,
UINT8 op_code, UINT16 s_hdl,
- UINT16 e_hdl, UINT8 *p_data, tBT_UUID value)
+ UINT16 e_hdl, tBT_UUID value)
{
tGATT_STATUS status = GATT_NOT_FOUND;
UINT8 handle_len =4, *p ;
@@ -784,7 +786,7 @@
else
{
memset(p_msg, 0, msg_len);
- reason = gatt_build_primary_service_rsp (p_msg, p_tcb, op_code, s_hdl, e_hdl, p_data, value);
+ reason = gatt_build_primary_service_rsp (p_msg, p_tcb, op_code, s_hdl, e_hdl, value);
}
}
}
@@ -1169,7 +1171,7 @@
**
*******************************************************************************/
static void gatts_process_read_req(tGATT_TCB *p_tcb, tGATT_SR_REG *p_rcb, UINT8 op_code,
- UINT16 handle, UINT16 len, UINT8 *p_data)
+ UINT16 handle, UINT8 *p_data)
{
UINT16 buf_len = (UINT16)(sizeof(BT_HDR) + p_tcb->payload_size + L2CAP_MIN_OFFSET);
tGATT_STATUS reason;
@@ -1285,7 +1287,7 @@
{
case GATT_REQ_READ: /* read char/char descriptor value */
case GATT_REQ_READ_BLOB:
- gatts_process_read_req(p_tcb, p_rcb, op_code, handle, len, p);
+ gatts_process_read_req(p_tcb, p_rcb, op_code, handle, p);
break;
case GATT_REQ_WRITE: /* write char/char descriptor value */
@@ -1502,7 +1504,7 @@
break;
case GATT_REQ_EXEC_WRITE:
- gatt_process_exec_write_req (p_tcb, op_code, len, p_data);
+ gatt_process_exec_write_req (p_tcb, op_code, p_data);
break;
case GATT_REQ_READ_MULTI:
diff --git a/stack/gatt/gatt_utils.c b/stack/gatt/gatt_utils.c
index e15918c..978c88c 100644
--- a/stack/gatt/gatt_utils.c
+++ b/stack/gatt/gatt_utils.c
@@ -22,6 +22,7 @@
*
******************************************************************************/
#include "bt_target.h"
+#include "bt_utils.h"
#if BLE_INCLUDED == TRUE
#include <string.h>
@@ -477,6 +478,8 @@
*******************************************************************************/
void gatts_update_srv_list_elem(UINT8 i_sreg, UINT16 handle, BOOLEAN is_primary)
{
+ UNUSED(handle);
+
gatt_cb.srv_list[i_sreg].in_use = TRUE;
gatt_cb.srv_list[i_sreg].i_sreg = i_sreg;
gatt_cb.srv_list[i_sreg].s_hdl = gatt_cb.sr_reg[i_sreg].s_hdl;
@@ -1116,11 +1119,18 @@
** Returns TRUE if command sent, otherwise FALSE.
**
*******************************************************************************/
-void gatt_start_rsp_timer(tGATT_TCB *p_tcb)
+void gatt_start_rsp_timer(UINT16 clcb_idx)
{
- p_tcb->rsp_timer_ent.param = (TIMER_PARAM_TYPE)p_tcb;
- btu_start_timer (&p_tcb->rsp_timer_ent, BTU_TTYPE_ATT_WAIT_FOR_RSP,
- GATT_WAIT_FOR_RSP_TOUT);
+ tGATT_CLCB *p_clcb = &gatt_cb.clcb[clcb_idx];
+ UINT32 timeout = GATT_WAIT_FOR_RSP_TOUT;
+ p_clcb->rsp_timer_ent.param = (TIMER_PARAM_TYPE)p_clcb;
+ if (p_clcb->operation == GATTC_OPTYPE_DISCOVERY &&
+ p_clcb->op_subtype == GATT_DISC_SRVC_ALL)
+ {
+ timeout = GATT_WAIT_FOR_DISC_RSP_TOUT;
+ }
+ btu_start_timer (&p_clcb->rsp_timer_ent, BTU_TTYPE_ATT_WAIT_FOR_RSP,
+ timeout);
}
/*******************************************************************************
**
@@ -1165,8 +1175,32 @@
*******************************************************************************/
void gatt_rsp_timeout(TIMER_LIST_ENT *p_tle)
{
+ tGATT_CLCB *p_clcb = (tGATT_CLCB *)p_tle->param;
+ if (p_clcb == NULL || p_clcb->p_tcb == NULL)
+ {
+ GATT_TRACE_WARNING0("gatt_rsp_timeout clcb is already deleted");
+ return;
+ }
+ if (p_clcb->operation == GATTC_OPTYPE_DISCOVERY &&
+ p_clcb->op_subtype == GATT_DISC_SRVC_ALL &&
+ p_clcb->retry_count < GATT_REQ_RETRY_LIMIT)
+ {
+ UINT8 rsp_code;
+ GATT_TRACE_WARNING0("gatt_rsp_timeout retry discovery primary service");
+ if (p_clcb != gatt_cmd_dequeue(p_clcb->p_tcb, &rsp_code))
+ {
+ GATT_TRACE_ERROR0("gatt_rsp_timeout command queue out of sync, disconnect");
+ }
+ else
+ {
+ p_clcb->retry_count++;
+ gatt_act_discovery(p_clcb);
+ return;
+ }
+ }
+
GATT_TRACE_WARNING0("gatt_rsp_timeout disconnecting...");
- gatt_disconnect (((tGATT_TCB *)p_tle->param)->peer_bda);
+ gatt_disconnect (p_clcb->p_tcb->peer_bda);
}
/*******************************************************************************
@@ -1299,6 +1333,7 @@
void gatt_sr_get_sec_info(BD_ADDR rem_bda, BOOLEAN le_conn, UINT8 *p_sec_flag, UINT8 *p_key_size)
{
UINT8 sec_flag = 0;
+ UNUSED(le_conn);
BTM_GetSecurityFlags(rem_bda, &sec_flag);
@@ -2073,6 +2108,7 @@
operation = p_clcb->operation;
conn_id = p_clcb->conn_id;
+ btu_stop_timer(&p_clcb->rsp_timer_ent);
gatt_clcb_dealloc(p_clcb);
@@ -2114,6 +2150,7 @@
p_clcb = &gatt_cb.clcb[i];
if (p_clcb->in_use && p_clcb->p_tcb == p_tcb)
{
+ btu_stop_timer(&p_clcb->rsp_timer_ent);
GATT_TRACE_DEBUG2 ("found p_clcb conn_id=%d clcb_idx=%d", p_clcb->conn_id, p_clcb->clcb_idx);
if (p_clcb->operation != GATTC_OPTYPE_NONE)
gatt_end_operation(p_clcb, GATT_ERROR, NULL);
@@ -2123,7 +2160,6 @@
}
}
- btu_stop_timer (&p_tcb->rsp_timer_ent);
btu_stop_timer (&p_tcb->ind_ack_timer_ent);
btu_stop_timer (&p_tcb->conf_timer_ent);
gatt_free_pending_ind(p_tcb);
diff --git a/stack/hid/hidh_conn.c b/stack/hid/hidh_conn.c
index d9345a0..86b41d3 100644
--- a/stack/hid/hidh_conn.c
+++ b/stack/hid/hidh_conn.c
@@ -41,6 +41,7 @@
#include "hidh_api.h"
#include "hidh_int.h"
+#include "bt_utils.h"
static UINT8 find_conn_by_cid (UINT16 cid);
static void hidh_conn_retry (UINT8 dhandle);
@@ -163,6 +164,7 @@
void hidh_sec_check_complete_term (BD_ADDR bd_addr, void *p_ref_data, UINT8 res)
{
tHID_HOST_DEV_CTB *p_dev= (tHID_HOST_DEV_CTB *) p_ref_data;
+ UNUSED(bd_addr);
if( res == BTM_SUCCESS && p_dev->conn.conn_state == HID_CONN_STATE_SECURITY )
{
@@ -320,6 +322,7 @@
UINT32 cb_res = HID_ERR_AUTH_FAILED;
#endif
UINT32 reason;
+ UNUSED(bd_addr);
dhandle = ((UINT32)p_dev - (UINT32)&(hh_cb.devices[0]))/ sizeof(tHID_HOST_DEV_CTB);
if( res == BTM_SUCCESS && p_dev->conn.conn_state == HID_CONN_STATE_SECURITY )
@@ -654,6 +657,7 @@
{
UINT8 dhandle;
tHID_CONN *p_hcon = NULL;
+ UNUSED(result);
/* Find CCB based on CID */
if( (dhandle = find_conn_by_cid(l2cap_cid)) < HID_HOST_MAX_DEVICES )
diff --git a/stack/include/avrc_defs.h b/stack/include/avrc_defs.h
index 16ba057..d6ff8a0 100644
--- a/stack/include/avrc_defs.h
+++ b/stack/include/avrc_defs.h
@@ -842,9 +842,7 @@
(a <= AVRC_EVT_APP_SETTING_CHANGE)) ? TRUE : FALSE)
#define AVRC_IS_VALID_ATTRIBUTE(a) (((((a > 0) && a <= AVRC_PLAYER_SETTING_SCAN)) || \
- ((a >= AVRC_PLAYER_SETTING_LOW_MENU_EXT) && \
- (a <= AVRC_PLAYER_SETTING_HIGH_MENU_EXT))) ? TRUE : FALSE)
-
+ (a >= AVRC_PLAYER_SETTING_LOW_MENU_EXT)) ? TRUE : FALSE)
#define AVRC_IS_VALID_MEDIA_ATTRIBUTE(a) ((a >= AVRC_MEDIA_ATTR_ID_TITLE) && \
(a <= AVRC_MEDIA_ATTR_ID_PLAYING_TIME) ? TRUE : FALSE)
diff --git a/stack/include/btm_ble_api.h b/stack/include/btm_ble_api.h
index 0dcc8d2..584ce9a 100644
--- a/stack/include/btm_ble_api.h
+++ b/stack/include/btm_ble_api.h
@@ -276,8 +276,8 @@
tBTM_BLE_MANU manu; /* manufactuer data */
tBTM_BLE_INT_RANGE int_range; /* slave prefered conn interval range */
tBTM_BLE_SERVICE services; /* services */
- UINT8 flag;
UINT16 appearance;
+ UINT8 flag;
tBTM_BLE_PROPRIETARY *p_proprietary;
}tBTM_BLE_ADV_DATA;
diff --git a/stack/include/gatt_api.h b/stack/include/gatt_api.h
index 01afb71..d9704b7 100644
--- a/stack/include/gatt_api.h
+++ b/stack/include/gatt_api.h
@@ -573,7 +573,8 @@
/* attribute request callback for ATT server */
typedef void (tGATT_REQ_CBACK )(UINT16 conn_id, UINT32 trans_id, tGATTS_REQ_TYPE type, tGATTS_DATA *p_data);
-
+/* Define a callback function when encryption is established. */
+typedef void (tGATT_ENC_CMPL_CB)(tGATT_IF gatt_if, BD_ADDR bda);
/* Define the structure that applications use to register with
@@ -587,6 +588,7 @@
tGATT_DISC_RES_CB *p_disc_res_cb;
tGATT_DISC_CMPL_CB *p_disc_cmpl_cb;
tGATT_REQ_CBACK *p_req_cb;
+ tGATT_ENC_CMPL_CB *p_enc_cmpl_cb;
} tGATT_CBACK;
/*********************** Start Handle Management Definitions **********************
diff --git a/stack/include/l2c_api.h b/stack/include/l2c_api.h
index 95c44e0..7679d26 100644
--- a/stack/include/l2c_api.h
+++ b/stack/include/l2c_api.h
@@ -1146,6 +1146,18 @@
/*******************************************************************************
**
+** Function L2CA_HandleConnUpdateEvent
+**
+** Description This function enables the connection update request from remote
+** after a successful connection update response is received.
+**
+** Returns void
+**
+*******************************************************************************/
+L2C_API void L2CA_HandleConnUpdateEvent (UINT16 handle, UINT8 status);
+
+/*******************************************************************************
+**
** Function L2CA_GetBleConnRole
**
** Description This function returns the connection role.
diff --git a/stack/l2cap/l2c_ble.c b/stack/l2cap/l2c_ble.c
index b8cddd7..2f2646e 100644
--- a/stack/l2cap/l2c_ble.c
+++ b/stack/l2cap/l2c_ble.c
@@ -24,6 +24,7 @@
#include <string.h>
#include "bt_target.h"
+#include "bt_utils.h"
#include "l2cdefs.h"
#include "l2c_int.h"
#include "btu.h"
@@ -81,6 +82,56 @@
return(FALSE);
}
+/*******************************************************************************
+**
+** Function L2CA_InternalBleConnUpdate
+**
+** Description update BLE connection based on status
+**
+** Parameters: lcb
+**
+** Return value: none
+**
+*******************************************************************************/
+static void L2CA_InternalBleConnUpdate (tL2C_LCB *p_lcb)
+{
+ if (p_lcb->upd_status & L2C_BLE_UPDATE_PENDING) return;
+
+ if (p_lcb->upd_status & L2C_BLE_CONN_UPDATE_DISABLE)
+ {
+ /* application requests to disable parameters update.
+ If parameters are already updated, lets set them
+ up to what has been requested during connection establishement */
+ if (p_lcb->upd_status & L2C_BLE_NOT_DEFAULT_PARAM)
+ {
+ tBTM_SEC_DEV_REC *p_dev_rec = btm_find_or_alloc_dev(p_lcb->remote_bd_addr);
+
+ btsnd_hcic_ble_upd_ll_conn_params(p_lcb->handle,
+ (UINT16)((p_dev_rec->conn_params.min_conn_int != BTM_BLE_CONN_PARAM_UNDEF) ?
+ p_dev_rec->conn_params.min_conn_int : BTM_BLE_CONN_INT_MIN_DEF),
+ (UINT16)((p_dev_rec->conn_params.max_conn_int != BTM_BLE_CONN_PARAM_UNDEF) ?
+ p_dev_rec->conn_params.max_conn_int : BTM_BLE_CONN_INT_MAX_DEF),
+ (UINT16)((p_dev_rec->conn_params.slave_latency != BTM_BLE_CONN_PARAM_UNDEF) ?
+ p_dev_rec->conn_params.slave_latency : BTM_BLE_CONN_SLAVE_LATENCY_DEF),
+ (UINT16)((p_dev_rec->conn_params.supervision_tout != BTM_BLE_CONN_PARAM_UNDEF) ?
+ p_dev_rec->conn_params.supervision_tout : BTM_BLE_CONN_TIMEOUT_DEF),
+ 0, 0);
+ p_lcb->upd_status &= ~L2C_BLE_NOT_DEFAULT_PARAM;
+ p_lcb->upd_status |= (L2C_BLE_UPDATE_PENDING | L2C_BLE_NEW_CONN_PARAM);
+ }
+ }
+ else
+ {
+ /* application allows to do update, if we were delaying one do it now */
+ if (p_lcb->upd_status & L2C_BLE_NEW_CONN_PARAM)
+ {
+ btsnd_hcic_ble_upd_ll_conn_params(p_lcb->handle, p_lcb->min_interval,
+ p_lcb->max_interval, p_lcb->latency, p_lcb->timeout, 0, 0);
+ p_lcb->upd_status &= ~L2C_BLE_NEW_CONN_PARAM;
+ p_lcb->upd_status |= (L2C_BLE_UPDATE_PENDING | L2C_BLE_NOT_DEFAULT_PARAM);
+ }
+ }
+}
/*******************************************************************************
**
@@ -116,7 +167,14 @@
}
if (p_lcb->link_role == HCI_ROLE_MASTER)
- btsnd_hcic_ble_upd_ll_conn_params (p_lcb->handle, min_int, max_int, latency, timeout, 0, 0);
+ {
+ p_lcb->min_interval = min_int;
+ p_lcb->max_interval = max_int;
+ p_lcb->latency = latency;
+ p_lcb->timeout = timeout;
+ p_lcb->upd_status |= L2C_BLE_NEW_CONN_PARAM;
+ L2CA_InternalBleConnUpdate(p_lcb);
+ }
else
l2cu_send_peer_ble_par_req (p_lcb, min_int, max_int, latency, timeout);
@@ -150,8 +208,9 @@
return (FALSE);
}
- L2CAP_TRACE_API4 ("L2CA_EnableUpdateBleConnParams - BD_ADDR %08x%04x enable %d current upd state %d",
- (rem_bda[0]<<24)+(rem_bda[1]<<16)+(rem_bda[2]<<8)+rem_bda[3], (rem_bda[4]<<8)+rem_bda[5], enable, p_lcb->upd_disabled);
+ L2CAP_TRACE_API4 ("L2CA_EnableUpdateBleConnParams - BD_ADDR %08x%04x enable %d upd state %d",
+ (rem_bda[0]<<24)+(rem_bda[1]<<16)+(rem_bda[2]<<8)+rem_bda[3], (rem_bda[4]<<8)+rem_bda[5],
+ enable, p_lcb->upd_status);
if (!p_lcb->is_ble_link || (p_lcb->link_role != HCI_ROLE_MASTER))
{
@@ -162,42 +221,56 @@
if (enable)
{
- /* application allows to do update, if we were delaying one do it now, otherwise
- just mark lcb that updates are enabled */
- if (p_lcb->upd_disabled == UPD_PENDING)
- {
- btsnd_hcic_ble_upd_ll_conn_params (p_lcb->handle, p_lcb->min_interval, p_lcb->max_interval,
- p_lcb->latency, p_lcb->timeout, 0, 0);
- p_lcb->upd_disabled = UPD_UPDATED;
- }
- else
- {
- p_lcb->upd_disabled = UPD_ENABLED;
- }
+ p_lcb->upd_status &= ~L2C_BLE_CONN_UPDATE_DISABLE;
}
else
{
- /* application requests to disable parameters update. If parameters are already updated, lets set them
- up to what has been requested during connection establishement */
- if (p_lcb->upd_disabled == UPD_UPDATED)
- {
- tBTM_SEC_DEV_REC *p_dev_rec = btm_find_or_alloc_dev (rem_bda);
-
- btsnd_hcic_ble_upd_ll_conn_params (p_lcb->handle,
- (UINT16)((p_dev_rec->conn_params.min_conn_int != BTM_BLE_CONN_PARAM_UNDEF) ? p_dev_rec->conn_params.min_conn_int : BTM_BLE_CONN_INT_MIN_DEF),
- (UINT16)((p_dev_rec->conn_params.max_conn_int != BTM_BLE_CONN_PARAM_UNDEF) ? p_dev_rec->conn_params.max_conn_int : BTM_BLE_CONN_INT_MAX_DEF),
- (UINT16)((p_dev_rec->conn_params.slave_latency != BTM_BLE_CONN_PARAM_UNDEF) ? p_dev_rec->conn_params.slave_latency : BTM_BLE_CONN_SLAVE_LATENCY_DEF),
- (UINT16) ((p_dev_rec->conn_params.supervision_tout != BTM_BLE_CONN_PARAM_UNDEF) ? p_dev_rec->conn_params.supervision_tout : BTM_BLE_CONN_TIMEOUT_DEF),
- 0, 0);
- }
- p_lcb->upd_disabled = UPD_DISABLED;
+ p_lcb->upd_status |= L2C_BLE_CONN_UPDATE_DISABLE;
}
+ L2CA_InternalBleConnUpdate(p_lcb);
+
return (TRUE);
}
/*******************************************************************************
**
+** Function L2CA_HandleConnUpdateEvent
+**
+** Description This function enables the connection update request from remote
+** after a successful connection update response is received.
+**
+** Returns void
+**
+*******************************************************************************/
+void L2CA_HandleConnUpdateEvent (UINT16 handle, UINT8 status)
+{
+ tL2C_LCB *p_lcb;
+
+ L2CAP_TRACE_DEBUG0("L2CA_HandleConnUpdateEvent");
+
+ /* See if we have a link control block for the remote device */
+ p_lcb = l2cu_find_lcb_by_handle(handle);
+ if (!p_lcb)
+ {
+ L2CAP_TRACE_WARNING1("L2CA_EnableUpdateBleConnParams: Invalid handle: %d", handle);
+ return;
+ }
+
+ p_lcb->upd_status &= ~L2C_BLE_UPDATE_PENDING;
+
+ if (status != HCI_SUCCESS)
+ {
+ L2CAP_TRACE_WARNING1("L2CA_EnableUpdateBleConnParams: Error status: %d", status);
+ }
+
+ L2CA_InternalBleConnUpdate(p_lcb);
+
+ L2CAP_TRACE_DEBUG1("L2CA_HandleConnUpdateEvent: upd_status=%d", p_lcb->upd_status);
+}
+
+/*******************************************************************************
+**
** Function L2CA_GetBleConnRole
**
** Description This function returns the connection role.
@@ -321,6 +394,7 @@
p_dev_rec->conn_params.slave_latency,
p_dev_rec->conn_params.supervision_tout,
0, 0);
+ p_lcb->upd_status |= L2C_BLE_UPDATE_PENDING;
}
/* Tell BTM Acl management about the link */
@@ -353,6 +427,10 @@
{
tL2C_LCB *p_lcb;
tBTM_SEC_DEV_REC *p_dev_rec;
+ UNUSED(type);
+ UNUSED(conn_interval);
+ UNUSED(conn_latency);
+ UNUSED(conn_timeout);
/* See if we have a link control block for the remote device */
p_lcb = l2cu_find_lcb_by_bd_addr (bda);
@@ -487,18 +565,8 @@
p_lcb->max_interval = max_interval;
p_lcb->latency = latency;
p_lcb->timeout = timeout;
-
- if (p_lcb->upd_disabled == UPD_ENABLED)
- {
- btsnd_hcic_ble_upd_ll_conn_params (p_lcb->handle, min_interval, max_interval,
- latency, timeout, 0, 0);
- p_lcb->upd_disabled = UPD_UPDATED;
- }
- else
- {
- L2CAP_TRACE_EVENT0 ("L2CAP - LE - update currently disabled");
- p_lcb->upd_disabled = UPD_PENDING;
- }
+ p_lcb->upd_status |= L2C_BLE_NEW_CONN_PARAM;
+ L2CA_InternalBleConnUpdate(p_lcb);
}
}
else
diff --git a/stack/l2cap/l2c_csm.c b/stack/l2cap/l2c_csm.c
index 0d04d8a..4e24c23 100644
--- a/stack/l2cap/l2c_csm.c
+++ b/stack/l2cap/l2c_csm.c
@@ -892,14 +892,17 @@
case L2CEVT_L2CAP_DATA: /* Peer data packet rcvd */
L2CAP_TRACE_API1 ("L2CAP - Calling DataInd_Cb(), CID: 0x%04x", p_ccb->local_cid);
#if (L2CAP_NUM_FIXED_CHNLS > 0)
- if (p_ccb->local_cid < L2CAP_BASE_APPL_CID)
+ if (p_ccb->local_cid >= L2CAP_FIRST_FIXED_CHNL &&
+ p_ccb->local_cid <= L2CAP_LAST_FIXED_CHNL)
{
- if (l2cb.fixed_reg[p_ccb->local_cid - L2CAP_FIRST_FIXED_CHNL].pL2CA_FixedData_Cb)
- (*l2cb.fixed_reg[p_ccb->local_cid - L2CAP_FIRST_FIXED_CHNL].pL2CA_FixedData_Cb)(p_ccb->p_lcb->remote_bd_addr,(BT_HDR *)p_data);
- else
- GKI_freebuf (p_data);
-
+ if (p_ccb->local_cid < L2CAP_BASE_APPL_CID)
+ {
+ if (l2cb.fixed_reg[p_ccb->local_cid - L2CAP_FIRST_FIXED_CHNL].pL2CA_FixedData_Cb)
+ (*l2cb.fixed_reg[p_ccb->local_cid - L2CAP_FIRST_FIXED_CHNL].pL2CA_FixedData_Cb)(p_ccb->p_lcb->remote_bd_addr,(BT_HDR *)p_data);
+ else
+ GKI_freebuf (p_data);
break;
+ }
}
#endif
(*p_ccb->p_rcb->api.pL2CA_DataInd_Cb)(p_ccb->local_cid, (BT_HDR *)p_data);
diff --git a/stack/l2cap/l2c_int.h b/stack/l2cap/l2c_int.h
index a17c583..72d5544 100644
--- a/stack/l2cap/l2c_int.h
+++ b/stack/l2cap/l2c_int.h
@@ -435,11 +435,11 @@
BOOLEAN is_ble_link;
tBLE_ADDR_TYPE ble_addr_type;
-#define UPD_ENABLED 0 /* If peer requests update, we will change params */
-#define UPD_DISABLED 1 /* application requested not to update */
-#define UPD_PENDING 2 /* while updates are disabled, peer requested new parameters */
-#define UPD_UPDATED 3 /* peer updated connection parameters */
- UINT8 upd_disabled;
+#define L2C_BLE_CONN_UPDATE_DISABLE 0x1 /* disable update connection parameters */
+#define L2C_BLE_NEW_CONN_PARAM 0x2 /* new connection parameter to be set */
+#define L2C_BLE_UPDATE_PENDING 0x4 /* waiting for connection update finished */
+#define L2C_BLE_NOT_DEFAULT_PARAM 0x8 /* not using default connection parameters */
+ UINT8 upd_status;
UINT16 min_interval; /* parameters as requested by peripheral */
UINT16 max_interval;
diff --git a/stack/l2cap/l2c_link.c b/stack/l2cap/l2c_link.c
index ca563d9..fd38ca2 100644
--- a/stack/l2cap/l2c_link.c
+++ b/stack/l2cap/l2c_link.c
@@ -30,6 +30,7 @@
#include "gki.h"
#include "bt_types.h"
+#include "bt_utils.h"
#include "hcimsgs.h"
#include "l2cdefs.h"
#include "l2c_int.h"
@@ -949,7 +950,9 @@
num_found++;
}
}
-
+#else
+ UNUSED(num_pkts);
+ UNUSED(handles);
#endif
return (num_found);
diff --git a/stack/l2cap/l2c_utils.c b/stack/l2cap/l2c_utils.c
index 93f602d..05d5e5d 100644
--- a/stack/l2cap/l2c_utils.c
+++ b/stack/l2cap/l2c_utils.c
@@ -36,7 +36,7 @@
#include "btm_api.h"
#include "btm_int.h"
#include "hcidefs.h"
-#include "bd.h" /* bdcmp */
+#include "bd.h"
/*******************************************************************************
**
diff --git a/stack/mcap/mca_cact.c b/stack/mcap/mca_cact.c
index 85f19f4..16a8cec 100644
--- a/stack/mcap/mca_cact.c
+++ b/stack/mcap/mca_cact.c
@@ -24,6 +24,7 @@
******************************************************************************/
#include <string.h>
#include "bt_target.h"
+#include "bt_utils.h"
#include "gki.h"
#include "btm_api.h"
#include "mca_api.h"
@@ -47,6 +48,8 @@
void mca_ccb_rsp_tout(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data)
{
tMCA_CTRL evt_data;
+ UNUSED(p_data);
+
mca_ccb_report_event(p_ccb, MCA_RSP_TOUT_IND_EVT, &evt_data);
}
@@ -76,6 +79,8 @@
*******************************************************************************/
void mca_ccb_free_msg(tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data)
{
+ UNUSED(p_ccb);
+
GKI_freebuf (p_data);
}
@@ -210,6 +215,8 @@
*******************************************************************************/
void mca_ccb_do_disconn (tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data)
{
+ UNUSED(p_data);
+
mca_dcb_close_by_mdl_id (p_ccb, MCA_ALL_MDL_ID);
L2CA_DisconnectReq(p_ccb->lcid);
}
@@ -573,6 +580,8 @@
*******************************************************************************/
void mca_ccb_dl_open (tMCA_CCB *p_ccb, tMCA_CCB_EVT *p_data)
{
+ UNUSED(p_data);
+
mca_free_buf ((void **)&p_ccb->p_tx_req);
mca_free_buf ((void **)&p_ccb->p_rx_msg);
p_ccb->status = MCA_CCB_STAT_NORM;
diff --git a/stack/mcap/mca_dact.c b/stack/mcap/mca_dact.c
index 353153e..d147c39 100644
--- a/stack/mcap/mca_dact.c
+++ b/stack/mcap/mca_dact.c
@@ -23,6 +23,7 @@
*
******************************************************************************/
#include "bt_target.h"
+#include "bt_utils.h"
#include "gki.h"
#include "mca_api.h"
#include "mca_int.h"
@@ -99,6 +100,8 @@
*******************************************************************************/
void mca_dcb_free_data (tMCA_DCB *p_dcb, tMCA_DCB_EVT *p_data)
{
+ UNUSED(p_dcb);
+
GKI_freebuf (p_data);
}
@@ -114,6 +117,8 @@
void mca_dcb_do_disconn (tMCA_DCB *p_dcb, tMCA_DCB_EVT *p_data)
{
tMCA_CLOSE close;
+ UNUSED(p_data);
+
if ((p_dcb->lcid == 0) || (L2CA_DisconnectReq(p_dcb->lcid) == FALSE))
{
close.param = MCA_INT;
diff --git a/stack/mcap/mca_l2c.c b/stack/mcap/mca_l2c.c
index 23d56f5..bc6fe09 100644
--- a/stack/mcap/mca_l2c.c
+++ b/stack/mcap/mca_l2c.c
@@ -24,6 +24,7 @@
#include <string.h>
#include "bt_target.h"
+#include "bt_utils.h"
#include "btm_api.h"
#include "btm_int.h"
#include "mca_api.h"
@@ -118,6 +119,7 @@
{
tMCA_TC_TBL *p_tbl = (tMCA_TC_TBL *)p_ref_data;
tL2CAP_CFG_INFO cfg;
+ UNUSED(bd_addr);
MCA_TRACE_DEBUG1("mca_sec_check_complete_orig res: %d", res);
diff --git a/stack/pan/pan_api.c b/stack/pan/pan_api.c
index c3c74b3..f9742ed 100644
--- a/stack/pan/pan_api.c
+++ b/stack/pan/pan_api.c
@@ -34,7 +34,8 @@
#include "l2c_api.h"
#include "hcidefs.h"
#include "btm_api.h"
-#include "bta_sys.h" /* For bta_sys_add_uuid and bta_sys_remove_uuid */
+#include "bta_sys.h"
+
/*******************************************************************************
**
diff --git a/stack/pan/pan_main.c b/stack/pan/pan_main.c
index 6cbe1ce..bfaced6 100644
--- a/stack/pan/pan_main.c
+++ b/stack/pan/pan_main.c
@@ -26,6 +26,7 @@
#include <string.h>
#include "gki.h"
#include "bt_types.h"
+#include "bt_utils.h"
#include "bnep_api.h"
#include "pan_api.h"
#include "pan_int.h"
@@ -333,6 +334,7 @@
{
tPAN_CONN *pcb;
UINT8 peer_role;
+ UNUSED(rem_bda);
PAN_TRACE_EVENT2 ("pan_connect_state_cb - for handle %d, result %d", handle, result);
pcb = pan_get_pcb_by_handle (handle);
diff --git a/stack/rfcomm/port_rfc.c b/stack/rfcomm/port_rfc.c
index 3f697e1..003cbb5 100644
--- a/stack/rfcomm/port_rfc.c
+++ b/stack/rfcomm/port_rfc.c
@@ -32,6 +32,7 @@
#include "btm_api.h"
#include "port_int.h"
#include "rfc_int.h"
+#include "bt_utils.h"
/*
** Local function definitions
@@ -581,6 +582,7 @@
void PORT_PortNegCnf (tRFC_MCB *p_mcb, UINT8 dlci, tPORT_STATE *p_pars, UINT16 result)
{
tPORT *p_port = port_find_mcb_dlci_port (p_mcb, dlci);
+ UNUSED(p_pars);
RFCOMM_TRACE_EVENT0 ("PORT_PortNegCnf");
@@ -682,6 +684,7 @@
{
tPORT *p_port = port_find_mcb_dlci_port (p_mcb, dlci);
UINT32 event = 0;
+ UNUSED(p_pars);
RFCOMM_TRACE_EVENT0 ("PORT_ControlCnf");
diff --git a/stack/rfcomm/rfc_l2cap_if.c b/stack/rfcomm/rfc_l2cap_if.c
index cb50612..9137a66 100644
--- a/stack/rfcomm/rfc_l2cap_if.c
+++ b/stack/rfcomm/rfc_l2cap_if.c
@@ -31,6 +31,7 @@
#include "l2c_api.h"
#include "l2cdefs.h"
#include "rfc_int.h"
+#include "bt_utils.h"
/*
@@ -87,6 +88,7 @@
void RFCOMM_ConnectInd (BD_ADDR bd_addr, UINT16 lcid, UINT16 psm, UINT8 id)
{
tRFC_MCB *p_mcb = rfc_alloc_multiplexer_channel(bd_addr, FALSE);
+ UNUSED(psm);
if ((p_mcb)&&(p_mcb->state != RFC_MX_STATE_IDLE))
{
@@ -257,6 +259,7 @@
*******************************************************************************/
void RFCOMM_QoSViolationInd (BD_ADDR bd_addr)
{
+ UNUSED(bd_addr);
}
diff --git a/stack/rfcomm/rfc_mx_fsm.c b/stack/rfcomm/rfc_mx_fsm.c
index 842f8ee..6d8bb06 100644
--- a/stack/rfcomm/rfc_mx_fsm.c
+++ b/stack/rfcomm/rfc_mx_fsm.c
@@ -31,6 +31,7 @@
#include "port_int.h"
#include "l2c_api.h"
#include "rfc_int.h"
+#include "bt_utils.h"
#define L2CAP_SUCCESS 0
#define L2CAP_ERROR 1
@@ -308,6 +309,8 @@
*******************************************************************************/
void rfc_mx_sm_sabme_wait_ua (tRFC_MCB *p_mcb, UINT16 event, void *p_data)
{
+ UNUSED(p_data);
+
RFCOMM_TRACE_EVENT1 ("rfc_mx_sm_sabme_wait_ua - evt:%d", event);
switch (event)
{
@@ -436,6 +439,8 @@
*******************************************************************************/
void rfc_mx_sm_state_connected (tRFC_MCB *p_mcb, UINT16 event, void *p_data)
{
+ UNUSED(p_data);
+
RFCOMM_TRACE_EVENT1 ("rfc_mx_sm_state_connected - evt:%d", event);
switch (event)
@@ -614,7 +619,9 @@
else
{
p_mcb->state = RFC_MX_STATE_WAIT_SABME;
- rfc_timer_start (p_mcb, RFC_T2_TIMEOUT);
+ rfc_timer_start (p_mcb, RFCOMM_CONN_TIMEOUT); /* - increased from T2=20 to CONN=120
+ to allow the user more than 10 sec to type in the
+ pin which can be e.g. 16 digits */
}
}
}
@@ -657,7 +664,9 @@
else
{
p_mcb->state = RFC_MX_STATE_WAIT_SABME;
- rfc_timer_start (p_mcb, RFC_T2_TIMEOUT);
+ rfc_timer_start (p_mcb, RFCOMM_CONN_TIMEOUT); /* - increased from T2=20 to CONN=120
+ to allow the user more than 10 sec to type in the
+ pin which can be e.g. 16 digits */
}
}
}
diff --git a/stack/rfcomm/rfc_port_fsm.c b/stack/rfcomm/rfc_port_fsm.c
index d5335ad..e519a98 100644
--- a/stack/rfcomm/rfc_port_fsm.c
+++ b/stack/rfcomm/rfc_port_fsm.c
@@ -31,6 +31,7 @@
#include "port_api.h"
#include "port_int.h"
#include "rfc_int.h"
+#include "bt_utils.h"
/********************************************************************************/
/* L O C A L F U N C T I O N P R O T O T Y P E S */
@@ -795,6 +796,8 @@
*******************************************************************************/
void rfc_process_nsc (tRFC_MCB *p_mcb, MX_FRAME *p_frame)
{
+ UNUSED(p_mcb);
+ UNUSED(p_frame);
}
@@ -808,6 +811,8 @@
*******************************************************************************/
void rfc_process_test_rsp (tRFC_MCB *p_mcb, BT_HDR *p_buf)
{
+ UNUSED(p_mcb);
+
GKI_freebuf (p_buf);
}
diff --git a/stack/rfcomm/rfc_port_if.c b/stack/rfcomm/rfc_port_if.c
index 083d9ef..741df20 100644
--- a/stack/rfcomm/rfc_port_if.c
+++ b/stack/rfcomm/rfc_port_if.c
@@ -31,7 +31,7 @@
#include "l2c_api.h"
#include "port_int.h"
#include "rfc_int.h"
-
+#include "bt_utils.h"
#if RFC_DYNAMIC_MEMORY == FALSE
tRFC_CB rfc_cb;
@@ -82,6 +82,7 @@
void RFCOMM_DlcEstablishReq (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu)
{
tPORT *p_port = port_find_mcb_dlci_port (p_mcb, dlci);
+ UNUSED(mtu);
if (p_mcb->state != RFC_MX_STATE_CONNECTED)
{
@@ -104,6 +105,7 @@
void RFCOMM_DlcEstablishRsp (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu, UINT16 result)
{
tPORT *p_port = port_find_mcb_dlci_port (p_mcb, dlci);
+ UNUSED(mtu);
if ((p_mcb->state != RFC_MX_STATE_CONNECTED) && (result == RFCOMM_SUCCESS))
{
diff --git a/stack/rfcomm/rfc_utils.c b/stack/rfcomm/rfc_utils.c
index 2b850fa..d2b02fc 100644
--- a/stack/rfcomm/rfc_utils.c
+++ b/stack/rfcomm/rfc_utils.c
@@ -33,6 +33,7 @@
#include "port_int.h"
#include "rfc_int.h"
#include "btu.h"
+#include "bt_utils.h"
#include <string.h>
@@ -352,6 +353,7 @@
void rfc_sec_check_complete (BD_ADDR bd_addr, void *p_ref_data, UINT8 res)
{
tPORT *p_port = (tPORT *)p_ref_data;
+ UNUSED(bd_addr);
/* Verify that PORT is still waiting for Security to complete */
if (!p_port->in_use
diff --git a/stack/sdp/sdp_api.c b/stack/sdp/sdp_api.c
index cb632bd..1471664 100644
--- a/stack/sdp/sdp_api.c
+++ b/stack/sdp/sdp_api.c
@@ -27,6 +27,7 @@
#include <stdio.h>
#include "bt_target.h"
+#include "bt_utils.h"
#include "gki.h"
#include "l2cdefs.h"
#include "hcidefs.h"
@@ -244,6 +245,8 @@
#if SDP_CLIENT_ENABLED == TRUE
void SDP_SetIdleTimeout (BD_ADDR addr, UINT16 timeout)
{
+ UNUSED(addr);
+ UNUSED(timeout);
}
#endif
@@ -513,7 +516,7 @@
printf("SDP_FindServiceInDb - p_sattr value = 0x%x serviceuuid = 0x%x\r\n", p_sattr->attr_value.v.u16, service_uuid);
if(service_uuid == UUID_SERVCLASS_HDP_PROFILE)
{
- if( (p_sattr->attr_value.v.u16==UUID_SERVCLASS_HDP_SOURCE) || ( p_sattr->attr_value.v.u16==UUID_SERVCLASS_HDP_SOURCE))
+ if( (p_sattr->attr_value.v.u16==UUID_SERVCLASS_HDP_SOURCE) || ( p_sattr->attr_value.v.u16==UUID_SERVCLASS_HDP_SINK))
{
printf("SDP_FindServiceInDb found HDP source or sink\n" );
return (p_rec);
@@ -989,6 +992,34 @@
/*******************************************************************************
**
+** Function SDP_AttrStringCopy
+**
+** Description This function copy given attribute to specified buffer as a string
+**
+** Returns none
+**
+*******************************************************************************/
+static void SDP_AttrStringCopy(char *dst, tSDP_DISC_ATTR *p_attr, UINT16 dst_size)
+{
+ if ( dst == NULL ) return;
+ if ( p_attr )
+ {
+ UINT16 len = SDP_DISC_ATTR_LEN(p_attr->attr_len_type);
+ if ( len > dst_size - 1 )
+ {
+ len = dst_size - 1;
+ }
+ memcpy(dst, (char *)p_attr->attr_value.v.array, len);
+ dst[len] = '\0';
+ }
+ else
+ {
+ dst[0] = '\0';
+ }
+}
+
+/*******************************************************************************
+**
** Function SDP_GetDiRecord
**
** Description This function retrieves a remote device's DI record from
@@ -1028,27 +1059,16 @@
/* ClientExecutableURL is optional */
p_curr_attr = SDP_FindAttributeInRec( p_curr_record, ATTR_ID_CLIENT_EXE_URL );
- if ( p_curr_attr )
- BCM_STRNCPY_S( p_device_info->rec.client_executable_url, sizeof(p_device_info->rec.client_executable_url),
- (char *)p_curr_attr->attr_value.v.array, SDP_MAX_ATTR_LEN );
- else
- p_device_info->rec.client_executable_url[0] = '\0';
+ SDP_AttrStringCopy( p_device_info->rec.client_executable_url, p_curr_attr,
+ SDP_MAX_ATTR_LEN );
/* Service Description is optional */
p_curr_attr = SDP_FindAttributeInRec( p_curr_record, ATTR_ID_SERVICE_DESCRIPTION );
- if ( p_curr_attr )
- BCM_STRNCPY_S( p_device_info->rec.service_description, sizeof(p_device_info->rec.service_description),
- (char *)p_curr_attr->attr_value.v.array, SDP_MAX_ATTR_LEN );
- else
- p_device_info->rec.service_description[0] = '\0';
+ SDP_AttrStringCopy( p_device_info->rec.service_description, p_curr_attr, SDP_MAX_ATTR_LEN );
/* DocumentationURL is optional */
p_curr_attr = SDP_FindAttributeInRec( p_curr_record, ATTR_ID_DOCUMENTATION_URL );
- if ( p_curr_attr )
- BCM_STRNCPY_S( p_device_info->rec.documentation_url, sizeof(p_device_info->rec.documentation_url),
- (char *)p_curr_attr->attr_value.v.array, SDP_MAX_ATTR_LEN );
- else
- p_device_info->rec.documentation_url[0] = '\0';
+ SDP_AttrStringCopy( p_device_info->rec.documentation_url, p_curr_attr, SDP_MAX_ATTR_LEN );
p_curr_attr = SDP_FindAttributeInRec( p_curr_record, ATTR_ID_SPECIFICATION_ID );
if ( p_curr_attr )
diff --git a/stack/sdp/sdp_discovery.c b/stack/sdp/sdp_discovery.c
index 1ad1336..4f1db1b 100644
--- a/stack/sdp/sdp_discovery.c
+++ b/stack/sdp/sdp_discovery.c
@@ -45,9 +45,9 @@
/* L O C A L F U N C T I O N P R O T O T Y P E S */
/********************************************************************************/
#if SDP_CLIENT_ENABLED == TRUE
-static void process_service_search_rsp (tCONN_CB *p_ccb, UINT8 *p_reply, UINT16 len);
-static void process_service_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply, UINT16 len);
-static void process_service_search_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply, UINT16 len);
+static void process_service_search_rsp (tCONN_CB *p_ccb, UINT8 *p_reply);
+static void process_service_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply);
+static void process_service_search_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply);
static UINT8 *save_attr_seq (tCONN_CB *p_ccb, UINT8 *p, UINT8 *p_msg_end);
static tSDP_DISC_REC *add_record (tSDP_DISCOVERY_DB *p_db, BD_ADDR p_bda);
static UINT8 *add_attr (UINT8 *p, tSDP_DISCOVERY_DB *p_db, tSDP_DISC_REC *p_rec,
@@ -215,7 +215,7 @@
{
p_ccb->disc_state = SDP_DISC_WAIT_SEARCH_ATTR;
- process_service_search_attr_rsp (p_ccb, NULL, 0);
+ process_service_search_attr_rsp (p_ccb, NULL);
}
else
{
@@ -278,7 +278,7 @@
case SDP_PDU_SERVICE_SEARCH_RSP:
if (p_ccb->disc_state == SDP_DISC_WAIT_HANDLES)
{
- process_service_search_rsp (p_ccb, p, p_msg->len);
+ process_service_search_rsp (p_ccb, p);
invalid_pdu = FALSE;
}
break;
@@ -286,7 +286,7 @@
case SDP_PDU_SERVICE_ATTR_RSP:
if (p_ccb->disc_state == SDP_DISC_WAIT_ATTR)
{
- process_service_attr_rsp (p_ccb, p, p_msg->len);
+ process_service_attr_rsp (p_ccb, p);
invalid_pdu = FALSE;
}
break;
@@ -294,7 +294,7 @@
case SDP_PDU_SERVICE_SEARCH_ATTR_RSP:
if (p_ccb->disc_state == SDP_DISC_WAIT_SEARCH_ATTR)
{
- process_service_search_attr_rsp (p_ccb, p, p_msg->len);
+ process_service_search_attr_rsp (p_ccb, p);
invalid_pdu = FALSE;
}
break;
@@ -317,7 +317,7 @@
** Returns void
**
*******************************************************************************/
-static void process_service_search_rsp (tCONN_CB *p_ccb, UINT8 *p_reply, UINT16 len)
+static void process_service_search_rsp (tCONN_CB *p_ccb, UINT8 *p_reply)
{
UINT16 xx;
UINT16 total, cur_handles, orig;
@@ -363,7 +363,7 @@
p_ccb->disc_state = SDP_DISC_WAIT_ATTR;
/* Kick off the first attribute request */
- process_service_attr_rsp (p_ccb, NULL, 0);
+ process_service_attr_rsp (p_ccb, NULL);
}
}
@@ -378,7 +378,7 @@
**
*******************************************************************************/
#if (SDP_RAW_DATA_INCLUDED == TRUE)
-static void sdp_copy_raw_data (tCONN_CB *p_ccb, UINT16 len, BOOLEAN offset)
+static void sdp_copy_raw_data (tCONN_CB *p_ccb, BOOLEAN offset)
{
unsigned int cpy_len;
UINT32 list_len;
@@ -433,15 +433,15 @@
** Returns void
**
*******************************************************************************/
-static void process_service_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply, UINT16 len)
+static void process_service_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply)
{
UINT8 *p_start, *p_param_len;
UINT16 param_len, list_byte_count;
BOOLEAN cont_request_needed = FALSE;
#if (SDP_DEBUG_RAW == TRUE)
- SDP_TRACE_WARNING2("process_service_attr_rsp len:%d raw inc:%d",
- len, SDP_RAW_DATA_INCLUDED);
+ SDP_TRACE_WARNING2("process_service_attr_rsp raw inc:%d",
+ SDP_RAW_DATA_INCLUDED);
#endif
/* If p_reply is NULL, we were called after the records handles were read */
if (p_reply)
@@ -502,7 +502,7 @@
#if (SDP_RAW_DATA_INCLUDED == TRUE)
SDP_TRACE_WARNING0("process_service_attr_rsp");
- sdp_copy_raw_data (p_ccb, len, FALSE);
+ sdp_copy_raw_data (p_ccb, FALSE);
#endif
/* Save the response in the database. Stop on any error */
@@ -591,7 +591,7 @@
** Returns void
**
*******************************************************************************/
-static void process_service_search_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply, UINT16 len)
+static void process_service_search_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply)
{
UINT8 *p, *p_start, *p_end, *p_param_len;
UINT8 type;
@@ -600,7 +600,7 @@
BOOLEAN cont_request_needed = FALSE;
#if (SDP_DEBUG_RAW == TRUE)
- SDP_TRACE_WARNING1("process_service_search_attr_rsp len:%d", len);
+ SDP_TRACE_WARNING1("process_service_search_attr_rsp");
#endif
/* If p_reply is NULL, we were called for the initial read */
if (p_reply)
@@ -734,7 +734,7 @@
#if (SDP_RAW_DATA_INCLUDED == TRUE)
SDP_TRACE_WARNING0("process_service_search_attr_rsp");
- sdp_copy_raw_data (p_ccb, len, TRUE);
+ sdp_copy_raw_data (p_ccb, TRUE);
#endif
p = &p_ccb->rsp_list[0];
diff --git a/stack/sdp/sdp_main.c b/stack/sdp/sdp_main.c
index 14cd39b..d43c634 100644
--- a/stack/sdp/sdp_main.c
+++ b/stack/sdp/sdp_main.c
@@ -27,6 +27,7 @@
#include <stdio.h>
#include "bt_target.h"
+#include "bt_utils.h"
#include "gki.h"
#include "l2cdefs.h"
#include "hcidefs.h"
@@ -170,6 +171,7 @@
*******************************************************************************/
static void sdp_connect_ind (BD_ADDR bd_addr, UINT16 l2cap_cid, UINT16 psm, UINT8 l2cap_id)
{
+ UNUSED(psm);
#if SDP_SERVER_ENABLED == TRUE
tCONN_CB *p_ccb;
@@ -671,6 +673,7 @@
static void sdp_disconnect_cfm (UINT16 l2cap_cid, UINT16 result)
{
tCONN_CB *p_ccb;
+ UNUSED(result);
/* Find CCB based on CID */
if ((p_ccb = sdpu_find_ccb_by_cid (l2cap_cid)) == NULL)
diff --git a/stack/sdp/sdp_server.c b/stack/sdp/sdp_server.c
index 342d93e..5d11cb4 100644
--- a/stack/sdp/sdp_server.c
+++ b/stack/sdp/sdp_server.c
@@ -29,6 +29,7 @@
#include "gki.h"
#include "bt_types.h"
+#include "bt_utils.h"
#include "btu.h"
#include "l2cdefs.h"
@@ -177,6 +178,7 @@
tSDP_RECORD *p_rec = NULL;
BT_HDR *p_buf;
BOOLEAN is_cont = FALSE;
+ UNUSED(p_req_end);
p_req = sdpu_extract_uid_seq (p_req, param_len, &uid_seq);
@@ -565,6 +567,7 @@
BOOLEAN maxxed_out = FALSE, is_cont = FALSE;
UINT8 *p_seq_start;
UINT16 seq_len, attr_len;
+ UNUSED(p_req_end);
/* Extract the UUID sequence to search for */
p_req = sdpu_extract_uid_seq (p_req, param_len, &uid_seq);
diff --git a/stack/smp/aes.c b/stack/smp/aes.c
index 1028d5b..65cddf5 100644
--- a/stack/smp/aes.c
+++ b/stack/smp/aes.c
@@ -510,7 +510,6 @@
keylen = 24;
break;
case 32:
- case 256:
keylen = 32;
break;
default:
diff --git a/stack/smp/smp_act.c b/stack/smp/smp_act.c
index 032f3ed..47cd2c9 100644
--- a/stack/smp/smp_act.c
+++ b/stack/smp/smp_act.c
@@ -17,6 +17,7 @@
******************************************************************************/
#include "bt_target.h"
+#include "bt_utils.h"
#if SMP_INCLUDED == TRUE
@@ -83,6 +84,8 @@
{
tSMP_EVT_DATA cb_data;
tSMP_STATUS callback_rc;
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG1 ("smp_send_app_cback p_cb->cb_evt=%d", p_cb->cb_evt );
if (p_cb->p_callback && p_cb->cb_evt != 0)
{
@@ -105,6 +108,12 @@
{
p_cb->loc_auth_req = cb_data.io_req.auth_req;
p_cb->loc_io_caps = cb_data.io_req.io_cap;
+#if (defined(BLE_PERIPHERAL_DISPLAYONLY) && (BLE_PERIPHERAL_DISPLAYONLY == TRUE))
+ if (p_cb->role == HCI_ROLE_SLAVE)
+ {
+ p_cb->loc_io_caps = SMP_IO_CAP_OUT;
+ }
+#endif
p_cb->loc_oob_flag = cb_data.io_req.oob_data;
p_cb->loc_enc_size = cb_data.io_req.max_key_size;
p_cb->loc_i_key = cb_data.io_req.init_keys;
@@ -147,6 +156,8 @@
void smp_send_pair_req(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev (p_cb->pairing_bda);
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_send_pair_req ");
#if BLE_INCLUDED == TRUE
@@ -170,6 +181,8 @@
*******************************************************************************/
void smp_send_pair_rsp(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_send_pair_rsp ");
p_cb->loc_i_key &= p_cb->peer_i_key;
@@ -187,6 +200,8 @@
*******************************************************************************/
void smp_send_confirm(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_send_confirm ");
smp_send_cmd(SMP_OPCODE_CONFIRM, p_cb);
}
@@ -196,6 +211,8 @@
*******************************************************************************/
void smp_send_init(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_send_init ");
#if SMP_CONFORMANCE_TESTING == TRUE
@@ -215,6 +232,7 @@
void smp_send_enc_info(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
tBTM_LE_LENC_KEYS le_key;
+ UNUSED(p_data);
SMP_TRACE_DEBUG1 ("smp_send_enc_info p_cb->loc_enc_size = %d", p_cb->loc_enc_size);
smp_update_key_mask (p_cb, SMP_SEC_KEY_TYPE_ENC, FALSE);
@@ -238,6 +256,8 @@
*******************************************************************************/
void smp_send_id_info(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_send_id_info ");
smp_update_key_mask (p_cb, SMP_SEC_KEY_TYPE_ID, FALSE);
@@ -255,6 +275,8 @@
void smp_send_csrk_info(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
tBTM_LE_KEY_VALUE key;
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_send_csrk_info ");
smp_update_key_mask (p_cb, SMP_SEC_KEY_TYPE_CSRK, FALSE);
@@ -614,6 +636,8 @@
*******************************************************************************/
void smp_proc_discard(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_proc_discard ");
smp_reset_control_value(p_cb);
}
@@ -623,6 +647,8 @@
*******************************************************************************/
void smp_proc_release_delay(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_proc_release_delay ");
btu_stop_timer (&p_cb->rsp_timer_ent);
btu_start_timer (&p_cb->rsp_timer_ent, BTU_TTYPE_SMP_PAIRING_CMD,
@@ -635,6 +661,8 @@
*******************************************************************************/
void smp_proc_release_delay_tout(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_proc_release_delay_tout ");
btu_stop_timer (&p_cb->rsp_timer_ent);
smp_proc_pairing_cmpl(p_cb);
@@ -750,6 +778,7 @@
UINT8 int_evt = 0;
tSMP_KEY key;
tSMP_INT_DATA *p = NULL;
+ UNUSED(p_data);
SMP_TRACE_DEBUG3 ("smp_decide_asso_model p_cb->peer_io_caps = %d p_cb->loc_io_caps = %d \
p_cb->peer_auth_req = %02x",
@@ -847,6 +876,8 @@
*******************************************************************************/
void smp_proc_io_rsp(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_proc_io_rsp ");
if (p_cb->flags & SMP_PAIR_FLAGS_WE_STARTED_DD)
{
@@ -887,9 +918,11 @@
*******************************************************************************/
void smp_pair_terminate(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_pair_terminate ");
- p_cb->status = SMP_CONN_TOUT;
+ p_cb->status = SMP_CONN_TOUT;
smp_proc_pairing_cmpl(p_cb);
}
@@ -905,21 +938,21 @@
btu_stop_timer (&p_cb->rsp_timer_ent);
- /* if remote user terminate connection, finish SMP pairing as normal */
- if (p_data->reason == HCI_ERR_PEER_USER)
- p_cb->status = SMP_SUCCESS;
- else
+ /* if remote user terminate connection, keep the previous status */
+ /* this is to avoid reporting reverse status to uplayer */
+ if (p_data->reason != HCI_ERR_PEER_USER)
p_cb->status = SMP_CONN_TOUT;
smp_proc_pairing_cmpl(p_cb);
}
/*******************************************************************************
** Function smp_idle_terminate
-** Description This function calledin idle state to determine to send authentication
+** Description This function called in idle state to determine to send authentication
** complete or not.
*******************************************************************************/
void smp_idle_terminate(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
+ UNUSED(p_data);
if (p_cb->flags & SMP_PAIR_FLAGS_WE_STARTED_DD)
{
SMP_TRACE_DEBUG0("Pairing terminated at IDLE state.");
diff --git a/stack/smp/smp_api.c b/stack/smp/smp_api.c
index cfde2d4..64644da 100644
--- a/stack/smp/smp_api.c
+++ b/stack/smp/smp_api.c
@@ -25,6 +25,7 @@
#include <string.h>
#include "bt_target.h"
+#include "bt_utils.h"
#if SMP_INCLUDED == TRUE
#include "smp_int.h"
#include "smp_api.h"
@@ -204,6 +205,9 @@
memcmp (smp_cb.pairing_bda, bd_addr, BD_ADDR_LEN))
return;
+ /* clear the SMP_SEC_REQUEST_EVT event after get grant */
+ /* avoid generate duplicate pair request */
+ smp_cb.cb_evt = 0;
smp_sm_event(&smp_cb, SMP_API_SEC_GRANT_EVT, &res);
}
@@ -281,6 +285,7 @@
tSMP_CB *p_cb = & smp_cb;
UINT8 failure = SMP_OOB_FAIL;
tSMP_KEY key;
+ UNUSED(bd_addr);
SMP_TRACE_EVENT2 ("SMP_OobDataReply State: %d res:%d",
smp_cb.state, res);
diff --git a/stack/smp/smp_keys.c b/stack/smp/smp_keys.c
index a1955f2..49612a5 100644
--- a/stack/smp/smp_keys.c
+++ b/stack/smp/smp_keys.c
@@ -24,6 +24,7 @@
******************************************************************************/
#include "bt_target.h"
+#include "bt_utils.h"
#if SMP_INCLUDED == TRUE
#if SMP_DEBUG == TRUE
@@ -161,6 +162,8 @@
*******************************************************************************/
void smp_generate_passkey(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_generate_passkey");
p_cb->rand_enc_proc = SMP_GEN_TK;
@@ -226,6 +229,7 @@
UINT8 *p = ptext;
tSMP_ENC output;
tSMP_STATUS status = SMP_PAIR_FAIL_UNKNOWN;
+ UNUSED(p_data);
SMP_TRACE_DEBUG0 ("smp_generate_stk ");
@@ -266,6 +270,8 @@
*******************************************************************************/
void smp_generate_confirm (tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_generate_confirm");
p_cb->rand_enc_proc = SMP_GEN_SRAND_MRAND;
/* generate MRand or SRand */
@@ -284,6 +290,8 @@
*******************************************************************************/
void smp_genenrate_rand_cont(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_genenrate_rand_cont ");
p_cb->rand_enc_proc = SMP_GEN_SRAND_MRAND_CONT;
/* generate 64 MSB of MRand or SRand */
@@ -305,6 +313,7 @@
void smp_generate_ltk(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
BOOLEAN div_status;
+ UNUSED(p_data);
SMP_TRACE_DEBUG0 ("smp_generate_ltk ");
@@ -343,6 +352,7 @@
UINT8 *p=buffer;
tSMP_ENC output;
tSMP_STATUS status = SMP_PAIR_FAIL_UNKNOWN;
+ UNUSED(p_data);
SMP_TRACE_DEBUG1 ("smp_compute_csrk div=%x", p_cb->div);
BTM_GetDeviceEncRoot(er);
@@ -376,6 +386,7 @@
void smp_generate_csrk(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
BOOLEAN div_status;
+ UNUSED(p_data);
SMP_TRACE_DEBUG0 ("smp_generate_csrk");
@@ -544,6 +555,7 @@
BT_OCTET16 p1;
tSMP_ENC output;
tSMP_STATUS status = SMP_PAIR_FAIL_UNKNOWN;
+ UNUSED(bda);
SMP_TRACE_DEBUG0 ("smp_calculate_comfirm ");
/* generate p1 = pres || preq || rat' || iat' */
@@ -625,6 +637,8 @@
*******************************************************************************/
static void smp_genenrate_confirm(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_genenrate_confirm ");
p_cb->rand_enc_proc = SMP_GEN_CONFIRM;
@@ -645,6 +659,8 @@
*******************************************************************************/
void smp_generate_compare (tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
+ UNUSED(p_data);
+
SMP_TRACE_DEBUG0 ("smp_generate_compare ");
p_cb->rand_enc_proc = SMP_GEN_COMPARE;
@@ -755,6 +771,7 @@
BT_OCTET16 er;
tSMP_ENC output;
tSMP_STATUS status = SMP_PAIR_FAIL_UNKNOWN;
+ UNUSED(p_data);
SMP_TRACE_DEBUG0 ("smp_genenrate_ltk_cont ");
BTM_GetDeviceEncRoot(er);
@@ -790,7 +807,7 @@
BT_OCTET16 dhk;
tSMP_ENC output;
tSMP_STATUS status = SMP_PAIR_FAIL_UNKNOWN;
-
+ UNUSED(p);
SMP_TRACE_DEBUG0 ("smp_generate_y ");
BTM_GetDeviceDHK(dhk);
@@ -818,6 +835,8 @@
*******************************************************************************/
static void smp_generate_rand_vector (tSMP_CB *p_cb, tSMP_INT_DATA *p)
{
+ UNUSED(p);
+
/* generate EDIV and rand now */
/* generate random vector */
SMP_TRACE_DEBUG0 ("smp_generate_rand_vector ");
diff --git a/stack/smp/smp_utils.c b/stack/smp/smp_utils.c
index 168d6bd..dac0cc0 100644
--- a/stack/smp/smp_utils.c
+++ b/stack/smp/smp_utils.c
@@ -26,6 +26,7 @@
#if SMP_INCLUDED == TRUE
#include "bt_types.h"
+#include "bt_utils.h"
#include <string.h>
#include <ctype.h>
#include "hcidefs.h"
@@ -151,6 +152,7 @@
{
tSMP_CB *p_cb = &smp_cb;
UINT8 failure = SMP_RSP_TIMEOUT;
+ UNUSED(p_tle);
SMP_TRACE_EVENT1("smp_rsp_timeout state:%d", p_cb->state);
@@ -207,6 +209,8 @@
{
BT_HDR *p_buf = NULL ;
UINT8 *p;
+ UNUSED(cmd_code);
+
SMP_TRACE_EVENT0("smp_build_confirm_cmd");
if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_CONFIRM_CMD_SIZE + L2CAP_MIN_OFFSET)) != NULL)
{
@@ -232,6 +236,8 @@
{
BT_HDR *p_buf = NULL ;
UINT8 *p;
+ UNUSED(cmd_code);
+
SMP_TRACE_EVENT0("smp_build_rand_cmd");
if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_INIT_CMD_SIZE + L2CAP_MIN_OFFSET)) != NULL)
{
@@ -257,6 +263,8 @@
{
BT_HDR *p_buf = NULL ;
UINT8 *p;
+ UNUSED(cmd_code);
+
SMP_TRACE_EVENT0("smp_build_encrypt_info_cmd");
if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_ENC_INFO_SIZE + L2CAP_MIN_OFFSET)) != NULL)
{
@@ -282,6 +290,8 @@
{
BT_HDR *p_buf = NULL ;
UINT8 *p;
+ UNUSED(cmd_code);
+
SMP_TRACE_EVENT0("smp_build_master_id_cmd ");
if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_MASTER_ID_SIZE + L2CAP_MIN_OFFSET)) != NULL)
{
@@ -309,6 +319,9 @@
BT_HDR *p_buf = NULL ;
UINT8 *p;
BT_OCTET16 irk;
+ UNUSED(cmd_code);
+ UNUSED(p_cb);
+
SMP_TRACE_EVENT0("smp_build_identity_info_cmd");
if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_ID_INFO_SIZE + L2CAP_MIN_OFFSET)) != NULL)
{
@@ -337,7 +350,8 @@
BT_HDR *p_buf = NULL ;
UINT8 *p;
BD_ADDR static_addr;
-
+ UNUSED(cmd_code);
+ UNUSED(p_cb);
SMP_TRACE_EVENT0("smp_build_id_addr_cmd");
if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_ID_ADDR_SIZE + L2CAP_MIN_OFFSET)) != NULL)
@@ -367,6 +381,7 @@
{
BT_HDR *p_buf = NULL ;
UINT8 *p;
+ UNUSED(cmd_code);
SMP_TRACE_EVENT0("smp_build_signing_info_cmd");
if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_SIGN_INFO_SIZE + L2CAP_MIN_OFFSET)) != NULL)
@@ -393,6 +408,8 @@
{
BT_HDR *p_buf = NULL ;
UINT8 *p;
+ UNUSED(cmd_code);
+
SMP_TRACE_EVENT0("smp_build_pairing_fail");
if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + SMP_PAIR_FAIL_SIZE + L2CAP_MIN_OFFSET)) != NULL)
{
@@ -418,6 +435,8 @@
{
BT_HDR *p_buf = NULL ;
UINT8 *p;
+ UNUSED(cmd_code);
+
SMP_TRACE_EVENT0("smp_build_security_request");
if ((p_buf = (BT_HDR *)GKI_getbuf(sizeof(BT_HDR) + 2 + L2CAP_MIN_OFFSET)) != NULL)
diff --git a/stack/srvc/srvc_battery.c b/stack/srvc/srvc_battery.c
index 22e538b..0606fd2 100644
--- a/stack/srvc/srvc_battery.c
+++ b/stack/srvc/srvc_battery.c
@@ -17,7 +17,7 @@
******************************************************************************/
#include "bt_target.h"
-
+#include "bt_utils.h"
#include "gatt_api.h"
#include "gatt_int.h"
#include "srvc_eng_int.h"
@@ -115,10 +115,11 @@
tBA_INST *p_inst = &battery_cb.battery_inst[0];
tGATT_STATUS st = GATT_NOT_FOUND;
UINT8 act = SRVC_ACT_RSP;
+ UNUSED(p_value);
- for (i = 0; i < BA_MAX_INT_NUM; i ++, p_inst ++)
- {
- /* read battery level */
+ for (i = 0; i < BA_MAX_INT_NUM; i ++, p_inst ++)
+ {
+ /* read battery level */
if (handle == p_inst->ba_level_hdl ||
handle == p_inst->clt_cfg_hdl ||
handle == p_inst->rpt_ref_hdl ||
@@ -164,6 +165,7 @@
*******************************************************************************/
BOOLEAN battery_gatt_c_read_ba_req(UINT16 conn_id)
{
+ UNUSED(conn_id);
return TRUE;
}
@@ -179,6 +181,10 @@
void battery_c_cmpl_cback (tSRVC_CLCB *p_clcb, tGATTC_OPTYPE op,
tGATT_STATUS status, tGATT_CL_COMPLETE *p_data)
{
+ UNUSED(p_clcb);
+ UNUSED(op);
+ UNUSED(status);
+ UNUSED(p_data);
}
@@ -395,6 +401,7 @@
*******************************************************************************/
BOOLEAN Battery_ReadBatteryLevel(BD_ADDR peer_bda)
{
+ UNUSED(peer_bda);
/* to be implemented */
return TRUE;
}
diff --git a/stack/srvc/srvc_dis.c b/stack/srvc/srvc_dis.c
index fcface2..90b4acd 100644
--- a/stack/srvc/srvc_dis.c
+++ b/stack/srvc/srvc_dis.c
@@ -17,7 +17,7 @@
******************************************************************************/
#include "bt_target.h"
-
+#include "bt_utils.h"
#include "gatt_api.h"
#include "gatt_int.h"
#include "srvc_eng_int.h"
@@ -76,6 +76,8 @@
*******************************************************************************/
UINT8 dis_write_attr_value(tGATT_WRITE_REQ * p_data, tGATT_STATUS *p_status)
{
+ UNUSED(p_data);
+
*p_status = GATT_WRITE_NOT_PERMIT;
return SRVC_ACT_RSP;
}
@@ -90,6 +92,7 @@
UINT16 offset = p_value->offset;
UINT8 act = SRVC_ACT_RSP;
tGATT_STATUS st = GATT_NOT_FOUND;
+ UNUSED(clcb_idx);
for (i = 0; i < DIS_MAX_CHAR_NUM; i ++, p_db_attr ++)
{
diff --git a/stack/srvc/srvc_eng.c b/stack/srvc/srvc_eng.c
index a9b466e..4598738 100644
--- a/stack/srvc/srvc_eng.c
+++ b/stack/srvc/srvc_eng.c
@@ -17,7 +17,7 @@
******************************************************************************/
#include "bt_target.h"
-
+#include "bt_utils.h"
#include "gatt_api.h"
#include "gatt_int.h"
#include "srvc_eng_int.h"
@@ -39,7 +39,8 @@
srvc_eng_c_cmpl_cback,
NULL,
NULL,
- srvc_eng_s_request_cback
+ srvc_eng_s_request_cback,
+ NULL
} ;
/* type for action functions */
typedef void (*tSRVC_ENG_C_CMPL_ACTION)(tSRVC_CLCB *p_clcb, tGATTC_OPTYPE op,
@@ -229,6 +230,7 @@
UINT8 srvc_eng_process_write_req (UINT8 clcb_idx, tGATT_WRITE_REQ *p_data, tGATTS_RSP *p_rsp, tGATT_STATUS *p_status)
{
UINT8 act = SRVC_ACT_RSP;
+ UNUSED(p_rsp);
if (dis_valid_handle_range(p_data->handle))
{
@@ -341,6 +343,8 @@
static void srvc_eng_connect_cback (tGATT_IF gatt_if, BD_ADDR bda, UINT16 conn_id,
BOOLEAN connected, tGATT_DISCONN_REASON reason)
{
+ UNUSED(gatt_if);
+
GATT_TRACE_EVENT5 ("srvc_eng_connect_cback: from %08x%04x connected:%d conn_id=%d reason = 0x%04x",
(bda[0]<<24)+(bda[1]<<16)+(bda[2]<<8)+bda[3],
(bda[4]<<8)+bda[5], connected, conn_id, reason);
diff --git a/udrv/ulinux/uipc.c b/udrv/ulinux/uipc.c
index a3529cf..186e58c 100644
--- a/udrv/ulinux/uipc.c
+++ b/udrv/ulinux/uipc.c
@@ -50,6 +50,7 @@
#include <cutils/sockets.h>
#include "audio_a2dp_hw.h"
+#include "bt_utils.h"
/*****************************************************************************
** Constants & Macros
@@ -194,6 +195,7 @@
if(socket_local_server_bind(s, name, ANDROID_SOCKET_NAMESPACE_ABSTRACT) < 0)
{
BTIF_TRACE_EVENT1("socket failed to create (%s)", strerror(errno));
+ close(s);
return -1;
}
@@ -429,7 +431,7 @@
ret = poll(&pfd, 1, 1);
BTIF_TRACE_EVENT3("uipc_flush_ch_locked polling : fd %d, rxev %x, ret %d", pfd.fd, pfd.revents, ret);
- if (pfd.revents | (POLLERR|POLLHUP))
+ if (pfd.revents & (POLLERR|POLLHUP))
return;
if (ret <= 0)
@@ -517,6 +519,7 @@
{
int ch_id;
int result;
+ UNUSED(arg);
prctl(PR_SET_NAME, (unsigned long)"uipc-main", 0, 0, 0);
@@ -607,6 +610,8 @@
UDRV_API void UIPC_Init(void *p_data)
{
+ UNUSED(p_data);
+
BTIF_TRACE_DEBUG0("UIPC_Init");
memset(&uipc_main, 0, sizeof(tUIPC_MAIN));
@@ -701,6 +706,8 @@
*******************************************************************************/
UDRV_API BOOLEAN UIPC_SendBuf(tUIPC_CH_ID ch_id, BT_HDR *p_msg)
{
+ UNUSED(p_msg);
+
BTIF_TRACE_DEBUG1("UIPC_SendBuf : ch_id %d NOT IMPLEMENTED", ch_id);
UIPC_LOCK();
@@ -725,6 +732,7 @@
UINT16 msglen)
{
int n;
+ UNUSED(msg_evt);
BTIF_TRACE_DEBUG2("UIPC_Send : ch_id:%d %d bytes", ch_id, msglen);
@@ -751,6 +759,8 @@
*******************************************************************************/
UDRV_API void UIPC_ReadBuf(tUIPC_CH_ID ch_id, BT_HDR *p_msg)
{
+ UNUSED(p_msg);
+
BTIF_TRACE_DEBUG1("UIPC_ReadBuf : ch_id:%d NOT IMPLEMENTED", ch_id);
UIPC_LOCK();
@@ -773,6 +783,7 @@
int n_read = 0;
int fd = uipc_main.ch[ch_id].fd;
struct pollfd pfd;
+ UNUSED(p_msg_evt);
if (ch_id >= UIPC_CH_NUM)
{
@@ -799,7 +810,7 @@
if (poll(&pfd, 1, uipc_main.ch[ch_id].read_poll_tmo_ms) == 0)
{
BTIF_TRACE_EVENT1("poll timeout (%d ms)", uipc_main.ch[ch_id].read_poll_tmo_ms);
- return 0;
+ break;
}
//BTIF_TRACE_EVENT1("poll revents %x", pfd.revents);
diff --git a/utils/include/bt_utils.h b/utils/include/bt_utils.h
index ac18f07..d601f2e 100644
--- a/utils/include/bt_utils.h
+++ b/utils/include/bt_utils.h
@@ -40,4 +40,6 @@
void bt_utils_cleanup();
void raise_priority_a2dp(tHIGH_PRIORITY_TASK high_task);
+#define UNUSED(x) (void)(x)
+
#endif /* BT_UTILS_H */