Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Makefile.am fixes
From: Marcel Mol @ 2010-08-20 16:32 UTC (permalink / raw)
  To: linux-bluetooth

phonebook.h should not be under _nodist.
vcard.[ch] is not related to pbap, but to phonebook backend
---
 Makefile.am |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 07fc27d..fdc4f7e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -52,8 +52,7 @@ builtin_modules += ftp
 builtin_sources += plugins/ftp.c
 
 builtin_modules += pbap
-builtin_sources += plugins/pbap.c plugins/phonebook.h \
-			plugins/vcard.h plugins/vcard.c
+builtin_sources += plugins/pbap.c
 
 builtin_modules += irmc
 builtin_sources += plugins/irmc.c
@@ -61,6 +60,8 @@ builtin_sources += plugins/irmc.c
 builtin_modules += syncevolution
 builtin_sources += plugins/syncevolution.c
 
+builtin_sources += plugins/phonebook.h plugins/vcard.h plugins/vcard.c
+
 builtin_nodist += plugins/phonebook.c
 
 libexec_PROGRAMS += src/obexd
@@ -99,7 +100,6 @@ src/plugin.$(OBJEXT): src/builtin.h
 
 src/builtin.h: src/genbuiltin $(builtin_sources)
 	$(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
-
 endif
 
 if CLIENT
-- 
1.7.2.1


^ permalink raw reply related

* [PATCH 2nd version] Makefile.am fixes
From: Marcel Mol @ 2010-08-20 16:32 UTC (permalink / raw)
  To: linux-bluetooth

vcard.[ch] is not related to pbap, but to phonebook backend
---
 Makefile.am |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 07fc27d..fdc4f7e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -52,8 +52,7 @@ builtin_modules += ftp
 builtin_sources += plugins/ftp.c
 
 builtin_modules += pbap
-builtin_sources += plugins/pbap.c plugins/phonebook.h \
-			plugins/vcard.h plugins/vcard.c
+builtin_sources += plugins/pbap.c
 
 builtin_modules += irmc
 builtin_sources += plugins/irmc.c
@@ -61,6 +60,8 @@ builtin_sources += plugins/irmc.c
 builtin_modules += syncevolution
 builtin_sources += plugins/syncevolution.c
 
+builtin_sources += plugins/phonebook.h plugins/vcard.h plugins/vcard.c
+
 builtin_nodist += plugins/phonebook.c
 
 libexec_PROGRAMS += src/obexd
@@ -99,7 +100,6 @@ src/plugin.$(OBJEXT): src/builtin.h
 
 src/builtin.h: src/genbuiltin $(builtin_sources)
 	$(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
-
 endif
 
 if CLIENT
-- 
1.7.2.1


^ permalink raw reply related

* Re: [PATCH] Remove dup VCard2.1 SDP format for OPP
From: Johan Hedberg @ 2010-08-20 15:58 UTC (permalink / raw)
  To: Tom Counihan; +Cc: linux-bluetooth
In-Reply-To: <AANLkTim9y59pMzPGSkZi431oTAjEjdiEtQHnt_-D2z85@mail.gmail.com>

Hi Tom,

On Fri, Aug 20, 2010, Tom Counihan wrote:
> Attaching patch as an attachment - hopefully all should be fine now.

Yes, it was fine. The patch is now upstream. Thanks.

Johan

^ permalink raw reply

* Re: [PATCH] Remove dup VCard2.1 SDP format for OPP
From: Tom Counihan @ 2010-08-20 13:39 UTC (permalink / raw)
  To: Tom Counihan, linux-bluetooth
In-Reply-To: <AANLkTi=YeYGdojmXt-0gRdXPafsupP6CZc4r7dj2ufAg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 973 bytes --]

Hi Johan,

Attaching patch as an attachment - hopefully all should be fine now.

Warm Regards
Tom.

On Fri, Aug 20, 2010 at 2:32 PM, Tom Counihan
<tomcounihan@googlemail.com> wrote:
> On Fri, Aug 20, 2010 at 1:59 PM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
>> Hi Tom,
>>
>> On Fri, Aug 20, 2010, Tom Counihan wrote:
>>> OPP SDP record appears to have a duplicate
>>> entry for Supported Formats List.
>>>
>>> ---
>>>  plugins/opp.c |    1 -
>>>  1 files changed, 0 insertions(+), 1 deletions(-)
>>
>> The patch looks fine but doesn't apply against latest git:
>>
>> error: patch failed: plugins/opp.c:83
>> error: plugins/opp.c: patch does not apply
>> Patch failed at 0001 Remove dup VCard2.1 SDP format for OPP
>>
>> Could you make sure that it applies cleanly to latest git and then
>> resend? Thanks.
>
> I'll send again - I'm assuming that the cause here is we had a race
> condition between inbound patches?
>>
>> Johan
>>
>

[-- Attachment #2: 0001-Remove-dup-VCard2.1-SDP-format-for-OPP.patch --]
[-- Type: application/octet-stream, Size: 758 bytes --]

From ab7d7fbf60a016b491200f4c5eaf100188dd5d7b Mon Sep 17 00:00:00 2001
From: Tom Counihan <tomcounihan@googlemail.com>
Date: Fri, 20 Aug 2010 14:20:53 +0100
Subject: [PATCH] Remove dup VCard2.1 SDP format for OPP

OPP SDP record appears to have a duplicate
entry for Supported Formats List.
---
 plugins/opp.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/plugins/opp.c b/plugins/opp.c
index cd46464..05f944f 100644
--- a/plugins/opp.c
+++ b/plugins/opp.c
@@ -83,7 +83,6 @@
   <attribute id=\"0x0303\">					\
     <sequence>							\
       <uint8 value=\"0x01\"/>					\
-      <uint8 value=\"0x01\"/>					\
       <uint8 value=\"0x02\"/>					\
       <uint8 value=\"0x03\"/>					\
       <uint8 value=\"0x04\"/>					\
-- 
1.7.1.1


^ permalink raw reply related

* Re: [PATCH] Remove dup VCard2.1 SDP format for OPP
From: Tom Counihan @ 2010-08-20 13:32 UTC (permalink / raw)
  To: Tom Counihan, linux-bluetooth
In-Reply-To: <20100820125948.GA16376@jh-x301>

On Fri, Aug 20, 2010 at 1:59 PM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> Hi Tom,
>
> On Fri, Aug 20, 2010, Tom Counihan wrote:
>> OPP SDP record appears to have a duplicate
>> entry for Supported Formats List.
>>
>> ---
>>  plugins/opp.c |    1 -
>>  1 files changed, 0 insertions(+), 1 deletions(-)
>
> The patch looks fine but doesn't apply against latest git:
>
> error: patch failed: plugins/opp.c:83
> error: plugins/opp.c: patch does not apply
> Patch failed at 0001 Remove dup VCard2.1 SDP format for OPP
>
> Could you make sure that it applies cleanly to latest git and then
> resend? Thanks.

I'll send again - I'm assuming that the cause here is we had a race
condition between inbound patches?
>
> Johan
>

^ permalink raw reply

* Re: [PATCH] Remove dup VCard2.1 SDP format for OPP
From: Johan Hedberg @ 2010-08-20 12:59 UTC (permalink / raw)
  To: Tom Counihan; +Cc: linux-bluetooth
In-Reply-To: <AANLkTin+CRVwKgC+UaDK6q4PRrw9eGi3c7++PSxWODcu@mail.gmail.com>

Hi Tom,

On Fri, Aug 20, 2010, Tom Counihan wrote:
> OPP SDP record appears to have a duplicate
> entry for Supported Formats List.
> 
> ---
>  plugins/opp.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)

The patch looks fine but doesn't apply against latest git:

error: patch failed: plugins/opp.c:83
error: plugins/opp.c: patch does not apply
Patch failed at 0001 Remove dup VCard2.1 SDP format for OPP

Could you make sure that it applies cleanly to latest git and then
resend? Thanks.

Johan

^ permalink raw reply

* [PATCH] Remove dup VCard2.1 SDP format for OPP
From: Tom Counihan @ 2010-08-20 12:34 UTC (permalink / raw)
  To: linux-bluetooth

OPP SDP record appears to have a duplicate
entry for Supported Formats List.

---
 plugins/opp.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/plugins/opp.c b/plugins/opp.c
index cd46464..05f944f 100644
--- a/plugins/opp.c
+++ b/plugins/opp.c
@@ -83,7 +83,6 @@
   <attribute id=\"0x0303\">                                    \
     <sequence>                                                 \
       <uint8 value=\"0x01\"/>                                  \
-      <uint8 value=\"0x01\"/>                                  \
       <uint8 value=\"0x02\"/>                                  \
       <uint8 value=\"0x03\"/>                                  \
       <uint8 value=\"0x04\"/>                                  \
-- 
1.7.1.1

^ permalink raw reply related

* Re: [PATCH 2/2] Add handling of ORG contact's fields handled in VCARD structure
From: Johan Hedberg @ 2010-08-20 12:26 UTC (permalink / raw)
  To: Rafał Michalski; +Cc: linux-bluetooth
In-Reply-To: <AANLkTimU5SnF1D0xJ=qEKsqgJSWNmv+USpViaaUV+bQ0@mail.gmail.com>

Hi Rafal,

On Fri, Aug 20, 2010, Rafał Michalski wrote:
> From 44a30279e45df82ae4ceed254a7f895331073414 Mon Sep 17 00:00:00 2001
> From: Rafal Michalski <michalski.raf@gmail.com>
> Date: Fri, 20 Aug 2010 09:01:29 +0200
> Subject: [PATCH 2/2] Add handling of ORG contact's fields handled in VCARD structure
> 
> After pulling contacts these fields weren't present in downloaded
> VCARD structure in spite of that these fields existed (not empty).
> 
> This patch adds handling of fields grouped under ORG tag.
> To solve this problem extending number of columns and queries of database
> was needed especially. Of course fields mentioned above were added to
> phonebook_contact structure as char * type to save gained data.
> ---
>  plugins/phonebook-tracker.c |   38 +++++++++++++++++++++++++++-----------
>  plugins/vcard.c             |   30 ++++++++++++++++++++++++++++++
>  plugins/vcard.h             |    3 +++
>  3 files changed, 60 insertions(+), 11 deletions(-)

And this one is also upstream. Thanks.

Johan

^ permalink raw reply

* Re: [PATCH 1/2] Add handling of single contact's fields handled in VCARD structure
From: Johan Hedberg @ 2010-08-20 12:25 UTC (permalink / raw)
  To: Rafał Michalski; +Cc: linux-bluetooth
In-Reply-To: <AANLkTin5i+qBUga7sjMQFMCxHgafP8H4Lbd1+zfM1Jcf@mail.gmail.com>

Hi Rafal,

On Fri, Aug 20, 2010, Rafał Michalski wrote:
> From 09a00e743a8aa8f11b88f9fc440029970b030e04 Mon Sep 17 00:00:00 2001
> From: Rafal Michalski <michalski.raf@gmail.com>
> Date: Fri, 20 Aug 2010 09:00:33 +0200
> Subject: [PATCH 1/2] Add handling of single contact's fields handled in VCARD structure
> 
> After pulling contacts these fields weren't present in downloaded
> VCARD structure in spite of that these fields existed (not empty).
> 
> This patch adds handling of fields: BDAY, NICKNAME, URL, PHOTO
> To solve this problem extending number of columns and queries of database
> was needed especially. Displaying these fields is done by genaral
> functions: vcard_printf_tag, vcard_printf_slash_tag.
> Of course fields mentioned above were added to phonebook_contact structure
> as char * type to save gained data.
> ---
>  plugins/phonebook-tracker.c |   29 ++++++++++++++----
>  plugins/vcard.c             |   68 +++++++++++++++++++++++++++++++++++++++++++
>  plugins/vcard.h             |    4 ++
>  3 files changed, 95 insertions(+), 6 deletions(-)

Thanks. This patch has now been pushed upstream.

Johan

^ permalink raw reply

* Re: [PATCH 0/8] Clean up Obex btio.[ch] and make it self contained
From: Luiz Augusto von Dentz @ 2010-08-20 11:39 UTC (permalink / raw)
  To: Zhenhua Zhang; +Cc: linux-bluetooth
In-Reply-To: <1282227676-15381-1-git-send-email-zhenhua.zhang@intel.com>

Hi,

On Thu, Aug 19, 2010 at 5:21 PM, Zhenhua Zhang <zhenhua.zhang@intel.com> wrote:
> Hi,
>
> This series of patches is to seperate btio.[ch] from src to btio directory. To make btio.[ch] self contained for obexd, there're some cleanup work:

Sounds good, this should make it easier to maintain those in sync with
other projects using it.

> 1. remove unused bt_io_set(). It is neither used by bluez or obexd.
> 2. remove unused SCO/L2RAW related code for Obexd. Note: BlueZ code requires SCO/L2RAW related functions. We may consider to add them back later.

Im not so sure if we want to have this code removed, obviously after
that in case of changes/fixes they may not apply cleanly in all
projects, so keeping them in sync won't be as easy anymore.

> 3. replace void *userdata with gpointer userdata. To make it consistent with bluez btio.c
> 4. refactor hci_devba into devid2ba. Remove dependence with hci*.h
> 5. Remove libbluetooth dependence for obexd.

This is fine as long as the other copies have this changes too.


-- 
Luiz Augusto von Dentz
Computer Engineer

^ permalink raw reply

* Re: [PATCH] bluetooth: fix not setting security level when creating a rfcomm session
From: Ville Tervo @ 2010-08-20 10:55 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <1282215970-32758-1-git-send-email-luiz.dentz@gmail.com>

On Thu, Aug 19, 2010 at 01:06:10PM +0200, Luiz Augusto von Dentz wrote:
> From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
> 
> This cause 'No Bonding' to be used if userspace has not yet been paired
> with remote device since the l2cap socket used to create the rfcomm
> session does not have any security level set.

Looks good.

> Signed-off-by: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>

Acked-by: Ville Tervo <ville.tervo@nokia.com>

-- 
Ville

^ permalink raw reply

* Re: [PATCH v2] Bluetooth: Implement LE Set Advertise Enable cmd
From: Ville Tervo @ 2010-08-20 10:31 UTC (permalink / raw)
  To: ext Anderson Briglia; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <1282232558-14472-1-git-send-email-anderson.briglia@openbossa.org>

Hi,

On Thu, Aug 19, 2010 at 05:42:38PM +0200, ext Anderson Briglia wrote:
> This patch implements LE Set Advertise Enable command for dual mode and
> Low Energy hci controllers. It also adds new HCI flags in order to
> indicate the Advertising state for userland applications and kernel
> itself.
> 
> Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
> ---
>  include/net/bluetooth/hci.h |    6 ++++++
>  net/bluetooth/hci_event.c   |   27 +++++++++++++++++++++++++++
>  2 files changed, 33 insertions(+), 0 deletions(-)

Patch looks good to me, but I don't have working hardware to verify it currently.


-- 
Ville

^ permalink raw reply

* [PATCH 2/2] Add handling of ORG contact's fields handled in VCARD structure
From: Rafał Michalski @ 2010-08-20  9:45 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Rafał Michalski

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0002-Add-handling-of-ORG-contact-s-fields-handled-in-VCAR.patch --]
[-- Type: text/x-patch, Size: 8312 bytes --]

From 44a30279e45df82ae4ceed254a7f895331073414 Mon Sep 17 00:00:00 2001
From: Rafal Michalski <michalski.raf@gmail.com>
Date: Fri, 20 Aug 2010 09:01:29 +0200
Subject: [PATCH 2/2] Add handling of ORG contact's fields handled in VCARD structure

After pulling contacts these fields weren't present in downloaded
VCARD structure in spite of that these fields existed (not empty).

This patch adds handling of fields grouped under ORG tag.
To solve this problem extending number of columns and queries of database
was needed especially. Of course fields mentioned above were added to
phonebook_contact structure as char * type to save gained data.
---
 plugins/phonebook-tracker.c |   38 +++++++++++++++++++++++++++-----------
 plugins/vcard.c             |   30 ++++++++++++++++++++++++++++++
 plugins/vcard.h             |    3 +++
 3 files changed, 60 insertions(+), 11 deletions(-)

diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index fd92125..3f63dcb 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -43,16 +43,16 @@
 #define TRACKER_RESOURCES_INTERFACE "org.freedesktop.Tracker1.Resources"
 
 #define TRACKER_DEFAULT_CONTACT_ME "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#default-contact-me"
-#define CONTACTS_ID_COL 25
-#define PULL_QUERY_COL_AMOUNT 26
+#define CONTACTS_ID_COL 28
+#define PULL_QUERY_COL_AMOUNT 29
 #define COL_HOME_NUMBER 0
 #define COL_HOME_EMAIL 7
 #define COL_WORK_NUMBER 8
 #define COL_FAX_NUMBER 16
 #define COL_WORK_EMAIL 17
-#define COL_DATE 22
-#define COL_SENT 23
-#define COL_ANSWERED 24
+#define COL_DATE 25
+#define COL_SENT 26
+#define COL_ANSWERED 27
 
 #define CONTACTS_QUERY_ALL						\
 	"SELECT ?v nco:fullname(?c) "					\
@@ -63,7 +63,8 @@
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
 	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
-	"nco:photo(?c) "						\
+	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
+	"nco:role(?a) "							\
 	"\"NOTACALL\" \"false\" \"false\" ?c "				\
 	"WHERE { "							\
 		"?c a nco:PersonContact . "				\
@@ -83,6 +84,7 @@
 		"?c nco:hasAffiliation ?a . "				\
 		"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " 		\
 		"OPTIONAL { ?a nco:hasEmailAddress ?ew . } "		\
+		"OPTIONAL { ?a nco:org ?o . } "				\
 	"} "								\
 	"}"
 
@@ -109,7 +111,8 @@
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
 	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
-	"nco:photo(?c) "						\
+	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
+	"nco:role(?a) "							\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -130,6 +133,7 @@
 		"?c nco:hasAffiliation ?a . "				\
 		"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " 		\
 		"OPTIONAL { ?a nco:hasEmailAddress ?ew . } "		\
+		"OPTIONAL { ?a nco:org ?o . } "				\
 	"} "								\
 	"} ORDER BY DESC(nmo:receivedDate(?call))"
 
@@ -156,7 +160,8 @@
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
 	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
-	"nco:photo(?c) "						\
+	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
+	"nco:role(?a) "							\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -177,6 +182,7 @@
 		"?c nco:hasAffiliation ?a . "				\
 		"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " 		\
 		"OPTIONAL { ?a nco:hasEmailAddress ?ew . } "		\
+		"OPTIONAL { ?a nco:org ?o . } "				\
 	"} "								\
 	"} ORDER BY DESC(nmo:receivedDate(?call))"
 
@@ -203,7 +209,8 @@
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew)"	\
 	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
-	"nco:photo(?c) "						\
+	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
+	"nco:role(?a) "							\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -223,6 +230,7 @@
 		"?c nco:hasAffiliation ?a . "				\
 		"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " 		\
 		"OPTIONAL { ?a nco:hasEmailAddress ?ew . } "		\
+		"OPTIONAL { ?a nco:org ?o . } "				\
 	"} "								\
 	"} ORDER BY DESC(nmo:sentDate(?call))"
 
@@ -248,7 +256,8 @@
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
 	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
-	"nco:photo(?c) "						\
+	"nco:photo(?c) nco:fullname(?o) nco:department(?a) "		\
+	"nco:role(?a) "							\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -268,6 +277,7 @@
 	"OPTIONAL { ?c nco:hasAffiliation ?a . "			\
 		"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " 		\
 		"OPTIONAL { ?a nco:hasEmailAddress ?ew . } "		\
+		"OPTIONAL { ?a nco:org ?o . } "				\
 	"} "								\
 	"} UNION { "							\
 		"?call a nmo:Call ; "					\
@@ -285,6 +295,7 @@
 	"OPTIONAL { ?c nco:hasAffiliation ?a . "			\
 		"OPTIONAL { ?a nco:hasPhoneNumber ?w . } " 		\
 		"OPTIONAL { ?a nco:hasEmailAddress ?ew . } "		\
+		"OPTIONAL { ?a nco:org ?o . } "				\
 	"} "								\
 	"} } ORDER BY DESC(nmo:receivedDate(?call))"
 
@@ -317,7 +328,8 @@
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f  nco:emailAddress(?ew)"	\
 	"nco:birthDate(<%s>) nco:nickname(<%s>) nco:websiteUrl(<%s>) "	\
-	"nco:photo(<%s>) "						\
+	"nco:photo(<%s>) nco:fullname(?o) nco:department(?a) "		\
+	"nco:role(?a) "							\
 	"\"NOTACALL\" \"false\" \"false\" <%s> "			\
 	"WHERE { "							\
 		"<%s> a nco:Contact . "					\
@@ -337,6 +349,7 @@
 		"<%s> nco:hasAffiliation ?a . "				\
 		"OPTIONAL { ?a nco:hasPhoneNumber ?w . }" 		\
 		"OPTIONAL { ?a nco:hasEmailAddress ?ew . }"		\
+		"OPTIONAL { ?a nco:org ?o . } "				\
 	"} "								\
 	"}"
 
@@ -790,6 +803,9 @@ add_entry:
 	contact->nickname = g_strdup(reply[19]);
 	contact->website = g_strdup(reply[20]);
 	contact->photo = g_strdup(reply[21]);
+	contact->company = g_strdup(reply[22]);
+	contact->department = g_strdup(reply[23]);
+	contact->title = g_strdup(reply[24]);
 
 	set_call_type(contact, reply[COL_DATE], reply[COL_SENT],
 			reply[COL_ANSWERED]);
diff --git a/plugins/vcard.c b/plugins/vcard.c
index 05a8a13..0eed8ae 100644
--- a/plugins/vcard.c
+++ b/plugins/vcard.c
@@ -321,6 +321,30 @@ static void vcard_printf_email(GString *vcards, const char *email)
 	}
 }
 
+static gboolean org_fields_present(struct phonebook_contact *contact)
+{
+	if (contact->company && strlen(contact->company))
+		return TRUE;
+
+	if (contact->department && strlen(contact->department))
+		return TRUE;
+
+	if (contact->title && strlen(contact->title))
+		return TRUE;
+
+	return FALSE;
+}
+
+static void vcard_printf_org(GString *vcards,
+					struct phonebook_contact *contact)
+{
+	if (org_fields_present(contact) == FALSE)
+		return;
+
+	vcard_printf(vcards, "ORG:%s;%s;%s", contact->company,
+				contact->department, contact->title);
+}
+
 static void vcard_printf_adr(GString *vcards, struct phonebook_contact *contact)
 {
 	if (address_fields_present(contact) == FALSE) {
@@ -418,6 +442,9 @@ void phonebook_add_contact(GString *vcards, struct phonebook_contact *contact,
 	if (filter & FILTER_PHOTO)
 		vcard_printf_tag(vcards, "PHOTO", NULL, contact->photo);
 
+	if (filter & FILTER_ORG)
+		vcard_printf_org(vcards, contact);
+
 	if (filter & FILTER_X_IRMC_CALL_DATETIME)
 		vcard_printf_datetime(vcards, contact);
 
@@ -460,6 +487,9 @@ void phonebook_contact_free(struct phonebook_contact *contact)
 	g_free(contact->nickname);
 	g_free(contact->website);
 	g_free(contact->photo);
+	g_free(contact->company);
+	g_free(contact->department);
+	g_free(contact->title);
 	g_free(contact->datetime);
 	g_free(contact);
 }
diff --git a/plugins/vcard.h b/plugins/vcard.h
index a9809ea..0f52425 100644
--- a/plugins/vcard.h
+++ b/plugins/vcard.h
@@ -59,6 +59,9 @@ struct phonebook_contact {
 	char *nickname;
 	char *website;
 	char *photo;
+	char *company;
+	char *department;
+	char *title;
 	char *datetime;
 	int calltype;
 };
-- 
1.6.3.3


^ permalink raw reply related

* [PATCH 1/2] Add handling of single contact's fields handled in VCARD structure
From: Rafał Michalski @ 2010-08-20  9:43 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Rafał Michalski

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0001-Add-handling-of-single-contact-s-fields-handled-in-V.patch --]
[-- Type: text/x-patch, Size: 7785 bytes --]

From 09a00e743a8aa8f11b88f9fc440029970b030e04 Mon Sep 17 00:00:00 2001
From: Rafal Michalski <michalski.raf@gmail.com>
Date: Fri, 20 Aug 2010 09:00:33 +0200
Subject: [PATCH 1/2] Add handling of single contact's fields handled in VCARD structure

After pulling contacts these fields weren't present in downloaded
VCARD structure in spite of that these fields existed (not empty).

This patch adds handling of fields: BDAY, NICKNAME, URL, PHOTO
To solve this problem extending number of columns and queries of database
was needed especially. Displaying these fields is done by genaral
functions: vcard_printf_tag, vcard_printf_slash_tag.
Of course fields mentioned above were added to phonebook_contact structure
as char * type to save gained data.
---
 plugins/phonebook-tracker.c |   29 ++++++++++++++----
 plugins/vcard.c             |   68 +++++++++++++++++++++++++++++++++++++++++++
 plugins/vcard.h             |    4 ++
 3 files changed, 95 insertions(+), 6 deletions(-)

diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index 1109968..fd92125 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -43,16 +43,16 @@
 #define TRACKER_RESOURCES_INTERFACE "org.freedesktop.Tracker1.Resources"
 
 #define TRACKER_DEFAULT_CONTACT_ME "http://www.semanticdesktop.org/ontologies/2007/03/22/nco#default-contact-me"
-#define CONTACTS_ID_COL 21
-#define PULL_QUERY_COL_AMOUNT 22
+#define CONTACTS_ID_COL 25
+#define PULL_QUERY_COL_AMOUNT 26
 #define COL_HOME_NUMBER 0
 #define COL_HOME_EMAIL 7
 #define COL_WORK_NUMBER 8
 #define COL_FAX_NUMBER 16
 #define COL_WORK_EMAIL 17
-#define COL_DATE 18
-#define COL_SENT 19
-#define COL_ANSWERED 20
+#define COL_DATE 22
+#define COL_SENT 23
+#define COL_ANSWERED 24
 
 #define CONTACTS_QUERY_ALL						\
 	"SELECT ?v nco:fullname(?c) "					\
@@ -62,6 +62,8 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
+	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
+	"nco:photo(?c) "						\
 	"\"NOTACALL\" \"false\" \"false\" ?c "				\
 	"WHERE { "							\
 		"?c a nco:PersonContact . "				\
@@ -106,6 +108,8 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
+	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
+	"nco:photo(?c) "						\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -151,6 +155,8 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
+	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
+	"nco:photo(?c) "						\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -196,6 +202,8 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew)"	\
+	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
+	"nco:photo(?c) "						\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -239,6 +247,8 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f nco:emailAddress(?ew) "	\
+	"nco:birthDate(?c) nco:nickname(?c) nco:websiteUrl(?c) "	\
+	"nco:photo(?c) "						\
 	"nmo:receivedDate(?call) "					\
 	"nmo:isSent(?call) nmo:isAnswered(?call) ?c "			\
 	"WHERE { "							\
@@ -306,6 +316,8 @@
 	"nco:phoneNumber(?w) nco:pobox(?p) nco:extendedAddress(?p) "	\
 	"nco:streetAddress(?p) nco:locality(?p) nco:region(?p) "	\
 	"nco:postalcode(?p) nco:country(?p) ?f  nco:emailAddress(?ew)"	\
+	"nco:birthDate(<%s>) nco:nickname(<%s>) nco:websiteUrl(<%s>) "	\
+	"nco:photo(<%s>) "						\
 	"\"NOTACALL\" \"false\" \"false\" <%s> "			\
 	"WHERE { "							\
 		"<%s> a nco:Contact . "					\
@@ -774,6 +786,10 @@ add_entry:
 	contact->region = g_strdup(reply[13]);
 	contact->postal = g_strdup(reply[14]);
 	contact->country = g_strdup(reply[15]);
+	contact->birthday = g_strdup(reply[18]);
+	contact->nickname = g_strdup(reply[19]);
+	contact->website = g_strdup(reply[20]);
+	contact->photo = g_strdup(reply[21]);
 
 	set_call_type(contact, reply[COL_DATE], reply[COL_SENT],
 			reply[COL_ANSWERED]);
@@ -978,7 +994,8 @@ int phonebook_get_entry(const char *folder, const char *id,
 	data->vcardentry = TRUE;
 
 	query = g_strdup_printf(CONTACTS_QUERY_FROM_URI, id, id, id, id, id,
-						id, id, id, id, id, id, id);
+						id, id, id, id, id, id, id,
+						id, id, id, id);
 
 	ret = query_tracker(query, PULL_QUERY_COL_AMOUNT, pull_contacts, data);
 
diff --git a/plugins/vcard.c b/plugins/vcard.c
index 18b5952..05a8a13 100644
--- a/plugins/vcard.c
+++ b/plugins/vcard.c
@@ -256,6 +256,56 @@ static void vcard_printf_number(GString *vcards, uint8_t format,
 	vcard_printf(vcards, buf, number);
 }
 
+static void vcard_printf_tag(GString *vcards, const char *tag,
+					const char *category, const char *fld)
+{
+	char *separator = "", *type = "";
+	char buf[LEN_MAX];
+
+	if (tag == NULL || strlen(tag) == 0)
+		return;
+
+	if (fld == NULL || strlen(fld) == 0)
+		return;
+
+	if (category && strlen(category)) {
+		separator = ";";
+		type = "TYPE=";
+	} else {
+		category = "";
+	}
+
+	snprintf(buf, LEN_MAX, "%s%s%s%s", tag, separator, type, category);
+
+	vcard_printf(vcards, "%s:%s", buf, fld);
+}
+
+static void vcard_printf_slash_tag(GString *vcards, const char *tag,
+					const char *category, const char *fld)
+{
+	int len;
+	char *separator = "", *type = "";
+	char buf[LEN_MAX], field[LEN_MAX];
+
+	if (tag == NULL || strlen(tag) == 0)
+		return;
+
+	if (fld == NULL || (len = strlen(fld)) == 0)
+		return;
+
+	if (category && strlen(category)) {
+		separator = ";";
+		type = "TYPE=";
+	} else {
+		category = "";
+	}
+
+	snprintf(buf, LEN_MAX, "%s%s%s%s", tag, separator, type, category);
+
+	add_slash(field, fld, LEN_MAX, len);
+	vcard_printf(vcards, "%s:%s", buf, field);
+}
+
 static void vcard_printf_email(GString *vcards, const char *email)
 {
 	int len = 0;
@@ -354,6 +404,20 @@ void phonebook_add_contact(GString *vcards, struct phonebook_contact *contact,
 	if (filter & FILTER_ADR)
 		vcard_printf_adr(vcards, contact);
 
+	if (filter & FILTER_BDAY)
+		vcard_printf_tag(vcards, "BDAY", NULL, contact->birthday);
+
+	if (filter & FILTER_NICKNAME)
+		vcard_printf_slash_tag(vcards, "NICKNAME", NULL,
+							contact->nickname);
+
+	if (filter & FILTER_URL)
+		vcard_printf_slash_tag(vcards, "URL", "INTERNET",
+							contact->website);
+
+	if (filter & FILTER_PHOTO)
+		vcard_printf_tag(vcards, "PHOTO", NULL, contact->photo);
+
 	if (filter & FILTER_X_IRMC_CALL_DATETIME)
 		vcard_printf_datetime(vcards, contact);
 
@@ -392,6 +456,10 @@ void phonebook_contact_free(struct phonebook_contact *contact)
 	g_free(contact->region);
 	g_free(contact->postal);
 	g_free(contact->country);
+	g_free(contact->birthday);
+	g_free(contact->nickname);
+	g_free(contact->website);
+	g_free(contact->photo);
 	g_free(contact->datetime);
 	g_free(contact);
 }
diff --git a/plugins/vcard.h b/plugins/vcard.h
index fa571e4..a9809ea 100644
--- a/plugins/vcard.h
+++ b/plugins/vcard.h
@@ -55,6 +55,10 @@ struct phonebook_contact {
 	char *region;
 	char *postal;
 	char *country;
+	char *birthday;
+	char *nickname;
+	char *website;
+	char *photo;
 	char *datetime;
 	int calltype;
 };
-- 
1.6.3.3


^ permalink raw reply related

* Re: [PATCH 1/2] bluetooth: Add support Bluetooth controller of MacbookPro 6,2
From: Nobuhiro Iwamatsu @ 2010-08-20  7:24 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: linux-bluetooth, stable
In-Reply-To: <1282205470.23399.156.camel@localhost.localdomain>

Hi,

2010/8/19 Marcel Holtmann <marcel@holtmann.org>:
> Hi Nobuhiro.
>
>> Bluetooth controller of MacbookPro 6,2 does not work.
>> Because Device Class of these controllers was set 255 (Vendor Sepecific =
Class).
>>
>> Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
>
> it would be nice if you include the output from /proc/bus/usb/devices or
> usb-devices.sh script to proof the different device class.
>
Oh, sorry. I sent patch with infomation of USB device.

Best regards,
  Nobuhiro
--=20
Nobuhiro Iwamatsu
=A0=A0 iwamatsu at {nigauri.org / debian.org}
=A0=A0 GPG ID: 40AD1FA6

^ permalink raw reply

* [PATCH 2/2 v3] bluetooth: Add support Bluetooth controller of MacbookPro 7,1
From: Nobuhiro Iwamatsu @ 2010-08-20  7:24 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Nobuhiro Iwamatsu
In-Reply-To: <1282289047-21444-1-git-send-email-iwamatsu@nigauri.org>

Bluetooth controller of MacbookPro 7,1 does not work.
Because Device Class of these controllers was set 255 (Vendor Sepecific Class).

T:  Bus=04 Lev=02 Prnt=04 Port=00 Cnt=01 Dev#=  5 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=05ac ProdID=8213 Rev=01.86
S:  Manufacturer=Apple Inc.
S:  Product=Bluetooth USB Host Controller
S:  SerialNumber=5C5948C81B99
C:  #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I:  If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=00 Driver=(none)

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
 drivers/bluetooth/btusb.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 9fb8635..3da2ba2 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -59,6 +59,9 @@ static struct usb_device_id btusb_table[] = {
 	/* Generic Bluetooth USB device */
 	{ USB_DEVICE_INFO(0xe0, 0x01, 0x01) },
 
+	/* Apple MacBookPro 7,1 */
+	{ USB_DEVICE(0x05ac, 0x8213) },
+
 	/* Apple iMac11,1 */
 	{ USB_DEVICE(0x05ac, 0x8215) },
 
-- 
1.7.1


^ permalink raw reply related

* [PATCH 1/2 v3] bluetooth: Add support Bluetooth controller of MacbookPro 6,2
From: Nobuhiro Iwamatsu @ 2010-08-20  7:24 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Nobuhiro Iwamatsu

Bluetooth controller of MacbookPro 6,2 does not work.
Because Device Class of these controllers was set 255 (Vendor Sepecific Class).

T:  Bus=01 Lev=03 Prnt=03 Port=02 Cnt=03 Dev#=  8 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=05ac ProdID=8218 Rev=00.22
S:  Manufacturer=Apple Inc.
S:  Product=Bluetooth USB Host Controller
C:  #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
I:  If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=(none)
I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I:  If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
 drivers/bluetooth/btusb.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index d22ce3c..9fb8635 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -62,6 +62,9 @@ static struct usb_device_id btusb_table[] = {
 	/* Apple iMac11,1 */
 	{ USB_DEVICE(0x05ac, 0x8215) },
 
+	/* Apple MacBookPro6,2 */
+	{ USB_DEVICE(0x05ac, 0x8218) },
+
 	/* AVM BlueFRITZ! USB v2.0 */
 	{ USB_DEVICE(0x057c, 0x3800) },
 
-- 
1.7.1


^ permalink raw reply related

* PAN performance
From: Han @ 2010-08-20  3:57 UTC (permalink / raw)
  To: linux-bluetooth

Hi,
I have been using bluetooth PAN to run some personal programs. One
thing I noticed is that PAN seems to be very slow (i.e. not up to
3Mbps for BT 2.0). I have bluetooth 2.0 adapters on my laptops and I
do SSH over PAN.  Whenever I run a GUI application (on sshd server), i
see the GUI response is very slow.  It is not video or anything so I
don't think it needs up to 3Mbps. Is this slowness over PAN expected?

Thanks.
Han

^ permalink raw reply

* [PATCH v2] hciconfig: add LE_SET_ADVERTISE_ENABLE cmd
From: Anderson Briglia @ 2010-08-19 20:52 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Briglia

This patch implements two new hciconfig commands: leadv and noleadv.
These new hciconfig flags are responsible to LE_SET_ADVERTISE_ENABLE
command implementation.
---
 tools/hciconfig.c |   41 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index 87dd127..1e04193 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -149,6 +149,45 @@ static void cmd_scan(int ctl, int hdev, char *opt)
 	}
 }
 
+static void cmd_le_adv(int ctl, int hdev, char *opt)
+{
+	struct hci_request rq;
+	le_set_advertise_enable_cp advertise_cp;
+	uint8_t status, enable;
+	int dd, ret;
+
+	if (hdev < 0)
+		hdev = hci_get_route(NULL);
+
+	dd = hci_open_dev(hdev);
+	if (dd < 0) {
+		perror("Could not open device");
+		exit(1);
+	}
+
+	enable = 0x01;
+	if (!strcmp(opt, "noleadv"))
+		enable = 0x00;
+
+	memset(&advertise_cp, 0, sizeof(advertise_cp));
+	advertise_cp.enable = enable;
+
+	memset(&rq, 0, sizeof(rq));
+	rq.ogf = OGF_LE_CTL;
+	rq.ocf = OCF_LE_SET_ADVERTISE_ENABLE;
+	rq.cparam = &advertise_cp;
+	rq.clen = LE_SET_ADVERTISE_ENABLE_CP_SIZE;
+	rq.rparam = &status;
+	rq.rlen = 1;
+
+	ret = hci_send_req(dd, &rq, 100);
+	if (status || ret < 0)
+		fprintf(stderr, "Can't set advertise mode on hci%d: %s (%d)\n",
+						hdev, strerror(errno), errno);
+
+	hci_close_dev(dd);
+}
+
 static void cmd_iac(int ctl, int hdev, char *opt)
 {
 	int s = hci_open_dev(hdev);
@@ -1728,6 +1767,8 @@ static struct {
 	{ "revision",	cmd_revision,	0,		"Display revision information" },
 	{ "block",	cmd_block,	"<bdaddr>",	"Add a device to the blacklist" },
 	{ "unblock",	cmd_unblock,	"<bdaddr>",	"Remove a device from the blacklist" },
+	{ "leadv",	cmd_le_adv,	0,		"Enable LE advertising" },
+	{ "noleadv",	cmd_le_adv,	0,		"Disable LE advertising" },
 	{ NULL, NULL, 0 }
 };
 
-- 
1.7.0.4


^ permalink raw reply related

* Re: [PATCH] hciconfig: add LE_SET_ADVERTISE_ENABLE cmd
From: Anderson Briglia @ 2010-08-19 17:50 UTC (permalink / raw)
  To: Claudio Takahasi; +Cc: linux-bluetooth
In-Reply-To: <AANLkTinVA+hkzmnTGFEp-veWaEkjywq-Z9OLmqpihA=E@mail.gmail.com>

Thanks for reviewing. I'll update and send again.

On 08/19/2010 12:36 PM, Claudio Takahasi wrote:
> Hi Briglia,
>
> On Thu, Aug 19, 2010 at 12:43 PM, Anderson Briglia
> <anderson.briglia@openbossa.org>  wrote:
>    
>> This patch implements two new hciconfig commands: leadv and noleadv.
>> These new hciconfig flags are responsible to LE_SET_ADVERTISE_ENABLE
>> command implementation.
>> ---
>>   lib/hci.c         |    1 +
>>   lib/hci.h         |    1 +
>>   tools/hciconfig.c |   46 ++++++++++++++++++++++++++++++++++++++++++++++
>>   3 files changed, 48 insertions(+), 0 deletions(-)
>>
>> diff --git a/lib/hci.c b/lib/hci.c
>> index 3304daa..64ac5f2 100644
>> --- a/lib/hci.c
>> +++ b/lib/hci.c
>> @@ -188,6 +188,7 @@ static hci_map dev_flags_map[] = {
>>         { "INQUIRY", HCI_INQUIRY },
>>         { "AUTH",    HCI_AUTH    },
>>         { "ENCRYPT", HCI_ENCRYPT },
>> +       { "LEADV",   HCI_LE_ADV  },
>>         { NULL }
>>   };
>>
>> diff --git a/lib/hci.h b/lib/hci.h
>> index 512dab9..8b9d33f 100644
>> --- a/lib/hci.h
>> +++ b/lib/hci.h
>> @@ -73,6 +73,7 @@ enum {
>>         HCI_INQUIRY,
>>
>>         HCI_RAW,
>> +       HCI_LE_ADV,
>>   };
>>      
> I prefer this small change in another commit, it needs your previous
> kernel patch to work/test properly.
>
>    
>>   /* HCI ioctl defines */
>> diff --git a/tools/hciconfig.c b/tools/hciconfig.c
>> index 87dd127..ba12a8a 100644
>> --- a/tools/hciconfig.c
>> +++ b/tools/hciconfig.c
>> @@ -149,6 +149,50 @@ static void cmd_scan(int ctl, int hdev, char *opt)
>>         }
>>   }
>>
>> +static void cmd_le_adv(int ctl, int hdev, char *opt)
>> +{
>> +
>>      
> No empty line here!
>
>    
>> +       struct hci_request rq;
>> +       le_set_advertise_enable_cp advertise_cp;
>> +       uint8_t status;
>> +       uint8_t enable;
>>      
> "enable" can be declared in the same line of "status"
>
>    
>> +       int dd, ret;
>> +
>> +       if (hdev<  0)
>> +               hdev = hci_get_route(NULL);
>> +
>> +       dd = hci_open_dev(hdev);
>> +       if (dd<  0) {
>> +               perror("Could not open device");
>> +               exit(1);
>> +       }
>> +
>> +       enable = 0x01;
>> +       if (!strcmp(opt, "noleadv"))
>> +               enable = 0x00;
>> +
>> +       memset(&advertise_cp, 0, sizeof(advertise_cp));
>> +       advertise_cp.enable = enable;
>> +
>> +       memset(&rq, 0, sizeof(rq));
>> +       rq.ogf = OGF_LE_CTL;
>> +       rq.ocf = OCF_LE_SET_ADVERTISE_ENABLE;
>> +       rq.cparam =&advertise_cp;
>> +       rq.clen = LE_SET_ADVERTISE_ENABLE_CP_SIZE;
>> +       rq.rparam =&status;
>> +       rq.rlen = 1;
>> +
>> +       ret = hci_send_req(dd,&rq, 100);
>> +
>>      
> No empty line here.
>    
>> +       if (status || ret<  0) {
>> +               errno = EIO;
>>      
> No need to set errno. hci_send_req sets errno when needed.
>
> Claudio
>
>    
>> +               fprintf(stderr, "Can't set advertise mode on hci%d: %s (%d)\n",
>> +                                               hdev, strerror(errno), errno);
>> +       }
>> +
>> +       hci_close_dev(dd);
>> +}
>> +
>>   static void cmd_iac(int ctl, int hdev, char *opt)
>>   {
>>         int s = hci_open_dev(hdev);
>> @@ -1728,6 +1772,8 @@ static struct {
>>         { "revision",   cmd_revision,   0,              "Display revision information" },
>>         { "block",      cmd_block,      "<bdaddr>",     "Add a device to the blacklist" },
>>         { "unblock",    cmd_unblock,    "<bdaddr>",     "Remove a device from the blacklist" },
>> +       { "leadv",      cmd_le_adv,     0,              "Enable LE advertising" },
>> +       { "noleadv",    cmd_le_adv,     0,              "Disable LE advertising" },
>>         { NULL, NULL, 0 }
>>   };
>>
>> --
>> 1.7.0.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>      


^ permalink raw reply

* Re: [PATCH] hciconfig: add LE_SET_ADVERTISE_ENABLE cmd
From: Claudio Takahasi @ 2010-08-19 16:36 UTC (permalink / raw)
  To: Anderson Briglia; +Cc: linux-bluetooth
In-Reply-To: <1282232587-14551-1-git-send-email-anderson.briglia@openbossa.org>

Hi Briglia,

On Thu, Aug 19, 2010 at 12:43 PM, Anderson Briglia
<anderson.briglia@openbossa.org> wrote:
> This patch implements two new hciconfig commands: leadv and noleadv.
> These new hciconfig flags are responsible to LE_SET_ADVERTISE_ENABLE
> command implementation.
> ---
>  lib/hci.c         |    1 +
>  lib/hci.h         |    1 +
>  tools/hciconfig.c |   46 ++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 48 insertions(+), 0 deletions(-)
>
> diff --git a/lib/hci.c b/lib/hci.c
> index 3304daa..64ac5f2 100644
> --- a/lib/hci.c
> +++ b/lib/hci.c
> @@ -188,6 +188,7 @@ static hci_map dev_flags_map[] = {
>        { "INQUIRY", HCI_INQUIRY },
>        { "AUTH",    HCI_AUTH    },
>        { "ENCRYPT", HCI_ENCRYPT },
> +       { "LEADV",   HCI_LE_ADV  },
>        { NULL }
>  };
>
> diff --git a/lib/hci.h b/lib/hci.h
> index 512dab9..8b9d33f 100644
> --- a/lib/hci.h
> +++ b/lib/hci.h
> @@ -73,6 +73,7 @@ enum {
>        HCI_INQUIRY,
>
>        HCI_RAW,
> +       HCI_LE_ADV,
>  };
I prefer this small change in another commit, it needs your previous
kernel patch to work/test properly.

>
>  /* HCI ioctl defines */
> diff --git a/tools/hciconfig.c b/tools/hciconfig.c
> index 87dd127..ba12a8a 100644
> --- a/tools/hciconfig.c
> +++ b/tools/hciconfig.c
> @@ -149,6 +149,50 @@ static void cmd_scan(int ctl, int hdev, char *opt)
>        }
>  }
>
> +static void cmd_le_adv(int ctl, int hdev, char *opt)
> +{
> +
No empty line here!

> +       struct hci_request rq;
> +       le_set_advertise_enable_cp advertise_cp;
> +       uint8_t status;
> +       uint8_t enable;
"enable" can be declared in the same line of "status"

> +       int dd, ret;
> +
> +       if (hdev < 0)
> +               hdev = hci_get_route(NULL);
> +
> +       dd = hci_open_dev(hdev);
> +       if (dd < 0) {
> +               perror("Could not open device");
> +               exit(1);
> +       }
> +
> +       enable = 0x01;
> +       if (!strcmp(opt, "noleadv"))
> +               enable = 0x00;
> +
> +       memset(&advertise_cp, 0, sizeof(advertise_cp));
> +       advertise_cp.enable = enable;
> +
> +       memset(&rq, 0, sizeof(rq));
> +       rq.ogf = OGF_LE_CTL;
> +       rq.ocf = OCF_LE_SET_ADVERTISE_ENABLE;
> +       rq.cparam = &advertise_cp;
> +       rq.clen = LE_SET_ADVERTISE_ENABLE_CP_SIZE;
> +       rq.rparam = &status;
> +       rq.rlen = 1;
> +
> +       ret = hci_send_req(dd, &rq, 100);
> +
No empty line here.
> +       if (status || ret < 0) {
> +               errno = EIO;
No need to set errno. hci_send_req sets errno when needed.

Claudio

> +               fprintf(stderr, "Can't set advertise mode on hci%d: %s (%d)\n",
> +                                               hdev, strerror(errno), errno);
> +       }
> +
> +       hci_close_dev(dd);
> +}
> +
>  static void cmd_iac(int ctl, int hdev, char *opt)
>  {
>        int s = hci_open_dev(hdev);
> @@ -1728,6 +1772,8 @@ static struct {
>        { "revision",   cmd_revision,   0,              "Display revision information" },
>        { "block",      cmd_block,      "<bdaddr>",     "Add a device to the blacklist" },
>        { "unblock",    cmd_unblock,    "<bdaddr>",     "Remove a device from the blacklist" },
> +       { "leadv",      cmd_le_adv,     0,              "Enable LE advertising" },
> +       { "noleadv",    cmd_le_adv,     0,              "Disable LE advertising" },
>        { NULL, NULL, 0 }
>  };
>
> --
> 1.7.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply

* [PATCH] hciconfig: add LE_SET_ADVERTISE_ENABLE cmd
From: Anderson Briglia @ 2010-08-19 15:43 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Briglia

This patch implements two new hciconfig commands: leadv and noleadv.
These new hciconfig flags are responsible to LE_SET_ADVERTISE_ENABLE
command implementation.
---
 lib/hci.c         |    1 +
 lib/hci.h         |    1 +
 tools/hciconfig.c |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/lib/hci.c b/lib/hci.c
index 3304daa..64ac5f2 100644
--- a/lib/hci.c
+++ b/lib/hci.c
@@ -188,6 +188,7 @@ static hci_map dev_flags_map[] = {
 	{ "INQUIRY", HCI_INQUIRY },
 	{ "AUTH",    HCI_AUTH    },
 	{ "ENCRYPT", HCI_ENCRYPT },
+	{ "LEADV",   HCI_LE_ADV	 },
 	{ NULL }
 };
 
diff --git a/lib/hci.h b/lib/hci.h
index 512dab9..8b9d33f 100644
--- a/lib/hci.h
+++ b/lib/hci.h
@@ -73,6 +73,7 @@ enum {
 	HCI_INQUIRY,
 
 	HCI_RAW,
+	HCI_LE_ADV,
 };
 
 /* HCI ioctl defines */
diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index 87dd127..ba12a8a 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -149,6 +149,50 @@ static void cmd_scan(int ctl, int hdev, char *opt)
 	}
 }
 
+static void cmd_le_adv(int ctl, int hdev, char *opt)
+{
+
+	struct hci_request rq;
+	le_set_advertise_enable_cp advertise_cp;
+	uint8_t status;
+	uint8_t enable;
+	int dd, ret;
+
+	if (hdev < 0)
+		hdev = hci_get_route(NULL);
+
+	dd = hci_open_dev(hdev);
+	if (dd < 0) {
+		perror("Could not open device");
+		exit(1);
+	}
+
+	enable = 0x01;
+	if (!strcmp(opt, "noleadv"))
+		enable = 0x00;
+
+	memset(&advertise_cp, 0, sizeof(advertise_cp));
+	advertise_cp.enable = enable;
+
+	memset(&rq, 0, sizeof(rq));
+	rq.ogf = OGF_LE_CTL;
+	rq.ocf = OCF_LE_SET_ADVERTISE_ENABLE;
+	rq.cparam = &advertise_cp;
+	rq.clen = LE_SET_ADVERTISE_ENABLE_CP_SIZE;
+	rq.rparam = &status;
+	rq.rlen = 1;
+
+	ret = hci_send_req(dd, &rq, 100);
+
+	if (status || ret < 0) {
+		errno = EIO;
+		fprintf(stderr, "Can't set advertise mode on hci%d: %s (%d)\n",
+						hdev, strerror(errno), errno);
+	}
+
+	hci_close_dev(dd);
+}
+
 static void cmd_iac(int ctl, int hdev, char *opt)
 {
 	int s = hci_open_dev(hdev);
@@ -1728,6 +1772,8 @@ static struct {
 	{ "revision",	cmd_revision,	0,		"Display revision information" },
 	{ "block",	cmd_block,	"<bdaddr>",	"Add a device to the blacklist" },
 	{ "unblock",	cmd_unblock,	"<bdaddr>",	"Remove a device from the blacklist" },
+	{ "leadv",	cmd_le_adv,	0,		"Enable LE advertising" },
+	{ "noleadv",	cmd_le_adv,	0,		"Disable LE advertising" },
 	{ NULL, NULL, 0 }
 };
 
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH v2] Bluetooth: Implement LE Set Advertise Enable cmd
From: Anderson Briglia @ 2010-08-19 15:42 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Briglia

