summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README3
-rw-r--r--audio/headset.c2
-rw-r--r--audio/unix.c14
-rw-r--r--src/sdpd-database.c12
-rw-r--r--src/sdpd-request.c94
-rw-r--r--src/sdpd-service.c40
-rw-r--r--src/sdpd.h6
7 files changed, 88 insertions, 83 deletions
diff --git a/README b/README
index a2aa62b3..39b78f89 100644
--- a/README
+++ b/README
@@ -32,8 +32,7 @@ Information
===========
Mailing lists:
- bluez-users@lists.sf.net - BlueZ general questions and discussions
- bluez-devel@lists.sf.net - BlueZ development
+ linux-bluetooth@vger.kernel.org
For additional information about the project visit BlueZ web site:
http://www.bluez.org
diff --git a/audio/headset.c b/audio/headset.c
index f0eb0b7b..102d0bca 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -513,7 +513,7 @@ static void sco_connect_cb(GIOChannel *chan, int err, const bdaddr_t *src,
sk = g_io_channel_unix_get_fd(chan);
- info("SCO fd=%d", sk);
+ debug("SCO fd=%d", sk);
hs->sco = chan;
p->io = NULL;
diff --git a/audio/unix.c b/audio/unix.c
index 10e6021e..5d5ab206 100644
--- a/audio/unix.c
+++ b/audio/unix.c
@@ -152,7 +152,7 @@ static int unix_sendmsg_fd(int sock, int fd)
static void unix_ipc_sendmsg(struct unix_client *client,
const bt_audio_msg_header_t *msg)
{
- info("Audio API: sending %s", bt_audio_strmsg(msg->msg_type));
+ debug("Audio API: sending %s", bt_audio_strmsg(msg->msg_type));
if (send(client->sock, msg, BT_AUDIO_IPC_PACKET_SIZE, 0) < 0)
error("Error %s(%d)", strerror(errno), errno);
@@ -789,7 +789,7 @@ static int handle_sco_transport(struct unix_client *client,
{
client->interface = g_strdup(AUDIO_HEADSET_INTERFACE);
- info("config sco - device = %s access_mode = %u", req->device,
+ debug("config sco - device = %s access_mode = %u", req->device,
req->access_mode);
return 0;
@@ -814,7 +814,7 @@ static int handle_a2dp_transport(struct unix_client *client,
client->caps = g_slist_append(client->caps, media_transport);
- info("config a2dp - device = %s access_mode = %u", req->device,
+ debug("config a2dp - device = %s access_mode = %u", req->device,
req->access_mode);
if (req->mpeg_capabilities.frequency) {
@@ -833,7 +833,7 @@ static int handle_a2dp_transport(struct unix_client *client,
media_codec = avdtp_service_cap_new(AVDTP_MEDIA_CODEC, &mpeg_cap,
sizeof(mpeg_cap));
- info("codec mpeg12 - frequency = %u channel_mode = %u "
+ debug("codec mpeg12 - frequency = %u channel_mode = %u "
"layer = %u crc = %u mpf = %u bitrate = %u",
mpeg_cap.frequency, mpeg_cap.channel_mode,
mpeg_cap.layer, mpeg_cap.crc, mpeg_cap.mpf,
@@ -854,7 +854,7 @@ static int handle_a2dp_transport(struct unix_client *client,
media_codec = avdtp_service_cap_new(AVDTP_MEDIA_CODEC, &sbc_cap,
sizeof(sbc_cap));
- info("codec sbc - frequency = %u channel_mode = %u "
+ debug("codec sbc - frequency = %u channel_mode = %u "
"allocation = %u subbands = %u blocks = %u "
"bitpool = %u", sbc_cap.frequency,
sbc_cap.channel_mode, sbc_cap.allocation_method,
@@ -1008,7 +1008,7 @@ static gboolean client_cb(GIOChannel *chan, GIOCondition cond, gpointer data)
}
if ((type = bt_audio_strmsg(msghdr->msg_type)))
- info("Audio API: received %s", type);
+ debug("Audio API: received %s", type);
switch (msghdr->msg_type) {
case BT_GETCAPABILITIES_REQ:
@@ -1119,7 +1119,7 @@ int unix_init(void)
server_cb, NULL);
g_io_channel_unref(io);
- info("Unix socket created: %d", sk);
+ debug("Unix socket created: %d", sk);
return 0;
}
diff --git a/src/sdpd-database.c b/src/sdpd-database.c
index 3642ae18..543f0d15 100644
--- a/src/sdpd-database.c
+++ b/src/sdpd-database.c
@@ -170,8 +170,8 @@ void sdp_record_add(const bdaddr_t *device, sdp_record_t *rec)
{
sdp_access_t *dev;
- debug("Adding rec : 0x%lx", (long) rec);
- debug("with handle : 0x%x", rec->handle);
+ SDPDBG("Adding rec : 0x%lx", (long) rec);
+ SDPDBG("with handle : 0x%x", rec->handle);
service_db = sdp_list_insert_sorted(service_db, rec, record_sort);
@@ -196,7 +196,7 @@ static sdp_list_t *record_locate(uint32_t handle)
return p;
}
- debug("Could not find svcRec for : 0x%x", handle);
+ SDPDBG("Could not find svcRec for : 0x%x", handle);
return NULL;
}
@@ -211,7 +211,7 @@ static sdp_list_t *access_locate(uint32_t handle)
return p;
}
- debug("Could not find access data for : 0x%x", handle);
+ SDPDBG("Could not find access data for : 0x%x", handle);
return NULL;
}
@@ -222,8 +222,8 @@ sdp_record_t *sdp_record_find(uint32_t handle)
{
sdp_list_t *p = record_locate(handle);
- if (!p) {
- debug("Couldn't find record for : 0x%x", handle);
+ if (!p) {
+ SDPDBG("Couldn't find record for : 0x%x", handle);
return 0;
}
diff --git a/src/sdpd-request.c b/src/sdpd-request.c
index 3ddf25ce..3d82d51d 100644
--- a/src/sdpd-request.c
+++ b/src/sdpd-request.c
@@ -108,7 +108,7 @@ static int extract_des(uint8_t *buf, int len, sdp_list_t **svcReqSeq, uint8_t *p
scanned = sdp_extract_seqtype(buf, len, &seqType, &data_size);
- debug("Seq type : %d", seqType);
+ SDPDBG("Seq type : %d", seqType);
if (!scanned || (seqType != SDP_SEQ8 && seqType != SDP_SEQ16)) {
error("Unknown seq type");
return -1;
@@ -116,27 +116,27 @@ static int extract_des(uint8_t *buf, int len, sdp_list_t **svcReqSeq, uint8_t *p
p = buf + scanned;
bufsize = len - scanned;
- debug("Data size : %d", data_size);
+ SDPDBG("Data size : %d", data_size);
for (;;) {
char *pElem = NULL;
int localSeqLength = 0;
if (bufsize < sizeof(uint8_t)) {
- debug("->Unexpected end of buffer");
+ SDPDBG("->Unexpected end of buffer");
return -1;
}
dataType = *(uint8_t *)p;
- debug("Data type: 0x%02x", dataType);
+ SDPDBG("Data type: 0x%02x", dataType);
if (expectedType == SDP_TYPE_UUID) {
if (dataType != SDP_UUID16 && dataType != SDP_UUID32 && dataType != SDP_UUID128) {
- debug("->Unexpected Data type (expected UUID_ANY)");
+ SDPDBG("->Unexpected Data type (expected UUID_ANY)");
return -1;
}
} else if (expectedType != SDP_TYPE_ANY && dataType != expectedType) {
- debug("->Unexpected Data type (expected 0x%02x)", expectedType);
+ SDPDBG("->Unexpected Data type (expected 0x%02x)", expectedType);
return -1;
}
@@ -146,7 +146,7 @@ static int extract_des(uint8_t *buf, int len, sdp_list_t **svcReqSeq, uint8_t *p
seqlen += sizeof(uint8_t);
bufsize -= sizeof(uint8_t);
if (bufsize < sizeof(uint16_t)) {
- debug("->Unexpected end of buffer");
+ SDPDBG("->Unexpected end of buffer");
return -1;
}
@@ -161,7 +161,7 @@ static int extract_des(uint8_t *buf, int len, sdp_list_t **svcReqSeq, uint8_t *p
seqlen += sizeof(uint8_t);
bufsize -= sizeof(uint8_t);
if (bufsize < (int)sizeof(uint32_t)) {
- debug("->Unexpected end of buffer");
+ SDPDBG("->Unexpected end of buffer");
return -1;
}
@@ -188,7 +188,7 @@ static int extract_des(uint8_t *buf, int len, sdp_list_t **svcReqSeq, uint8_t *p
if (status == 0) {
pSeq = sdp_list_append(pSeq, pElem);
numberOfElements++;
- debug("No of elements : %d", numberOfElements);
+ SDPDBG("No of elements : %d", numberOfElements);
if (seqlen == data_size)
break;
@@ -209,7 +209,7 @@ static int sdp_set_cstate_pdu(sdp_buf_t *buf, sdp_cont_state_t *cstate)
int length = 0;
if (cstate) {
- debug("Non null sdp_cstate_t id : 0x%lx", cstate->timestamp);
+ SDPDBG("Non null sdp_cstate_t id : 0x%lx", cstate->timestamp);
*(uint8_t *)pdata = sizeof(sdp_cont_state_t);
pdata += sizeof(uint8_t);
length += sizeof(uint8_t);
@@ -234,7 +234,7 @@ static sdp_cont_state_t *sdp_cstate_get(uint8_t *buffer)
* Check if continuation state exists, if yes attempt
* to get response remainder from cache, else send error
*/
- debug("Continuation State size : %d", cStateSize);
+ SDPDBG("Continuation State size : %d", cStateSize);
pdata += sizeof(uint8_t);
if (cStateSize != 0) {
@@ -242,8 +242,8 @@ static sdp_cont_state_t *sdp_cstate_get(uint8_t *buffer)
if (!cstate)
return NULL;
memcpy(cstate, (sdp_cont_state_t *)pdata, sizeof(sdp_cont_state_t));
- debug("Cstate TS : 0x%lx", cstate->timestamp);
- debug("Bytes sent : %d", cstate->cStateValue.maxBytesSent);
+ SDPDBG("Cstate TS : 0x%lx", cstate->timestamp);
+ SDPDBG("Bytes sent : %d", cstate->cStateValue.maxBytesSent);
return cstate;
}
return NULL;
@@ -325,8 +325,8 @@ static int service_search_req(sdp_req_t *req, sdp_buf_t *buf)
expected = ntohs(bt_get_unaligned((uint16_t *)pdata));
- debug("Expected count: %d", expected);
- debug("Bytes scanned : %d", scanned);
+ SDPDBG("Expected count: %d", expected);
+ SDPDBG("Bytes scanned : %d", scanned);
pdata += sizeof(uint16_t);
@@ -362,7 +362,7 @@ static int service_search_req(sdp_req_t *req, sdp_buf_t *buf)
for (; list && rsp_count < expected; list = list->next) {
sdp_record_t *rec = (sdp_record_t *) list->data;
- debug("Checking svcRec : 0x%x", rec->handle);
+ SDPDBG("Checking svcRec : 0x%x", rec->handle);
if (sdp_match_uuid(pattern, rec->pattern) > 0 &&
sdp_check_access(rec->handle, &req->device)) {
@@ -373,7 +373,7 @@ static int service_search_req(sdp_req_t *req, sdp_buf_t *buf)
}
}
- debug("Match count: %d", rsp_count);
+ SDPDBG("Match count: %d", rsp_count);
buf->data_size += handleSize;
bt_put_unaligned(htons(rsp_count), (uint16_t *)pTotalRecordCount);
@@ -455,7 +455,7 @@ static int service_search_req(sdp_req_t *req, sdp_buf_t *buf)
*/
sdp_cont_state_t newState;
- debug("Setting non-NULL sdp_cstate_t");
+ SDPDBG("Setting non-NULL sdp_cstate_t");
if (cstate)
memcpy((char *)&newState, cstate, sizeof(sdp_cont_state_t));
@@ -490,14 +490,14 @@ static int extract_attrs(sdp_record_t *rec, sdp_list_t *seq, uint8_t dtd, sdp_bu
return SDP_INVALID_RECORD_HANDLE;
if (seq)
- debug("Entries in attr seq : %d", sdp_list_len(seq));
+ SDPDBG("Entries in attr seq : %d", sdp_list_len(seq));
else
- debug("NULL attribute descriptor");
+ SDPDBG("NULL attribute descriptor");
- debug("AttrDataType : %d", dtd);
+ SDPDBG("AttrDataType : %d", dtd);
if (seq == NULL) {
- debug("Attribute sequence is NULL");
+ SDPDBG("Attribute sequence is NULL");
return 0;
}
if (dtd == SDP_UINT16)
@@ -517,9 +517,9 @@ static int extract_attrs(sdp_record_t *rec, sdp_list_t *seq, uint8_t dtd, sdp_bu
uint16_t high = 0x0000ffff & range;
sdp_data_t *data;
- debug("attr range : 0x%x", range);
- debug("Low id : 0x%x", low);
- debug("High id : 0x%x", high);
+ SDPDBG("attr range : 0x%x", range);
+ SDPDBG("Low id : 0x%x", low);
+ SDPDBG("High id : 0x%x", high);
if (low == 0x0000 && high == 0xffff && pdu.data_size <= buf->buf_size) {
/* copy it */
@@ -592,8 +592,8 @@ static int service_attr_req(sdp_req_t *req, sdp_buf_t *buf)
*/
cstate = sdp_cstate_get(pdata);
- debug("SvcRecHandle : 0x%x", handle);
- debug("max_rsp_size : %d", max_rsp_size);
+ SDPDBG("SvcRecHandle : 0x%x", handle);
+ SDPDBG("max_rsp_size : %d", max_rsp_size);
/*
* Calculate Attribute size acording to MTU
@@ -609,7 +609,7 @@ static int service_attr_req(sdp_req_t *req, sdp_buf_t *buf)
if (cstate) {
sdp_buf_t *pCache = sdp_get_cached_rsp(cstate);
- debug("Obtained cached rsp : %p", pCache);
+ SDPDBG("Obtained cached rsp : %p", pCache);
if (pCache) {
short sent = MIN(max_rsp_size, pCache->data_size - cstate->cStateValue.maxBytesSent);
@@ -618,7 +618,7 @@ static int service_attr_req(sdp_req_t *req, sdp_buf_t *buf)
buf->data_size += sent;
cstate->cStateValue.maxBytesSent += sent;
- debug("Response size : %d sending now : %d bytes sent so far : %d",
+ SDPDBG("Response size : %d sending now : %d bytes sent so far : %d",
pCache->data_size, sent, cstate->cStateValue.maxBytesSent);
if (cstate->cStateValue.maxBytesSent == pCache->data_size)
cstate_size = sdp_set_cstate_pdu(buf, NULL);
@@ -640,7 +640,7 @@ static int service_attr_req(sdp_req_t *req, sdp_buf_t *buf)
* Reset the buffer size to the maximum expected and
* set the sdp_cont_state_t
*/
- debug("Creating continuation state of size : %d", buf->data_size);
+ SDPDBG("Creating continuation state of size : %d", buf->data_size);
buf->data_size = max_rsp_size;
newState.cStateValue.maxBytesSent = max_rsp_size;
cstate_size = sdp_set_cstate_pdu(buf, &newState);
@@ -659,7 +659,7 @@ done:
if (cstate)
free(cstate);
if (seq)
- sdp_list_free(seq, free);
+ sdp_list_free(seq, free);
if (status)
return status;
@@ -688,18 +688,18 @@ static int service_search_attr_req(sdp_req_t *req, sdp_buf_t *buf)
scanned = extract_des(pdata, req->len - sizeof(sdp_pdu_hdr_t),
&pattern, &dtd, SDP_TYPE_UUID);
if (scanned == -1) {
- status = SDP_INVALID_SYNTAX;
+ status = SDP_INVALID_SYNTAX;
goto done;
}
totscanned = scanned;
- debug("Bytes scanned: %d", scanned);
+ SDPDBG("Bytes scanned: %d", scanned);
pdata += scanned;
max = ntohs(bt_get_unaligned((uint16_t *)pdata));
pdata += sizeof(uint16_t);
- debug("Max Attr expected: %d", max);
+ SDPDBG("Max Attr expected: %d", max);
/* extract the attribute list */
scanned = extract_des(pdata, req->len - sizeof(sdp_pdu_hdr_t),
@@ -750,10 +750,10 @@ static int service_search_attr_req(sdp_req_t *req, sdp_buf_t *buf)
rsp_count++;
status = extract_attrs(rec, seq, dtd, &tmpbuf);
- debug("Response count : %d", rsp_count);
- debug("Local PDU size : %d", tmpbuf.data_size);
+ SDPDBG("Response count : %d", rsp_count);
+ SDPDBG("Local PDU size : %d", tmpbuf.data_size);
if (status) {
- debug("Extract attr from record returns err");
+ SDPDBG("Extract attr from record returns err");
break;
}
if (buf->data_size + tmpbuf.data_size < buf->buf_size) {
@@ -765,7 +765,7 @@ static int service_search_attr_req(sdp_req_t *req, sdp_buf_t *buf)
error("Relocation needed");
break;
}
- debug("Net PDU size : %d", buf->data_size);
+ SDPDBG("Net PDU size : %d", buf->data_size);
}
}
if (buf->data_size > max) {
@@ -797,7 +797,7 @@ static int service_search_attr_req(sdp_req_t *req, sdp_buf_t *buf)
cstate_size = sdp_set_cstate_pdu(buf, cstate);
} else {
status = SDP_INVALID_CSTATE;
- debug("Non-null continuation state, but null cache buffer");
+ SDPDBG("Non-null continuation state, but null cache buffer");
}
}
@@ -856,37 +856,37 @@ static void process_request(sdp_req_t *req)
}
switch (reqhdr->pdu_id) {
case SDP_SVC_SEARCH_REQ:
- debug("Got a svc srch req");
+ SDPDBG("Got a svc srch req");
status = service_search_req(req, &rsp);
rsphdr->pdu_id = SDP_SVC_SEARCH_RSP;
break;
case SDP_SVC_ATTR_REQ:
- debug("Got a svc attr req");
+ SDPDBG("Got a svc attr req");
status = service_attr_req(req, &rsp);
rsphdr->pdu_id = SDP_SVC_ATTR_RSP;
break;
case SDP_SVC_SEARCH_ATTR_REQ:
- debug("Got a svc srch attr req");
+ SDPDBG("Got a svc srch attr req");
status = service_search_attr_req(req, &rsp);
rsphdr->pdu_id = SDP_SVC_SEARCH_ATTR_RSP;
break;
/* Following requests are allowed only for local connections */
case SDP_SVC_REGISTER_REQ:
- debug("Service register request");
+ SDPDBG("Service register request");
if (req->local) {
status = service_register_req(req, &rsp);
rsphdr->pdu_id = SDP_SVC_REGISTER_RSP;
}
break;
case SDP_SVC_UPDATE_REQ:
- debug("Service update request");
+ SDPDBG("Service update request");
if (req->local) {
status = service_update_req(req, &rsp);
rsphdr->pdu_id = SDP_SVC_UPDATE_RSP;
}
break;
case SDP_SVC_REMOVE_REQ:
- debug("Service removal request");
+ SDPDBG("Service removal request");
if (req->local) {
status = service_remove_req(req, &rsp);
rsphdr->pdu_id = SDP_SVC_REMOVE_RSP;
@@ -905,7 +905,7 @@ send_rsp:
rsp.data_size = sizeof(uint16_t);
}
- debug("Sending rsp. status %d", status);
+ SDPDBG("Sending rsp. status %d", status);
rsphdr->tid = reqhdr->tid;
rsphdr->plen = htons(rsp.data_size);
@@ -917,7 +917,7 @@ send_rsp:
/* stream the rsp PDU */
sent = send(req->sock, rsp.data, rsp.data_size, 0);
- debug("Bytes Sent : %d", sent);
+ SDPDBG("Bytes Sent : %d", sent);
free(rsp.data);
free(req->buf);
diff --git a/src/sdpd-service.c b/src/sdpd-service.c
index 713e12ef..30aad325 100644
--- a/src/sdpd-service.c
+++ b/src/sdpd-service.c
@@ -143,7 +143,7 @@ static void update_svclass_list(void)
}
}
- debug("Service classes 0x%02x", val);
+ SDPDBG("Service classes 0x%02x", val);
service_classes = val;
@@ -445,23 +445,23 @@ static sdp_record_t *extract_pdu_server(bdaddr_t *device, uint8_t *p, int bufsiz
bufsize -= *scanned;
if (bufsize < sizeof(uint8_t) + sizeof(uint8_t)) {
- debug("Unexpected end of packet");
+ SDPDBG("Unexpected end of packet");
return NULL;
}
lookAheadAttrId = ntohs(bt_get_unaligned((uint16_t *) (p + sizeof(uint8_t))));
- debug("Look ahead attr id : %d", lookAheadAttrId);
+ SDPDBG("Look ahead attr id : %d", lookAheadAttrId);
if (lookAheadAttrId == SDP_ATTR_RECORD_HANDLE) {
if (bufsize < (sizeof(uint8_t) * 2) + sizeof(uint16_t) + sizeof(uint32_t)) {
- debug("Unexpected end of packet");
+ SDPDBG("Unexpected end of packet");
return NULL;
}
handle = ntohl(bt_get_unaligned((uint32_t *) (p +
sizeof(uint8_t) + sizeof(uint16_t) +
sizeof(uint8_t))));
- debug("SvcRecHandle : 0x%x", handle);
+ SDPDBG("SvcRecHandle : 0x%x", handle);
rec = sdp_record_find(handle);
} else if (handleExpected != 0xffffffff)
rec = sdp_record_find(handleExpected);
@@ -486,26 +486,26 @@ static sdp_record_t *extract_pdu_server(bdaddr_t *device, uint8_t *p, int bufsiz
int attrValueLength = 0;
if (bufsize < attrSize + sizeof(uint16_t)) {
- debug("Unexpected end of packet: Terminating extraction of attributes");
+ SDPDBG("Unexpected end of packet: Terminating extraction of attributes");
break;
}
- debug("Extract PDU, sequenceLength: %d localExtractedLength: %d", seqlen, localExtractedLength);
+ SDPDBG("Extract PDU, sequenceLength: %d localExtractedLength: %d", seqlen, localExtractedLength);
dtd = *(uint8_t *) p;
attrId = ntohs(bt_get_unaligned((uint16_t *) (p + attrSize)));
attrSize += sizeof(uint16_t);
- debug("DTD of attrId : %d Attr id : 0x%x", dtd, attrId);
+ SDPDBG("DTD of attrId : %d Attr id : 0x%x", dtd, attrId);
pAttr = sdp_extract_attr(p + attrSize, bufsize - attrSize,
&attrValueLength, rec);
- debug("Attr id : 0x%x attrValueLength : %d", attrId, attrValueLength);
+ SDPDBG("Attr id : 0x%x attrValueLength : %d", attrId, attrValueLength);
attrSize += attrValueLength;
if (pAttr == NULL) {
- debug("Terminating extraction of attributes");
+ SDPDBG("Terminating extraction of attributes");
break;
}
localExtractedLength += attrSize;
@@ -513,12 +513,12 @@ static sdp_record_t *extract_pdu_server(bdaddr_t *device, uint8_t *p, int bufsiz
bufsize -= attrSize;
sdp_attr_replace(rec, attrId, pAttr);
extractStatus = 0;
- debug("Extract PDU, seqLength: %d localExtractedLength: %d",
+ SDPDBG("Extract PDU, seqLength: %d localExtractedLength: %d",
seqlen, localExtractedLength);
}
if (extractStatus == 0) {
- debug("Successful extracting of Svc Rec attributes");
+ SDPDBG("Successful extracting of Svc Rec attributes");
#ifdef SDP_DEBUG
sdp_print_service_attr(rec->attrlist);
#endif
@@ -608,14 +608,14 @@ int service_update_req(sdp_req_t *req, sdp_buf_t *rsp)
int bufsize = req->len - sizeof(sdp_pdu_hdr_t);
uint32_t handle = ntohl(bt_get_unaligned((uint32_t *) p));
- debug("Svc Rec Handle: 0x%x", handle);
+ SDPDBG("Svc Rec Handle: 0x%x", handle);
p += sizeof(uint32_t);
bufsize -= sizeof(uint32_t);
orec = sdp_record_find(handle);
- debug("SvcRecOld: %p", orec);
+ SDPDBG("SvcRecOld: %p", orec);
if (orec) {
sdp_record_t *nrec = extract_pdu_server(BDADDR_ANY, p, bufsize, handle, &scanned);
@@ -623,11 +623,11 @@ int service_update_req(sdp_req_t *req, sdp_buf_t *rsp)
update_db_timestamp();
update_svclass_list();
} else {
- debug("SvcRecHandle : 0x%x", handle);
- debug("SvcRecHandleNew : 0x%x", nrec->handle);
- debug("SvcRecNew : %p", nrec);
- debug("SvcRecOld : %p", orec);
- debug("Failure to update, restore old value");
+ SDPDBG("SvcRecHandle : 0x%x", handle);
+ SDPDBG("SvcRecHandleNew : 0x%x", nrec->handle);
+ SDPDBG("SvcRecNew : %p", nrec);
+ SDPDBG("SvcRecOld : %p", orec);
+ SDPDBG("Failure to update, restore old value");
if (nrec)
sdp_record_free(nrec);
@@ -666,7 +666,7 @@ int service_remove_req(sdp_req_t *req, sdp_buf_t *rsp)
}
} else {
status = SDP_INVALID_RECORD_HANDLE;
- debug("Could not find record : 0x%x", handle);
+ SDPDBG("Could not find record : 0x%x", handle);
}
p = rsp->data;
diff --git a/src/sdpd.h b/src/sdpd.h
index 15eb5940..194d45cb 100644
--- a/src/sdpd.h
+++ b/src/sdpd.h
@@ -27,6 +27,12 @@
#include <bluetooth/bluetooth.h>
#include <bluetooth/sdp.h>
+#ifdef SDP_DEBUG
+#define SDPDBG(fmt, arg...) syslog(LOG_DEBUG, "%s: " fmt "\n", __func__ , ## arg)
+#else
+#define SDPDBG(fmt...)
+#endif
+
typedef struct request {
bdaddr_t device;
bdaddr_t bdaddr;