component/bt: add new demo for Bluetooth SDP client

1. add Bluetooth SDP client demo;
2. some minor typo fixes
This commit is contained in:
wangmengyang
2016-10-31 12:34:11 +08:00
parent 0933339e4b
commit 2d15803f70
14 changed files with 513 additions and 115 deletions

View File

@@ -152,7 +152,7 @@ void sdp_server_handle_client_req (tCONN_CB *p_ccb, BT_HDR *p_msg)
default:
sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX, SDP_TEXT_BAD_PDU);
SDP_TRACE_WARNING ("SDP - server got unknown PDU: 0x%x", pdu_id);
SDP_TRACE_WARNING ("SDP - server got unknown PDU: 0x%x\n", pdu_id);
break;
}
}
@@ -258,7 +258,7 @@ static void process_service_search (tCONN_CB *p_ccb, UINT16 trans_num,
/* Get a buffer to use to build the response */
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (SDP_POOL_ID)) == NULL)
{
SDP_TRACE_ERROR ("SDP - no buf for search rsp");
SDP_TRACE_ERROR ("SDP - no buf for search rsp\n");
return;
}
p_buf->offset = L2CAP_MIN_OFFSET;
@@ -373,7 +373,7 @@ static void process_service_attr_req (tCONN_CB *p_ccb, UINT16 trans_num,
p_ccb->rsp_list = (UINT8 *)GKI_getbuf(max_list_len);
if (p_ccb->rsp_list == NULL)
{
SDP_TRACE_ERROR("%s No scratch buf for attr rsp", __func__);
SDP_TRACE_ERROR("%s No scratch buf for attr rsp\n", __func__);
return;
}
@@ -415,7 +415,7 @@ static void process_service_attr_req (tCONN_CB *p_ccb, UINT16 trans_num,
p_ccb->rsp_list = (UINT8 *)GKI_getbuf (max_list_len);
if (p_ccb->rsp_list == NULL)
{
SDP_TRACE_ERROR ("SDP - no scratch buf for search rsp");
SDP_TRACE_ERROR ("SDP - no scratch buf for search rsp\n");
return;
}
}
@@ -464,7 +464,7 @@ static void process_service_attr_req (tCONN_CB *p_ccb, UINT16 trans_num,
{
if (attr_len >= SDP_MAX_ATTR_LEN)
{
SDP_TRACE_ERROR("SDP attr too big: max_list_len=%d,attr_len=%d", max_list_len, attr_len);
SDP_TRACE_ERROR("SDP attr too big: max_list_len=%d,attr_len=%d\n", max_list_len, attr_len);
sdpu_build_n_send_error (p_ccb, trans_num, SDP_NO_RESOURCES, NULL);
return;
}
@@ -523,7 +523,7 @@ static void process_service_attr_req (tCONN_CB *p_ccb, UINT16 trans_num,
/* Get a buffer to use to build the response */
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (SDP_POOL_ID)) == NULL)
{
SDP_TRACE_ERROR ("SDP - no buf for search rsp");
SDP_TRACE_ERROR ("SDP - no buf for search rsp\n");
return;
}
p_buf->offset = L2CAP_MIN_OFFSET;
@@ -636,7 +636,7 @@ static void process_service_search_attr_req (tCONN_CB *p_ccb, UINT16 trans_num,
p_ccb->rsp_list = (UINT8 *)GKI_getbuf (max_list_len);
if (p_ccb->rsp_list == NULL)
{
SDP_TRACE_ERROR ("SDP - no scratch buf for search rsp");
SDP_TRACE_ERROR ("SDP - no scratch buf for search rsp\n");
return;
}
@@ -678,7 +678,7 @@ static void process_service_search_attr_req (tCONN_CB *p_ccb, UINT16 trans_num,
p_ccb->rsp_list = (UINT8 *)GKI_getbuf (max_list_len);
if (p_ccb->rsp_list == NULL)
{
SDP_TRACE_ERROR ("SDP - no scratch buf for search rsp");
SDP_TRACE_ERROR ("SDP - no scratch buf for search rsp\n");
return;
}
}
@@ -751,7 +751,7 @@ static void process_service_search_attr_req (tCONN_CB *p_ccb, UINT16 trans_num,
{
if (attr_len >= SDP_MAX_ATTR_LEN)
{
SDP_TRACE_ERROR("SDP attr too big: max_list_len=%d,attr_len=%d", max_list_len, attr_len);
SDP_TRACE_ERROR("SDP attr too big: max_list_len=%d,attr_len=%d\n", max_list_len, attr_len);
sdpu_build_n_send_error (p_ccb, trans_num, SDP_NO_RESOURCES, NULL);
return;
}
@@ -859,7 +859,7 @@ static void process_service_search_attr_req (tCONN_CB *p_ccb, UINT16 trans_num,
/* Get a buffer to use to build the response */
if ((p_buf = (BT_HDR *)GKI_getpoolbuf (SDP_POOL_ID)) == NULL)
{
SDP_TRACE_ERROR ("SDP - no buf for search rsp");
SDP_TRACE_ERROR ("SDP - no buf for search rsp\n");
return;
}
p_buf->offset = L2CAP_MIN_OFFSET;