This patch implements LE Set Advertise Enable command for dual mode and
Low Energy hci controllers. It also adds new HCI flags in order to
indicate the Advertising state for userland applications and kernel
itself.

Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org>
---
 include/net/bluetooth/hci.h |    6 ++++++
 net/bluetooth/hci_event.c   |   27 +++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index bcbdd6d..cae1816 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -76,6 +76,7 @@ enum {
 	HCI_INQUIRY,
 
 	HCI_RAW,
+	HCI_LE_ADV,
 };
 
 /* HCI ioctl defines */
@@ -593,6 +594,11 @@ struct hci_rp_read_bd_addr {
 	bdaddr_t bdaddr;
 } __packed;
 
+/* --- HCI LE Commands --- */
+#define HCI_OP_LE_SET_ADVERTISE_ENABLE	0x200a
+	#define ADVERTISE_ENABLED	0x01
+	#define ADVERTISE_DISABLED	0x00
+
 /* ---- HCI Events ---- */
 #define HCI_EV_INQUIRY_COMPLETE		0x01
 
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index bfef5ba..c86c655 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -822,6 +822,29 @@ static void hci_cs_exit_sniff_mode(struct hci_dev *hdev, __u8 status)
 	hci_dev_unlock(hdev);
 }
 
+static void hci_cc_le_set_advertise(struct hci_dev *hdev, struct sk_buff *skb)
+{
+	__u8 status = *((__u8 *) skb->data);
+	void *sent;
+
+	BT_DBG("%s status 0x%x", hdev->name, status);
+
+	sent = hci_sent_cmd_data(hdev, HCI_OP_LE_SET_ADVERTISE_ENABLE);
+	if (!sent)
+		return;
+
+	if (!status) {
+		__u8 param = *((__u8 *) sent);
+
+		clear_bit(HCI_LE_ADV, &hdev->flags);
+
+		if (param & ADVERTISE_ENABLED)
+			set_bit(HCI_LE_ADV, &hdev->flags);
+	}
+
+	hci_req_complete(hdev, status);
+}
+
 static inline void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
 {
 	__u8 status = *((__u8 *) skb->data);
@@ -1310,6 +1333,10 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *sk
 		hci_cc_read_bd_addr(hdev, skb);
 		break;
 
+	case HCI_OP_LE_SET_ADVERTISE_ENABLE:
+		hci_cc_le_set_advertise(hdev, skb);
+		break;
+
 	default:
 		BT_DBG("%s opcode 0x%x", hdev->name, opcode);
 		break;
-- 
1.7.0.4


^ permalink raw reply related

* Re: [PATCH] IrMC sync server support
From: Johan Hedberg @ 2010-08-19 15:02 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: Marcel J.E. Mol, Marcel Holtmann, linux-bluetooth
In-Reply-To: <AANLkTinD_KNBBpxwXZ8gB5p2o+NA_ThfbmspXe-5NGEc@mail.gmail.com>

Hi,

On Thu, Aug 19, 2010, Luiz Augusto von Dentz wrote:
> We decided to use 14, also Johan pushed a complete list of bluez
> assigned number to:
> 
> http://git.kernel.org/?p=bluetooth/bluez.git;a=commitdiff;h=fbeff4fd303b43fa7f6c27e95fb6f023e80720a9;hp=0627552640140e1d986d36bb4770ccc4b3206b03
> 
> Could you please update your changes to use 14? Also there seems to be
> some white spaces that doesn't follow our code styling, could you
> please fix those?

Since Luiz didn't send an update here about the status I'll do it to
avoid duplicate work at your end. Luiz went ahead and did the cleanups
himself (and I added a few more on top of that) and the resulting patch
is now pushed upstream. Btw, it'd proabably be a good idea for you to
hang out on the #obexd channel on freenode since that's where many of
these quick interactions and decisions seem to be happening now days.

Johan

^ permalink raw reply

* [PATCH 8/8] btio: Remove libbluetooth dependence for obexd
From: Zhenhua Zhang @ 2010-08-19 14:21 UTC (permalink / raw)
  To: linux-bluetooth
In-Reply-To: <1282227676-15381-1-git-send-email-zhenhua.zhang@intel.com>

Remove libbluetooth dependence for obex server daemon. obex-test and
obex-client still require libbluetooth because of sdp related
dependence.
---
 Makefile.am |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index f77fa27..05755a8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -75,7 +75,7 @@ src_obexd_SOURCES = $(gdbus_sources) $(builtin_sources) $(btio_sources) \
 
 src_obexd_LDADD = @DBUS_LIBS@ @GLIB_LIBS@ @GTHREAD_LIBS@ \
 					@EBOOK_LIBS@ @OPENOBEX_LIBS@ \
-					@BLUEZ_LIBS@ @LIBICAL_LIBS@ -ldl
+					@LIBICAL_LIBS@ -ldl
 
 src_obexd_LDFLAGS = -Wl,--export-dynamic
 
-- 
1.7.0.4


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox