* Re: [PATCH] Bluetooth: debug: Correct the PSM printing
From: Gustavo Padovan @ 2012-08-21 17:29 UTC (permalink / raw)
To: Syam Sidhardhan; +Cc: linux-bluetooth, jaganath.k
In-Reply-To: <1343413282-8901-2-git-send-email-s.syam@samsung.com>
Hi Syam,
* Syam Sidhardhan <s.syam@samsung.com> [2012-07-27 23:51:22 +0530]:
> Earlier we were printing chan->psm before assigning any value.
>
> Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
> ---
> net/bluetooth/l2cap_core.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Patch has been applied to bluetooth-next. Thanks.
Gustavo
^ permalink raw reply
* [PATCH BlueZ] Fix trivial coding style issues on pointer declarations and casting
From: Anderson Lizardo @ 2012-08-21 15:49 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Anderson Lizardo
Avoid using C++ style pointer declarations like "char* ptr", as most
BlueZ code uses "char *ptr".
---
This is a very trivial patch, but changes are so small that it was worthy to
fix.
I avoided touching tools/ubcsp.c because it has even more coding style issues.
audio/gstavdtpsink.h | 2 +-
audio/gstsbcutil.h | 8 ++++----
lib/sdp.c | 4 ++--
profiles/input/sixpair.c | 6 +++---
test/l2test.c | 4 ++--
tools/hciattach.h | 2 +-
tools/hciattach_ti.c | 22 +++++++++++++---------
tools/ppporc.c | 2 +-
tools/rfcomm.c | 4 ++--
9 files changed, 29 insertions(+), 25 deletions(-)
diff --git a/audio/gstavdtpsink.h b/audio/gstavdtpsink.h
index eb998ac..4862e7f 100644
--- a/audio/gstavdtpsink.h
+++ b/audio/gstavdtpsink.h
@@ -84,7 +84,7 @@ gboolean gst_avdtp_sink_set_device_caps(GstAvdtpSink *sink,
guint gst_avdtp_sink_get_link_mtu(GstAvdtpSink *sink);
void gst_avdtp_sink_set_device(GstAvdtpSink *sink,
- const gchar* device);
+ const gchar *device);
void gst_avdtp_sink_set_transport(GstAvdtpSink *sink,
const gchar *transport);
diff --git a/audio/gstsbcutil.h b/audio/gstsbcutil.h
index 5e47119..962532f 100644
--- a/audio/gstsbcutil.h
+++ b/audio/gstsbcutil.h
@@ -59,16 +59,16 @@ gint gst_sbc_parse_mode_to_sbc(const gchar *mode);
const gchar *gst_sbc_parse_allocation_from_sbc(gint alloc);
gint gst_sbc_parse_allocation_to_sbc(const gchar *allocation);
-GstCaps* gst_sbc_parse_caps_from_sbc(sbc_t *sbc);
+GstCaps *gst_sbc_parse_caps_from_sbc(sbc_t *sbc);
-GstCaps* gst_sbc_util_caps_fixate(GstCaps *caps, gchar** error_message);
+GstCaps *gst_sbc_util_caps_fixate(GstCaps *caps, gchar **error_message);
void gst_sbc_util_set_structure_int_param(GstStructure *structure,
- const gchar* field, gint field_value,
+ const gchar *field, gint field_value,
GValue *value);
void gst_sbc_util_set_structure_string_param(GstStructure *structure,
- const gchar* field, const gchar* field_value,
+ const gchar *field, const gchar *field_value,
GValue *value);
gboolean gst_sbc_util_fill_sbc_params(sbc_t *sbc, GstCaps *caps);
diff --git a/lib/sdp.c b/lib/sdp.c
index 497a058..fcbe593 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -193,7 +193,7 @@ static char *string_lookup(struct tupla *pt0, int index)
return "";
}
-static char *string_lookup_uuid(struct tupla *pt0, const uuid_t* uuid)
+static char *string_lookup_uuid(struct tupla *pt0, const uuid_t *uuid)
{
uuid_t tmp_uuid;
@@ -4677,7 +4677,7 @@ int sdp_set_supp_feat(sdp_record_t *rec, const sdp_list_t *sf)
goto fail;
}
for (r = p->data, j = 0; r; r = r->next, j++) {
- sdp_data_t *data = (sdp_data_t*)r->data;
+ sdp_data_t *data = (sdp_data_t *)r->data;
dtds[j] = &data->dtd;
switch (data->dtd) {
case SDP_URL_STR8:
diff --git a/profiles/input/sixpair.c b/profiles/input/sixpair.c
index 5c50a58..c47e01a 100644
--- a/profiles/input/sixpair.c
+++ b/profiles/input/sixpair.c
@@ -44,7 +44,7 @@ show_master (libusb_device_handle *devh, int itfnum)
res = libusb_control_transfer (devh,
LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE,
0x01, 0x03f5, itfnum,
- (void*) msg, sizeof(msg),
+ (void *) msg, sizeof(msg),
5000);
if (res < 0) {
@@ -67,7 +67,7 @@ get_bdaddr (libusb_device_handle *devh, int itfnum)
res = libusb_control_transfer (devh,
LIBUSB_ENDPOINT_IN | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE,
0x01, 0x03f2, itfnum,
- (void*) msg, sizeof(msg),
+ (void *) msg, sizeof(msg),
5000);
if (res < 0) {
@@ -109,7 +109,7 @@ set_master_bdaddr (libusb_device_handle *devh, int itfnum, char *host)
res = libusb_control_transfer (devh,
LIBUSB_ENDPOINT_OUT | LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_INTERFACE,
0x09, 0x03f5, itfnum,
- (void*) msg, sizeof(msg),
+ (void *) msg, sizeof(msg),
5000);
if (res < 0) {
diff --git a/test/l2test.c b/test/l2test.c
index f66486d..d31be10 100644
--- a/test/l2test.c
+++ b/test/l2test.c
@@ -175,7 +175,7 @@ static float tv2fl(struct timeval tv)
return (float)tv.tv_sec + (float)(tv.tv_usec/1000000.0);
}
-static char *ltoh(unsigned long c, char* s)
+static char *ltoh(unsigned long c, char *s)
{
int c1;
@@ -199,7 +199,7 @@ static char *ltoh(unsigned long c, char* s)
return s;
}
-static char *ctoh(char c, char* s)
+static char *ctoh(char c, char *s)
{
char c1;
diff --git a/tools/hciattach.h b/tools/hciattach.h
index a24dbc4..1b23ad7 100644
--- a/tools/hciattach.h
+++ b/tools/hciattach.h
@@ -44,7 +44,7 @@
#define HCI_UART_RESET_ON_INIT 1
#define HCI_UART_CREATE_AMP 2
-int read_hci_event(int fd, unsigned char* buf, int size);
+int read_hci_event(int fd, unsigned char *buf, int size);
int set_speed(int fd, struct termios *ti, int speed);
int texas_init(int fd, int *speed, struct termios *ti);
diff --git a/tools/hciattach_ti.c b/tools/hciattach_ti.c
index 158e568..b57c6b7 100644
--- a/tools/hciattach_ti.c
+++ b/tools/hciattach_ti.c
@@ -109,10 +109,10 @@ struct bts_action_serial {
uint32_t flow_control;
}__attribute__ ((packed));
-static FILE *bts_load_script(const char* file_name, uint32_t* version)
+static FILE *bts_load_script(const char *file_name, uint32_t *version)
{
struct bts_header header;
- FILE* fp;
+ FILE *fp;
fp = fopen(file_name, "rb");
if (!fp) {
@@ -141,8 +141,8 @@ errclose:
return NULL;
}
-static unsigned long bts_fetch_action(FILE* fp, unsigned char* action_buf,
- unsigned long buf_size, uint16_t* action_type)
+static unsigned long bts_fetch_action(FILE *fp, unsigned char *action_buf,
+ unsigned long buf_size, uint16_t *action_type)
{
struct bts_action action_hdr;
unsigned long nread;
@@ -169,7 +169,7 @@ static unsigned long bts_fetch_action(FILE* fp, unsigned char* action_buf,
return nread * sizeof(uint8_t);
}
-static void bts_unload_script(FILE* fp)
+static void bts_unload_script(FILE *fp)
{
if (fp)
fclose(fp);
@@ -237,7 +237,7 @@ static int brf_set_serial_params(struct bts_action_serial *serial_action,
return 0;
}
-static int brf_send_command_socket(int fd, struct bts_action_send* send_action)
+static int brf_send_command_socket(int fd, struct bts_action_send *send_action)
{
char response[1024] = {0};
hci_command_hdr *cmd = (hci_command_hdr *) send_action->data;
@@ -267,7 +267,8 @@ static int brf_send_command_socket(int fd, struct bts_action_send* send_action)
return 0;
}
-static int brf_send_command_file(int fd, struct bts_action_send* send_action, long size)
+static int brf_send_command_file(int fd, struct bts_action_send *send_action,
+ long size)
{
unsigned char response[1024] = {0};
long ret = 0;
@@ -296,7 +297,8 @@ static int brf_send_command_file(int fd, struct bts_action_send* send_action, lo
}
-static int brf_send_command(int fd, struct bts_action_send* send_action, long size, int hcill_installed)
+static int brf_send_command(int fd, struct bts_action_send *send_action,
+ long size, int hcill_installed)
{
int ret = 0;
char *fixed_action;
@@ -320,7 +322,9 @@ static int brf_do_action(uint16_t brf_type, uint8_t *brf_action, long brf_size,
switch (brf_type) {
case ACTION_SEND_COMMAND:
DPRINTF("W");
- ret = brf_send_command(fd, (struct bts_action_send*) brf_action, brf_size, hcill_installed);
+ ret = brf_send_command(fd,
+ (struct bts_action_send *) brf_action,
+ brf_size, hcill_installed);
break;
case ACTION_WAIT_EVENT:
DPRINTF("R");
diff --git a/tools/ppporc.c b/tools/ppporc.c
index ca44b40..5dad679 100644
--- a/tools/ppporc.c
+++ b/tools/ppporc.c
@@ -204,7 +204,7 @@ static void usage(void)
printf("Usage:\tppporc <bdaddr> [channel]\n");
}
-int main(int argc, char** argv)
+int main(int argc, char **argv)
{
struct sigaction sa;
int fd, err, opt;
diff --git a/tools/rfcomm.c b/tools/rfcomm.c
index add9f3b..e8bdd0f 100644
--- a/tools/rfcomm.c
+++ b/tools/rfcomm.c
@@ -223,14 +223,14 @@ static int release_all(int ctl)
return 0;
}
-static void run_cmdline(struct pollfd *p, sigset_t* sigs, char *devname,
+static void run_cmdline(struct pollfd *p, sigset_t *sigs, char *devname,
int argc, char **argv)
{
int i;
pid_t pid;
char **cmdargv;
- cmdargv = malloc((argc + 1) * sizeof(char*));
+ cmdargv = malloc((argc + 1) * sizeof(char *));
if (!cmdargv)
return;
--
1.7.9.5
^ permalink raw reply related
* Re: Setting up an A2DP server
From: Niklas Claesson @ 2012-08-21 15:13 UTC (permalink / raw)
To: Lucas De Marchi; +Cc: linux-bluetooth
In-Reply-To: <CAMOw1v5vTZpCYwCMSZjUmGYE65W63rKVH8r5_6Z43reNrPq02w@mail.gmail.com>
2012/8/20 Lucas De Marchi <lucas.demarchi@profusion.mobi>:
> On Fri, Aug 17, 2012 at 6:50 PM, Niklas Claesson
> <nicke.claesson@gmail.com> wrote:
>> I've actually solved the issue myself by writing an Agent that accepts
>
> You could mark the device as trusted, so you don't have to do this.
I don't know which devices will connect, perhaps I could mark all
nearby devices as trusted. But I don't know how I would do that.
>
>
>> all incoming requests, and another python script that polls 'pacmd
>> list-sources' every 2 seconds for new bluetooth sources. And third and
>
> Why do you need this?
I have to set the bluetooth device as current source in Pulseaudio.
>
>
> Lucas De Marchi
Niklas Claesson
^ permalink raw reply
* Re: [PATCH obexd v0] client-doc: Guarantee prefix in transfer paths
From: Mikel Astiz @ 2012-08-21 12:15 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: Patrick Ohly, linux-bluetooth
In-Reply-To: <1345550923.13726.84.camel@aeonflux>
Hi Marcel,
On Tue, Aug 21, 2012 at 2:08 PM, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Mikel,
>
>> >> The client D-Bus documentation should mention that all transfer paths
>> >> contain a prefix consisting of the path of the session they belong to.
>> >>
>> >> This can be conveniently used by clients to install D-Bus signal matches
>> >> that concentrate on the relevant signals.
>> >> ---
>> >> doc/client-api.txt | 2 +-
>> >> 1 files changed, 1 insertions(+), 1 deletions(-)
>> >>
>> >> diff --git a/doc/client-api.txt b/doc/client-api.txt
>> >> index 839a78c..7ca65cc 100644
>> >> --- a/doc/client-api.txt
>> >> +++ b/doc/client-api.txt
>> >> @@ -466,7 +466,7 @@ Transfer hierarchy
>> >>
>> >> Service org.bluez.obex.client
>> >> Interface org.bluez.obex.Transfer
>> >> -Object path [variable prefix]/{transfer0,transfer1,...}
>> >> +Object path [variable prefix]/{session0,session1,...}/{transfer0,...}
>> >>
>> >> Methods dict GetProperties()
>> >
>> > It would be even better to explicitly mention that the "[variable
>> > prefix]" here is the same as the "[variable prefix]" in the Session.
>>
>> This documentation pattern can be widely found in Obexd and Bluez, as
>> well as oFono. It's implicit that the variable prefix matches in both
>> cases.
>
> it actually means that you can not count on this prefix. It might change
> and it is perfect legal that it changes from one run of the daemon to
> another. The variable prefix is discovered via some defined initial
> method.
Indeed, you cannot rely on a stable prefix across different runs and
clients should not try to parse these strings, but you do have
relationships between objects that are guaranteed in the object path.
In this case you do know that, as long as the session is active (and
obviously the daemon is running), the session path will be an exact
prefix of the transfer path.
> Remember that I intermixed the PID in the object path of BlueZ. Simple
> because people started hardcoding object paths.
Yes, we need to be careful to avoid clients making false assumptions
about these paths.
Cheers,
Mikel
^ permalink raw reply
* Re: [PATCH obexd v0] client-doc: Guarantee prefix in transfer paths
From: Marcel Holtmann @ 2012-08-21 12:08 UTC (permalink / raw)
To: Mikel Astiz; +Cc: Patrick Ohly, linux-bluetooth
In-Reply-To: <CANT-zCV9exkSjQhvGqLVqdBL+GBvNG97EUnPGo55_AaAO60P+A@mail.gmail.com>
Hi Mikel,
> >> The client D-Bus documentation should mention that all transfer paths
> >> contain a prefix consisting of the path of the session they belong to.
> >>
> >> This can be conveniently used by clients to install D-Bus signal matches
> >> that concentrate on the relevant signals.
> >> ---
> >> doc/client-api.txt | 2 +-
> >> 1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/doc/client-api.txt b/doc/client-api.txt
> >> index 839a78c..7ca65cc 100644
> >> --- a/doc/client-api.txt
> >> +++ b/doc/client-api.txt
> >> @@ -466,7 +466,7 @@ Transfer hierarchy
> >>
> >> Service org.bluez.obex.client
> >> Interface org.bluez.obex.Transfer
> >> -Object path [variable prefix]/{transfer0,transfer1,...}
> >> +Object path [variable prefix]/{session0,session1,...}/{transfer0,...}
> >>
> >> Methods dict GetProperties()
> >
> > It would be even better to explicitly mention that the "[variable
> > prefix]" here is the same as the "[variable prefix]" in the Session.
>
> This documentation pattern can be widely found in Obexd and Bluez, as
> well as oFono. It's implicit that the variable prefix matches in both
> cases.
it actually means that you can not count on this prefix. It might change
and it is perfect legal that it changes from one run of the daemon to
another. The variable prefix is discovered via some defined initial
method.
Remember that I intermixed the PID in the object path of BlueZ. Simple
because people started hardcoding object paths.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH obexd v0] client-doc: Guarantee prefix in transfer paths
From: Mikel Astiz @ 2012-08-21 11:41 UTC (permalink / raw)
To: Patrick Ohly; +Cc: linux-bluetooth
In-Reply-To: <1345537878.29868.185.camel@pohly-mobl1.fritz.box>
Hi Patrick,
On Tue, Aug 21, 2012 at 10:31 AM, Patrick Ohly <patrick.ohly@intel.com> wrote:
> On Tue, 2012-08-21 at 09:23 +0200, Mikel Astiz wrote:
>> From: Mikel Astiz <mikel.astiz@bmw-carit.de>
>>
>> The client D-Bus documentation should mention that all transfer paths
>> contain a prefix consisting of the path of the session they belong to.
>>
>> This can be conveniently used by clients to install D-Bus signal matches
>> that concentrate on the relevant signals.
>> ---
>> doc/client-api.txt | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/doc/client-api.txt b/doc/client-api.txt
>> index 839a78c..7ca65cc 100644
>> --- a/doc/client-api.txt
>> +++ b/doc/client-api.txt
>> @@ -466,7 +466,7 @@ Transfer hierarchy
>>
>> Service org.bluez.obex.client
>> Interface org.bluez.obex.Transfer
>> -Object path [variable prefix]/{transfer0,transfer1,...}
>> +Object path [variable prefix]/{session0,session1,...}/{transfer0,...}
>>
>> Methods dict GetProperties()
>
> It would be even better to explicitly mention that the "[variable
> prefix]" here is the same as the "[variable prefix]" in the Session.
This documentation pattern can be widely found in Obexd and Bluez, as
well as oFono. It's implicit that the variable prefix matches in both
cases.
> Or perhaps change it like this?
>
> -Object path [variable prefix]/{transfer0,transfer1,...}
> +Object path [session prefix]/{transfer0,...}
Having said that, I'm not against using this other style. In that case
we would need to change lots of files for consistency.
Cheers,
Mikel
^ permalink raw reply
* [PATCH 5/5] network: Remove sessions from server on DBus call Unregister
From: Tomasz Bursztyka @ 2012-08-21 10:45 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Tomasz Bursztyka
In-Reply-To: <1345545955-13144-1-git-send-email-tomasz.bursztyka@linux.intel.com>
---
profiles/network/server.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/profiles/network/server.c b/profiles/network/server.c
index 1b9989d..cfad893 100644
--- a/profiles/network/server.c
+++ b/profiles/network/server.c
@@ -611,6 +611,8 @@ static void server_disconnect(DBusConnection *conn, void *user_data)
{
struct network_server *ns = user_data;
+ server_remove_sessions(ns);
+
ns->watch_id = 0;
if (ns->record_id) {
--
1.7.8.6
^ permalink raw reply related
* [PATCH 4/5] network: Kill underlying session's connection before freeing it
From: Tomasz Bursztyka @ 2012-08-21 10:45 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Tomasz Bursztyka
In-Reply-To: <1345545955-13144-1-git-send-email-tomasz.bursztyka@linux.intel.com>
---
profiles/network/server.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/profiles/network/server.c b/profiles/network/server.c
index 5d64ee2..1b9989d 100644
--- a/profiles/network/server.c
+++ b/profiles/network/server.c
@@ -598,6 +598,8 @@ static void server_remove_sessions(struct network_server *ns)
bnep_del_from_bridge(session->dev, ns->bridge);
bnep_if_down(session->dev);
+
+ bnep_kill_connection(&session->dst);
}
g_slist_free_full(ns->sessions, session_free);
--
1.7.8.6
^ permalink raw reply related
* [PATCH 3/5] network: Release session's interface from bridge when unregistering
From: Tomasz Bursztyka @ 2012-08-21 10:45 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Tomasz Bursztyka
In-Reply-To: <1345545955-13144-1-git-send-email-tomasz.bursztyka@linux.intel.com>
---
profiles/network/server.c | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/profiles/network/server.c b/profiles/network/server.c
index 1703f38..5d64ee2 100644
--- a/profiles/network/server.c
+++ b/profiles/network/server.c
@@ -586,6 +586,25 @@ static uint32_t register_server_record(struct network_server *ns)
return record->handle;
}
+static void server_remove_sessions(struct network_server *ns)
+{
+ GSList *list;
+
+ for (list = ns->sessions; list; list = list->next) {
+ struct network_session *session = list->data;
+
+ if (*session->dev == '\0')
+ continue;
+
+ bnep_del_from_bridge(session->dev, ns->bridge);
+ bnep_if_down(session->dev);
+ }
+
+ g_slist_free_full(ns->sessions, session_free);
+
+ ns->sessions = NULL;
+}
+
static void server_disconnect(DBusConnection *conn, void *user_data)
{
struct network_server *ns = user_data;
@@ -678,7 +697,8 @@ static void server_free(struct network_server *ns)
if (!ns)
return;
- /* FIXME: Missing release/free all bnepX interfaces */
+ server_remove_sessions(ns);
+
if (ns->record_id)
remove_record_from_server(ns->record_id);
@@ -686,8 +706,6 @@ static void server_free(struct network_server *ns)
g_free(ns->name);
g_free(ns->bridge);
- g_slist_free_full(ns->sessions, session_free);
-
g_free(ns);
}
--
1.7.8.6
^ permalink raw reply related
* [PATCH 2/5] network: Add helper function to remove an interface from a bridge
From: Tomasz Bursztyka @ 2012-08-21 10:45 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Tomasz Bursztyka
In-Reply-To: <1345545955-13144-1-git-send-email-tomasz.bursztyka@linux.intel.com>
---
profiles/network/common.c | 29 +++++++++++++++++++++++++++++
profiles/network/common.h | 1 +
2 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/profiles/network/common.c b/profiles/network/common.c
index a223685..da493c1 100644
--- a/profiles/network/common.c
+++ b/profiles/network/common.c
@@ -268,3 +268,32 @@ int bnep_add_to_bridge(const char *devname, const char *bridge)
return 0;
}
+
+int bnep_del_from_bridge(const char *devname, const char *bridge)
+{
+ int ifindex = if_nametoindex(devname);
+ struct ifreq ifr;
+ int sk, err;
+
+ if (!devname || !bridge)
+ return -EINVAL;
+
+ sk = socket(AF_INET, SOCK_STREAM, 0);
+ if (sk < 0)
+ return -1;
+
+ memset(&ifr, 0, sizeof(ifr));
+ strncpy(ifr.ifr_name, bridge, IFNAMSIZ - 1);
+ ifr.ifr_ifindex = ifindex;
+
+ err = ioctl(sk, SIOCBRDELIF, &ifr);
+
+ close(sk);
+
+ if (err < 0)
+ return err;
+
+ info("bridge %s: interface %s removed", bridge, devname);
+
+ return 0;
+}
diff --git a/profiles/network/common.h b/profiles/network/common.h
index cb1f08a..62f2f59 100644
--- a/profiles/network/common.h
+++ b/profiles/network/common.h
@@ -35,3 +35,4 @@ int bnep_connadd(int sk, uint16_t role, char *dev);
int bnep_if_up(const char *devname);
int bnep_if_down(const char *devname);
int bnep_add_to_bridge(const char *devname, const char *bridge);
+int bnep_del_from_bridge(const char *devname, const char *bridge);
--
1.7.8.6
^ permalink raw reply related
* [PATCH 1/5] network: Keep track of session's interface name in server
From: Tomasz Bursztyka @ 2012-08-21 10:45 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Tomasz Bursztyka
In-Reply-To: <1345545955-13144-1-git-send-email-tomasz.bursztyka@linux.intel.com>
---
profiles/network/server.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/profiles/network/server.c b/profiles/network/server.c
index 8ae608c..1703f38 100644
--- a/profiles/network/server.c
+++ b/profiles/network/server.c
@@ -57,6 +57,7 @@
/* Pending Authorization */
struct network_session {
bdaddr_t dst; /* Remote Bluetooth Address */
+ char dev[16]; /* Interface name */
GIOChannel *io; /* Pending connect channel */
guint watch; /* BNEP socket watch */
};
@@ -272,6 +273,8 @@ static int server_connadd(struct network_server *ns,
bnep_if_up(devname);
+ strncpy(session->dev, devname, sizeof(devname));
+
ns->sessions = g_slist_append(ns->sessions, session);
return 0;
--
1.7.8.6
^ permalink raw reply related
* [PATCH 0/5] PAN server fixes
From: Tomasz Bursztyka @ 2012-08-21 10:45 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Tomasz Bursztyka
Hi,
After looking at connman's bug https://bugs.meego.com/show_bug.cgi?id=25125 I figured out that PAN server code was missbehaving.
Basically, when DBus Unregister call is made: all bnep ifs and there corresponding connections are not touched at all, so on the
client side: it still thinks it's connected (it is, but it lost the tethering stuff and so on).
So here is a patch set that fixes the issue.
1 - it tracks the bnep interface per session, it will be necessary afterwards
2 - An helper to remove properly an interface from a bridge, it will be necessary afterwards also
3 - Here we are: it deletes the interface from the bridge, and puts it down when the server is freed. It's on its own function since it will be
necessary aft
erwards.
4 - It kills the underlying connection properly so the client is notified as it should
5 - Finally, when Unregister method call is made: it cleans up all sessions so clients are disconnected accordingly etc...
Note: I tested this patch against 4.101 and it worken properly.
Please review,
Tomasz Bursztyka (5):
network: Keep track of session's interface name in server
network: Add helper function to remove an interface from a bridge
network: Release session's interface from bridge when unregistering
network: Kill underlying session's connection before freeing it
network: Remove sessions from server on DBus call Unregister
profiles/network/common.c | 29 +++++++++++++++++++++++++++++
profiles/network/common.h | 1 +
profiles/network/server.c | 31 ++++++++++++++++++++++++++++---
3 files changed, 58 insertions(+), 3 deletions(-)
--
1.7.8.6
^ permalink raw reply
* Re: gatt-example plugin
From: Anderson Lizardo @ 2012-08-21 10:41 UTC (permalink / raw)
To: John Tobias; +Cc: linux-bluetooth
In-Reply-To: <CACUGKYPK6qhJNdpk6-bXaxj2DsUvkvquXQzLZTNDOBmrx3+r7Q@mail.gmail.com>
Hi John,
On Mon, Aug 20, 2012 at 9:19 PM, John Tobias <john.tobias.ph@gmail.com> wrote:
> Hello Guys,
>
> I was playing with bluez-4.99 for LE. After setting the "EnableGatt to
> true" and re-start the bluetoothd, I was able to connect to the
> advertised services of the bluez. But, I could not figured out how to
> access/load the gatt_example plugin and access the services. Any
> information how to do it?
First, make sure that gatt_example plugin was compiled into
bluetoothd. You can check this by looking at the first lines of the
debug log for this string:
src/plugin.c:add_plugin() Loading gatt_example plugin
As long as you don't pass any "-P" option to bluetoothd, all compiled
plugins will load by default.
Next, you can test GATT operations from a remote device, e.g. some
GATT client you already have or the "gatttool" in BlueZ (running on
another adapter).
Best Regards,
--
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
^ permalink raw reply
* Bluetooth Headset Profile
From: Christian Richter @ 2012-08-21 8:43 UTC (permalink / raw)
To: linux-bluetooth
Hello,
i have searched the internet for a solution to use a linux computer as a Bluetooth-Headset. My plan is to create an embedded arm based device which acts as a Bluetooth headset. So far i found only vague information about such possibility.
Is there any plan to add a sort of "Headset Profile"? What would be necessary to do that (we're familiar with linux-kernel development, but BT-Newbies)? Is there a way to "hire" a bluez-developer to add such features?
regards,
Christian
^ permalink raw reply
* Re: [PATCH obexd v0] client-doc: Guarantee prefix in transfer paths
From: Patrick Ohly @ 2012-08-21 8:31 UTC (permalink / raw)
To: Mikel Astiz; +Cc: linux-bluetooth, Mikel Astiz
In-Reply-To: <1345533815-5611-1-git-send-email-mikel.astiz.oss@gmail.com>
On Tue, 2012-08-21 at 09:23 +0200, Mikel Astiz wrote:
> From: Mikel Astiz <mikel.astiz@bmw-carit.de>
>
> The client D-Bus documentation should mention that all transfer paths
> contain a prefix consisting of the path of the session they belong to.
>
> This can be conveniently used by clients to install D-Bus signal matches
> that concentrate on the relevant signals.
> ---
> doc/client-api.txt | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/doc/client-api.txt b/doc/client-api.txt
> index 839a78c..7ca65cc 100644
> --- a/doc/client-api.txt
> +++ b/doc/client-api.txt
> @@ -466,7 +466,7 @@ Transfer hierarchy
>
> Service org.bluez.obex.client
> Interface org.bluez.obex.Transfer
> -Object path [variable prefix]/{transfer0,transfer1,...}
> +Object path [variable prefix]/{session0,session1,...}/{transfer0,...}
>
> Methods dict GetProperties()
It would be even better to explicitly mention that the "[variable
prefix]" here is the same as the "[variable prefix]" in the Session.
Or perhaps change it like this?
-Object path [variable prefix]/{transfer0,transfer1,...}
+Object path [session prefix]/{transfer0,...}
Using this knowledge efficiently is not always possible, however. D-Bus
itself has a "path_namespace" filter [1], but many D-Bus bindings don't
expose it (Python [2], GIO D-Bus [3]). Therefore a client using those
bindings still has to receive all Transfer signals and do its own
filtering.
[1] http://dbus.freedesktop.org/doc/dbus-specification.html#message-bus-routing-match-rules
[2] http://dbus.freedesktop.org/doc/dbus-python/api/dbus.connection.Connection-class.html#add_signal_receiver
[3] http://developer.gnome.org/gio/stable/GDBusConnection.html#g-dbus-connection-signal-subscribe
--
Best Regards, Patrick Ohly
The content of this message is my personal opinion only and although
I am an employee of Intel, the statements I make here in no way
represent Intel's position on the issue, nor am I authorized to speak
on behalf of Intel on this matter.
^ permalink raw reply
* [PATCH obexd v0] client-doc: Guarantee prefix in transfer paths
From: Mikel Astiz @ 2012-08-21 7:23 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Mikel Astiz
From: Mikel Astiz <mikel.astiz@bmw-carit.de>
The client D-Bus documentation should mention that all transfer paths
contain a prefix consisting of the path of the session they belong to.
This can be conveniently used by clients to install D-Bus signal matches
that concentrate on the relevant signals.
---
doc/client-api.txt | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/doc/client-api.txt b/doc/client-api.txt
index 839a78c..7ca65cc 100644
--- a/doc/client-api.txt
+++ b/doc/client-api.txt
@@ -466,7 +466,7 @@ Transfer hierarchy
Service org.bluez.obex.client
Interface org.bluez.obex.Transfer
-Object path [variable prefix]/{transfer0,transfer1,...}
+Object path [variable prefix]/{session0,session1,...}/{transfer0,...}
Methods dict GetProperties()
--
1.7.7.6
^ permalink raw reply related
* Re: [PATCH v2] Bluetooth: Add support for Sony Vaio T-Series
From: Mohammed Shafi Shajakhan @ 2012-08-21 5:54 UTC (permalink / raw)
To: Gustavo Padovan, marcel, linux-bluetooth, yevgeniy.melnichuk
In-Reply-To: <20120815040856.GC3344@joana>
Hi Gustavo,
On Wednesday 15 August 2012 09:38 AM, Gustavo Padovan wrote:
> Hi Mohammed,
>
> * Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> [2012-08-07 19:48:10 +0530]:
>
>> From: Yevgeniy Melnichuk <yevgeniy.melnichuk@googlemail.com>
>>
>> Add Sony Vaio T-Series Bluetooth Module( 0x489:0xE036) to
>> the blacklist of btusb module and add it to the ath3k module.
>>
>> output of cat /sys/kernel/debug/usb/devices
>>
>> T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 5 Spd=12 MxCh= 0
>> D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
>> P: Vendor=0489 ProdID=e036 Rev= 0.02
>> S: Manufacturer=Atheros Communications
>> S: Product=Bluetooth USB Host Controller
>> S: SerialNumber=Alaska Day 2006
>> C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
>> I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
>> E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms
>> E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
>> E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
>> I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
>> E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
>> E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
>> I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
>> E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
>> E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
>> I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
>> E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
>> E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
>> I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
>> E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
>> E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
>> I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
>> E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
>> E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
>> I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
>> E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms
>> E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
>>
>> Signed-off-by: Yevgeniy Melnichuk <yevgeniy.melnichuk@googlemail.com>
>> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
>> ---
>> drivers/bluetooth/ath3k.c | 2 ++
>> drivers/bluetooth/btusb.c | 1 +
>> 2 files changed, 3 insertions(+), 0 deletions(-)
>
> Patch has been applied to bluetooth.git. Thanks.
sure, thanks!
>
> Gustavo
>
--
thanks,
shafi
^ permalink raw reply
* gatt-example plugin
From: John Tobias @ 2012-08-21 1:19 UTC (permalink / raw)
To: linux-bluetooth
Hello Guys,
I was playing with bluez-4.99 for LE. After setting the "EnableGatt to
true" and re-start the bluetoothd, I was able to connect to the
advertised services of the bluez. But, I could not figured out how to
access/load the gatt_example plugin and access the services. Any
information how to do it?
Thanks,
John
^ permalink raw reply
* [RFC v2 BlueZ] doc: Introduce Alert API
From: Anderson Lizardo @ 2012-08-20 18:05 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Anderson Lizardo
In-Reply-To: <1344450186-14961-1-git-send-email-anderson.lizardo@openbossa.org>
This API will be implemented and initially used by Phone Alert Status
and Alert Notification GATT profiles (server role).
---
doc/alert-api.txt | 119 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 119 insertions(+)
create mode 100644 doc/alert-api.txt
diff --git a/doc/alert-api.txt b/doc/alert-api.txt
new file mode 100644
index 0000000..4ead9e8
--- /dev/null
+++ b/doc/alert-api.txt
@@ -0,0 +1,119 @@
+BlueZ D-Bus Alert API description
+*********************************
+
+Copyright (C) 2012 Instituto Nokia de Tecnologia - INdT
+
+Introduction
+------------
+
+Currently, there are two different GATT server profiles that depend on
+receiving alerts or notifications from the platform: Phone Alert Status (PASP)
+and Alert Notification (ANP). PASP is very specific to mobile phones, and also
+allows limited control to alerts (i.e. mute once or switch to a silent mode).
+
+This document presents a unified API that allows to register and notify alerts,
+and to control some alerts (using the provided agent object).
+
+
+Alert hierarchy
+===============
+
+Service org.bluez
+Interface org.bluez.Alert
+Object path /org/bluez
+
+Methods void RegisterAlert(string category, object agent)
+
+ Register a new alert category and an agent for it. This
+ means the application will be responsible for notifying
+ BlueZ of any alerts of that category, using the
+ NewAlert() method.
+
+ Supported ANP categories: simple, email, news, call,
+ missed_call, sms_mms, voice_mail, schedule,
+ high_priority, instant_message
+ Supported PASP categories: ringer, vibrate, display
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+
+ void NewAlert(string category, uint16 count, string description)
+
+ Notify BlueZ of new alert(s) for the given category. The
+ description is relative to the last received alert and
+ can be sender name, caller ID, title, or other
+ information specific to the category.
+
+ For ringer, vibrate and display categories, valid
+ descriptions are "active" and "not active". Alerts from
+ ringer category also accept "enabled" and "disabled",
+ depending on whether ringer is in silent mode or not.
+
+ If there is no description, an empty string can be
+ used.
+
+ The count argument contains the number of alerts not
+ yet acknowledged by the user on the UI. To save D-Bus
+ traffic, events that may generate multiple alerts at
+ the same time (like email, sms, news) should trigger a
+ single NewAlert().
+
+ PASP alerts should always set count to 1.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+
+ void UnreadAlert(string category, uint16 count)
+
+ Some services (like SMS and e-mail) keep track of
+ number of unread items. This method allows to update
+ this counter, so peer devices can be notified using
+ Alert Notification Profile.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+
+Alert Agent hierarchy
+=====================
+
+Service org.bluez
+Interface org.bluez.AlertAgent
+Object path freely definable
+
+Methods void MuteOnce()
+
+ This method is only called if "ringer" alert category
+ is specified when registering the agent.
+
+ Mute the ringer once (e.g. during a incoming call). If
+ ringer is not active, does nothing.
+
+ void SetRinger(string mode)
+
+ This method is only called if "ringer" alert category
+ is specified when registering the agent.
+
+ Set ringer to the specified mode. If mode is "enabled",
+ ringer is set to the default mode, as defined by the
+ current active profile. If mode is "disabled", ringer
+ will not activate on incoming calls, until it is set
+ back to "enabled" mode.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+
+ void Suspend(string category)
+
+ Suspend alerts for this category, which means that
+ new/unread alerts should not be reported to save D-Bus
+ traffic. This means that no client has enabled this
+ alert yet.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+
+ void Resume(string category)
+
+ Resume alerts for this category.
+
+ Possible Errors: org.bluez.Error.InvalidArguments
+
+ void Release()
+
+ Release this agent. At this point, it will be not used
+ by BlueZ anymore and can be destroyed by the owner.
--
1.7.9.5
^ permalink raw reply related
* [PATCH BlueZ v0] Add Nordic Semiconductor copyright
From: Claudio Takahasi @ 2012-08-20 17:53 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
---
profiles/input/hog_device.c | 1 +
profiles/input/hog_device.h | 1 +
profiles/input/hog_manager.c | 1 +
3 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/profiles/input/hog_device.c b/profiles/input/hog_device.c
index 10c5a45..d1fe445 100644
--- a/profiles/input/hog_device.c
+++ b/profiles/input/hog_device.c
@@ -3,6 +3,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2012 Marcel Holtmann <marcel@holtmann.org>
+ * Copyright (C) 2012 Nordic Semiconductor Inc.
* Copyright (C) 2012 Instituto Nokia de Tecnologia - INdT
*
*
diff --git a/profiles/input/hog_device.h b/profiles/input/hog_device.h
index ce6a79e..597dc7c 100644
--- a/profiles/input/hog_device.h
+++ b/profiles/input/hog_device.h
@@ -3,6 +3,7 @@
* BlueZ - Bluetooth protocol stack for Linux
*
* Copyright (C) 2012 Marcel Holtmann <marcel@holtmann.org>
+ * Copyright (C) 2012 Nordic Semiconductor Inc.
* Copyright (C) 2012 Instituto Nokia de Tecnologia - INdT
*
*
diff --git a/profiles/input/hog_manager.c b/profiles/input/hog_manager.c
index ddc5baf..c544e79 100644
--- a/profiles/input/hog_manager.c
+++ b/profiles/input/hog_manager.c
@@ -2,6 +2,7 @@
*
* BlueZ - Bluetooth protocol stack for Linux
*
+ * Copyright (C) 2012 Nordic Semiconductor Inc.
* Copyright (C) 2012 Instituto Nokia de Tecnologia
*
*
--
1.7.8.6
^ permalink raw reply related
* Re: [PATCH BlueZ v0 0/4] GATT & ATT cleanups
From: Johan Hedberg @ 2012-08-20 17:46 UTC (permalink / raw)
To: Claudio Takahasi; +Cc: linux-bluetooth
In-Reply-To: <1345483942-27973-1-git-send-email-claudio.takahasi@openbossa.org>
Hi Claudio,
On Mon, Aug 20, 2012, Claudio Takahasi wrote:
> Minor GATT & ATT cleanups. Requires: "[PATCH BlueZ v0 00/10] GATT
> plugin: Service Changed and MTU exchange"
>
> Claudio Takahasi (4):
> att: Add Find Info Response Format constants
> att: Replace ATT magic number
> gatt: Return not found if characteritics is empty
> gatt: Don't raise error if declaration was found
>
> attrib/att.h | 4 ++++
> attrib/gatt.c | 7 ++++---
> profiles/gatt/gas.c | 2 +-
> profiles/input/hog_device.c | 2 +-
> profiles/thermometer/thermometer.c | 2 +-
> 5 files changed, 11 insertions(+), 6 deletions(-)
All patches in this set have been applied. Thanks.
Johan
^ permalink raw reply
* Re: [PATCH BlueZ v0 00/10] GATT plugin: Service Changed and MTU exchange
From: Johan Hedberg @ 2012-08-20 17:44 UTC (permalink / raw)
To: Claudio Takahasi; +Cc: linux-bluetooth
In-Reply-To: <1345483375-27621-1-git-send-email-claudio.takahasi@openbossa.org>
Hi Claudio,
On Mon, Aug 20, 2012, Claudio Takahasi wrote:
> This patch series implements Service Changed attribute of the remote
> Generic Attribute Profile Service, and the MTU exchange sub-procedure.
>
> Service Changed characteristic is used to indicate to connected devices
> that services have changed (i.e., added, removed or modified).
>
> The MTU exchange sub-procedure is used by the client to set the ATT_MTU
> to the maximum possible value that can be supported by both devices when
> the client supports a value greater than the default ATT_MTU for the
> Attribute Protocol. BlueZ host will always start this sub-procedure when
> the ATT channel is established.
>
> Claudio Takahasi (10):
> gatt: Add Service Changed read
> gatt: Add Service Changed CCC discovery
> gatt: Enable indication for Service Changed
> gatt: Confirm the indication received
> gatt: Start Discover Services when handle changes
> core: Rename update_services
> core: Add updating GATT services
> gatt: Primary service interval may not change
> core: Rename services_changed to uuids_changed
> gatt: Add MTU exchange procedure
>
> attrib/gatt.h | 1 +
> profiles/gatt/gas.c | 214 +++++++++++++++++++++++++++++++++++++++++++++++++++
> src/device.c | 101 +++++++++++++++++++------
> src/device.h | 2 +
> 4 files changed, 295 insertions(+), 23 deletions(-)
All patches in this set have been applied. Thanks.
Johan
^ permalink raw reply
* Re: Setting up an A2DP server
From: Lucas De Marchi @ 2012-08-20 17:44 UTC (permalink / raw)
To: Niklas Claesson; +Cc: linux-bluetooth
In-Reply-To: <CAAHv3KG6NteONyJ1oM9Lakc=iMBGc0OZvpDKB-YTeN7ugjvd2w@mail.gmail.com>
On Fri, Aug 17, 2012 at 6:50 PM, Niklas Claesson
<nicke.claesson@gmail.com> wrote:
> I've actually solved the issue myself by writing an Agent that accepts
You could mark the device as trusted, so you don't have to do this.
> all incoming requests, and another python script that polls 'pacmd
> list-sources' every 2 seconds for new bluetooth sources. And third and
Why do you need this?
Lucas De Marchi
^ permalink raw reply
* [PATCH BlueZ v0 4/4] gatt: Don't raise error if declaration was found
From: Claudio Takahasi @ 2012-08-20 17:32 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
In-Reply-To: <1345483942-27973-1-git-send-email-claudio.takahasi@openbossa.org>
This patch avoids raising errors to the upper layer if at least one
characteristic declaration has been found. According to the Core SPEC
Characteristic declarations shall be read without authentication or
authorization.
---
attrib/gatt.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/attrib/gatt.c b/attrib/gatt.c
index aea59ec..6880e2d 100644
--- a/attrib/gatt.c
+++ b/attrib/gatt.c
@@ -253,7 +253,7 @@ static void char_discovered_cb(guint8 status, const guint8 *ipdu, guint16 iplen,
{
struct discover_char *dc = user_data;
struct att_data_list *list;
- unsigned int i, err;
+ unsigned int i, err = ATT_ECODE_ATTR_NOT_FOUND;
size_t buflen;
uint8_t *buf;
guint16 oplen;
@@ -261,7 +261,7 @@ static void char_discovered_cb(guint8 status, const guint8 *ipdu, guint16 iplen,
uint16_t last = 0;
if (status) {
- err = status == ATT_ECODE_ATTR_NOT_FOUND ? 0 : status;
+ err = status;
goto done;
}
@@ -320,9 +320,9 @@ static void char_discovered_cb(guint8 status, const guint8 *ipdu, guint16 iplen,
return;
}
- err = (dc->characteristics ? 0 : ATT_ECODE_ATTR_NOT_FOUND);
-
done:
+ err = (dc->characteristics ? 0 : err);
+
dc->cb(dc->characteristics, err, dc->user_data);
discover_char_free(dc);
}
--
1.7.8.6
^ permalink raw reply related
* [PATCH BlueZ v0 3/4] gatt: Return not found if characteritics is empty
From: Claudio Takahasi @ 2012-08-20 17:32 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
In-Reply-To: <1345483942-27973-1-git-send-email-claudio.takahasi@openbossa.org>
This patch changes the behaviour of Discover All Characteristics and
Discover Characteristics by UUID returning <<Attribute Not Found>> when
Characteristic list that matches the defined criteria is empty. This
scenario can happen when the GATT client avoids extra iteraction with
the remote attribute server if the last received handle(or handle + 1)
is equal to the end handle of the primary service.
---
attrib/gatt.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/attrib/gatt.c b/attrib/gatt.c
index 9ab283f..aea59ec 100644
--- a/attrib/gatt.c
+++ b/attrib/gatt.c
@@ -302,7 +302,6 @@ static void char_discovered_cb(guint8 status, const guint8 *ipdu, guint16 iplen,
}
att_data_list_free(list);
- err = 0;
if (last != 0 && (last + 1 < dc->end)) {
buf = g_attrib_get_buffer(dc->attrib, &buflen);
@@ -321,6 +320,8 @@ static void char_discovered_cb(guint8 status, const guint8 *ipdu, guint16 iplen,
return;
}
+ err = (dc->characteristics ? 0 : ATT_ECODE_ATTR_NOT_FOUND);
+
done:
dc->cb(dc->characteristics, err, dc->user_data);
discover_char_free(dc);
--
1.7.8.6
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox