* why scan_disable during hciops_power_off
From: Pavan Savoy @ 2011-01-25 13:12 UTC (permalink / raw)
To: linux-bluetooth
when hciops gets a set_powered with powered=0, then hciops_power_off is called.
However in here we write the SCAN_ENABLE (=0) to the device and then
do the HCIDEVDOWN...
so couple of questions,
1. are there controllers there which even after doing hci0 down,
allows other devices to be scanned?
for those what do hci0 down mean ? radio not switched off ?
2. what happens to the response? in case hci0 down is considered as
say close of UART?
There is a case I have a combo chip, and I need to keep UART opened,
because someone else is using the UART, and then
I do this power_off, the hci0 interface is down, and bluetooth just
dumps down the scan_disable and quits, but the response
which comes from the device has no takers....
so shouldn't hciops use a hci_send_req before HCIDEVDOWN ?
regards,
Pavan
^ permalink raw reply
* [PATCHv2] Bluetooth: flushable packet supports headers
From: Emeltchenko Andrei @ 2011-01-25 9:45 UTC (permalink / raw)
To: linux-bluetooth
From: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Modify headers to enable support for flushable packets. Following
commit: 8bcbd526c84724d8de087130d53e79da256e34bf to linux kernel
implements functionality on kernel side.
---
lib/bluetooth.h | 5 +++++
lib/hci.h | 1 +
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/bluetooth.h b/lib/bluetooth.h
index a0486c7..bc0921e 100644
--- a/lib/bluetooth.h
+++ b/lib/bluetooth.h
@@ -70,6 +70,11 @@ struct bt_security {
#define BT_DEFER_SETUP 7
+#define BT_FLUSHABLE 8
+
+#define BT_FLUSHABLE_OFF 0
+#define BT_FLUSHABLE_ON 1
+
/* Connection and socket states */
enum {
BT_CONNECTED = 1, /* Equal to TCP_ESTABLISHED to make net code happy */
diff --git a/lib/hci.h b/lib/hci.h
index 0cb120f..9b5388b 100644
--- a/lib/hci.h
+++ b/lib/hci.h
@@ -196,6 +196,7 @@ enum {
#define HCI_HOST_BUSY_PAIRING 0x38
/* ACL flags */
+#define ACL_START_NO_FLUSH 0x00
#define ACL_CONT 0x01
#define ACL_START 0x02
#define ACL_ACTIVE_BCAST 0x04
--
1.7.1
^ permalink raw reply related
* [PATCH] Bluetooth: flushable packet supports headers
From: Emeltchenko Andrei @ 2011-01-25 9:36 UTC (permalink / raw)
To: linux-bluetooth
From: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Modify headers to enable support for flushable packets. Following
commit: 8bcbd526c84724d8de087130d53e79da256e34bf to linux kernel
implements functionality on kernel side.
---
lib/bluetooth.h | 5 +++++
lib/hci.h | 3 ++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/lib/bluetooth.h b/lib/bluetooth.h
index a0486c7..bc0921e 100644
--- a/lib/bluetooth.h
+++ b/lib/bluetooth.h
@@ -70,6 +70,11 @@ struct bt_security {
#define BT_DEFER_SETUP 7
+#define BT_FLUSHABLE 8
+
+#define BT_FLUSHABLE_OFF 0
+#define BT_FLUSHABLE_ON 1
+
/* Connection and socket states */
enum {
BT_CONNECTED = 1, /* Equal to TCP_ESTABLISHED to make net code happy */
diff --git a/lib/hci.h b/lib/hci.h
index 0cb120f..d8d62b0 100644
--- a/lib/hci.h
+++ b/lib/hci.h
@@ -196,6 +196,7 @@ enum {
#define HCI_HOST_BUSY_PAIRING 0x38
/* ACL flags */
+#define ACL_START_NO_FLUSH 0x00
#define ACL_CONT 0x01
#define ACL_START 0x02
#define ACL_ACTIVE_BCAST 0x04
@@ -261,7 +262,7 @@ enum {
#define LMP_SIMPLE_PAIR 0x08
#define LMP_ENCAPS_PDU 0x10
#define LMP_ERR_DAT_REP 0x20
-#define LMP_NFLUSH_PKTS 0x40
+#define LMP_NO_FLUSH 0x40
#define LMP_LSTO 0x01
#define LMP_INQ_TX_PWR 0x02
--
1.7.1
^ permalink raw reply related
* [PATCH 10/11 v2] Bluetooth: Implement UUID handling through the management interface
From: johan.hedberg @ 2011-01-25 9:12 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1294135732-26765-10-git-send-email-johan.hedberg@gmail.com>
From: Johan Hedberg <johan.hedberg@nokia.com>
This patch adds methods to the management interface for userspace to
notify the kernel of which services have been registered for specific
adapters. This information is needed for setting the appropriate Class
of Device value as well as the Extended Inquiry Response value. This
patch doesn't actually implement setting of these values but just
provides the storage of the UUIDs so the needed functionality can be
built on top of it.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
---
v2: Fix compiler warning due to potentially uninitialized variable.
include/net/bluetooth/hci_core.h | 10 +++
include/net/bluetooth/mgmt.h | 12 ++++
net/bluetooth/hci_core.c | 19 ++++++
net/bluetooth/mgmt.c | 120 ++++++++++++++++++++++++++++++++++++++
4 files changed, 161 insertions(+), 0 deletions(-)
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index ba3dbe3..8ee0b8b 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -66,6 +66,12 @@ struct bdaddr_list {
struct list_head list;
bdaddr_t bdaddr;
};
+
+struct bt_uuid {
+ struct list_head list;
+ u8 uuid[16];
+};
+
#define NUM_REASSEMBLY 4
struct hci_dev {
struct list_head list;
@@ -139,6 +145,8 @@ struct hci_dev {
struct hci_conn_hash conn_hash;
struct list_head blacklist;
+ struct list_head uuids;
+
struct hci_dev_stats stat;
struct sk_buff_head driver_init;
@@ -441,6 +449,8 @@ int hci_inquiry(void __user *arg);
struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr);
int hci_blacklist_clear(struct hci_dev *hdev);
+int hci_uuids_clear(struct hci_dev *hdev);
+
void hci_del_off_timer(struct hci_dev *hdev);
void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index a554802..c118ad3 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -72,6 +72,18 @@ struct mgmt_mode {
#define MGMT_OP_SET_PAIRABLE 0x0008
+#define MGMT_OP_ADD_UUID 0x0009
+struct mgmt_cp_add_uuid {
+ __le16 index;
+ __u8 uuid[16];
+} __packed;
+
+#define MGMT_OP_REMOVE_UUID 0x000A
+struct mgmt_cp_remove_uuid {
+ __le16 index;
+ __u8 uuid[16];
+} __packed;
+
#define MGMT_EV_CMD_COMPLETE 0x0001
struct mgmt_ev_cmd_complete {
__le16 opcode;
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 13eb5a8..b99248d 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -955,6 +955,22 @@ void hci_del_off_timer(struct hci_dev *hdev)
del_timer(&hdev->off_timer);
}
+int hci_uuids_clear(struct hci_dev *hdev)
+{
+ struct list_head *p, *n;
+
+ list_for_each_safe(p, n, &hdev->uuids) {
+ struct bt_uuid *uuid;
+
+ uuid = list_entry(p, struct bt_uuid, list);
+
+ list_del(p);
+ kfree(uuid);
+ }
+
+ return 0;
+}
+
/* Register HCI device */
int hci_register_dev(struct hci_dev *hdev)
{
@@ -1012,6 +1028,8 @@ int hci_register_dev(struct hci_dev *hdev)
INIT_LIST_HEAD(&hdev->blacklist);
+ INIT_LIST_HEAD(&hdev->uuids);
+
INIT_WORK(&hdev->power_on, hci_power_on);
INIT_WORK(&hdev->power_off, hci_power_off);
setup_timer(&hdev->off_timer, hci_auto_off, (unsigned long) hdev);
@@ -1087,6 +1105,7 @@ int hci_unregister_dev(struct hci_dev *hdev)
hci_dev_lock_bh(hdev);
hci_blacklist_clear(hdev);
+ hci_uuids_clear(hdev);
hci_dev_unlock_bh(hdev);
__hci_dev_put(hdev);
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index d107350..0854c2f 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -571,6 +571,120 @@ failed:
return err;
}
+static int uuid_rsp(struct sock *sk, u16 opcode, u16 index)
+{
+ struct mgmt_hdr *hdr;
+ struct mgmt_ev_cmd_complete *ev;
+ struct sk_buff *skb;
+
+ skb = alloc_skb(sizeof(*hdr) + sizeof(*ev) + sizeof(index), GFP_ATOMIC);
+ if (!skb)
+ return -ENOMEM;
+
+ hdr = (void *) skb_put(skb, sizeof(*hdr));
+ hdr->opcode = cpu_to_le16(MGMT_EV_CMD_COMPLETE);
+ hdr->len = cpu_to_le16(sizeof(*ev) + sizeof(index));
+
+ ev = (void *) skb_put(skb, sizeof(*ev));
+ put_unaligned_le16(opcode, &ev->opcode);
+
+ put_unaligned_le16(index, skb_put(skb, sizeof(index)));
+
+ if (sock_queue_rcv_skb(sk, skb) < 0)
+ kfree_skb(skb);
+
+ return 0;
+}
+
+static int add_uuid(struct sock *sk, unsigned char *data, u16 len)
+{
+ struct mgmt_cp_add_uuid *cp;
+ struct hci_dev *hdev;
+ struct bt_uuid *uuid;
+ u16 dev_id;
+ int err;
+
+ cp = (void *) data;
+ dev_id = get_unaligned_le16(&cp->index);
+
+ BT_DBG("request for hci%u", dev_id);
+
+ hdev = hci_dev_get(dev_id);
+ if (!hdev)
+ return cmd_status(sk, MGMT_OP_ADD_UUID, ENODEV);
+
+ hci_dev_lock_bh(hdev);
+
+ uuid = kmalloc(sizeof(*uuid), GFP_ATOMIC);
+ if (!uuid) {
+ err = -ENOMEM;
+ goto failed;
+ }
+
+ memcpy(uuid->uuid, cp->uuid, 16);
+
+ list_add(&uuid->list, &hdev->uuids);
+
+ err = uuid_rsp(sk, MGMT_OP_ADD_UUID, dev_id);
+
+failed:
+ hci_dev_unlock_bh(hdev);
+ hci_dev_put(hdev);
+
+ return err;
+}
+
+static int remove_uuid(struct sock *sk, unsigned char *data, u16 len)
+{
+ struct list_head *p, *n;
+ struct mgmt_cp_add_uuid *cp;
+ struct hci_dev *hdev;
+ u8 bt_uuid_any[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ u16 dev_id;
+ int err, found;
+
+ cp = (void *) data;
+ dev_id = get_unaligned_le16(&cp->index);
+
+ BT_DBG("request for hci%u", dev_id);
+
+ hdev = hci_dev_get(dev_id);
+ if (!hdev)
+ return cmd_status(sk, MGMT_OP_REMOVE_UUID, ENODEV);
+
+ hci_dev_lock_bh(hdev);
+
+ if (memcmp(cp->uuid, bt_uuid_any, 16) == 0) {
+ err = hci_uuids_clear(hdev);
+ goto unlock;
+ }
+
+ found = 0;
+
+ list_for_each_safe(p, n, &hdev->uuids) {
+ struct bt_uuid *match = list_entry(p, struct bt_uuid, list);
+
+ if (memcmp(match->uuid, cp->uuid, 16) != 0)
+ continue;
+
+ list_del(&match->list);
+ found++;
+ }
+
+ if (found == 0) {
+ err = cmd_status(sk, MGMT_OP_REMOVE_UUID, ENOENT);
+ goto unlock;
+ }
+
+ err = uuid_rsp(sk, MGMT_OP_REMOVE_UUID, dev_id);
+
+unlock:
+ hci_dev_unlock_bh(hdev);
+ hci_dev_put(hdev);
+
+ return err;
+}
+
int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen)
{
unsigned char *buf;
@@ -623,6 +737,12 @@ int mgmt_control(struct sock *sk, struct msghdr *msg, size_t msglen)
case MGMT_OP_SET_PAIRABLE:
err = set_pairable(sk, buf + sizeof(*hdr), len);
break;
+ case MGMT_OP_ADD_UUID:
+ err = add_uuid(sk, buf + sizeof(*hdr), len);
+ break;
+ case MGMT_OP_REMOVE_UUID:
+ err = remove_uuid(sk, buf + sizeof(*hdr), len);
+ break;
default:
BT_DBG("Unknown op %u", opcode);
err = cmd_status(sk, opcode, 0x01);
--
1.7.2.3
^ permalink raw reply related
* Re: LE Kernel (bluetooth-le-2.6) and LE Security Manager
From: Luiz Augusto von Dentz @ 2011-01-25 8:35 UTC (permalink / raw)
To: Vinicius Costa Gomes; +Cc: Brian Gix, linux-bluetooth
In-Reply-To: <20110124213429.GA15121@piper>
Hi Vinicius,
On Mon, Jan 24, 2011 at 11:34 PM, Vinicius Costa Gomes
<vinicius.gomes@openbossa.org> wrote:
> Hi Brian,
>
> On 11:03 Mon 24 Jan, Brian Gix wrote:
>> Hi Vinicius,
>>
>> I am sorry that it has taken so long to test the snapshot that you
>> placed on gitorious, but I have now done so.
>>
>> On Fri, 2010-12-03 at 19:05 -0300, Vinicius Costa Gomes wrote:
>> > Hi Brian,
>> >
>> > On 11:11 Fri 03 Dec, Brian Gix wrote:
>> > >
>> > > Hi Claudio, Johan & All,
>> > >
>> > > Is this LE capable kernel that Ville is working on, the development stream
>> > > for the LE Security Manager? And if so, is it in a partial fleshed out
>> > > state?
>> >
>> > There is a simple implementation of SMP here[1] on my "devel" branch. I am
>> > cleaning it up for sending it for review.
>> >
>> > If you want to help, have any comments or just want to tell us what you are
>> > working on, please drop by #bluez on freenode, or send an email.
>>
>> I have been able to verify that the Just Works negotiation of the Short
>> Term Key does work against an independent implementation of the LE
>> Security Manager, as long as I have requested no MITM protection. I
>> have the following comments:
>>
>> 1. You currently reject security if I *do* request MITM protection.
>> This should not be done. The correct functionality should be to
>> continue the negotiation. Even though I requested MITM, it will be
>> clear to both sides that JUST_WORKS methodology has been used, and so
>> when the Keys are generated and exchanged, both sides will indicate in
>> their Key Database that they are no-MITM keys. If I then actually
>> *needed* MITM protection, then whatever functionality requiring that
>> level of security will fail with an insufficient security error code.
>> However, security should *never* be rejected unless there is a
>> fundamental incompatibility such as no level of security actually
>> supported. This is the only functionality that I found to be actually
>> incorrect.
>>
>
> I was assuming that the meaning of setting the MITM protection bit, was that
> it was *requiring* MITM protection, and when that couldn't be fulfilled the
> Pairing Request should be rejected.
>
> So my assumption was incorrect, going to fix it soon.
Well the spec says it is a requirement:
"If the STK generation method does not result in an STK that provides
sufficient security properties then the device shall send the Pairing
Failed command with the error code “Authentication Requirements”" -
2.3.5.1 Selecting STK Generation Method - Page 608
In my interpretation this is exactly what should happen when MITM is
set but there is no way to generate an authenticated key as Table 2.4:
Mapping of IO Capabilities to STK Generation Method suggest, in other
words if one of sides has NoInputNoOutput and MITM is set we should
return "Authentication Requirements" error.
--
Luiz Augusto von Dentz
Computer Engineer
^ permalink raw reply
* BCM2045A firmware loader
From: Oleg Kravchenko @ 2011-01-25 8:34 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <4765B7BC10CB4C488A56C73E15D6FBA31DA579F20A@EXDCVYMBSTM005.EQ1STM.local>
Hello!
Who can give datasheet about chip BCM2045A?
*specs, datasheets, ...
I want to write firmware loader for this chip :)
> S: Manufacturer=Broadcom Corp
> S: Product=BCM2045A
> P: Vendor=0a5c ProdID=2045 Rev= 1.12
^ permalink raw reply
* RE: [PATCH 4/4] HCI command to clear LE White List
From: Sumit Kumar BAJPAI @ 2011-01-25 5:21 UTC (permalink / raw)
To: linux-bluetooth@vger.kernel.org
> -----Original Message-----
> From: Sumit Kumar BAJPAI
> Sent: Monday, January 24, 2011 3:30 PM
> To: linux-bluetooth@vger.kernel.org
> Subject: [PATCH 4/4] HCI command to clear LE White List
>
> ---
> lib/hci.c | 22 ++++++++++++++++++++++
> lib/hci_lib.h | 1 +
> tools/hcitool.c | 42 ++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 65 insertions(+), 0 deletions(-)
>
> diff --git a/lib/hci.c b/lib/hci.c
> index ec8d48e..71a96ea 100755
> --- a/lib/hci.c
> +++ b/lib/hci.c
> @@ -1377,6 +1377,28 @@ int hci_le_read_white_list_size(int dd, int*
> size)
> return 0;
> }
>
> +int hci_le_clear_white_list(int dd)
> +{
> + struct hci_request rq;
> + uint8_t status;
> +
> + memset(&rq, 0, sizeof(rq));
> + rq.ogf = OGF_LE_CTL;
> + rq.ocf = OCF_LE_CLEAR_WHITE_LIST;
> + rq.rparam = &status;
> + rq.rlen = 1;
> +
> + if (hci_send_req(dd, &rq, 1000) < 0)
> + return -1;
> +
> + if (status) {
> + errno = EIO;
> + return -1;
> + }
> +
> + return 0;
> +}
> +
> int hci_read_local_name(int dd, int len, char *name, int to)
> {
> read_local_name_rp rp;
> diff --git a/lib/hci_lib.h b/lib/hci_lib.h
> index f0325b2..718e8a6 100755
> --- a/lib/hci_lib.h
> +++ b/lib/hci_lib.h
> @@ -130,6 +130,7 @@ int hci_le_create_conn(int dd, uint16_t interval,
> uint16_t window,
> int hci_le_add_to_white_list(int dd, const bdaddr_t* bdaddr, uint8_t
> type);
> int hci_le_remove_from_white_list(int dd, const bdaddr_t* bdaddr,
> uint8_t type);
> int hci_le_read_white_list_size(int dd, int* size);
> +int hci_le_clear_white_list(int dd);
>
> int hci_for_each_dev(int flag, int(*func)(int dd, int dev_id, long
> arg), long arg);
> int hci_get_route(bdaddr_t *bdaddr);
> diff --git a/tools/hcitool.c b/tools/hcitool.c
> index e80c7a3..f29bb47 100755
> --- a/tools/hcitool.c
> +++ b/tools/hcitool.c
> @@ -2603,6 +2603,47 @@ static void cmd_lerdwlsz(int dev_id, int argc,
> char **argv)
> }
> }
>
> +static struct option leclrwl_options[] = {
> + { "help", 0, 0, 'h' },
> + { 0, 0, 0, 0 }
> +};
> +
> +static const char *leclrwl_help =
> + "Usage:\n"
> + "\tleclrwl\n";
> +
> +static void cmd_leclrwl(int dev_id, int argc, char **argv)
> +{
> + int err, dd, opt;
> +
> + for_each_opt(opt, leclrwl_options, NULL) {
> + switch (opt) {
> + default:
> + printf("%s", leclrwl_help);
> + return;
> + }
> + }
> +
> + helper_arg(0, 0, &argc, &argv, leclrwl_help);
> +
> + if (dev_id < 0)
> + dev_id = hci_get_route(NULL);
> +
> + dd = hci_open_dev(dev_id);
> + if (dd < 0) {
> + perror("Could not open device");
> + exit(1);
> + }
> +
> + err = hci_le_clear_white_list(dd);
> + hci_close_dev(dd);
> +
> + if (err < 0) {
> + perror("Cant clear white list");
> + exit(1);
> + }
> +}
> +
> static struct option ledc_options[] = {
> { "help", 0, 0, 'h' },
> { 0, 0, 0, 0 }
> @@ -2682,6 +2723,7 @@ static struct {
> { "leaddwl", cmd_leaddwl, "Add this device to white list" },
> { "lermwl", cmd_lermwl, "Remove this device from white list" },
> { "lerdwlsz", cmd_lerdwlsz, "Read white list size" },
> + { "leclrwl", cmd_leclrwl, "Clear white list"
> },
> { "lecc", cmd_lecc, "Create a LE Connection", },
> { "ledc", cmd_ledc, "Disconnect a LE Connection", },
> { NULL, NULL, 0 }
> --
> 1.6.5
Making changes as per Anderson's review comments.
---
lib/hci.c | 22 ++++++++++++++++++++++
lib/hci_lib.h | 1 +
tools/hcitool.c | 42 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 65 insertions(+), 0 deletions(-)
diff --git a/lib/hci.c b/lib/hci.c
index 14737de..91638c5 100755
--- a/lib/hci.c
+++ b/lib/hci.c
@@ -1377,6 +1377,28 @@ int hci_le_read_white_list_size(int dd, int *size)
return 0;
}
+int hci_le_clear_white_list(int dd)
+{
+ struct hci_request rq;
+ uint8_t status;
+
+ memset(&rq, 0, sizeof(rq));
+ rq.ogf = OGF_LE_CTL;
+ rq.ocf = OCF_LE_CLEAR_WHITE_LIST;
+ rq.rparam = &status;
+ rq.rlen = 1;
+
+ if (hci_send_req(dd, &rq, 1000) < 0)
+ return -1;
+
+ if (status) {
+ errno = EIO;
+ return -1;
+ }
+
+ return 0;
+}
+
int hci_read_local_name(int dd, int len, char *name, int to)
{
read_local_name_rp rp;
diff --git a/lib/hci_lib.h b/lib/hci_lib.h
index d5f07f6..c86b0de 100755
--- a/lib/hci_lib.h
+++ b/lib/hci_lib.h
@@ -130,6 +130,7 @@ int hci_le_create_conn(int dd, uint16_t interval, uint16_t window,
int hci_le_add_to_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type);
int hci_le_remove_from_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type);
int hci_le_read_white_list_size(int dd, int *size);
+int hci_le_clear_white_list(int dd);
int hci_for_each_dev(int flag, int(*func)(int dd, int dev_id, long arg), long arg);
int hci_get_route(bdaddr_t *bdaddr);
diff --git a/tools/hcitool.c b/tools/hcitool.c
index 35b238c..fe95cb0 100755
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -2604,6 +2604,47 @@ static void cmd_lerdwlsz(int dev_id, int argc, char **argv)
}
}
+static struct option leclrwl_options[] = {
+ { "help", 0, 0, 'h' },
+ { 0, 0, 0, 0 }
+};
+
+static const char *leclrwl_help =
+ "Usage:\n"
+ "\tleclrwl\n";
+
+static void cmd_leclrwl(int dev_id, int argc, char **argv)
+{
+ int err, dd, opt;
+
+ for_each_opt(opt, leclrwl_options, NULL) {
+ switch (opt) {
+ default:
+ printf("%s", leclrwl_help);
+ return;
+ }
+ }
+
+ helper_arg(0, 0, &argc, &argv, leclrwl_help);
+
+ if (dev_id < 0)
+ dev_id = hci_get_route(NULL);
+
+ dd = hci_open_dev(dev_id);
+ if (dd < 0) {
+ perror("Could not open device");
+ exit(1);
+ }
+
+ err = hci_le_clear_white_list(dd);
+ hci_close_dev(dd);
+
+ if (err < 0) {
+ perror("Cant clear white list");
+ exit(1);
+ }
+}
+
static struct option ledc_options[] = {
{ "help", 0, 0, 'h' },
{ 0, 0, 0, 0 }
@@ -2683,6 +2724,7 @@ static struct {
{ "leaddwl", cmd_leaddwl, "Add this device to white list" },
{ "lermwl", cmd_lermwl, "Remove this device from white list" },
{ "lerdwlsz", cmd_lerdwlsz, "Read white list size" },
+ { "leclrwl", cmd_leclrwl, "Clear white list" },
{ "lecc", cmd_lecc, "Create a LE Connection", },
{ "ledc", cmd_ledc, "Disconnect a LE Connection", },
{ NULL, NULL, 0 }
--
1.6.5
^ permalink raw reply related
* RE: [PATCH 3/4] HCI command to read size of LE White List
From: Sumit Kumar BAJPAI @ 2011-01-25 5:19 UTC (permalink / raw)
To: Anderson Lizardo; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <AANLkTinuSJTq+QSXChjROqC19_+dZdP5TWqgkMj-MkwZ@mail.gmail.com>
> -----Original Message-----
> From: Anderson Lizardo [mailto:anderson.lizardo@openbossa.org]
> Sent: Monday, January 24, 2011 5:22 PM
> To: Sumit Kumar BAJPAI
> Cc: linux-bluetooth@vger.kernel.org
> Subject: Re: [PATCH 3/4] HCI command to read size of LE White List
>
> On Mon, Jan 24, 2011 at 5:59 AM, Sumit Kumar BAJPAI
> <sumitkumar.bajpai@stericsson.com> wrote:
> > diff --git a/tools/hcitool.c b/tools/hcitool.c
> > index 038d05e..e80c7a3 100755
> > --- a/tools/hcitool.c
> > +++ b/tools/hcitool.c
> > @@ -2563,6 +2563,46 @@ static void cmd_lermwl(int dev_id, int argc,
> char **argv)
> > }
> > }
> >
> > +static struct option lerdwlsz_options[] = {
> > + { "help", 0, 0, 'h' },
> > + { 0, 0, 0, 0 }
> > +};
> > +
> > +static const char *lerdwlsz_help =
> > + "Usage:\n"
> > + "\tlerdwlsz\n";
> > +
> > +static void cmd_lerdwlsz(int dev_id, int argc, char **argv)
> > +{
> > + int err, dd, opt, size;
> > +
> > + for_each_opt(opt, lerdwlsz_options, NULL) {
> > + switch (opt) {
> > + default:
> > + printf("%s", lerdwlsz_help);
> > + return;
> > + }
> > + }
> > + helper_arg(0, 0, &argc, &argv, lermwl_help);
>
> You are using the wrong *_help variable above.
>
> > +
> > + if (dev_id < 0)
> > + dev_id = hci_get_route(NULL);
> > +
> > + dd = hci_open_dev(dev_id);
> > + if (dd < 0) {
> > + perror("Could not open device");
> > + exit(1);
> > + }
> > +
> > + err = hci_le_read_white_list_size(dd, &size);
> > + hci_close_dev(dd);
> > +
> > + if (err < 0) {
> > + perror("Cant read white list size");
> > + exit(1);
> > + }
> > +}
> > +
> > static struct option ledc_options[] = {
> > { "help", 0, 0, 'h' },
> > { 0, 0, 0, 0 }
> > @@ -2641,6 +2681,7 @@ static struct {
> > { "lescan", cmd_lescan, "Start LE scan"
> },
> > { "leaddwl", cmd_leaddwl, "Add this device to white list"
> },
> > { "lermwl", cmd_lermwl, "Remove this device from white list"
> },
> > + { "lerdwlsz", cmd_lerdwlsz, "Read white list size"
> },
> > { "lecc", cmd_lecc, "Create a LE Connection",
> },
> > { "ledc", cmd_ledc, "Disconnect a LE Connection",
> },
> > { NULL, NULL, 0 }
> > --
> > 1.6.5
> > --
> > 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
> >
>
>
>
> --
> Anderson Lizardo
> OpenBossa Labs - INdT
> Manaus - Brazil
---
lib/hci.c | 28 ++++++++++++++++++++++++++++
lib/hci_lib.h | 1 +
tools/hcitool.c | 42 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 71 insertions(+), 0 deletions(-)
diff --git a/lib/hci.c b/lib/hci.c
index 1ae2dc6..14737de 100755
--- a/lib/hci.c
+++ b/lib/hci.c
@@ -1349,6 +1349,34 @@ int hci_le_remove_from_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type)
return 0;
}
+int hci_le_read_white_list_size(int dd, int *size)
+{
+ struct hci_request rq;
+ le_read_white_list_size_rp rp;
+
+ memset(&rp, 0, sizeof(rp));
+ rp.size = 0;
+
+ memset(&rq, 0, sizeof(rq));
+ rq.ogf = OGF_LE_CTL;
+ rq.ocf = OCF_LE_READ_WHITE_LIST_SIZE;
+ rq.rparam = &rp;
+ rq.rlen = LE_READ_WHITE_LIST_SIZE_RP_SIZE;
+
+ if (hci_send_req(dd, &rq, 1000) < 0)
+ return -1;
+
+ if (rp.status) {
+ errno = EIO;
+ return -1;
+ }
+
+ if (size)
+ *size = rp.size;
+
+ return 0;
+}
+
int hci_read_local_name(int dd, int len, char *name, int to)
{
read_local_name_rp rp;
diff --git a/lib/hci_lib.h b/lib/hci_lib.h
index b42a91b..d5f07f6 100755
--- a/lib/hci_lib.h
+++ b/lib/hci_lib.h
@@ -129,6 +129,7 @@ int hci_le_create_conn(int dd, uint16_t interval, uint16_t window,
uint16_t *handle, int to);
int hci_le_add_to_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type);
int hci_le_remove_from_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type);
+int hci_le_read_white_list_size(int dd, int *size);
int hci_for_each_dev(int flag, int(*func)(int dd, int dev_id, long arg), long arg);
int hci_get_route(bdaddr_t *bdaddr);
diff --git a/tools/hcitool.c b/tools/hcitool.c
index 038d05e..35b238c 100755
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -2563,6 +2563,47 @@ static void cmd_lermwl(int dev_id, int argc, char **argv)
}
}
+static struct option lerdwlsz_options[] = {
+ { "help", 0, 0, 'h' },
+ { 0, 0, 0, 0 }
+};
+
+static const char *lerdwlsz_help =
+ "Usage:\n"
+ "\tlerdwlsz\n";
+
+static void cmd_lerdwlsz(int dev_id, int argc, char **argv)
+{
+ int err, dd, opt, size;
+
+ for_each_opt(opt, lerdwlsz_options, NULL) {
+ switch (opt) {
+ default:
+ printf("%s", lerdwlsz_help);
+ return;
+ }
+ }
+
+ helper_arg(0, 0, &argc, &argv, lerdwlsz_help);
+
+ if (dev_id < 0)
+ dev_id = hci_get_route(NULL);
+
+ dd = hci_open_dev(dev_id);
+ if (dd < 0) {
+ perror("Could not open device");
+ exit(1);
+ }
+
+ err = hci_le_read_white_list_size(dd, &size);
+ hci_close_dev(dd);
+
+ if (err < 0) {
+ perror("Cant read white list size");
+ exit(1);
+ }
+}
+
static struct option ledc_options[] = {
{ "help", 0, 0, 'h' },
{ 0, 0, 0, 0 }
@@ -2641,6 +2682,7 @@ static struct {
{ "lescan", cmd_lescan, "Start LE scan" },
{ "leaddwl", cmd_leaddwl, "Add this device to white list" },
{ "lermwl", cmd_lermwl, "Remove this device from white list" },
+ { "lerdwlsz", cmd_lerdwlsz, "Read white list size" },
{ "lecc", cmd_lecc, "Create a LE Connection", },
{ "ledc", cmd_ledc, "Disconnect a LE Connection", },
{ NULL, NULL, 0 }
--
1.6.5
^ permalink raw reply related
* RE: [PATCH 2/4] HCI command to remove device from LE White List
From: Sumit Kumar BAJPAI @ 2011-01-25 5:19 UTC (permalink / raw)
To: Anderson Lizardo; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <AANLkTi=B8rXLVuYDHMCjFCQ1XEpFJaWE9Jg2o7ptqB-K@mail.gmail.com>
> -----Original Message-----
> From: Anderson Lizardo [mailto:anderson.lizardo@openbossa.org]
> Sent: Monday, January 24, 2011 5:12 PM
> To: Sumit Kumar BAJPAI
> Cc: linux-bluetooth@vger.kernel.org
> Subject: Re: [PATCH 2/4] HCI command to remove device from LE White
> List
>
> Hi,
>
> On Mon, Jan 24, 2011 at 5:58 AM, Sumit Kumar BAJPAI
> <sumitkumar.bajpai@stericsson.com> wrote:
> > ---
> > lib/hci.c | 29 +++++++++++++++++++++++++++++
> > lib/hci_lib.h | 1 +
> > tools/hcitool.c | 47
> +++++++++++++++++++++++++++++++++++++++++++++++
> > 3 files changed, 77 insertions(+), 0 deletions(-)
> >
> > diff --git a/lib/hci.c b/lib/hci.c
> > index b75f612..11b47b3 100755
> > --- a/lib/hci.c
> > +++ b/lib/hci.c
> > @@ -1320,6 +1320,35 @@ int hci_le_add_to_white_list(int dd, const
> bdaddr_t* bdaddr, uint8_t type)
> > return 0;
> > }
> >
> > +int hci_le_remove_from_white_list(int dd, const bdaddr_t* bdaddr,
> uint8_t type)
>
> Coding style issue:
>
> bdaddr_t* bdaddr -> bdaddr_t *bdaddr
>
> (no C++ style declarations)
>
> > +{
> > + struct hci_request rq;
> > + le_remove_device_from_white_list_cp cp;
> > + uint8_t status;
> > +
> > + memset(&cp, 0, sizeof(cp));
> > + cp.bdaddr_type = type;
> > + bacpy(&cp.bdaddr,bdaddr);
>
> bacpy(&cp.bdaddr,bdaddr); -> bacpy(&cp.bdaddr, bdaddr);
>
> (missing whitespace after comma)
>
> > +
> > + memset(&rq, 0, sizeof(rq));
> > + rq.ogf = OGF_LE_CTL;
> > + rq.ocf = OCF_LE_REMOVE_DEVICE_FROM_WHITE_LIST;
> > + rq.cparam = &cp;
> > + rq.clen = LE_REMOVE_DEVICE_FROM_WHITE_LIST_CP_SIZE;
> > + rq.rparam = &status;
> > + rq.rlen = 1;
> > +
> > + if (hci_send_req(dd, &rq, 1000) < 0)
> > + return -1;
> > +
> > + if (status) {
> > + errno = EIO;
> > + return -1;
> > + }
> > +
> > + return 0;
> > +}
> > +
> > int hci_read_local_name(int dd, int len, char *name, int to)
> > {
> > read_local_name_rp rp;
> > diff --git a/lib/hci_lib.h b/lib/hci_lib.h
> > index dd995dd..e64a431 100755
> > --- a/lib/hci_lib.h
> > +++ b/lib/hci_lib.h
> > @@ -128,6 +128,7 @@ int hci_le_create_conn(int dd, uint16_t interval,
> uint16_t window,
> > uint16_t min_ce_length, uint16_t max_ce_length,
> > uint16_t *handle, int to);
> > int hci_le_add_to_white_list(int dd, const bdaddr_t* bdaddr, uint8_t
> type);
> > +int hci_le_remove_from_white_list(int dd, const bdaddr_t* bdaddr,
> uint8_t type);
>
> bdaddr_t* bdaddr -> bdaddr_t *bdaddr
>
> >
> > int hci_for_each_dev(int flag, int(*func)(int dd, int dev_id, long
> arg), long arg);
> > int hci_get_route(bdaddr_t *bdaddr);
> > diff --git a/tools/hcitool.c b/tools/hcitool.c
> > index 9147995..038d05e 100755
> > --- a/tools/hcitool.c
> > +++ b/tools/hcitool.c
> > @@ -2517,6 +2517,52 @@ static void cmd_leaddwl(int dev_id, int argc,
> char **argv)
> > }
> > }
> >
> > +static struct option lermwl_options[] = {
> > + { "help", 0, 0, 'h' },
> > + { 0, 0, 0, 0 }
> > +};
> > +
> > +static const char *lermwl_help =
> > + "Usage:\n"
> > + "\tlermwl <bdaddr>\n";
> > +
> > +static void cmd_lermwl(int dev_id, int argc, char **argv)
> > +{
> > + int err, opt, dd;
> > + bdaddr_t bdaddr;
> > + le_device_addr_type bdaddr_type;
> > +
> > + for_each_opt(opt, lermwl_options, NULL) {
> > + switch (opt) {
> > + default:
> > + printf("%s", lermwl_help);
> > + return;
> > + }
> > + }
> > +
> > + helper_arg(1, 1, &argc, &argv, lermwl_help);
> > +
> > + if (dev_id < 0)
> > + dev_id = hci_get_route(NULL);
> > +
> > + dd = hci_open_dev(dev_id);
> > + if (dd < 0) {
> > + perror("Could not open device");
> > + exit(1);
> > + }
> > +
> > + str2ba(argv[0], &bdaddr);
> > + bdaddr_type = LE_PUBLIC_DEVICE_ADDR;
> > +
> > + err = hci_le_remove_from_white_list(dd, &bdaddr,
> bdaddr_type);
> > + hci_close_dev(dd);
> > +
> > + if (err < 0) {
> > + perror("Cant remove from white list");
> > + exit(1);
> > + }
> > +}
> > +
> > static struct option ledc_options[] = {
> > { "help", 0, 0, 'h' },
> > { 0, 0, 0, 0 }
> > @@ -2594,6 +2640,7 @@ static struct {
> > { "clock", cmd_clock, "Read local or remote clock"
> },
> > { "lescan", cmd_lescan, "Start LE scan"
> },
> > { "leaddwl", cmd_leaddwl, "Add this device to white list"
> },
> > + { "lermwl", cmd_lermwl, "Remove this device from white list"
> },
> > { "lecc", cmd_lecc, "Create a LE Connection",
> },
> > { "ledc", cmd_ledc, "Disconnect a LE Connection",
> },
> > { NULL, NULL, 0 }
> > --
> > 1.6.5
> > --
> > 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
> >
>
>
>
> --
> Anderson Lizardo
> OpenBossa Labs - INdT
> Manaus - Brazil
Thanks Anderson for review comments.
Posting patch again.
---
lib/hci.c | 29 +++++++++++++++++++++++++++++
lib/hci_lib.h | 1 +
tools/hcitool.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 77 insertions(+), 0 deletions(-)
diff --git a/lib/hci.c b/lib/hci.c
index a85f193..1ae2dc6 100755
--- a/lib/hci.c
+++ b/lib/hci.c
@@ -1320,6 +1320,35 @@ int hci_le_add_to_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type)
return 0;
}
+int hci_le_remove_from_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type)
+{
+ struct hci_request rq;
+ le_remove_device_from_white_list_cp cp;
+ uint8_t status;
+
+ memset(&cp, 0, sizeof(cp));
+ cp.bdaddr_type = type;
+ bacpy(&cp.bdaddr, bdaddr);
+
+ memset(&rq, 0, sizeof(rq));
+ rq.ogf = OGF_LE_CTL;
+ rq.ocf = OCF_LE_REMOVE_DEVICE_FROM_WHITE_LIST;
+ rq.cparam = &cp;
+ rq.clen = LE_REMOVE_DEVICE_FROM_WHITE_LIST_CP_SIZE;
+ rq.rparam = &status;
+ rq.rlen = 1;
+
+ if (hci_send_req(dd, &rq, 1000) < 0)
+ return -1;
+
+ if (status) {
+ errno = EIO;
+ return -1;
+ }
+
+ return 0;
+}
+
int hci_read_local_name(int dd, int len, char *name, int to)
{
read_local_name_rp rp;
diff --git a/lib/hci_lib.h b/lib/hci_lib.h
index 7127d70..b42a91b 100755
--- a/lib/hci_lib.h
+++ b/lib/hci_lib.h
@@ -128,6 +128,7 @@ int hci_le_create_conn(int dd, uint16_t interval, uint16_t window,
uint16_t min_ce_length, uint16_t max_ce_length,
uint16_t *handle, int to);
int hci_le_add_to_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type);
+int hci_le_remove_from_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type);
int hci_for_each_dev(int flag, int(*func)(int dd, int dev_id, long arg), long arg);
int hci_get_route(bdaddr_t *bdaddr);
diff --git a/tools/hcitool.c b/tools/hcitool.c
index 9147995..038d05e 100755
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -2517,6 +2517,52 @@ static void cmd_leaddwl(int dev_id, int argc, char **argv)
}
}
+static struct option lermwl_options[] = {
+ { "help", 0, 0, 'h' },
+ { 0, 0, 0, 0 }
+};
+
+static const char *lermwl_help =
+ "Usage:\n"
+ "\tlermwl <bdaddr>\n";
+
+static void cmd_lermwl(int dev_id, int argc, char **argv)
+{
+ int err, opt, dd;
+ bdaddr_t bdaddr;
+ le_device_addr_type bdaddr_type;
+
+ for_each_opt(opt, lermwl_options, NULL) {
+ switch (opt) {
+ default:
+ printf("%s", lermwl_help);
+ return;
+ }
+ }
+
+ helper_arg(1, 1, &argc, &argv, lermwl_help);
+
+ if (dev_id < 0)
+ dev_id = hci_get_route(NULL);
+
+ dd = hci_open_dev(dev_id);
+ if (dd < 0) {
+ perror("Could not open device");
+ exit(1);
+ }
+
+ str2ba(argv[0], &bdaddr);
+ bdaddr_type = LE_PUBLIC_DEVICE_ADDR;
+
+ err = hci_le_remove_from_white_list(dd, &bdaddr, bdaddr_type);
+ hci_close_dev(dd);
+
+ if (err < 0) {
+ perror("Cant remove from white list");
+ exit(1);
+ }
+}
+
static struct option ledc_options[] = {
{ "help", 0, 0, 'h' },
{ 0, 0, 0, 0 }
@@ -2594,6 +2640,7 @@ static struct {
{ "clock", cmd_clock, "Read local or remote clock" },
{ "lescan", cmd_lescan, "Start LE scan" },
{ "leaddwl", cmd_leaddwl, "Add this device to white list" },
+ { "lermwl", cmd_lermwl, "Remove this device from white list" },
{ "lecc", cmd_lecc, "Create a LE Connection", },
{ "ledc", cmd_ledc, "Disconnect a LE Connection", },
{ NULL, NULL, 0 }
--
1.6.5
^ permalink raw reply related
* [PATCH 1/4] HCI command to add device in LE White List
From: Sumit Kumar BAJPAI @ 2011-01-25 5:17 UTC (permalink / raw)
To: linux-bluetooth@vger.kernel.org
---
lib/hci.c | 29 +++++++++++++++++++++++++++++
lib/hci.h | 5 +++++
lib/hci_lib.h | 1 +
tools/hcitool.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 82 insertions(+), 0 deletions(-)
mode change 100644 => 100755 lib/hci.c
mode change 100644 => 100755 lib/hci.h
mode change 100644 => 100755 lib/hci_lib.h
mode change 100644 => 100755 tools/hcitool.c
diff --git a/lib/hci.c b/lib/hci.c
old mode 100644
new mode 100755
index 048fda4..a85f193
--- a/lib/hci.c
+++ b/lib/hci.c
@@ -1291,6 +1291,35 @@ int hci_disconnect(int dd, uint16_t handle, uint8_t reason, int to)
return 0;
}
+int hci_le_add_to_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type)
+{
+ struct hci_request rq;
+ le_add_device_to_white_list_cp cp;
+ uint8_t status;
+
+ memset(&cp, 0, sizeof(cp));
+ cp.bdaddr_type = type;
+ bacpy(&cp.bdaddr, bdaddr);
+
+ memset(&rq, 0, sizeof(rq));
+ rq.ogf = OGF_LE_CTL;
+ rq.ocf = OCF_LE_ADD_DEVICE_TO_WHITE_LIST;
+ rq.cparam = &cp;
+ rq.clen = LE_ADD_DEVICE_TO_WHITE_LIST_CP_SIZE;
+ rq.rparam = &status;
+ rq.rlen = 1;
+
+ if (hci_send_req(dd, &rq, 1000) < 0)
+ return -1;
+
+ if (status) {
+ errno = EIO;
+ return -1;
+ }
+
+ return 0;
+}
+
int hci_read_local_name(int dd, int len, char *name, int to)
{
read_local_name_rp rp;
diff --git a/lib/hci.h b/lib/hci.h
old mode 100644
new mode 100755
index 0cb120f..de0eaa0
--- a/lib/hci.h
+++ b/lib/hci.h
@@ -1522,6 +1522,11 @@ typedef struct {
#define OCF_LE_CREATE_CONN_CANCEL 0x000E
+typedef enum {
+ LE_PUBLIC_DEVICE_ADDR = 0x00,
+ LE_RANDOM_DEVICE_ADDR = 0x01,
+}le_device_addr_type;
+
#define OCF_LE_READ_WHITE_LIST_SIZE 0x000F
typedef struct {
uint8_t status;
diff --git a/lib/hci_lib.h b/lib/hci_lib.h
old mode 100644
new mode 100755
index b63a2a4..7127d70
--- a/lib/hci_lib.h
+++ b/lib/hci_lib.h
@@ -127,6 +127,7 @@ int hci_le_create_conn(int dd, uint16_t interval, uint16_t window,
uint16_t latency, uint16_t supervision_timeout,
uint16_t min_ce_length, uint16_t max_ce_length,
uint16_t *handle, int to);
+int hci_le_add_to_white_list(int dd, const bdaddr_t *bdaddr, uint8_t type);
int hci_for_each_dev(int flag, int(*func)(int dd, int dev_id, long arg), long arg);
int hci_get_route(bdaddr_t *bdaddr);
diff --git a/tools/hcitool.c b/tools/hcitool.c
old mode 100644
new mode 100755
index d50adaf..9147995
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -2471,6 +2471,52 @@ static void cmd_lecc(int dev_id, int argc, char **argv)
hci_close_dev(dd);
}
+static struct option leaddwl_options[] = {
+ { "help", 0, 0, 'h' },
+ { 0, 0, 0, 0 }
+};
+
+static const char *leaddwl_help =
+ "Usage:\n"
+ "\tleaddwl\n";
+
+static void cmd_leaddwl(int dev_id, int argc, char **argv)
+{
+ int err, opt, dd;
+ bdaddr_t bdaddr;
+ le_device_addr_type bdaddr_type;
+
+ for_each_opt(opt, leaddwl_options, NULL) {
+ switch (opt) {
+ default:
+ printf("%s", leaddwl_help);
+ return;
+ }
+ }
+
+ helper_arg(1, 1, &argc, &argv, leaddwl_help);
+
+ if (dev_id < 0)
+ dev_id = hci_get_route(NULL);
+
+ dd = hci_open_dev(dev_id);
+ if (dd < 0) {
+ perror("Could not open device");
+ exit(1);
+ }
+
+ str2ba(argv[0], &bdaddr);
+ bdaddr_type = LE_PUBLIC_DEVICE_ADDR;
+
+ err = hci_le_add_to_white_list(dd, &bdaddr, bdaddr_type);
+ hci_close_dev(dd);
+
+ if (err < 0) {
+ perror("Cant add to white list");
+ exit(1);
+ }
+}
+
static struct option ledc_options[] = {
{ "help", 0, 0, 'h' },
{ 0, 0, 0, 0 }
@@ -2547,6 +2593,7 @@ static struct {
{ "clkoff", cmd_clkoff, "Read clock offset" },
{ "clock", cmd_clock, "Read local or remote clock" },
{ "lescan", cmd_lescan, "Start LE scan" },
+ { "leaddwl", cmd_leaddwl, "Add this device to white list" },
{ "lecc", cmd_lecc, "Create a LE Connection", },
{ "ledc", cmd_ledc, "Disconnect a LE Connection", },
{ NULL, NULL, 0 }
--
1.6.5
Thanks,
Sumit
^ permalink raw reply related
* Re: Bluetooth Help Needed Please
From: Arun K. Singh @ 2011-01-25 4:55 UTC (permalink / raw)
To: Andrew Kirch; +Cc: Morné Liebenberg, linux-bluetooth
In-Reply-To: <4D3E3EC4.3010304@trelane.net>
or may be just the dbus header [libdbus-1-dev] - as most of the
contemporary linux hosts have dbus pre-installed ...
Best Regards,
Arun
www.crazydaks.com
On Tue, Jan 25, 2011 at 8:38 AM, Andrew Kirch <trelane@trelane.net> wrote:
> install dbus-dev dbus-devel libdbus, etc
>
> Andrew
>
> On 1/24/2011 9:05 PM, Morné Liebenberg wrote:
>> To whom it may concern;
>>
>> Hi may name is Morne and I'm trying to update my Bluez software but
>> get the following errors:
>>
>> gmg@GMG:~/Downloads/bluez-4.86$ ./configure --prefix=/usr
>> --mandir=/usr/share/man \
>>> --sysconfdir=/etc --localstatedir=/var --libexecdir=/lib
>> checking for a BSD-compatible install... /usr/bin/install -c
>> checking whether build environment is sane... yes
>> checking for a thread-safe mkdir -p... /bin/mkdir -p
>> checking for gawk... no
>> checking for mawk... mawk
>> checking whether make sets $(MAKE)... yes
>> checking whether to enable maintainer-specific portions of Makefiles... no
>> checking for pkg-config... /usr/bin/pkg-config
>> checking pkg-config is at least version 0.9.0... yes
>> checking for gcc... gcc
>> checking for C compiler default output file name... a.out
>> checking whether the C compiler works... yes
>> checking whether we are cross compiling... no
>> checking for suffix of executables...
>> checking for suffix of object files... o
>> checking whether we are using the GNU C compiler... yes
>> checking whether gcc accepts -g... yes
>> checking for gcc option to accept ISO C89... none needed
>> checking for style of include used by make... GNU
>> checking dependency style of gcc... gcc3
>> checking whether gcc and cc understand -c and -o together... yes
>> checking whether gcc accepts -fPIE... yes
>> checking for a BSD-compatible install... /usr/bin/install -c
>> checking for bison... no
>> checking for byacc... no
>> checking for flex... no
>> checking for lex... no
>> checking build system type... i686-pc-linux-gnu
>> checking host system type... i686-pc-linux-gnu
>> checking for a sed that does not truncate output... /bin/sed
>> checking for grep that handles long lines and -e... /bin/grep
>> checking for egrep... /bin/grep -E
>> checking for fgrep... /bin/grep -F
>> checking for ld used by gcc... /usr/bin/ld
>> checking if the linker (/usr/bin/ld) is GNU ld... yes
>> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
>> checking the name lister (/usr/bin/nm -B) interface... BSD nm
>> checking whether ln -s works... yes
>> checking the maximum length of command line arguments... 1572864
>> checking whether the shell understands some XSI constructs... yes
>> checking whether the shell understands "+="... yes
>> checking for /usr/bin/ld option to reload object files... -r
>> checking for objdump... objdump
>> checking how to recognize dependent libraries... pass_all
>> checking for ar... ar
>> checking for strip... strip
>> checking for ranlib... ranlib
>> checking command to parse /usr/bin/nm -B output from gcc object... ok
>> checking how to run the C preprocessor... gcc -E
>> checking for ANSI C header files... yes
>> checking for sys/types.h... yes
>> checking for sys/stat.h... yes
>> checking for stdlib.h... yes
>> checking for string.h... yes
>> checking for memory.h... yes
>> checking for strings.h... yes
>> checking for inttypes.h... yes
>> checking for stdint.h... yes
>> checking for unistd.h... yes
>> checking for dlfcn.h... yes
>> checking for objdir... .libs
>> checking if gcc supports -fno-rtti -fno-exceptions... no
>> checking for gcc option to produce PIC... -fPIC -DPIC
>> checking if gcc PIC flag -fPIC -DPIC works... yes
>> checking if gcc static flag -static works... yes
>> checking if gcc supports -c -o file.o... yes
>> checking if gcc supports -c -o file.o... (cached) yes
>> checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
>> checking whether -lc should be explicitly linked in... no
>> checking dynamic linker characteristics... GNU/Linux ld.so
>> checking how to hardcode library paths into programs... immediate
>> checking whether stripping libraries is possible... yes
>> checking if libtool supports shared libraries... yes
>> checking whether to build shared libraries... yes
>> checking whether to build static libraries... no
>> checking for ppoll... yes
>> checking for dlopen in -ldl... yes
>> checking for DBUS... no
>> configure: error: D-Bus library is required
>> gmg@GMG:~/Downloads/bluez-4.86$
>>
>> Could you perhaps help me with this update issue...
>>
>> The other issue I am having is receiving calls to my cellphone and
>> playing the person who is calling via my computer speakers using a
>> blue-tooth dongle.
>> Otherwise if it's not possible then I could just might as well buy a
>> blue-tooth earpiece, disconnect it's small speaker and connect it to
>> my amp but will only have mono sound
>>
>> Anyways please help me on this issue...i would be gratefull if any
>> good news came back
>>
>> Thank you
>> Morne
>> --
>> 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
>
> --
> 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: Refusing SCO from non-connected headset
From: Mike @ 2011-01-25 3:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Gustavo F. Padovan
In-Reply-To: <AANLkTinkEr1FcmZAyvS68=nU-SR8QpfYi5z=Pmqe6V-H@mail.gmail.com>
On Mon, Jan 24, 2011 at 9:07 PM, Gustavo F. Padovan
<padovan@profusion.mobi> wrote:
> Hi Mike,
>
> * Mike <puffy.taco@gmail.com> [2011-01-24 20:35:51 -0600]:
>
>> I get the following error when I try to dial a phone number from my
>> cell phone and am connected using HFP:
>>
>> bluetoothd[14651]: audio/main.c:sco_server_cb() Refusing SCO from
>> non-connected headset
>
> Please post full logs of bluetoothd -nd
Log is pasted below. One thing to note, if I comment out the section
of audio/main.c that is the "if (device->headset) {" block (around
line 102), then the connection goes through as a gateway. I can then
see SCO packets scroll by in hcidump, though pulseaudio does not seem
to notice so I have no way of playing that audio. The log though is
of unaltered source.
bluetoothd[15602]: Bluetooth deamon 4.86
bluetoothd[15602]: src/main.c:parse_config() parsing main.conf
bluetoothd[15602]: src/main.c:parse_config() discovto=0
bluetoothd[15602]: src/main.c:parse_config() pairto=0
bluetoothd[15602]: src/main.c:parse_config() pageto=8192
bluetoothd[15602]: src/main.c:parse_config() name=%h-%d
bluetoothd[15602]: src/main.c:parse_config() class=0x000100
bluetoothd[15602]: src/main.c:parse_config() discov_interval=0
bluetoothd[15602]: src/main.c:parse_config() Key file does not have
key 'DeviceID'
bluetoothd[15602]: Starting SDP server
bluetoothd[15602]: src/plugin.c:plugin_init() Loading builtin plugins
bluetoothd[15602]: src/plugin.c:add_plugin() Loading audio plugin
bluetoothd[15602]: src/plugin.c:add_plugin() Loading input plugin
bluetoothd[15602]: src/plugin.c:add_plugin() Loading serial plugin
bluetoothd[15602]: src/plugin.c:add_plugin() Loading network plugin
bluetoothd[15602]: src/plugin.c:add_plugin() Loading service plugin
bluetoothd[15602]: src/plugin.c:add_plugin() Loading hciops plugin
bluetoothd[15602]: src/plugin.c:add_plugin() Loading mgmtops plugin
bluetoothd[15602]: src/plugin.c:add_plugin() Loading formfactor plugin
bluetoothd[15602]: src/plugin.c:add_plugin() Loading storage plugin
bluetoothd[15602]: src/plugin.c:plugin_init() Loading plugins
/usr/local/lib/bluetooth/plugins
bluetoothd[15602]: plugins/service.c:register_interface() path
/org/bluez/15602/any
bluetoothd[15602]: plugins/service.c:register_interface() Registered
interface org.bluez.Service on path /org/bluez/15602/any
bluetoothd[15602]: network/manager.c:read_config()
/etc/bluetooth/network.conf: Key file does not have key
'DisableSecurity'
bluetoothd[15602]: network/manager.c:read_config() Config options: Security=true
bluetoothd[15602]: input/manager.c:input_manager_init() input.conf:
Key file does not have key 'IdleTimeout'
bluetoothd[15602]: audio/manager.c:audio_manager_init() audio.conf:
Key file does not have key 'AutoConnect'
bluetoothd[15602]: audio/unix.c:unix_init() Unix socket created: 8
bluetoothd[15602]: plugins/hciops.c:hciops_init()
bluetoothd[15602]: plugins/hciops.c:hciops_setup()
bluetoothd[15602]: src/main.c:main() Entering main loop
bluetoothd[15602]: src/rfkill.c:rfkill_event() RFKILL event idx 2 type
2 op 0 soft 0 hard 0
bluetoothd[15602]: plugins/hciops.c:init_known_adapters()
bluetoothd[15602]: HCI dev 0 registered
bluetoothd[15602]: plugins/hciops.c:device_devreg_setup() hci0
bluetoothd[15602]: plugins/hciops.c:init_device() hci0
bluetoothd[15602]: Listening for HCI events on hci0
bluetoothd[15602]: plugins/hciops.c:init_device() child 15603 forked
bluetoothd[15602]: HCI dev 0 up
bluetoothd[15602]: plugins/hciops.c:device_devup_setup() hci0
bluetoothd[15602]: plugins/hciops.c:child_exit() child 15603 exited
bluetoothd[15602]: plugins/hciops.c:read_local_features_complete() Got
features for hci0
bluetoothd[15602]: plugins/hciops.c:read_local_version_complete() Got
version for hci0
bluetoothd[15602]: plugins/hciops.c:read_bd_addr_complete() hci0 status 0
bluetoothd[15602]: plugins/hciops.c:read_bd_addr_complete() Got bdaddr for hci0
bluetoothd[15602]: plugins/hciops.c:read_local_name_complete() hci0 status 0
bluetoothd[15602]: plugins/hciops.c:read_local_name_complete() Got name for hci0
bluetoothd[15602]: src/adapter.c:btd_adapter_ref() 0x21ef94a0: ref=1
bluetoothd[15602]: plugins/hciops.c:hciops_read_bdaddr() hci0
bluetoothd[15602]: plugins/hciops.c:hciops_read_local_version() hci0
bluetoothd[15602]: plugins/hciops.c:hciops_read_local_features() hci0
bluetoothd[15602]: src/sdpd-database.c:sdp_init_services_list()
bluetoothd[15602]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[15602]: plugins/hciops.c:update_service_classes() hci0 value 0
bluetoothd[15602]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[15602]: plugins/hciops.c:update_service_classes() hci0 value 0
bluetoothd[15602]: plugins/service.c:register_interface() path
/org/bluez/15602/hci0
bluetoothd[15602]: plugins/service.c:register_interface() Registered
interface org.bluez.Service on path /org/bluez/15602/hci0
bluetoothd[15602]: network/manager.c:network_server_probe() path
/org/bluez/15602/hci0
bluetoothd[15602]: src/adapter.c:btd_adapter_ref() 0x21ef94a0: ref=2
bluetoothd[15602]: network/server.c:server_register() Registered
interface org.bluez.NetworkServer on path /org/bluez/15602/hci0
bluetoothd[15602]: serial/manager.c:proxy_probe() path /org/bluez/15602/hci0
bluetoothd[15602]: src/adapter.c:btd_adapter_ref() 0x21ef94a0: ref=3
bluetoothd[15602]: serial/proxy.c:proxy_register() Registered
interface org.bluez.SerialProxyManager on path /org/bluez/15602/hci0
bluetoothd[15602]: src/adapter.c:btd_adapter_ref() 0x21ef94a0: ref=4
bluetoothd[15602]: audio/manager.c:headset_server_probe() path
/org/bluez/15602/hci0
bluetoothd[15602]: src/adapter.c:btd_adapter_ref() 0x21ef94a0: ref=5
bluetoothd[15602]: audio/manager.c:audio_adapter_ref() 0x21ef9820: ref=1
bluetoothd[15602]: audio/manager.c:headset_server_init() audio.conf:
Key file does not have key 'Master'
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Adding
record with handle 0x10000
bluetoothd[15602]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[15602]: plugins/hciops.c:update_service_classes() hci0 value 0
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00000003-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00001108-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00001112-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00001203-0000-1000-8000-00805f9
bluetoothd[15602]: audio/headset.c:headset_config_init() audio.conf:
Key file does not have key 'SCORouting'
bluetoothd[15602]: audio/headset.c:headset_config_init() audio.conf:
Key file does not have key 'FastConnectable'
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Adding
record with handle 0x10001
bluetoothd[15602]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[15602]: plugins/hciops.c:update_service_classes() hci0 value 64
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00000003-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 0000111e-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 0000111f-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00001203-0000-1000-8000-00805f9
bluetoothd[15602]: audio/manager.c:state_changed()
/org/bluez/15602/hci0 powered on
bluetoothd[15602]: audio/telephony.c:telephony_init()
bluetoothd[15602]: audio/headset.c:telephony_ready_ind() Telephony
plugin initialized
bluetoothd[15602]: audio/headset.c:print_ag_features() HFP AG
features: "Ability to reject a call" "Enhanced call status" "Extended
Error Result Codes"
bluetoothd[15602]: audio/manager.c:audio_adapter_ref() 0x21ef9820: ref=2
bluetoothd[15602]: audio/manager.c:gateway_server_init() audio.conf:
Key file does not have key 'Master'
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Adding
record with handle 0x10002
bluetoothd[15602]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[15602]: plugins/hciops.c:update_service_classes() hci0 value 96
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00000003-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 0000111e-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00001203-0000-1000-8000-00805f9
bluetoothd[15602]: audio/manager.c:a2dp_server_probe() path
/org/bluez/15602/hci0
bluetoothd[15602]: audio/manager.c:audio_adapter_ref() 0x21ef9820: ref=3
bluetoothd[15602]: audio/a2dp.c:a2dp_register() audio.conf: Key file
does not have key 'Disable'
bluetoothd[15602]: audio/a2dp.c:a2dp_register() audio.conf: Key file
does not have group 'A2DP'
bluetoothd[15602]: audio/a2dp.c:a2dp_register() audio.conf: Key file
does not have group 'A2DP'
bluetoothd[15602]: audio/a2dp.c:a2dp_register() audio.conf: Key file
does not have group 'A2DP'
bluetoothd[15602]: audio/a2dp.c:a2dp_register() audio.conf: Key file
does not have group 'A2DP'
bluetoothd[15602]: audio/avdtp.c:avdtp_init() audio.conf: Key file
does not have key 'Master'
bluetoothd[15602]: audio/avdtp.c:avdtp_register_sep() SEP 0x21ef6d30
registered: type:0 codec:0 seid:1
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Adding
record with handle 0x10003
bluetoothd[15602]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[15602]: plugins/hciops.c:update_service_classes() hci0 value 104
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00000019-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 0000110a-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 0000110d-0000-1000-8000-00805f9
bluetoothd[15602]: audio/manager.c:avrcp_server_probe() path
/org/bluez/15602/hci0
bluetoothd[15602]: audio/manager.c:audio_adapter_ref() 0x21ef9820: ref=4
bluetoothd[15602]: audio/control.c:avrcp_register() audio.conf: Key
file does not have key 'Master'
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Adding
record with handle 0x10004
bluetoothd[15602]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[15602]: plugins/hciops.c:update_service_classes() hci0 value 104
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00000017-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 0000110c-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 0000110e-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Adding
record with handle 0x10005
bluetoothd[15602]: plugins/hciops.c:hciops_add_uuid() hci0
bluetoothd[15602]: plugins/hciops.c:update_service_classes() hci0 value 104
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00000017-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00000100-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 00001002-0000-1000-8000-00805f9
bluetoothd[15602]: src/sdpd-service.c:add_record_to_server() Record
pattern UUID 0000110e-0000-1000-8000-00805f9
bluetoothd[15602]: plugins/formfactor.c:formfactor_probe() Setting
0x000100 for major/minor device class
bluetoothd[15602]: plugins/hciops.c:hciops_set_dev_class() hci0 major 1 minor 0
bluetoothd[15602]: plugins/hciops.c:hciops_unblock_device() hci0 dba
00:00:00:00:00:00
bluetoothd[15602]: Clearing blocked list failed: Invalid argument (22)
bluetoothd[15602]: plugins/hciops.c:hciops_load_keys() hci0 keys 0 debug_keys 0
bluetoothd[15602]: plugins/hciops.c:hciops_get_conn_list() hci0
bluetoothd[15602]: src/manager.c:btd_manager_register_adapter()
Adapter /org/bluez/15602/hci0 registered
bluetoothd[15602]: src/adapter.c:btd_adapter_ref() 0x21ef94a0: ref=6
bluetoothd[15602]: plugins/hciops.c:hciops_set_name() hci0, name rome-0
bluetoothd[15602]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[15602]: plugins/hciops.c:hciops_set_dev_class() hci0 major 1 minor 4
bluetoothd[15602]: audio/manager.c:state_changed()
/org/bluez/15602/hci0 powered on
bluetoothd[15602]: plugins/hciops.c:hciops_disable_cod_cache() hci0
cache_enable 1
bluetoothd[15602]: plugins/hciops.c:hciops_disable_cod_cache() hci0
current_cod 0x000000 wanted_cod 0x680104
bluetoothd[15602]: plugins/hciops.c:write_class() hci0 class 0x680104
bluetoothd[15602]: Adapter /org/bluez/15602/hci0 has been enabled
bluetoothd[15602]: plugins/hciops.c:hciops_set_discoverable() hci0
discoverable 1
bluetoothd[15602]: plugins/hciops.c:hciops_set_pairable() hci0 pairable 1
bluetoothd[15602]: src/adapter.c:btd_adapter_unref() 0x21ef94a0: ref=5
bluetoothd[15602]: src/adapter.c:register_agent() Agent registered for
hci0 at :1.32:/org/bluez/agent/hci0
bluetoothd[15602]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[15602]: plugins/hciops.c:hciops_read_scan_enable() hci0
bluetoothd[15602]: plugins/hciops.c:read_local_name_complete() hci0 status 0
bluetoothd[15602]: plugins/hciops.c:update_ext_inquiry_response() hci0
bluetoothd[15602]: plugins/hciops.c:read_scan_complete() hci0 status 0
bluetoothd[15602]: src/adapter.c:adapter_mode_changed() old 0x00 new 0x03
bluetoothd[15602]: src/adapter.c:set_mode_complete()
bluetoothd[15602]: src/adapter.c:adapter_get_device() 00:17:E3:3B:4F:DD
bluetoothd[15602]: src/adapter.c:adapter_create_device() 00:17:E3:3B:4F:DD
bluetoothd[15602]: src/device.c:device_create() Creating device
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD
bluetoothd[15602]: src/device.c:btd_device_ref() 0x21efc148: ref=1
bluetoothd[15602]: plugins/hciops.c:remote_features_information() hci0 status 0
bluetoothd[15602]: plugins/hciops.c:link_key_request() hci0 dba
00:17:E3:3B:4F:DD
bluetoothd[15602]: plugins/hciops.c:link_key_request() kernel auth
requirements = 0x04
bluetoothd[15602]: plugins/hciops.c:link_key_request() Matching key not found
bluetoothd[15602]: plugins/hciops.c:pin_code_request() hci0 PIN
request for 00:17:E3:3B:4F:DD
bluetoothd[15602]: src/adapter.c:adapter_get_device() 00:17:E3:3B:4F:DD
bluetoothd[15602]: src/device.c:device_request_authentication()
Requesting agent authentication for 00:17:E3:3B:4F:DD
bluetoothd[15602]: plugins/hciops.c:hciops_pincode_reply() hci0 dba
00:17:E3:3B:4F:DD
bluetoothd[15602]: plugins/hciops.c:link_key_notify() hci0 dba
00:17:E3:3B:4F:DD type 0
bluetoothd[15602]: src/adapter.c:adapter_get_device() 00:17:E3:3B:4F:DD
bluetoothd[15602]: plugins/hciops.c:hciops_get_auth_info() hci0 dba
00:17:E3:3B:4F:DD
bluetoothd[15602]: src/event.c:btd_event_link_key_notify() key type
0x00 old key type 0xff new key type 0x00
bluetoothd[15602]: src/event.c:btd_event_link_key_notify() local auth
0x04 and remote auth 0xff
bluetoothd[15602]: src/event.c:btd_event_link_key_notify() storing
link key of type 0x00
bluetoothd[15602]: src/event.c:btd_event_bonding_process_complete() status=00
bluetoothd[15602]: src/adapter.c:adapter_get_device() 00:17:E3:3B:4F:DD
bluetoothd[15602]: src/device.c:device_bonding_complete() setting
timer for reverse service discovery
bluetoothd[15602]: plugins/hciops.c:auth_complete() hci0 status 0
bluetoothd[15602]: src/event.c:btd_event_bonding_process_complete() status=00
bluetoothd[15602]: src/adapter.c:adapter_get_device() 00:17:E3:3B:4F:DD
bluetoothd[15602]: src/event.c:btd_event_bonding_process_complete() no
pending auth request
bluetoothd[15602]: src/adapter.c:adapter_get_device() 00:17:E3:3B:4F:DD
bluetoothd[15602]: src/device.c:btd_device_ref() 0x21efc148: ref=2
bluetoothd[15602]: audio/device.c:audio_device_register() Registered
interface org.bluez.Audio on path
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD
bluetoothd[15602]: src/device.c:device_probe_drivers() Probing drivers
for 00:17:E3:3B:4F:DD
bluetoothd[15602]: audio/manager.c:handle_uuid() Found Handsfree record
bluetoothd[15602]: audio/headset.c:headset_init() Registered interface
org.bluez.Headset on path /org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD
bluetoothd[15602]: src/device.c:btd_device_ref() 0x21efc148: ref=3
bluetoothd[15602]: src/adapter.c:adapter_get_device() 00:17:E3:3B:4F:DD
bluetoothd[15602]: plugins/hciops.c:remote_features_information() hci0 status 0
bluetoothd[15602]: src/device.c:device_probe_drivers() Probing drivers
for 00:17:E3:3B:4F:DD
bluetoothd[15602]: serial/manager.c:serial_probe() path
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD:
00001103-0000-1000-8000-00805f9b34fb
bluetoothd[15602]: serial/port.c:create_serial_device() Registered
interface org.bluez.Serial on path
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD
bluetoothd[15602]: serial/manager.c:serial_probe() path
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD:
00001112-0000-1000-8000-00805f9b34fb
bluetoothd[15602]: serial/manager.c:serial_probe() path
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD:
0000111f-0000-1000-8000-00805f9b34fb
bluetoothd[15602]: serial/manager.c:serial_probe() path
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD:
00001105-0000-1000-8000-00805f9b34fb
bluetoothd[15602]: serial/manager.c:serial_probe() path
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD:
00001106-0000-1000-8000-00805f9b34fb
bluetoothd[15602]: serial/manager.c:serial_probe() path
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD:
0000111b-0000-1000-8000-00805f9b34fb
bluetoothd[15602]: serial/manager.c:serial_probe() path
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD:
00000002-0000-1000-8000-0002ee000002
bluetoothd[15602]: input/manager.c:headset_probe() path
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD
bluetoothd[15602]: input-headset driver probe failed for device
00:17:E3:3B:4F:DD
bluetoothd[15602]: audio/manager.c:handle_uuid() server not enabled
for 00001112-0000-1000-8000-00805f9b34fb (0x1112)
bluetoothd[15602]: audio/manager.c:handle_uuid() Found Handsfree AG record
bluetoothd[15602]: audio/manager.c:handle_uuid() server not enabled
for 0000110a-0000-1000-8000-00805f9b34fb (0x110a)
bluetoothd[15602]: audio/manager.c:handle_uuid() Found AV Target
bluetoothd[15602]: audio/control.c:control_init() Registered interface
org.bluez.Control on path /org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD
bluetoothd[15602]: src/device.c:btd_device_unref() 0x21efc148: ref=2
bluetoothd[15602]: plugins/hciops.c:link_key_request() hci0 dba
00:17:E3:3B:4F:DD
bluetoothd[15602]: plugins/hciops.c:link_key_request() kernel auth
requirements = 0x04
bluetoothd[15602]: plugins/hciops.c:link_key_request() Matching key found
bluetoothd[15602]: plugins/hciops.c:link_key_request() link key type 0x00
bluetoothd[15602]: plugins/hciops.c:auth_complete() hci0 status 0
bluetoothd[15602]: src/event.c:btd_event_bonding_process_complete() status=00
bluetoothd[15602]: src/adapter.c:adapter_get_device() 00:17:E3:3B:4F:DD
bluetoothd[15602]: src/event.c:btd_event_bonding_process_complete() no
pending auth request
bluetoothd[15602]: src/agent.c:agent_authorize() authorize request was
sent for /org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD
bluetoothd[15602]: audio/manager.c:gateway_auth_cb() Accepted AG
connection from 00:17:E3:3B:4F:DD for
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD
bluetoothd[15602]: audio/gateway.c:newconnection_reply() Agent reply:
file descriptor passed successfully
bluetoothd[15602]: audio/main.c:sco_server_cb() Refusing SCO from
non-connected headset
bluetoothd[15602]: src/event.c:btd_event_disconn_complete() No
matching connection found for handle 42
bluetoothd[15602]: audio/main.c:sco_server_cb() Refusing SCO from
non-connected headset
bluetoothd[15602]: src/event.c:btd_event_disconn_complete() No
matching connection found for handle 46
bluetoothd[15602]: src/adapter.c:adapter_remove() Removing adapter
/org/bluez/15602/hci0
bluetoothd[15602]: src/device.c:device_remove() Removing device
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD
bluetoothd[15602]: audio/unix.c:unix_device_removed()
unix_device_removed(0x21efbdd8)
bluetoothd[15602]: audio/headset.c:path_unregister() Unregistered
interface org.bluez.Headset on path
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD
bluetoothd[15602]: audio/gateway.c:path_unregister() Unregistered
interface org.bluez.HandsfreeGateway on path
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD
bluetoothd[15602]: audio/control.c:path_unregister() Unregistered
interface org.bluez.Control on path
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD
bluetoothd[15602]: src/device.c:btd_device_unref() 0x21efc148: ref=1
bluetoothd[15602]: serial/manager.c:serial_remove() path
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD
bluetoothd[15602]: serial/port.c:path_unregister() Unregistered
interface org.bluez.Serial on path
/org/bluez/15602/hci0/dev_00_17_E3_3B_4F_DD
bluetoothd[15602]: src/device.c:btd_device_unref() 0x21efc148: ref=0
bluetoothd[15602]: src/device.c:device_free() 0x21efc148
bluetoothd[15602]: plugins/service.c:unregister_interface() path
/org/bluez/15602/hci0
bluetoothd[15602]: network/manager.c:network_server_remove() path
/org/bluez/15602/hci0
bluetoothd[15602]: network/server.c:path_unregister() Unregistered
interface org.bluez.NetworkServer on path /org/bluez/15602/hci0
bluetoothd[15602]: src/adapter.c:btd_adapter_unref() 0x21ef94a0: ref=4
bluetoothd[15602]: serial/manager.c:proxy_remove() path /org/bluez/15602/hci0
bluetoothd[15602]: src/adapter.c:btd_adapter_unref() 0x21ef94a0: ref=3
bluetoothd[15602]: src/adapter.c:btd_adapter_unref() 0x21ef94a0: ref=2
bluetoothd[15602]: audio/manager.c:headset_server_remove() path
/org/bluez/15602/hci0
bluetoothd[15602]: src/sdpd-service.c:remove_record_from_server()
Removing record with handle 0x10000
bluetoothd[15602]: src/sdpd-service.c:remove_record_from_server()
Removing record with handle 0x10001
bluetoothd[15602]: audio/manager.c:audio_adapter_unref() 0x21ef9820: ref=3
bluetoothd[15602]: audio/manager.c:gateway_server_remove() path
/org/bluez/15602/hci0
bluetoothd[15602]: src/sdpd-service.c:remove_record_from_server()
Removing record with handle 0x10002
bluetoothd[15602]: audio/manager.c:audio_adapter_unref() 0x21ef9820: ref=2
bluetoothd[15602]: audio/manager.c:a2dp_server_remove() path
/org/bluez/15602/hci0
bluetoothd[15602]: src/sdpd-service.c:remove_record_from_server()
Removing record with handle 0x10003
bluetoothd[15602]: audio/avdtp.c:avdtp_unregister_sep() SEP 0x21ef6d30
unregistered: type:0 codec:0 seid:1
bluetoothd[15602]: audio/manager.c:audio_adapter_unref() 0x21ef9820: ref=1
bluetoothd[15602]: audio/manager.c:avrcp_server_remove() path
/org/bluez/15602/hci0
bluetoothd[15602]: src/sdpd-service.c:remove_record_from_server()
Removing record with handle 0x10005
bluetoothd[15602]: src/sdpd-service.c:remove_record_from_server()
Removing record with handle 0x10004
bluetoothd[15602]: audio/manager.c:audio_adapter_unref() 0x21ef9820: ref=0
bluetoothd[15602]: src/adapter.c:btd_adapter_unref() 0x21ef94a0: ref=1
bluetoothd[15602]: plugins/hciops.c:hciops_power_off() hci0
bluetoothd[15602]: src/adapter.c:btd_adapter_unref() 0x21ef94a0: ref=0
bluetoothd[15602]: src/agent.c:agent_release() Releasing agent :1.32,
/org/bluez/agent/hci0
bluetoothd[15602]: src/adapter.c:adapter_free() 0x21ef94a0
bluetoothd[15602]: src/plugin.c:plugin_cleanup() Cleanup plugins
bluetoothd[15602]: plugins/service.c:unregister_interface() path
/org/bluez/15602/any
bluetoothd[15602]: plugins/hciops.c:hciops_exit()
bluetoothd[15602]: plugins/hciops.c:hciops_cleanup()
bluetoothd[15602]: Stopping hci0 event socket
bluetoothd[15602]: Stopping SDP server
bluetoothd[15602]: Exit
^ permalink raw reply
* Re: Bluetooth Help Needed Please
From: Andrew Kirch @ 2011-01-25 3:08 UTC (permalink / raw)
To: Morné Liebenberg; +Cc: linux-bluetooth
In-Reply-To: <AANLkTim-w9rFa-W4HTGW7RBMoMyFUT9-cZ4NnFj0LsaV@mail.gmail.com>
install dbus-dev dbus-devel libdbus, etc
Andrew
On 1/24/2011 9:05 PM, Morné Liebenberg wrote:
> To whom it may concern;
>
> Hi may name is Morne and I'm trying to update my Bluez software but
> get the following errors:
>
> gmg@GMG:~/Downloads/bluez-4.86$ ./configure --prefix=/usr
> --mandir=/usr/share/man \
>> --sysconfdir=/etc --localstatedir=/var --libexecdir=/lib
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... yes
> checking for a thread-safe mkdir -p... /bin/mkdir -p
> checking for gawk... no
> checking for mawk... mawk
> checking whether make sets $(MAKE)... yes
> checking whether to enable maintainer-specific portions of Makefiles... no
> checking for pkg-config... /usr/bin/pkg-config
> checking pkg-config is at least version 0.9.0... yes
> checking for gcc... gcc
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ISO C89... none needed
> checking for style of include used by make... GNU
> checking dependency style of gcc... gcc3
> checking whether gcc and cc understand -c and -o together... yes
> checking whether gcc accepts -fPIE... yes
> checking for a BSD-compatible install... /usr/bin/install -c
> checking for bison... no
> checking for byacc... no
> checking for flex... no
> checking for lex... no
> checking build system type... i686-pc-linux-gnu
> checking host system type... i686-pc-linux-gnu
> checking for a sed that does not truncate output... /bin/sed
> checking for grep that handles long lines and -e... /bin/grep
> checking for egrep... /bin/grep -E
> checking for fgrep... /bin/grep -F
> checking for ld used by gcc... /usr/bin/ld
> checking if the linker (/usr/bin/ld) is GNU ld... yes
> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
> checking the name lister (/usr/bin/nm -B) interface... BSD nm
> checking whether ln -s works... yes
> checking the maximum length of command line arguments... 1572864
> checking whether the shell understands some XSI constructs... yes
> checking whether the shell understands "+="... yes
> checking for /usr/bin/ld option to reload object files... -r
> checking for objdump... objdump
> checking how to recognize dependent libraries... pass_all
> checking for ar... ar
> checking for strip... strip
> checking for ranlib... ranlib
> checking command to parse /usr/bin/nm -B output from gcc object... ok
> checking how to run the C preprocessor... gcc -E
> checking for ANSI C header files... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for unistd.h... yes
> checking for dlfcn.h... yes
> checking for objdir... .libs
> checking if gcc supports -fno-rtti -fno-exceptions... no
> checking for gcc option to produce PIC... -fPIC -DPIC
> checking if gcc PIC flag -fPIC -DPIC works... yes
> checking if gcc static flag -static works... yes
> checking if gcc supports -c -o file.o... yes
> checking if gcc supports -c -o file.o... (cached) yes
> checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
> checking whether -lc should be explicitly linked in... no
> checking dynamic linker characteristics... GNU/Linux ld.so
> checking how to hardcode library paths into programs... immediate
> checking whether stripping libraries is possible... yes
> checking if libtool supports shared libraries... yes
> checking whether to build shared libraries... yes
> checking whether to build static libraries... no
> checking for ppoll... yes
> checking for dlopen in -ldl... yes
> checking for DBUS... no
> configure: error: D-Bus library is required
> gmg@GMG:~/Downloads/bluez-4.86$
>
> Could you perhaps help me with this update issue...
>
> The other issue I am having is receiving calls to my cellphone and
> playing the person who is calling via my computer speakers using a
> blue-tooth dongle.
> Otherwise if it's not possible then I could just might as well buy a
> blue-tooth earpiece, disconnect it's small speaker and connect it to
> my amp but will only have mono sound
>
> Anyways please help me on this issue...i would be gratefull if any
> good news came back
>
> Thank you
> Morne
> --
> 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: Refusing SCO from non-connected headset
From: Gustavo F. Padovan @ 2011-01-25 3:07 UTC (permalink / raw)
To: Mike; +Cc: linux-bluetooth
In-Reply-To: <AANLkTi=CufNvvAr0w2JfsG8b3ddgAsHh31pRANoW+z1r@mail.gmail.com>
Hi Mike,
* Mike <puffy.taco@gmail.com> [2011-01-24 20:35:51 -0600]:
> I get the following error when I try to dial a phone number from my
> cell phone and am connected using HFP:
>
> bluetoothd[14651]: audio/main.c:sco_server_cb() Refusing SCO from
> non-connected headset
Please post full logs of bluetoothd -nd
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply
* Refusing SCO from non-connected headset
From: Mike @ 2011-01-25 2:35 UTC (permalink / raw)
To: linux-bluetooth
I get the following error when I try to dial a phone number from my
cell phone and am connected using HFP:
bluetoothd[14651]: audio/main.c:sco_server_cb() Refusing SCO from
non-connected headset
Here are my versions:
2.6.35-24-generic
bluez 4.86
ofono 0.39
dbus 1.4.0
Is this something that is supposed to work? Known to almost work? Do
I need a newer kernel? Something that doesn't work that I can fix
given a pointer of what to look at?
Let me know if there is any more helpful debug information I can provide.
Thanks,
Mike
^ permalink raw reply
* Bluetooth Help Needed Please
From: Morné Liebenberg @ 2011-01-25 2:05 UTC (permalink / raw)
To: linux-bluetooth
To whom it may concern;
Hi may name is Morne and I'm trying to update my Bluez software but
get the following errors:
gmg@GMG:~/Downloads/bluez-4.86$ ./configure --prefix=/usr
--mandir=/usr/share/man \
> --sysconfdir=/etc --localstatedir=/var --libexecdir=/lib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether gcc and cc understand -c and -o together... yes
checking whether gcc accepts -fPIE... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for bison... no
checking for byacc... no
checking for flex... no
checking for lex... no
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking for ppoll... yes
checking for dlopen in -ldl... yes
checking for DBUS... no
configure: error: D-Bus library is required
gmg@GMG:~/Downloads/bluez-4.86$
Could you perhaps help me with this update issue...
The other issue I am having is receiving calls to my cellphone and
playing the person who is calling via my computer speakers using a
blue-tooth dongle.
Otherwise if it's not possible then I could just might as well buy a
blue-tooth earpiece, disconnect it's small speaker and connect it to
my amp but will only have mono sound
Anyways please help me on this issue...i would be gratefull if any
good news came back
Thank you
Morne
^ permalink raw reply
* Re: LE Kernel (bluetooth-le-2.6) and LE Security Manager
From: Vinicius Costa Gomes @ 2011-01-24 21:34 UTC (permalink / raw)
To: Brian Gix; +Cc: linux-bluetooth
In-Reply-To: <1295895817.2656.26.camel@ubuntuLab1>
Hi Brian,
On 11:03 Mon 24 Jan, Brian Gix wrote:
> Hi Vinicius,
>
> I am sorry that it has taken so long to test the snapshot that you
> placed on gitorious, but I have now done so.
>
> On Fri, 2010-12-03 at 19:05 -0300, Vinicius Costa Gomes wrote:
> > Hi Brian,
> >
> > On 11:11 Fri 03 Dec, Brian Gix wrote:
> > >
> > > Hi Claudio, Johan & All,
> > >
> > > Is this LE capable kernel that Ville is working on, the development stream
> > > for the LE Security Manager? And if so, is it in a partial fleshed out
> > > state?
> >
> > There is a simple implementation of SMP here[1] on my "devel" branch. I am
> > cleaning it up for sending it for review.
> >
> > If you want to help, have any comments or just want to tell us what you are
> > working on, please drop by #bluez on freenode, or send an email.
>
> I have been able to verify that the Just Works negotiation of the Short
> Term Key does work against an independent implementation of the LE
> Security Manager, as long as I have requested no MITM protection. I
> have the following comments:
>
> 1. You currently reject security if I *do* request MITM protection.
> This should not be done. The correct functionality should be to
> continue the negotiation. Even though I requested MITM, it will be
> clear to both sides that JUST_WORKS methodology has been used, and so
> when the Keys are generated and exchanged, both sides will indicate in
> their Key Database that they are no-MITM keys. If I then actually
> *needed* MITM protection, then whatever functionality requiring that
> level of security will fail with an insufficient security error code.
> However, security should *never* be rejected unless there is a
> fundamental incompatibility such as no level of security actually
> supported. This is the only functionality that I found to be actually
> incorrect.
>
I was assuming that the meaning of setting the MITM protection bit, was that
it was *requiring* MITM protection, and when that couldn't be fulfilled the
Pairing Request should be rejected.
So my assumption was incorrect, going to fix it soon.
> 2. Currently, you are not exchanging any permanent keys, which I am sure
> you are aware. This makes it impossible to test much else, such as
> command signing, or security requests that use the generated keys.
>
This is being worked on, but nothing ready for testing yet.
> If you have a later version of SM that could be uploaded to your devel
> branch on gitorious, I would be more than happy (and in fact would love
> to be able) to test that for you as well.
>
> This is the git configuration I used for testing, which only has your SM
> up to the end of last December, and is so about a month old:
>
> remote.origin.url=git://gitorious.org/bluetooth-next/bluetooth-next.git
> branch.devel.remote=origin
> branch.devel.merge=refs/heads/devel
>
>
> Thanks for doing the SM,
>
> --
> Brian Gix
> bgix@codeaurora.org
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
>
Cheers,
--
Vinicius
^ permalink raw reply
* Re: LE Kernel (bluetooth-le-2.6) and LE Security Manager
From: Brian Gix @ 2011-01-24 20:33 UTC (permalink / raw)
To: Luiz Augusto von Dentz; +Cc: Vinicius Costa Gomes, linux-bluetooth
In-Reply-To: <AANLkTi=Hzaf2Ad7=+hQFEcvMfV4_P+-ZUVg5kzxvZyJH@mail.gmail.com>
Hi Luiz,
On Mon, 2011-01-24 at 22:09 +0200, Luiz Augusto von Dentz wrote:
> Hi,
>
> On Mon, Jan 24, 2011 at 9:03 PM, Brian Gix <bgix@codeaurora.org> wrote:
> > Hi Vinicius,
> >
[...]
> >
> > 1. You currently reject security if I *do* request MITM protection.
> > This should not be done. The correct functionality should be to
> > continue the negotiation. Even though I requested MITM, it will be
> > clear to both sides that JUST_WORKS methodology has been used, and so
> > when the Keys are generated and exchanged, both sides will indicate in
> > their Key Database that they are no-MITM keys. If I then actually
> > *needed* MITM protection, then whatever functionality requiring that
> > level of security will fail with an insufficient security error code.
> > However, security should *never* be rejected unless there is a
> > fundamental incompatibility such as no level of security actually
> > supported. This is the only functionality that I found to be actually
> > incorrect.
>
> But the point of MITM is man in the middle protection, so if we end up
> with a key which is not MITM there is no protection why store the link
> key? Actually if we do that we can end up in a situation where
> insufficient security is always triggered and the other stack may
> attempt to repair but with current code it will never succeed to
> generate a valid MITM link key. Anyway I suppose supporting MITM is
> mandatory so obviously the only possible fix for this is to support
> MITM.
The basic use case envisioned is that the two sides do not necessarily
know what the other side can support or has available until it attempts
this "pairing" operation. So we want to avoid this catch 22:
1. We support MITM but don't know if the other side does, nor if it
requires it. With the code I just tested, the remote side (bluez)
indicated that it doesn't not support MITM and therefore rejects
pairing.
2. However, if we support MITM but don't know if the other side does and
we *do not* request MITM, then a remote side that *requires* MITM should
reject us for *not* requesting it.
The solution is therefore to *always* request MITM, if you are capable
of supporting it. If it turns out that neither side actually needs it,
then there is no harm in having provided it. If one side does not
support it (as bluez currently does not) and the other side requires it,
then it is up to the side that *requested* MITM to reject the pairing
attempt, if it determines that MITM is required.
A low security device like the current bluez should *never* reject a
pairing request because the other side needs MITM. It is up to the side
that has the MITM requirement to issue the Security Failure packet.
So until bluez can support MITM, it should *accept* remote requests for
MITM, knowing that the remote side may reject it. As long as bluez
advertises no OOB and NO_IN_NO_OUT, there will be no MITM. It should
just not request MITM, and then provide no way to achieve it.
[...]
--
Brian Gix
bgix@codeaurora.org
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
^ permalink raw reply
* Re: LE Kernel (bluetooth-le-2.6) and LE Security Manager
From: Luiz Augusto von Dentz @ 2011-01-24 20:09 UTC (permalink / raw)
To: Brian Gix; +Cc: Vinicius Costa Gomes, linux-bluetooth
In-Reply-To: <1295895817.2656.26.camel@ubuntuLab1>
Hi,
On Mon, Jan 24, 2011 at 9:03 PM, Brian Gix <bgix@codeaurora.org> wrote:
> Hi Vinicius,
>
> I am sorry that it has taken so long to test the snapshot that you
> placed on gitorious, but I have now done so.
>
> On Fri, 2010-12-03 at 19:05 -0300, Vinicius Costa Gomes wrote:
>> Hi Brian,
>>
>> On 11:11 Fri 03 Dec, Brian Gix wrote:
>> >
>> > Hi Claudio, Johan & All,
>> >
>> > Is this LE capable kernel that Ville is working on, the development stream
>> > for the LE Security Manager? And if so, is it in a partial fleshed out
>> > state?
>>
>> There is a simple implementation of SMP here[1] on my "devel" branch. I am
>> cleaning it up for sending it for review.
>>
>> If you want to help, have any comments or just want to tell us what you are
>> working on, please drop by #bluez on freenode, or send an email.
>
> I have been able to verify that the Just Works negotiation of the Short
> Term Key does work against an independent implementation of the LE
> Security Manager, as long as I have requested no MITM protection. I
> have the following comments:
>
> 1. You currently reject security if I *do* request MITM protection.
> This should not be done. The correct functionality should be to
> continue the negotiation. Even though I requested MITM, it will be
> clear to both sides that JUST_WORKS methodology has been used, and so
> when the Keys are generated and exchanged, both sides will indicate in
> their Key Database that they are no-MITM keys. If I then actually
> *needed* MITM protection, then whatever functionality requiring that
> level of security will fail with an insufficient security error code.
> However, security should *never* be rejected unless there is a
> fundamental incompatibility such as no level of security actually
> supported. This is the only functionality that I found to be actually
> incorrect.
But the point of MITM is man in the middle protection, so if we end up
with a key which is not MITM there is no protection why store the link
key? Actually if we do that we can end up in a situation where
insufficient security is always triggered and the other stack may
attempt to repair but with current code it will never succeed to
generate a valid MITM link key. Anyway I suppose supporting MITM is
mandatory so obviously the only possible fix for this is to support
MITM.
> 2. Currently, you are not exchanging any permanent keys, which I am sure
> you are aware. This makes it impossible to test much else, such as
> command signing, or security requests that use the generated keys.
>
> If you have a later version of SM that could be uploaded to your devel
> branch on gitorious, I would be more than happy (and in fact would love
> to be able) to test that for you as well.
>
> This is the git configuration I used for testing, which only has your SM
> up to the end of last December, and is so about a month old:
>
> remote.origin.url=git://gitorious.org/bluetooth-next/bluetooth-next.git
> branch.devel.remote=origin
> branch.devel.merge=refs/heads/devel
>
>
> Thanks for doing the SM,
>
> --
> Brian Gix
> bgix@codeaurora.org
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
>
> --
> 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
>
--
Luiz Augusto von Dentz
Computer Engineer
^ permalink raw reply
* [PATCH 2/2] Implement dumping for evnet LE Connection Update Complete.
From: André Dieb Martins @ 2011-01-24 19:32 UTC (permalink / raw)
To: linux-bluetooth; +Cc: André Dieb Martins
In-Reply-To: <1295897559-5540-1-git-send-email-andre.dieb@signove.com>
---
parser/hci.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/parser/hci.c b/parser/hci.c
index 41a19b4..64c3b0c 100644
--- a/parser/hci.c
+++ b/parser/hci.c
@@ -3532,6 +3532,19 @@ static inline void evt_le_advertising_report_dump(int level, struct frame *frm)
}
}
+static inline void evt_le_conn_update_complete_dump(int level, struct frame *frm)
+{
+ evt_le_connection_update_complete *uevt = frm->ptr;
+
+ p_indent(level, frm);
+ printf("status 0x%2.2x handle %d\n", uevt->status, btohs(uevt->handle));
+
+ p_indent(level, frm);
+ printf("interval %.2fms, latency %.2fms, superv. timeout %.2fms\n",
+ btohs(uevt->interval) * 1.25, btohs(uevt->latency) * 1.25,
+ btohs(uevt->supervision_timeout) * 10.0);
+}
+
static inline void le_meta_ev_dump(int level, struct frame *frm)
{
evt_le_meta_event *mevt = frm->ptr;
@@ -3552,6 +3565,9 @@ static inline void le_meta_ev_dump(int level, struct frame *frm)
case EVT_LE_ADVERTISING_REPORT:
evt_le_advertising_report_dump(level + 1, frm);
break;
+ case EVT_LE_CONN_UPDATE_COMPLETE:
+ evt_le_conn_update_complete_dump(level + 1, frm);
+ break;
default:
raw_dump(level, frm);
break;
--
1.7.1
^ permalink raw reply related
* [PATCH 1/2] Fix time intervals dumping of LE commands.
From: André Dieb Martins @ 2011-01-24 19:32 UTC (permalink / raw)
To: linux-bluetooth; +Cc: André Dieb Martins
Add missing btohs() convertions and spec. constants for converting time
intervals for LE Set Scan Parameters and LE Set Advertising Parameters.
---
parser/hci.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/parser/hci.c b/parser/hci.c
index d9bac9b..41a19b4 100644
--- a/parser/hci.c
+++ b/parser/hci.c
@@ -1582,7 +1582,8 @@ static inline void le_set_advertising_parameters_dump(int level, struct frame *f
le_set_advertising_parameters_cp *cp = frm->ptr;
p_indent(level, frm);
- printf("min 0x%04xms max 0x%04xms\n", cp->min_interval, cp->max_interval);
+ printf("min %.3fms, max %.3fms\n", btohs(cp->min_interval) * 0.625,
+ btohs(cp->max_interval) * 0.625);
p_indent(level, frm);
printf("type 0x%02x (%s) ownbdaddr 0x%02x (%s)\n", cp->advtype,
@@ -1608,7 +1609,8 @@ static inline void le_set_scan_parameters_dump(int level, struct frame *frm)
cp->type == 0x00 ? "passive" : "active");
p_indent(level, frm);
- printf("interval %04xms window %04xms\n", cp->interval, cp->window);
+ printf("interval %.3fms window %.3fms\n", btohs(cp->interval) * 0.625,
+ btohs(cp->window) * 0.625);
p_indent(level, frm);
printf("own address: 0x%02x (%s) policy: %s\n", cp->own_bdaddr_type,
--
1.7.1
^ permalink raw reply related
* Re: Problems with L2CAP: deferred setup and MTU
From: Gustavo F. Padovan @ 2011-01-24 19:09 UTC (permalink / raw)
To: Elvis Pfützenreuter; +Cc: linux-bluetooth
In-Reply-To: <5E5308B0-BA11-46A2-B7A9-22CD4ADBCF80@signove.com>
Hi Elvis,
* Elvis Pfützenreuter <epx@signove.com> [2011-01-19 17:10:51 -0200]:
> I am currently investigating two problems with L2CAP sockets. Since I am not a kernel guy, I will take an indefinite amount of time to find and fix them; perhaps someone else can find and fix it in 5 minutes, so I think it is worth reporting.
>
> First problem is ERTM x MTU, sockets configured with a MTU != 672. Normal sockets exchange MTU in initialization:
>
> ./l2test -P 4099 -I 1000 -O 1000
> l2test[3211]: Connect from 00:1B:DC:0F:C8:A9 [imtu 1000, omtu 1000, flush_to 65535, mode 0, handle 12, class 0x480100]
>
> but ERTM sockets seem to ignore the setsockopt() value and exchange the default size (672):
>
> ./l2test -P 4099 -I 1000 -O 1000 -X ERTM
> l2test[3228]: Connect from 00:1B:DC:0F:C8:A9 [imtu 1000, omtu 672, flush_to 65535, mode 3, handle 11, class 0x480100]
>
> (obviously the initiator side uses the same parameters)
I pushed I fix for this to bluetooth-next-2.6
Author: Gustavo F. Padovan <padovan@profusion.mobi>
Date: Mon Jan 24 16:01:43 2011 -0200
Bluetooth: Fix setting of MTU for ERTM and Streaming Mode
The desired MTU should be sent in an Config_Req for all modes.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index ff191b9..1ee18c6 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -2588,11 +2588,11 @@ static int l2cap_build_conf_req(struct sock *sk, void *data)
}
done:
+ if (pi->imtu != L4CAP_DEFAULT_MTU)
+ l2cap_add_conf_opt(&ptr, L2CAP_CONF_MTU, 2, pi->imtu);
+
switch (pi->mode) {
case L2CAP_MODE_BASIC:
- if (pi->imtu != L2CAP_DEFAULT_MTU)
- l2cap_add_conf_opt(&ptr, L2CAP_CONF_MTU, 2, pi->imtu);
-
if (!(pi->conn->feat_mask & L2CAP_FEAT_ERTM) &&
!(pi->conn->feat_mask & L2CAP_FEAT_STREAMING))
break;
--
Gustavo F. Padovan
http://profusion.mobi
^ permalink raw reply related
* Re: LE Kernel (bluetooth-le-2.6) and LE Security Manager
From: Brian Gix @ 2011-01-24 19:03 UTC (permalink / raw)
To: Vinicius Costa Gomes; +Cc: linux-bluetooth
In-Reply-To: <20101203220534.GA16709@eris>
Hi Vinicius,
I am sorry that it has taken so long to test the snapshot that you
placed on gitorious, but I have now done so.
On Fri, 2010-12-03 at 19:05 -0300, Vinicius Costa Gomes wrote:
> Hi Brian,
>
> On 11:11 Fri 03 Dec, Brian Gix wrote:
> >
> > Hi Claudio, Johan & All,
> >
> > Is this LE capable kernel that Ville is working on, the development stream
> > for the LE Security Manager? And if so, is it in a partial fleshed out
> > state?
>
> There is a simple implementation of SMP here[1] on my "devel" branch. I am
> cleaning it up for sending it for review.
>
> If you want to help, have any comments or just want to tell us what you are
> working on, please drop by #bluez on freenode, or send an email.
I have been able to verify that the Just Works negotiation of the Short
Term Key does work against an independent implementation of the LE
Security Manager, as long as I have requested no MITM protection. I
have the following comments:
1. You currently reject security if I *do* request MITM protection.
This should not be done. The correct functionality should be to
continue the negotiation. Even though I requested MITM, it will be
clear to both sides that JUST_WORKS methodology has been used, and so
when the Keys are generated and exchanged, both sides will indicate in
their Key Database that they are no-MITM keys. If I then actually
*needed* MITM protection, then whatever functionality requiring that
level of security will fail with an insufficient security error code.
However, security should *never* be rejected unless there is a
fundamental incompatibility such as no level of security actually
supported. This is the only functionality that I found to be actually
incorrect.
2. Currently, you are not exchanging any permanent keys, which I am sure
you are aware. This makes it impossible to test much else, such as
command signing, or security requests that use the generated keys.
If you have a later version of SM that could be uploaded to your devel
branch on gitorious, I would be more than happy (and in fact would love
to be able) to test that for you as well.
This is the git configuration I used for testing, which only has your SM
up to the end of last December, and is so about a month old:
remote.origin.url=git://gitorious.org/bluetooth-next/bluetooth-next.git
branch.devel.remote=origin
branch.devel.merge=refs/heads/devel
Thanks for doing the SM,
--
Brian Gix
bgix@codeaurora.org
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
^ permalink raw reply
* Re: [PATCH 3/4] HCI command to read size of LE White List
From: Anderson Lizardo @ 2011-01-24 11:52 UTC (permalink / raw)
To: Sumit Kumar BAJPAI; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <4765B7BC10CB4C488A56C73E15D6FBA31DA570022B@EXDCVYMBSTM005.EQ1STM.local>
On Mon, Jan 24, 2011 at 5:59 AM, Sumit Kumar BAJPAI
<sumitkumar.bajpai@stericsson.com> wrote:
> diff --git a/tools/hcitool.c b/tools/hcitool.c
> index 038d05e..e80c7a3 100755
> --- a/tools/hcitool.c
> +++ b/tools/hcitool.c
> @@ -2563,6 +2563,46 @@ static void cmd_lermwl(int dev_id, int argc, char **argv)
> }
> }
>
> +static struct option lerdwlsz_options[] = {
> + { "help", 0, 0, 'h' },
> + { 0, 0, 0, 0 }
> +};
> +
> +static const char *lerdwlsz_help =
> + "Usage:\n"
> + "\tlerdwlsz\n";
> +
> +static void cmd_lerdwlsz(int dev_id, int argc, char **argv)
> +{
> + int err, dd, opt, size;
> +
> + for_each_opt(opt, lerdwlsz_options, NULL) {
> + switch (opt) {
> + default:
> + printf("%s", lerdwlsz_help);
> + return;
> + }
> + }
> + helper_arg(0, 0, &argc, &argv, lermwl_help);
You are using the wrong *_help variable above.
> +
> + if (dev_id < 0)
> + dev_id = hci_get_route(NULL);
> +
> + dd = hci_open_dev(dev_id);
> + if (dd < 0) {
> + perror("Could not open device");
> + exit(1);
> + }
> +
> + err = hci_le_read_white_list_size(dd, &size);
> + hci_close_dev(dd);
> +
> + if (err < 0) {
> + perror("Cant read white list size");
> + exit(1);
> + }
> +}
> +
> static struct option ledc_options[] = {
> { "help", 0, 0, 'h' },
> { 0, 0, 0, 0 }
> @@ -2641,6 +2681,7 @@ static struct {
> { "lescan", cmd_lescan, "Start LE scan" },
> { "leaddwl", cmd_leaddwl, "Add this device to white list" },
> { "lermwl", cmd_lermwl, "Remove this device from white list" },
> + { "lerdwlsz", cmd_lerdwlsz, "Read white list size" },
> { "lecc", cmd_lecc, "Create a LE Connection", },
> { "ledc", cmd_ledc, "Disconnect a LE Connection", },
> { NULL, NULL, 0 }
> --
> 1.6.5
> --
> 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
>
--
Anderson Lizardo
OpenBossa Labs - INdT
Manaus - Brazil
^ permalink raw reply
* Re: [PATCH 3/4] HCI command to read size of LE White List
From: Anderson Lizardo @ 2011-01-24 11:47 UTC (permalink / raw)
To: Sumit Kumar BAJPAI; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <4765B7BC10CB4C488A56C73E15D6FBA31DA570022B@EXDCVYMBSTM005.EQ1STM.local>
Hi,
On Mon, Jan 24, 2011 at 5:59 AM, Sumit Kumar BAJPAI
<sumitkumar.bajpai@stericsson.com> wrote:
> ---
> lib/hci.c | 28 ++++++++++++++++++++++++++++
> lib/hci_lib.h | 1 +
> tools/hcitool.c | 41 +++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 70 insertions(+), 0 deletions(-)
>
> diff --git a/lib/hci.c b/lib/hci.c
> index 11b47b3..ec8d48e 100755
> --- a/lib/hci.c
> +++ b/lib/hci.c
> @@ -1349,6 +1349,34 @@ int hci_le_remove_from_white_list(int dd, const bdaddr_t* bdaddr, uint8_t type)
> return 0;
> }
>
> +int hci_le_read_white_list_size(int dd, int* size)
int* size -> int *size
(No C++ style declarations)
> +{
> + struct hci_request rq;
> + le_read_white_list_size_rp rp;
> +
> + memset(&rp, 0, sizeof(rp));
> + rp.size=0;
Missing whitespace around "=".
> +
> + memset(&rq, 0, sizeof(rq));
> + rq.ogf = OGF_LE_CTL;
> + rq.ocf = OCF_LE_READ_WHITE_LIST_SIZE;
> + rq.rparam = &rp;
> + rq.rlen = LE_READ_WHITE_LIST_SIZE_RP_SIZE;
> +
> + if (hci_send_req(dd, &rq, 1000) < 0)
> + return -1;
> +
> + if (rp.status) {
> + errno = EIO;
> + return -1;
> + }
> +
> + if(size)
> + *size=rp.size;
Missing whitespace before "(".
Missing whitespace around "="
> +
> + return 0;
> +}
> +
> int hci_read_local_name(int dd, int len, char *name, int to)
> {
> read_local_name_rp rp;
> diff --git a/lib/hci_lib.h b/lib/hci_lib.h
> index e64a431..f0325b2 100755
> --- a/lib/hci_lib.h
> +++ b/lib/hci_lib.h
> @@ -129,6 +129,7 @@ int hci_le_create_conn(int dd, uint16_t interval, uint16_t window,
> uint16_t *handle, int to);
> int hci_le_add_to_white_list(int dd, const bdaddr_t* bdaddr, uint8_t type);
> int hci_le_remove_from_white_list(int dd, const bdaddr_t* bdaddr, uint8_t type);
> +int hci_le_read_white_list_size(int dd, int* size);
int* size -> int *size
>
> int hci_for_each_dev(int flag, int(*func)(int dd, int dev_id, long arg), long arg);
> int hci_get_route(bdaddr_t *bdaddr);
> diff --git a/tools/hcitool.c b/tools/hcitool.c
> index 038d05e..e80c7a3 100755
> --- a/tools/hcitool.c
> +++ b/tools/hcitool.c
> @@ -2563,6 +2563,46 @@ static void cmd_lermwl(int dev_id, int argc, char **argv)
> }
> }
>
> +static struct option lerdwlsz_options[] = {
> + { "help", 0, 0, 'h' },
> + { 0, 0, 0, 0 }
> +};
> +
> +static const char *lerdwlsz_help =
> + "Usage:\n"
> + "\tlerdwlsz\n";
> +
> +static void cmd_lerdwlsz(int dev_id, int argc, char **argv)
> +{
> + int err, dd, opt, size;
> +
> + for_each_opt(opt, lerdwlsz_options, NULL) {
> + switch (opt) {
> + default:
> + printf("%s", lerdwlsz_help);
> + return;
> + }
> + }
> + helper_arg(0, 0, &argc, &argv, lermwl_help);
> +
> + if (dev_id < 0)
> + dev_id = hci_get_route(NULL);
> +
> + dd = hci_open_dev(dev_id);
> + if (dd < 0) {
> + perror("Could not open device");
> + exit(1);
> + }
> +
> + err = hci_le_read_white_list_size(dd, &size);
> + hci_close_dev(dd);
> +
> + if (err < 0) {
> + perror("Cant read white list size");
> + exit(1);
> + }
> +}
> +
> static struct option ledc_options[] = {
> { "help", 0, 0, 'h' },
> { 0, 0, 0, 0 }
> @@ -2641,6 +2681,7 @@ static struct {
> { "lescan", cmd_lescan, "Start LE scan" },
> { "leaddwl", cmd_leaddwl, "Add this device to white list" },
> { "lermwl", cmd_lermwl, "Remove this device from white list" },
> + { "lerdwlsz", cmd_lerdwlsz, "Read white list size" },
> { "lecc", cmd_lecc, "Create a LE Connection", },
> { "ledc", cmd_ledc, "Disconnect a LE Connection", },
> { NULL, NULL, 0 }
> --
> 1.6.5
> --
> 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
>
--
Anderson Lizardo
OpenBossa Labs - INdT
Manaus - Brazil
^ permalink raw reply
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