Linux bluetooth development
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Zhenhua Zhang <zhenhua.zhang@intel.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] sdp: Remove sdp_general_inquiry API
Date: Wed, 18 Aug 2010 13:59:07 +0200	[thread overview]
Message-ID: <1282132747.23399.138.camel@localhost.localdomain> (raw)
In-Reply-To: <1282126410-6157-1-git-send-email-zhenhua.zhang@intel.com>

Hi Zhenhua,

> So that sdp.c won't include hci.h and hci_lib.h. The inquiry operation
> could be done by simply invoking hci_inquiry().
> ---
>  lib/sdp.c       |   16 ----------------
>  lib/sdp_lib.h   |    5 -----
>  tools/sdptool.c |    6 ++++--
>  3 files changed, 4 insertions(+), 23 deletions(-)
> 
> diff --git a/lib/sdp.c b/lib/sdp.c
> index 8a31b55..76695af 100644
> --- a/lib/sdp.c
> +++ b/lib/sdp.c
> @@ -43,8 +43,6 @@
>  #include <netinet/in.h>
>  
>  #include "bluetooth.h"
> -#include "hci.h"
> -#include "hci_lib.h"
>  #include "l2cap.h"
>  #include "sdp.h"
>  #include "sdp_lib.h"
> @@ -4523,20 +4521,6 @@ end:
>  	return status;
>  }
>  
> -/*
> - * Find devices in the piconet.
> - */
> -int sdp_general_inquiry(inquiry_info *ii, int num_dev, int duration, uint8_t *found)
> -{
> -	int n = hci_inquiry(-1, 10, num_dev, NULL, &ii, 0);
> -	if (n < 0) {
> -		SDPERR("Inquiry failed:%s", strerror(errno));
> -		return -1;
> -	}
> -	*found = n;
> -	return 0;
> -}
> -

this breaks API and ABI compatibility. Even if most likely nobody in the
world uses this function, we should keep it for now.

>  int sdp_close(sdp_session_t *session)
>  {
>  	struct sdp_transaction *t;
> diff --git a/lib/sdp_lib.h b/lib/sdp_lib.h
> index e506ac1..5ad4b56 100644
> --- a/lib/sdp_lib.h
> +++ b/lib/sdp_lib.h
> @@ -146,11 +146,6 @@ int sdp_service_search_attr_async(sdp_session_t *session, const sdp_list_t *sear
>  
>  uint16_t sdp_gen_tid(sdp_session_t *session);
>  
> -/*
> - * find all devices in the piconet
> - */
> -int sdp_general_inquiry(inquiry_info *ii, int dev_num, int duration, uint8_t *found);
> -
>  /* flexible extraction of basic attributes - Jean II */
>  int sdp_get_int_attr(const sdp_record_t *rec, uint16_t attr, int *value);
>  int sdp_get_string_attr(const sdp_record_t *rec, uint16_t attr, char *value, int valuelen);
> diff --git a/tools/sdptool.c b/tools/sdptool.c
> index d06b159..3ce0fc3 100644
> --- a/tools/sdptool.c
> +++ b/tools/sdptool.c
> @@ -3733,11 +3733,13 @@ static int cmd_del(int argc, char **argv)
>  static void inquiry(handler_t handler, void *arg)
>  {
>  	inquiry_info ii[20];
> -	uint8_t count = 0;
> +	int count = 0;
>  	int i;
>  
>  	printf("Inquiring ...\n");
> -	if (sdp_general_inquiry(ii, 20, 8, &count) < 0) {
> +
> +	count = hci_inquiry(-1, 10, 20, NULL, (inquiry_info **) &ii, 0);
> +	if (count < 0) {
>  		printf("Inquiry failed\n");
>  		return;
>  	}

This change is fine btw. Send a separate patch for this.

Regards

Marcel




      reply	other threads:[~2010-08-18 11:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-18 10:13 [PATCH] sdp: Remove sdp_general_inquiry API Zhenhua Zhang
2010-08-18 11:59 ` Marcel Holtmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1282132747.23399.138.camel@localhost.localdomain \
    --to=marcel@holtmann.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=zhenhua.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox