#include "btif_sock_thread.h"
#include <string.h>
#include "btif_util.h"
+#include "btcore/include/bdaddr.h"
/*******************************************************************************
**
BOOLEAN ext;
BOOLEAN forward;
- BTIF_TRACE_API("bta_pan_co_tx_path, handle:%d, app_id:%d", handle, app_id);
+ BTIF_TRACE_API("%s, handle:%d, app_id:%d", __func__, handle, app_id);
btpan_conn_t* conn = btpan_find_conn_handle(handle);
- if(!conn || conn->state != PAN_STATE_OPEN)
+ if (!conn)
{
- BTIF_TRACE_ERROR("bta_pan_co_tx_path: cannot find pan connction or conn"
- "is not opened, conn:%p, conn->state:%d", conn, conn ? conn->state : -1);
+ BTIF_TRACE_ERROR("%s: cannot find pan connection", __func__);
return;
}
+ else if(conn->state != PAN_STATE_OPEN)
+ {
+ BTIF_TRACE_ERROR("%s: conn is not opened, conn:%p, conn->state:%d",
+ __func__, conn, conn->state);
+ return;
+ }
+
do
{
/* read next data buffer from pan */
if ((p_buf = bta_pan_ci_readbuf(handle, src, dst, &protocol,
&ext, &forward)))
{
- BTIF_TRACE_DEBUG("bta_pan_co_tx_path, calling btapp_tap_send, "
- "p_buf->len:%d, offset:%d", p_buf->len, p_buf->offset);
+ bdstr_t bdstr;
+ BTIF_TRACE_DEBUG("%s, calling btapp_tap_send, "
+ "p_buf->len:%d, offset:%d", __func__, p_buf->len, p_buf->offset);
if(is_empty_eth_addr(conn->eth_addr) && is_valid_bt_eth_addr(src))
{
- BTIF_TRACE_DEBUG("pan bt peer addr: %02x:%02x:%02x:%02x:%02x:%02x",
- conn->peer[0], conn->peer[1], conn->peer[2],
- conn->peer[3],conn->peer[4], conn->peer[5]);
- BTIF_TRACE_DEBUG(" update its ethernet addr: "
- "%02x:%02x:%02x:%02x:%02x:%02x", src[0], src[1], src[2],
- src[3],src[4], src[5]);
+ BTIF_TRACE_DEBUG("%s pan bt peer addr: %s", __func__,
+ bdaddr_to_string((bt_bdaddr_t *)conn->peer, bdstr, sizeof(bdstr)));
+ bdaddr_to_string((bt_bdaddr_t *)src, bdstr, sizeof(bdstr));
+ BTIF_TRACE_DEBUG("%s: update its ethernet addr: %s", __func__,
+ bdaddr_to_string((bt_bdaddr_t *)src, bdstr, sizeof(bdstr)));
memcpy(conn->eth_addr, src, sizeof(conn->eth_addr));
}
BT_HDR *p_buf;
UINT8 *p, *p_start;
- BNEP_TRACE_DEBUG ("BNEP sending setup req with dst uuid %x", p_bcb->dst_uuid.uu.uuid16);
+ BNEP_TRACE_DEBUG ("%s: sending setup req with dst uuid %x",
+ __func__, p_bcb->dst_uuid.uu.uuid16);
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (BNEP_POOL_ID)) == NULL)
{
- BNEP_TRACE_ERROR ("BNEP - not able to send connection request");
+ BNEP_TRACE_ERROR ("%s: not able to send connection request", __func__);
return;
}
UINT32_TO_BE_STREAM (p, p_bcb->dst_uuid.uu.uuid32);
UINT32_TO_BE_STREAM (p, p_bcb->src_uuid.uu.uuid32);
}
- else
+ else if (p_bcb->dst_uuid.len == 16)
{
memcpy (p, p_bcb->dst_uuid.uu.uuid128, p_bcb->dst_uuid.len);
p += p_bcb->dst_uuid.len;
memcpy (p, p_bcb->src_uuid.uu.uuid128, p_bcb->dst_uuid.len);
p += p_bcb->dst_uuid.len;
}
+ else
+ {
+ BNEP_TRACE_ERROR ("%s: uuid: %x, invalid length: %x",
+ __func__, p_bcb->dst_uuid.uu.uuid16, p_bcb->dst_uuid.len);
+ }
p_buf->len = (UINT16)(p - p_start);