* Re: Wireshark and new BlueZ BTSNOOP format
From: Michal Labedzki @ 2013-11-05 11:37 UTC (permalink / raw)
To: Marcel Holtmann; +Cc: linux-bluetooth@vger.kernel.org development
In-Reply-To: <AF259BFC-2022-4280-9F98-D4679A280A84@holtmann.org>
On 4 November 2013 15:40, Marcel Holtmann <marcel@holtmann.org> wrote:
> Hi Michal,
>
>> There is a need to add support for latest BTSNOOP format currently
>> used in BlueZ (5). I have two questions:
>>
>> 1. Is BlueZ btsnoop format official and stable? Or invented by BlueZ
>> team? (stable? safe?)
>
> the original btsnoop format was done by Symbian and adopted by Frontline.=
We started using that as well since it was better than what we had before.=
These are the ones with 1xxx link types.
> With BlueZ 5 and kernels 3.5 and newer we introduced a Bluetooth monitor =
to the kernel that can catch all controllers and can catch early messages a=
s well. Previous hcidump could only read one interface at a time and was no=
t able to catch early init frames.
>
> The link type 2001 is stable.
Regarding "all controllers and catch early messages" - if you use
Bluetooth USB dongle than this is not a problem, because
Wireshark/libpcap can live capture USB stream. There is ready HCI USB
transport described in Bluetooth Core specification. Try Wireshark >=3D
1.10 and filter by "hci_usb" . Only non-standard Bluetooth USB dongles
cannot work with it (however I have non-standard dongle "Broadcom
Corp. BCM20702A0 Bluetooth 4.0", but it seems to be standard dongle -
only it present itself as "vendor specific").
Quick Howto:
1. [Recommended] Latest Wireshark
2. [Recommended] Latest libpcap.
3. lsusb # to detect on which "Bus" Bluetooth dongle is connected
4. wireshark and select usbmonN, where N is "Bus" ID.
5. Filter "hci_usb" (useful if more devices connected to this Bus)
>> 2. Is there any documentation describes this format?
>
> It is documented inside the kernel as include/net/bluetooth/hci_mon.h and=
that is as close as it gets to documentation. btsnoop v2 takes the BTSnoop=
header and uses the 2001 link type and then encodes the opcode and index i=
nto the flags field. The frame data is always a raw HCI message similar to =
link type 1001.
Ok, I assume there is no real specification. This is not a problem for me.
>> In code I saw two new magic numbers:
>> 2001 Bluetooth monitor
>> 2002 Bluetooth simulator
>> Is Bluetooth simulator completed now?
>
> The simulator is a low-level Low Energy Link Layer simulator. And it is n=
ot completed and not stable yet.
Please let me know if will be completed or dropped. Or please create
feature request on Wireshark Bugzilla:
https://bugs.wireshark.org/bugzilla/buglist.cgi?resolution=3D---&query_form=
at=3Dadvanced&list_id=3D11093
>> For now Wireshark (>=3D 1.10, trunk is recommended) provide probably
>> full Bluetooth support, all protocols, colours, filtering,
>> reassembling. If you find a bug or need new feature please create a
>> bug at https://bugs.wireshark.org/bugzilla/buglist.cgi?resolution=3D---&=
query_format=3Dadvanced&list_id=3D11093
>
> What also would be interesting is an integration of Bluetooth monitor soc=
ket with libpcap so Wireshark can do live capture.
>
> Regards
>
> Marcel
>
For now Wireshark can support live capture on old kernel interface (if
you do not see Bluetooth interfaces than you need newer libpcap). Also
you can choose more than one interface to capture: for example
Bluetooth0, Bluetooth1 and usbmon1 (nice duplicated streams do you
see)
I will try to add support for new BTSNOOP format and libpcap support
for new kernel. I think Wireshark can be useful for BlueZ and Android
developers.
--=20
Pozdrawiam / Best regards
---------------------------------------------------------------------------=
----------------------------------
Micha=C5=82 =C5=81ab=C4=99dzki, Software Engineer
Tieto Corporation
Product Development Services
http://www.tieto.com / http://www.tieto.pl
---
ASCII: Michal Labedzki
location: Swobodna 1 Street, 50-088 Wroc=C5=82aw, Poland
room: 5.01 (desk next to 5.08)
---
Please note: The information contained in this message may be legally
privileged and confidential and protected from disclosure. If the
reader of this message is not the intended recipient, you are hereby
notified that any unauthorised use, distribution or copying of this
communication is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to
the message and deleting it from your computer. Thank You.
---
Please consider the environment before printing this e-mail.
---
Tieto Poland sp=C3=B3=C5=82ka z ograniczon=C4=85 odpowiedzialno=C5=9Bci=C4=
=85 z siedzib=C4=85 w
Szczecinie, ul. Malczewskiego 26. Zarejestrowana w S=C4=85dzie Rejonowym
Szczecin-Centrum w Szczecinie, XIII Wydzia=C5=82 Gospodarczy Krajowego
Rejestru S=C4=85dowego pod numerem 0000124858. NIP: 8542085557. REGON:
812023656. Kapita=C5=82 zak=C5=82adowy: 4 271500 PLN
^ permalink raw reply
* [PATCH_v2 00/13] Implemented hid interfaces in daemon and hal
From: Ravi kumar Veeramally @ 2013-11-05 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
v2: Fixed Johan's comments (splitting of patches, proper function and
struct names, update hal-msg.h and ipc document, alignment issues
removed pointer from ipc struct)
v1: This patch set implements get/set protocol and get/set report
interfaces and supported functionality in daemon. Sending notifications
and notification handling in hal. Few naming fixes and error handling.
And last handling of few uHID events.
Ravi kumar Veeramally (13):
android/hid: Add hid event proto mode structure to hal msg headers
android/hid: Implement hid get protocol in daemon
android/hid: Implement hid set protocol in daemon
android/hid: Handle protocol mode notification in hal
android/hid: Add hid event get report structure to hal msg headers
android/hid: Implement hid get report in daemon
android/hid: Add missing set report parameters to ipc document
android/hid: Implement hid set report in daemon
android/hid: Handle get report notification in hal
android/hid: Replace header checking magic number with defines
android/hid: Handle invalid parameters in hal
android/hid: Handle uhid events
android/hid: Align hal hid struct variables properly
android/hal-hidhost.c | 41 +++++-
android/hal-ipc-api.txt | 4 +-
android/hal-msg.h | 41 ++++--
android/hid.c | 329 ++++++++++++++++++++++++++++++++++++++++++++++--
4 files changed, 385 insertions(+), 30 deletions(-)
--
1.8.1.2
^ permalink raw reply
* [PATCH_v2 01/13] android/hid: Add hid event proto mode structure to hal msg headers
From: Ravi kumar Veeramally @ 2013-11-05 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383651495-12434-1-git-send-email-ravikumar.veeramally@linux.intel.com>
---
android/hal-msg.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/android/hal-msg.h b/android/hal-msg.h
index f381862..5faf852 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -442,6 +442,8 @@ struct hal_ev_hid_conn_state {
uint8_t state;
} __attribute__((packed));
+#define HAL_HID_STATUS_OK 0x00
+
#define HAL_EV_HID_INFO 0x82
struct hal_ev_hid_info {
uint8_t bdaddr[6];
@@ -456,6 +458,13 @@ struct hal_ev_hid_info {
uint8_t descr[884];
} __attribute__((packed));
+#define HAL_EV_HID_PROTO_MODE 0x83
+struct hal_ev_hid_proto_mode {
+ uint8_t bdaddr[6];
+ uint8_t status;
+ uint8_t mode;
+} __attribute__((packed));
+
#define HAL_EV_AV_CONNECTION_STATE 0x81
struct hal_ev_av_connection_state {
uint8_t state;
--
1.8.1.2
^ permalink raw reply related
* [PATCH_v2 02/13] android/hid: Implement hid get protocol in daemon
From: Ravi kumar Veeramally @ 2013-11-05 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383651495-12434-1-git-send-email-ravikumar.veeramally@linux.intel.com>
This patch requests hid device protocol mode and reads reply
message and sends notification to hal.
---
android/hid.c | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 104 insertions(+), 4 deletions(-)
diff --git a/android/hid.c b/android/hid.c
index c0c9aeb..97835d9 100644
--- a/android/hid.c
+++ b/android/hid.c
@@ -54,6 +54,14 @@
#define L2CAP_PSM_HIDP_INTR 0x13
#define UHID_DEVICE_FILE "/dev/uhid"
+/* HID message types */
+#define HID_MSG_GET_PROTOCOL 0x60
+#define HID_MSG_DATA 0xa0
+
+/* HID protocol header parameters */
+#define HID_PROTO_BOOT 0x00
+#define HID_PROTO_REPORT 0x01
+
static GIOChannel *notification_io = NULL;
static GIOChannel *ctrl_io = NULL;
static GIOChannel *intr_io = NULL;
@@ -76,6 +84,7 @@ struct hid_device {
guint intr_watch;
int uhid_fd;
guint uhid_watch_id;
+ int hid_msg;
};
static int device_cmp(gconstpointer s, gconstpointer user_data)
@@ -243,12 +252,74 @@ static gboolean intr_watch_cb(GIOChannel *chan, GIOCondition cond,
return FALSE;
}
+static void bt_hid_notify_proto_mode(struct hid_device *dev, uint8_t *buf,
+ int len)
+{
+ struct hal_ev_hid_proto_mode ev;
+ char address[18];
+
+ ba2str(&dev->dst, address);
+ DBG("device %s", address);
+
+ memset(&ev, 0, sizeof(ev));
+ bdaddr2android(&dev->dst, ev.bdaddr);
+
+ if (buf[0] == HID_MSG_DATA) {
+ ev.status = HAL_HID_STATUS_OK;
+ if (buf[1] == HID_PROTO_REPORT)
+ ev.mode = HAL_HID_REPORT_PROTOCOL;
+ else if (buf[1] == HID_PROTO_BOOT)
+ ev.mode = HAL_HID_BOOT_PROTOCOL;
+ else
+ ev.mode = HAL_HID_UNSUPPORTED_PROTOCOL;
+
+ } else {
+ ev.status = buf[0];
+ ev.mode = HAL_HID_UNSUPPORTED_PROTOCOL;
+ }
+
+ ipc_send(notification_io, HAL_SERVICE_ID_HIDHOST,
+ HAL_EV_HID_PROTO_MODE, sizeof(ev), &ev, -1);
+}
+
+static gboolean ctrl_io_watch_cb(GIOChannel *chan, gpointer data)
+{
+ struct hid_device *dev = data;
+ int fd, bread;
+ uint8_t buf[UHID_DATA_MAX];
+
+ DBG("");
+
+ fd = g_io_channel_unix_get_fd(chan);
+ bread = read(fd, buf, sizeof(buf));
+ if (bread < 0) {
+ error("read: %s(%d)", strerror(errno), -errno);
+ return TRUE;
+ }
+
+ switch (dev->hid_msg) {
+ case HID_MSG_GET_PROTOCOL:
+ bt_hid_notify_proto_mode(dev, buf, bread);
+ break;
+ default:
+ DBG("unhandled hid msg type 0x%02x", dev->hid_msg);
+ }
+
+ /* reset msg type request */
+ dev->hid_msg = -1;
+
+ return TRUE;
+}
+
static gboolean ctrl_watch_cb(GIOChannel *chan, GIOCondition cond,
gpointer data)
{
struct hid_device *dev = data;
char address[18];
+ if (cond & G_IO_IN)
+ return ctrl_io_watch_cb(chan, data);
+
ba2str(&dev->dst, address);
bt_hid_notify_state(dev, HAL_HID_STATE_DISCONNECTED);
@@ -395,8 +466,8 @@ static void control_connect_cb(GIOChannel *chan, GError *conn_err,
}
dev->ctrl_watch = g_io_add_watch(dev->ctrl_io,
- G_IO_HUP | G_IO_ERR | G_IO_NVAL,
- ctrl_watch_cb, dev);
+ G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
+ ctrl_watch_cb, dev);
return;
@@ -591,9 +662,38 @@ static uint8_t bt_hid_info(struct hal_cmd_hid_set_info *cmd, uint16_t len)
static uint8_t bt_hid_get_protocol(struct hal_cmd_hid_get_protocol *cmd,
uint16_t len)
{
- DBG("Not Implemented");
+ struct hid_device *dev;
+ GSList *l;
+ bdaddr_t dst;
+ int fd;
+ uint8_t hdr[1];
- return HAL_STATUS_FAILED;
+ DBG("");
+
+ if (len < sizeof(*cmd))
+ return HAL_STATUS_INVALID;
+
+ android2bdaddr(&cmd->bdaddr, &dst);
+
+ l = g_slist_find_custom(devices, &dst, device_cmp);
+ if (!l)
+ return HAL_STATUS_FAILED;
+
+ dev = l->data;
+
+ if (dev->boot_dev)
+ return HAL_STATUS_UNSUPPORTED;
+
+ dev->hid_msg = HID_MSG_GET_PROTOCOL;
+ hdr[0] = HID_MSG_GET_PROTOCOL | cmd->mode;
+ fd = g_io_channel_unix_get_fd(dev->ctrl_io);
+
+ if (write(fd, hdr, sizeof(hdr)) < 0) {
+ error("error while querying device protocol");
+ return HAL_STATUS_FAILED;
+ }
+
+ return HAL_STATUS_SUCCESS;
}
static uint8_t bt_hid_set_protocol(struct hal_cmd_hid_set_protocol *cmd,
--
1.8.1.2
^ permalink raw reply related
* [PATCH_v2 03/13] android/hid: Implement hid set protocol in daemon
From: Ravi kumar Veeramally @ 2013-11-05 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383651495-12434-1-git-send-email-ravikumar.veeramally@linux.intel.com>
This patch requests hid device to set protocol mode and reads
reply message and sends notification to hal.
---
android/hid.c | 35 +++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)
diff --git a/android/hid.c b/android/hid.c
index 97835d9..d387d6d 100644
--- a/android/hid.c
+++ b/android/hid.c
@@ -56,6 +56,7 @@
/* HID message types */
#define HID_MSG_GET_PROTOCOL 0x60
+#define HID_MSG_SET_PROTOCOL 0x70
#define HID_MSG_DATA 0xa0
/* HID protocol header parameters */
@@ -299,6 +300,7 @@ static gboolean ctrl_io_watch_cb(GIOChannel *chan, gpointer data)
switch (dev->hid_msg) {
case HID_MSG_GET_PROTOCOL:
+ case HID_MSG_SET_PROTOCOL:
bt_hid_notify_proto_mode(dev, buf, bread);
break;
default:
@@ -699,9 +701,38 @@ static uint8_t bt_hid_get_protocol(struct hal_cmd_hid_get_protocol *cmd,
static uint8_t bt_hid_set_protocol(struct hal_cmd_hid_set_protocol *cmd,
uint16_t len)
{
- DBG("Not Implemented");
+ struct hid_device *dev;
+ GSList *l;
+ bdaddr_t dst;
+ int fd;
+ uint8_t hdr[1];
- return HAL_STATUS_FAILED;
+ DBG("");
+
+ if (len < sizeof(*cmd))
+ return HAL_STATUS_INVALID;
+
+ android2bdaddr(&cmd->bdaddr, &dst);
+
+ l = g_slist_find_custom(devices, &dst, device_cmp);
+ if (!l)
+ return HAL_STATUS_FAILED;
+
+ dev = l->data;
+
+ if (dev->boot_dev)
+ return HAL_STATUS_UNSUPPORTED;
+
+ dev->hid_msg = HID_MSG_SET_PROTOCOL;
+ hdr[0] = HID_MSG_SET_PROTOCOL | cmd->mode;
+ fd = g_io_channel_unix_get_fd(dev->ctrl_io);
+
+ if (write(fd, hdr, sizeof(hdr)) < 0) {
+ error("error while setting device protocol");
+ return HAL_STATUS_FAILED;
+ }
+
+ return HAL_STATUS_SUCCESS;
}
static uint8_t bt_hid_get_report(struct hal_cmd_hid_get_report *cmd,
--
1.8.1.2
^ permalink raw reply related
* [PATCH_v2 04/13] android/hid: Handle protocol mode notification in hal
From: Ravi kumar Veeramally @ 2013-11-05 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383651495-12434-1-git-send-email-ravikumar.veeramally@linux.intel.com>
---
android/hal-hidhost.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index c20c785..13928e6 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -59,6 +59,15 @@ static void handle_info(void *buf)
bt_hh_cbacks->hid_info_cb((bt_bdaddr_t *) ev->bdaddr, info);
}
+static void handle_proto_mode(void *buf)
+{
+ struct hal_ev_hid_proto_mode *ev = buf;
+
+ if (bt_hh_cbacks->protocol_mode_cb)
+ bt_hh_cbacks->protocol_mode_cb((bt_bdaddr_t *) ev->bdaddr,
+ ev->status, ev->mode);
+}
+
/* will be called from notification thread context */
void bt_notify_hh(uint16_t opcode, void *buf, uint16_t len)
{
@@ -72,6 +81,9 @@ void bt_notify_hh(uint16_t opcode, void *buf, uint16_t len)
case HAL_EV_HID_INFO:
handle_info(buf);
break;
+ case HAL_EV_HID_PROTO_MODE:
+ handle_proto_mode(buf);
+ break;
default:
DBG("Unhandled callback opcode=0x%x", opcode);
break;
--
1.8.1.2
^ permalink raw reply related
* [PATCH_v2 05/13] android/hid: Add hid event get report structure to hal msg headers
From: Ravi kumar Veeramally @ 2013-11-05 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383651495-12434-1-git-send-email-ravikumar.veeramally@linux.intel.com>
---
android/hal-msg.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 5faf852..bc7df6b 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -465,6 +465,14 @@ struct hal_ev_hid_proto_mode {
uint8_t mode;
} __attribute__((packed));
+#define HAL_EV_HID_GET_REPORT 0x85
+struct hal_ev_hid_get_report {
+ uint8_t bdaddr[6];
+ uint8_t status;
+ uint16_t len;
+ uint8_t data[0];
+} __attribute__((packed));
+
#define HAL_EV_AV_CONNECTION_STATE 0x81
struct hal_ev_av_connection_state {
uint8_t state;
--
1.8.1.2
^ permalink raw reply related
* [PATCH_v2 06/13] android/hid: Implement hid get report in daemon
From: Ravi kumar Veeramally @ 2013-11-05 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383651495-12434-1-git-send-email-ravikumar.veeramally@linux.intel.com>
This patch requests hid device report and reads reply
message and sends notification to hal.
---
android/hal-hidhost.c | 1 +
android/hid.c | 104 +++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 103 insertions(+), 2 deletions(-)
diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index 13928e6..f554cb2 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -251,6 +251,7 @@ static bt_status_t hh_get_report(bt_bdaddr_t *bd_addr,
memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
cmd.id = reportId;
+ cmd.buf = bufferSize;
switch (reportType) {
case BTHH_INPUT_REPORT:
diff --git a/android/hid.c b/android/hid.c
index d387d6d..f1bf9e8 100644
--- a/android/hid.c
+++ b/android/hid.c
@@ -55,14 +55,23 @@
#define UHID_DEVICE_FILE "/dev/uhid"
/* HID message types */
+#define HID_MSG_GET_REPORT 0x40
#define HID_MSG_GET_PROTOCOL 0x60
#define HID_MSG_SET_PROTOCOL 0x70
#define HID_MSG_DATA 0xa0
+/* HID data types */
+#define HID_DATA_TYPE_INPUT 0x01
+#define HID_DATA_TYPE_OUTPUT 0x02
+#define HID_DATA_TYPE_FEATURE 0x03
+
/* HID protocol header parameters */
#define HID_PROTO_BOOT 0x00
#define HID_PROTO_REPORT 0x01
+/* HID GET REPORT Size Field */
+#define HID_GET_REPORT_SIZE_FIELD 0x08
+
static GIOChannel *notification_io = NULL;
static GIOChannel *ctrl_io = NULL;
static GIOChannel *intr_io = NULL;
@@ -283,6 +292,52 @@ static void bt_hid_notify_proto_mode(struct hid_device *dev, uint8_t *buf,
HAL_EV_HID_PROTO_MODE, sizeof(ev), &ev, -1);
}
+static void bt_hid_notify_get_report(struct hid_device *dev, uint8_t *buf,
+ int len)
+{
+ struct hal_ev_hid_get_report *ev;
+ int ev_len;
+ char address[18];
+
+ ba2str(&dev->dst, address);
+ DBG("device %s", address);
+
+ ev_len = sizeof(*ev) + sizeof(struct hal_ev_hid_get_report) + 1;
+
+ if (!((buf[0] == (HID_MSG_DATA | HID_DATA_TYPE_INPUT)) ||
+ (buf[0] == (HID_MSG_DATA | HID_DATA_TYPE_OUTPUT)) ||
+ (buf[0] == (HID_MSG_DATA | HID_DATA_TYPE_FEATURE)))) {
+ ev = g_malloc(len);
+ memset(ev, 0, ev_len);
+ ev->status = buf[0];
+ bdaddr2android(&dev->dst, ev->bdaddr);
+ goto send;
+ }
+
+ /* Report porotocol mode reply contains id after hdr, in boot
+ * protocol mode id doesn't exist */
+ ev_len += (dev->boot_dev) ? (len - 1) : (len - 2);
+ ev = g_malloc(ev_len);
+ memset(ev, 0, ev_len);
+ ev->status = HAL_HID_STATUS_OK;
+ bdaddr2android(&dev->dst, ev->bdaddr);
+
+ /* Report porotocol mode reply contains id after hdr, in boot
+ * protocol mode id doesn't exist */
+ if (dev->boot_dev) {
+ ev->len = len - 1;
+ memcpy(ev->data, buf + 1, ev->len);
+ } else {
+ ev->len = len - 2;
+ memcpy(ev->data, buf + 2, ev->len);
+ }
+
+send:
+ ipc_send(notification_io, HAL_SERVICE_ID_HIDHOST, HAL_EV_HID_GET_REPORT,
+ ev_len, ev, -1);
+ g_free(ev);
+}
+
static gboolean ctrl_io_watch_cb(GIOChannel *chan, gpointer data)
{
struct hid_device *dev = data;
@@ -303,6 +358,9 @@ static gboolean ctrl_io_watch_cb(GIOChannel *chan, gpointer data)
case HID_MSG_SET_PROTOCOL:
bt_hid_notify_proto_mode(dev, buf, bread);
break;
+ case HID_MSG_GET_REPORT:
+ bt_hid_notify_get_report(dev, buf, bread);
+ break;
default:
DBG("unhandled hid msg type 0x%02x", dev->hid_msg);
}
@@ -738,9 +796,51 @@ static uint8_t bt_hid_set_protocol(struct hal_cmd_hid_set_protocol *cmd,
static uint8_t bt_hid_get_report(struct hal_cmd_hid_get_report *cmd,
uint16_t len)
{
- DBG("Not Implemented");
+ struct hid_device *dev;
+ GSList *l;
+ bdaddr_t dst;
+ int fd;
+ uint8_t *req;
+ uint8_t req_size;
- return HAL_STATUS_FAILED;
+ DBG("");
+
+ if (len < sizeof(*cmd))
+ return HAL_STATUS_INVALID;
+
+ android2bdaddr(&cmd->bdaddr, &dst);
+
+ l = g_slist_find_custom(devices, &dst, device_cmp);
+ if (!l)
+ return HAL_STATUS_FAILED;
+
+ dev = l->data;
+ dev->hid_msg = HID_MSG_GET_REPORT;
+ req_size = (cmd->buf > 0) ? 4 : 2;
+ req = g_try_malloc0(req_size);
+ if (!req)
+ return HAL_STATUS_NOMEM;
+
+ req[0] = HID_MSG_GET_REPORT | cmd->type;
+
+ if (cmd->buf > 0)
+ req[0] = req[0] | HID_GET_REPORT_SIZE_FIELD;
+
+ req[1] = cmd->id;
+
+ if (cmd->buf > 0)
+ bt_put_le16(cmd->buf, (req + 2));
+
+ fd = g_io_channel_unix_get_fd(dev->ctrl_io);
+
+ if (write(fd, req, req_size) < 0) {
+ error("error while querying device protocol");
+ g_free(req);
+ return HAL_STATUS_FAILED;
+ }
+
+ g_free(req);
+ return HAL_STATUS_SUCCESS;
}
static uint8_t bt_hid_set_report(struct hal_cmd_hid_set_report *cmd,
--
1.8.1.2
^ permalink raw reply related
* [PATCH_v2 07/13] android/hid: Add missing set report parameters to ipc document
From: Ravi kumar Veeramally @ 2013-11-05 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383651495-12434-1-git-send-email-ravikumar.veeramally@linux.intel.com>
---
android/hal-ipc-api.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/android/hal-ipc-api.txt b/android/hal-ipc-api.txt
index 6b11684..48bcc45 100644
--- a/android/hal-ipc-api.txt
+++ b/android/hal-ipc-api.txt
@@ -552,7 +552,9 @@ Commands and responses:
Command parameters: Remote address (6 octets)
Report type (1 octet)
- ...
+ Report length (2 octet)
+ Report data (670 octet) L2CAP default MTU
+
Response parameters: <none>
Valid report types: 0x01 = Input
--
1.8.1.2
^ permalink raw reply related
* [PATCH_v2 08/13] android/hid: Implement hid set report in daemon
From: Ravi kumar Veeramally @ 2013-11-05 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383651495-12434-1-git-send-email-ravikumar.veeramally@linux.intel.com>
This patch requests hid device to set report.
---
android/hal-hidhost.c | 2 ++
android/hal-msg.h | 6 ++++--
android/hid.c | 40 ++++++++++++++++++++++++++++++++++++++--
3 files changed, 44 insertions(+), 4 deletions(-)
diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index f554cb2..29e3ee0 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -284,6 +284,8 @@ static bt_status_t hh_set_report(bt_bdaddr_t *bd_addr,
return BT_STATUS_PARM_INVALID;
memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
+ cmd.len = strlen(report);
+ memcpy(cmd.data, report, cmd.len);
switch (reportType) {
case BTHH_INPUT_REPORT:
diff --git a/android/hal-msg.h b/android/hal-msg.h
index bc7df6b..2c3067f 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -290,8 +290,10 @@ struct hal_cmd_hid_get_report {
#define HAL_OP_HID_SET_REPORT 0x08
struct hal_cmd_hid_set_report {
- uint8_t bdaddr[6];
- uint8_t type;
+ uint8_t bdaddr[6];
+ uint8_t type;
+ uint16_t len;
+ uint8_t data[670];
} __attribute__((packed));
#define HAL_OP_HID_SEND_DATA 0x09
diff --git a/android/hid.c b/android/hid.c
index f1bf9e8..25e33fa 100644
--- a/android/hid.c
+++ b/android/hid.c
@@ -56,6 +56,7 @@
/* HID message types */
#define HID_MSG_GET_REPORT 0x40
+#define HID_MSG_SET_REPORT 0x50
#define HID_MSG_GET_PROTOCOL 0x60
#define HID_MSG_SET_PROTOCOL 0x70
#define HID_MSG_DATA 0xa0
@@ -846,9 +847,44 @@ static uint8_t bt_hid_get_report(struct hal_cmd_hid_get_report *cmd,
static uint8_t bt_hid_set_report(struct hal_cmd_hid_set_report *cmd,
uint16_t len)
{
- DBG("Not Implemented");
+ struct hid_device *dev;
+ GSList *l;
+ bdaddr_t dst;
+ int fd;
+ uint8_t *req;
+ uint8_t req_size;
- return HAL_STATUS_FAILED;
+ DBG("");
+
+ if (len < sizeof(*cmd))
+ return HAL_STATUS_INVALID;
+
+ android2bdaddr(&cmd->bdaddr, &dst);
+
+ l = g_slist_find_custom(devices, &dst, device_cmp);
+ if (!l)
+ return HAL_STATUS_FAILED;
+
+ dev = l->data;
+ dev->hid_msg = HID_MSG_SET_REPORT;
+ req_size = 1 + cmd->len;
+ req = g_try_malloc0(req_size);
+ if (!req)
+ return HAL_STATUS_NOMEM;
+
+ req[0] = HID_MSG_SET_REPORT | cmd->type;
+ memcpy(req + 1, cmd->data, req_size - 1);
+
+ fd = g_io_channel_unix_get_fd(dev->ctrl_io);
+
+ if (write(fd, req, req_size) < 0) {
+ error("error while querying device protocol");
+ g_free(req);
+ return HAL_STATUS_FAILED;
+ }
+
+ g_free(req);
+ return HAL_STATUS_SUCCESS;
}
static uint8_t bt_hid_send_data(struct hal_cmd_hid_send_data *cmd,
--
1.8.1.2
^ permalink raw reply related
* [PATCH_v2 09/13] android/hid: Handle get report notification in hal
From: Ravi kumar Veeramally @ 2013-11-05 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383651495-12434-1-git-send-email-ravikumar.veeramally@linux.intel.com>
---
android/hal-hidhost.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index 29e3ee0..fe68fe7 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -68,6 +68,15 @@ static void handle_proto_mode(void *buf)
ev->status, ev->mode);
}
+static void handle_get_report(void *buf)
+{
+ struct hal_ev_hid_get_report *ev = buf;
+
+ if (bt_hh_cbacks->get_report_cb)
+ bt_hh_cbacks->get_report_cb((bt_bdaddr_t *) ev->bdaddr,
+ ev->status, ev->data, ev->len);
+}
+
/* will be called from notification thread context */
void bt_notify_hh(uint16_t opcode, void *buf, uint16_t len)
{
@@ -84,6 +93,9 @@ void bt_notify_hh(uint16_t opcode, void *buf, uint16_t len)
case HAL_EV_HID_PROTO_MODE:
handle_proto_mode(buf);
break;
+ case HAL_EV_HID_GET_REPORT:
+ handle_get_report(buf);
+ break;
default:
DBG("Unhandled callback opcode=0x%x", opcode);
break;
--
1.8.1.2
^ permalink raw reply related
* [PATCH_v2 10/13] android/hid: Replace header checking magic number with defines
From: Ravi kumar Veeramally @ 2013-11-05 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383651495-12434-1-git-send-email-ravikumar.veeramally@linux.intel.com>
---
android/hid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/android/hid.c b/android/hid.c
index 25e33fa..d3a74b9 100644
--- a/android/hid.c
+++ b/android/hid.c
@@ -200,7 +200,7 @@ static gboolean intr_io_watch_cb(GIOChannel *chan, gpointer data)
}
/* Discard non-data packets */
- if (bread == 0 || buf[0] != 0xA1)
+ if (bread == 0 || buf[0] != (HID_MSG_DATA | HID_DATA_TYPE_INPUT))
return TRUE;
/* send data to uHID device skipping HIDP header byte */
--
1.8.1.2
^ permalink raw reply related
* [PATCH_v2 11/13] android/hid: Handle invalid parameters in hal
From: Ravi kumar Veeramally @ 2013-11-05 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383651495-12434-1-git-send-email-ravikumar.veeramally@linux.intel.com>
---
android/hal-hidhost.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index fe68fe7..815902b 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -204,9 +204,8 @@ static bt_status_t hh_get_protocol(bt_bdaddr_t *bd_addr,
case BTHH_BOOT_MODE:
cmd.mode = HAL_HID_BOOT_PROTOCOL;
break;
- case BTHH_UNSUPPORTED_MODE:
- cmd.mode = HAL_HID_UNSUPPORTED_PROTOCOL;
- break;
+ default:
+ return BT_STATUS_PARM_INVALID;
}
return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST,
@@ -236,9 +235,8 @@ static bt_status_t hh_set_protocol(bt_bdaddr_t *bd_addr,
case BTHH_BOOT_MODE:
cmd.mode = HAL_HID_BOOT_PROTOCOL;
break;
- case BTHH_UNSUPPORTED_MODE:
- cmd.mode = HAL_HID_UNSUPPORTED_PROTOCOL;
- break;
+ default:
+ return BT_STATUS_PARM_INVALID;
}
return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST,
@@ -275,6 +273,8 @@ static bt_status_t hh_get_report(bt_bdaddr_t *bd_addr,
case BTHH_FEATURE_REPORT:
cmd.type = HAL_HID_FEATURE_REPORT;
break;
+ default:
+ return BT_STATUS_PARM_INVALID;
}
return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, HAL_OP_HID_GET_REPORT,
@@ -309,6 +309,8 @@ static bt_status_t hh_set_report(bt_bdaddr_t *bd_addr,
case BTHH_FEATURE_REPORT:
cmd.type = HAL_HID_FEATURE_REPORT;
break;
+ default:
+ return BT_STATUS_PARM_INVALID;
}
return hal_ipc_cmd(HAL_SERVICE_ID_HIDHOST, HAL_OP_HID_SET_REPORT,
--
1.8.1.2
^ permalink raw reply related
* [PATCH_v2 12/13] android/hid: Handle uhid events
From: Ravi kumar Veeramally @ 2013-11-05 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383651495-12434-1-git-send-email-ravikumar.veeramally@linux.intel.com>
Handling few uhid events and described scenarios. OUTPUT and
FEATURE events are not yet handled.
---
android/hid.c | 40 +++++++++++++++++++++++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
diff --git a/android/hid.c b/android/hid.c
index d3a74b9..8f3a28a 100644
--- a/android/hid.c
+++ b/android/hid.c
@@ -149,6 +149,11 @@ static void hid_device_free(struct hid_device *dev)
g_free(dev);
}
+static void handle_uhid_event(struct hid_device *dev, struct uhid_event *ev)
+{
+ DBG("UHID_OUTPUT UHID_FEATURE unsupported");
+}
+
static gboolean uhid_event_cb(GIOChannel *io, GIOCondition cond,
gpointer user_data)
{
@@ -172,7 +177,40 @@ static gboolean uhid_event_cb(GIOChannel *io, GIOCondition cond,
}
DBG("uHID event type %d received", ev.type);
- /* TODO Handle events */
+
+ switch (ev.type) {
+ case UHID_START:
+ case UHID_STOP:
+ /* These are called to start and stop the underlying hardware.
+ * We open the channels before creating the device so the
+ * hardware is always ready. No need to handle these.
+ * The kernel never destroys a device itself! Only an explicit
+ * UHID_DESTROY request can remove a device. */
+
+ break;
+ case UHID_OPEN:
+ case UHID_CLOSE:
+ /* OPEN/CLOSE are sent whenever user-space opens any interface
+ * provided by the kernel HID device. Whenever the open-count
+ * is non-zero we must be ready for I/O. As long as it is zero,
+ * we can decide to drop all I/O and put the device
+ * asleep This is optional, though. */
+ break;
+ case UHID_OUTPUT:
+ case UHID_FEATURE:
+ handle_uhid_event(dev, &ev);
+ break;
+ case UHID_OUTPUT_EV:
+ /* This is only sent by kernels prior to linux-3.11. It
+ * requires us to parse HID-descriptors in user-space to
+ * properly handle it. This is redundant as the kernel
+ * does it already. That's why newer kernels assemble
+ * the output-reports and send it to us via UHID_OUTPUT. */
+ DBG("UHID_OUTPUT_EV unsupported");
+ break;
+ default:
+ warn("unexpected uHID event");
+ }
return TRUE;
--
1.8.1.2
^ permalink raw reply related
* [PATCH_v2 13/13] android/hid: Align hal hid struct variables properly
From: Ravi kumar Veeramally @ 2013-11-05 11:38 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383651495-12434-1-git-send-email-ravikumar.veeramally@linux.intel.com>
---
android/hal-msg.h | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/android/hal-msg.h b/android/hal-msg.h
index 2c3067f..41ba649 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -282,9 +282,9 @@ struct hal_cmd_hid_set_protocol {
#define HAL_OP_HID_GET_REPORT 0x07
struct hal_cmd_hid_get_report {
- uint8_t bdaddr[6];
- uint8_t type;
- uint8_t id;
+ uint8_t bdaddr[6];
+ uint8_t type;
+ uint8_t id;
uint16_t buf;
} __attribute__((packed));
@@ -448,16 +448,16 @@ struct hal_ev_hid_conn_state {
#define HAL_EV_HID_INFO 0x82
struct hal_ev_hid_info {
- uint8_t bdaddr[6];
- uint8_t attr;
- uint8_t subclass;
- uint8_t app_id;
+ uint8_t bdaddr[6];
+ uint8_t attr;
+ uint8_t subclass;
+ uint8_t app_id;
uint16_t vendor;
uint16_t product;
uint16_t version;
- uint8_t country;
+ uint8_t country;
uint16_t descr_len;
- uint8_t descr[884];
+ uint8_t descr[884];
} __attribute__((packed));
#define HAL_EV_HID_PROTO_MODE 0x83
--
1.8.1.2
^ permalink raw reply related
* [PATCH] android/client: Fix build for android 4.3
From: Jerzy Kasenberg @ 2013-11-05 11:48 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Jerzy Kasenberg
Chagnes in HAL interface from 4.3 to 4.4 result in build failure:
target thumb C: haltest <=
external/bluetooth/bluez/android/client/if-gatt.c
external/bluetooth/bluez/android/client/if-gatt.c:225:1:
error: unknown type name 'btgatt_gatt_id_t'
This patch allows to build GATT for Android 4.3 (api level 18).
---
I sent this patch to the mailing list primarily to allow people
who work on android 4.3 to be able to build GATT.
android/client/if-gatt.c | 27 +++++++++++++++++++++------
1 file changed, 21 insertions(+), 6 deletions(-)
diff --git a/android/client/if-gatt.c b/android/client/if-gatt.c
index f070bb3..b2b20cb 100644
--- a/android/client/if-gatt.c
+++ b/android/client/if-gatt.c
@@ -21,6 +21,21 @@
const btgatt_interface_t *if_gatt = NULL;
+/* In version 19 some callback were changed.
+ * btgatt_char_id_t -> btgatt_gatt_id_t
+ * bt_uuid_t -> btgatt_gatt_id_t
+ */
+#if PLATFORM_SDK_VERSION > 18
+#define str2btgatt_descr_id_t str2btgatt_gatt_id_t
+#define btgatt_descr_id_t2str btgatt_gatt_id_t2str
+#define btgatt_descr_id_t btgatt_gatt_id_t
+#else
+#define btgatt_descr_id_t2str gatt_uuid_t2str
+#define str2btgatt_descr_id_t(a, b) gatt_str2bt_uuid_t(a, -1, b)
+#define btgatt_gatt_id_t btgatt_char_id_t
+#define btgatt_descr_id_t bt_uuid_t
+#endif
+
#define MAX_CHAR_ID_STR_LEN (MAX_UUID_STR_LEN + 3 + 11)
#define MAX_SRVC_ID_STR_LEN (MAX_UUID_STR_LEN + 3 + 11 + 1 + 11)
/* How man characters print from binary objects (arbitrary) */
@@ -90,7 +105,7 @@ const btgatt_interface_t *if_gatt = NULL;
#define VERIFY_DESCR_ID(n, v) \
do { \
if (n < argc) \
- str2btgatt_gatt_id_t(argv[n], v); \
+ str2btgatt_descr_id_t(argv[n], v); \
else { \
haltest_error("No descr_id specified\n"); \
return;\
@@ -358,7 +373,7 @@ static char *btgatt_read_params_t2str(const btgatt_read_params_t *data,
sprintf(buf, "{srvc_id=%s, char_id=%s, descr_id=%s, val=%s value_type=%d, status=%d}",
btgatt_srvc_id_t2str(&data->srvc_id, srvc_id),
btgatt_gatt_id_t2str(&data->char_id, char_id),
- btgatt_gatt_id_t2str(&data->descr_id, descr_id),
+ btgatt_descr_id_t2str(&data->descr_id, descr_id),
btgatt_unformatted_value_t2str(&data->value, value, 100),
data->value_type, data->status);
return buf;
@@ -455,7 +470,7 @@ static void gattc_get_characteristic_cb(int conn_id, int status,
/* GATT descriptor enumeration result callback */
static void gattc_get_descriptor_cb(int conn_id, int status,
btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
- btgatt_gatt_id_t *descr_id)
+ btgatt_descr_id_t *descr_id)
{
char buf[MAX_UUID_STR_LEN];
char srvc_id_buf[MAX_SRVC_ID_STR_LEN];
@@ -465,7 +480,7 @@ static void gattc_get_descriptor_cb(int conn_id, int status,
__func__, conn_id, status,
btgatt_srvc_id_t2str(srvc_id, srvc_id_buf),
btgatt_gatt_id_t2str(char_id, char_id_buf),
- btgatt_gatt_id_t2str(descr_id, buf));
+ btgatt_descr_id_t2str(descr_id, buf));
if (status == 0)
EXEC(if_gatt->client->get_descriptor, conn_id, srvc_id, char_id,
@@ -1124,7 +1139,7 @@ static void read_descriptor_p(int argc, const char **argv)
int conn_id;
btgatt_srvc_id_t srvc_id;
btgatt_gatt_id_t char_id;
- btgatt_gatt_id_t descr_id;
+ btgatt_descr_id_t descr_id;
int auth_req = 0;
RETURN_IF_NULL(if_gatt);
@@ -1166,7 +1181,7 @@ static void write_descriptor_p(int argc, const char **argv)
int conn_id;
btgatt_srvc_id_t srvc_id;
btgatt_gatt_id_t char_id;
- btgatt_gatt_id_t descr_id;
+ btgatt_descr_id_t descr_id;
int write_type;
int len;
int auth_req = 0;
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH] Bluetooth: Fix to set proper bdaddr_type for RFCOMM connect
From: Marcel Holtmann @ 2013-11-05 12:07 UTC (permalink / raw)
To: Seung-Woo Kim
Cc: linux-bluetooth@vger.kernel.org development, Gustavo F. Padovan,
Johan Hedberg, Syam Sidhardhan
In-Reply-To: <1383639342-9972-1-git-send-email-sw0312.kim@samsung.com>
Hi Seung-Woo,
> L2CAP socket validates proper bdaddr_type for connect, so this
> patch fixes to set explictly bdaddr_type for RFCOMM connect.
>
> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
> ---
> net/bluetooth/rfcomm/core.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply
* [PATCH_v3 01/04] android/hid: Implement hid get protocol in daemon
From: Ravi kumar Veeramally @ 2013-11-05 12:22 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
This patch requests hid device protocol mode and reads reply
message and sends notification to hal.
---
v3: Changed hid_msg to last_hid_msg and variable type uint8_t type
---
android/hid.c | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 104 insertions(+), 4 deletions(-)
diff --git a/android/hid.c b/android/hid.c
index c0c9aeb..97835d9 100644
--- a/android/hid.c
+++ b/android/hid.c
@@ -54,6 +54,14 @@
#define L2CAP_PSM_HIDP_INTR 0x13
#define UHID_DEVICE_FILE "/dev/uhid"
+/* HID message types */
+#define HID_MSG_GET_PROTOCOL 0x60
+#define HID_MSG_DATA 0xa0
+
+/* HID protocol header parameters */
+#define HID_PROTO_BOOT 0x00
+#define HID_PROTO_REPORT 0x01
+
static GIOChannel *notification_io = NULL;
static GIOChannel *ctrl_io = NULL;
static GIOChannel *intr_io = NULL;
@@ -76,6 +84,7 @@ struct hid_device {
guint intr_watch;
int uhid_fd;
guint uhid_watch_id;
+ uint8_t last_hid_msg;
};
static int device_cmp(gconstpointer s, gconstpointer user_data)
@@ -243,12 +252,74 @@ static gboolean intr_watch_cb(GIOChannel *chan, GIOCondition cond,
return FALSE;
}
+static void bt_hid_notify_proto_mode(struct hid_device *dev, uint8_t *buf,
+ int len)
+{
+ struct hal_ev_hid_proto_mode ev;
+ char address[18];
+
+ ba2str(&dev->dst, address);
+ DBG("device %s", address);
+
+ memset(&ev, 0, sizeof(ev));
+ bdaddr2android(&dev->dst, ev.bdaddr);
+
+ if (buf[0] == HID_MSG_DATA) {
+ ev.status = HAL_HID_STATUS_OK;
+ if (buf[1] == HID_PROTO_REPORT)
+ ev.mode = HAL_HID_REPORT_PROTOCOL;
+ else if (buf[1] == HID_PROTO_BOOT)
+ ev.mode = HAL_HID_BOOT_PROTOCOL;
+ else
+ ev.mode = HAL_HID_UNSUPPORTED_PROTOCOL;
+
+ } else {
+ ev.status = buf[0];
+ ev.mode = HAL_HID_UNSUPPORTED_PROTOCOL;
+ }
+
+ ipc_send(notification_io, HAL_SERVICE_ID_HIDHOST,
+ HAL_EV_HID_PROTO_MODE, sizeof(ev), &ev, -1);
+}
+
+static gboolean ctrl_io_watch_cb(GIOChannel *chan, gpointer data)
+{
+ struct hid_device *dev = data;
+ int fd, bread;
+ uint8_t buf[UHID_DATA_MAX];
+
+ DBG("");
+
+ fd = g_io_channel_unix_get_fd(chan);
+ bread = read(fd, buf, sizeof(buf));
+ if (bread < 0) {
+ error("read: %s(%d)", strerror(errno), -errno);
+ return TRUE;
+ }
+
+ switch (dev->last_hid_msg) {
+ case HID_MSG_GET_PROTOCOL:
+ bt_hid_notify_proto_mode(dev, buf, bread);
+ break;
+ default:
+ DBG("unhandled hid msg type 0x%02x", dev->last_hid_msg);
+ }
+
+ /* reset msg type request */
+ dev->last_hid_msg = 0;
+
+ return TRUE;
+}
+
static gboolean ctrl_watch_cb(GIOChannel *chan, GIOCondition cond,
gpointer data)
{
struct hid_device *dev = data;
char address[18];
+ if (cond & G_IO_IN)
+ return ctrl_io_watch_cb(chan, data);
+
ba2str(&dev->dst, address);
bt_hid_notify_state(dev, HAL_HID_STATE_DISCONNECTED);
@@ -395,8 +466,8 @@ static void control_connect_cb(GIOChannel *chan, GError *conn_err,
}
dev->ctrl_watch = g_io_add_watch(dev->ctrl_io,
- G_IO_HUP | G_IO_ERR | G_IO_NVAL,
- ctrl_watch_cb, dev);
+ G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
+ ctrl_watch_cb, dev);
return;
@@ -591,9 +662,38 @@ static uint8_t bt_hid_info(struct hal_cmd_hid_set_info *cmd, uint16_t len)
static uint8_t bt_hid_get_protocol(struct hal_cmd_hid_get_protocol *cmd,
uint16_t len)
{
- DBG("Not Implemented");
+ struct hid_device *dev;
+ GSList *l;
+ bdaddr_t dst;
+ int fd;
+ uint8_t hdr[1];
- return HAL_STATUS_FAILED;
+ DBG("");
+
+ if (len < sizeof(*cmd))
+ return HAL_STATUS_INVALID;
+
+ android2bdaddr(&cmd->bdaddr, &dst);
+
+ l = g_slist_find_custom(devices, &dst, device_cmp);
+ if (!l)
+ return HAL_STATUS_FAILED;
+
+ dev = l->data;
+
+ if (dev->boot_dev)
+ return HAL_STATUS_UNSUPPORTED;
+
+ hdr[0] = HID_MSG_GET_PROTOCOL | cmd->mode;
+ fd = g_io_channel_unix_get_fd(dev->ctrl_io);
+
+ if (write(fd, hdr, sizeof(hdr)) < 0) {
+ error("error while querying device protocol");
+ return HAL_STATUS_FAILED;
+ }
+
+ dev->last_hid_msg = HID_MSG_GET_PROTOCOL;
+ return HAL_STATUS_SUCCESS;
}
static uint8_t bt_hid_set_protocol(struct hal_cmd_hid_set_protocol *cmd,
--
1.8.1.2
^ permalink raw reply related
* [PATCH_v3 02/04] android/hid: Implement hid set protocol in daemon
From: Ravi kumar Veeramally @ 2013-11-05 12:22 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383654126-19237-1-git-send-email-ravikumar.veeramally@linux.intel.com>
This patch requests hid device to set protocol mode and reads
reply message and sends notification to hal.
---
android/hid.c | 35 +++++++++++++++++++++++++++++++++--
1 file changed, 33 insertions(+), 2 deletions(-)
diff --git a/android/hid.c b/android/hid.c
index 97835d9..d387d6d 100644
--- a/android/hid.c
+++ b/android/hid.c
@@ -56,6 +56,7 @@
/* HID message types */
#define HID_MSG_GET_PROTOCOL 0x60
+#define HID_MSG_SET_PROTOCOL 0x70
#define HID_MSG_DATA 0xa0
/* HID protocol header parameters */
@@ -299,6 +300,7 @@ static gboolean ctrl_io_watch_cb(GIOChannel *chan, gpointer data)
switch (dev->last_hid_msg) {
case HID_MSG_GET_PROTOCOL:
+ case HID_MSG_SET_PROTOCOL:
bt_hid_notify_proto_mode(dev, buf, bread);
break;
default:
@@ -699,9 +701,38 @@ static uint8_t bt_hid_get_protocol(struct hal_cmd_hid_get_protocol *cmd,
static uint8_t bt_hid_set_protocol(struct hal_cmd_hid_set_protocol *cmd,
uint16_t len)
{
- DBG("Not Implemented");
+ struct hid_device *dev;
+ GSList *l;
+ bdaddr_t dst;
+ int fd;
+ uint8_t hdr[1];
- return HAL_STATUS_FAILED;
+ DBG("");
+
+ if (len < sizeof(*cmd))
+ return HAL_STATUS_INVALID;
+
+ android2bdaddr(&cmd->bdaddr, &dst);
+
+ l = g_slist_find_custom(devices, &dst, device_cmp);
+ if (!l)
+ return HAL_STATUS_FAILED;
+
+ dev = l->data;
+
+ if (dev->boot_dev)
+ return HAL_STATUS_UNSUPPORTED;
+
+ hdr[0] = HID_MSG_SET_PROTOCOL | cmd->mode;
+ fd = g_io_channel_unix_get_fd(dev->ctrl_io);
+
+ if (write(fd, hdr, sizeof(hdr)) < 0) {
+ error("error while setting device protocol");
+ return HAL_STATUS_FAILED;
+ }
+
+ dev->last_hid_msg = HID_MSG_SET_PROTOCOL;
+ return HAL_STATUS_SUCCESS;
}
static uint8_t bt_hid_get_report(struct hal_cmd_hid_get_report *cmd,
--
1.8.1.2
^ permalink raw reply related
* [PATCH_v3 03/04] android/hid: Implement hid get report in daemon
From: Ravi kumar Veeramally @ 2013-11-05 12:22 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383654126-19237-1-git-send-email-ravikumar.veeramally@linux.intel.com>
This patch requests hid device report and reads reply
message and sends notification to hal.
---
android/hal-hidhost.c | 1 +
android/hid.c | 105 +++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 104 insertions(+), 2 deletions(-)
diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index 13928e6..f554cb2 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -251,6 +251,7 @@ static bt_status_t hh_get_report(bt_bdaddr_t *bd_addr,
memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
cmd.id = reportId;
+ cmd.buf = bufferSize;
switch (reportType) {
case BTHH_INPUT_REPORT:
diff --git a/android/hid.c b/android/hid.c
index d387d6d..f1bf9e8 100644
--- a/android/hid.c
+++ b/android/hid.c
@@ -55,14 +55,23 @@
#define UHID_DEVICE_FILE "/dev/uhid"
/* HID message types */
+#define HID_MSG_GET_REPORT 0x40
#define HID_MSG_GET_PROTOCOL 0x60
#define HID_MSG_SET_PROTOCOL 0x70
#define HID_MSG_DATA 0xa0
+/* HID data types */
+#define HID_DATA_TYPE_INPUT 0x01
+#define HID_DATA_TYPE_OUTPUT 0x02
+#define HID_DATA_TYPE_FEATURE 0x03
+
/* HID protocol header parameters */
#define HID_PROTO_BOOT 0x00
#define HID_PROTO_REPORT 0x01
+/* HID GET REPORT Size Field */
+#define HID_GET_REPORT_SIZE_FIELD 0x08
+
static GIOChannel *notification_io = NULL;
static GIOChannel *ctrl_io = NULL;
static GIOChannel *intr_io = NULL;
@@ -283,6 +292,52 @@ static void bt_hid_notify_proto_mode(struct hid_device *dev, uint8_t *buf,
HAL_EV_HID_PROTO_MODE, sizeof(ev), &ev, -1);
}
+static void bt_hid_notify_get_report(struct hid_device *dev, uint8_t *buf,
+ int len)
+{
+ struct hal_ev_hid_get_report *ev;
+ int ev_len;
+ char address[18];
+
+ ba2str(&dev->dst, address);
+ DBG("device %s", address);
+
+ ev_len = sizeof(*ev) + sizeof(struct hal_ev_hid_get_report) + 1;
+
+ if (!((buf[0] == (HID_MSG_DATA | HID_DATA_TYPE_INPUT)) ||
+ (buf[0] == (HID_MSG_DATA | HID_DATA_TYPE_OUTPUT)) ||
+ (buf[0] == (HID_MSG_DATA | HID_DATA_TYPE_FEATURE)))) {
+ ev = g_malloc(len);
+ memset(ev, 0, ev_len);
+ ev->status = buf[0];
+ bdaddr2android(&dev->dst, ev->bdaddr);
+ goto send;
+ }
+
+ /* Report porotocol mode reply contains id after hdr, in boot
+ * protocol mode id doesn't exist */
+ ev_len += (dev->boot_dev) ? (len - 1) : (len - 2);
+ ev = g_malloc(ev_len);
+ memset(ev, 0, ev_len);
+ ev->status = HAL_HID_STATUS_OK;
+ bdaddr2android(&dev->dst, ev->bdaddr);
+
+ /* Report porotocol mode reply contains id after hdr, in boot
+ * protocol mode id doesn't exist */
+ if (dev->boot_dev) {
+ ev->len = len - 1;
+ memcpy(ev->data, buf + 1, ev->len);
+ } else {
+ ev->len = len - 2;
+ memcpy(ev->data, buf + 2, ev->len);
+ }
+
+send:
+ ipc_send(notification_io, HAL_SERVICE_ID_HIDHOST, HAL_EV_HID_GET_REPORT,
+ ev_len, ev, -1);
+ g_free(ev);
+}
+
static gboolean ctrl_io_watch_cb(GIOChannel *chan, gpointer data)
{
struct hid_device *dev = data;
@@ -303,6 +358,9 @@ static gboolean ctrl_io_watch_cb(GIOChannel *chan, gpointer data)
case HID_MSG_SET_PROTOCOL:
bt_hid_notify_proto_mode(dev, buf, bread);
break;
+ case HID_MSG_GET_REPORT:
+ bt_hid_notify_get_report(dev, buf, bread);
+ break;
default:
DBG("unhandled hid msg type 0x%02x", dev->last_hid_msg);
}
@@ -738,9 +796,51 @@ static uint8_t bt_hid_set_protocol(struct hal_cmd_hid_set_protocol *cmd,
static uint8_t bt_hid_get_report(struct hal_cmd_hid_get_report *cmd,
uint16_t len)
{
- DBG("Not Implemented");
+ struct hid_device *dev;
+ GSList *l;
+ bdaddr_t dst;
+ int fd;
+ uint8_t *req;
+ uint8_t req_size;
- return HAL_STATUS_FAILED;
+ DBG("");
+
+ if (len < sizeof(*cmd))
+ return HAL_STATUS_INVALID;
+
+ android2bdaddr(&cmd->bdaddr, &dst);
+
+ l = g_slist_find_custom(devices, &dst, device_cmp);
+ if (!l)
+ return HAL_STATUS_FAILED;
+
+ dev = l->data;
+ req_size = (cmd->buf > 0) ? 4 : 2;
+ req = g_try_malloc0(req_size);
+ if (!req)
+ return HAL_STATUS_NOMEM;
+
+ req[0] = HID_MSG_GET_REPORT | cmd->type;
+
+ if (cmd->buf > 0)
+ req[0] = req[0] | HID_GET_REPORT_SIZE_FIELD;
+
+ req[1] = cmd->id;
+
+ if (cmd->buf > 0)
+ bt_put_le16(cmd->buf, (req + 2));
+
+ fd = g_io_channel_unix_get_fd(dev->ctrl_io);
+
+ if (write(fd, req, req_size) < 0) {
+ error("error while querying device protocol");
+ g_free(req);
+ return HAL_STATUS_FAILED;
+ }
+
+ dev->last_hid_msg = HID_MSG_GET_REPORT;
+ g_free(req);
+ return HAL_STATUS_SUCCESS;
}
static uint8_t bt_hid_set_report(struct hal_cmd_hid_set_report *cmd,
--
1.8.1.2
^ permalink raw reply related
* [PATCH_v3 04/04] android/hid: Implement hid set report in daemon
From: Ravi kumar Veeramally @ 2013-11-05 12:22 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Ravi kumar Veeramally
In-Reply-To: <1383654126-19237-1-git-send-email-ravikumar.veeramally@linux.intel.com>
This patch requests hid device to set report.
---
android/hal-hidhost.c | 2 ++
android/hal-msg.h | 6 ++++--
android/hid.c | 40 ++++++++++++++++++++++++++++++++++++++--
3 files changed, 44 insertions(+), 4 deletions(-)
diff --git a/android/hal-hidhost.c b/android/hal-hidhost.c
index f554cb2..29e3ee0 100644
--- a/android/hal-hidhost.c
+++ b/android/hal-hidhost.c
@@ -284,6 +284,8 @@ static bt_status_t hh_set_report(bt_bdaddr_t *bd_addr,
return BT_STATUS_PARM_INVALID;
memcpy(cmd.bdaddr, bd_addr, sizeof(cmd.bdaddr));
+ cmd.len = strlen(report);
+ memcpy(cmd.data, report, cmd.len);
switch (reportType) {
case BTHH_INPUT_REPORT:
diff --git a/android/hal-msg.h b/android/hal-msg.h
index bc7df6b..2c3067f 100644
--- a/android/hal-msg.h
+++ b/android/hal-msg.h
@@ -290,8 +290,10 @@ struct hal_cmd_hid_get_report {
#define HAL_OP_HID_SET_REPORT 0x08
struct hal_cmd_hid_set_report {
- uint8_t bdaddr[6];
- uint8_t type;
+ uint8_t bdaddr[6];
+ uint8_t type;
+ uint16_t len;
+ uint8_t data[670];
} __attribute__((packed));
#define HAL_OP_HID_SEND_DATA 0x09
diff --git a/android/hid.c b/android/hid.c
index f1bf9e8..25e33fa 100644
--- a/android/hid.c
+++ b/android/hid.c
@@ -56,6 +56,7 @@
/* HID message types */
#define HID_MSG_GET_REPORT 0x40
+#define HID_MSG_SET_REPORT 0x50
#define HID_MSG_GET_PROTOCOL 0x60
#define HID_MSG_SET_PROTOCOL 0x70
#define HID_MSG_DATA 0xa0
@@ -846,9 +847,44 @@ static uint8_t bt_hid_get_report(struct hal_cmd_hid_get_report *cmd,
static uint8_t bt_hid_set_report(struct hal_cmd_hid_set_report *cmd,
uint16_t len)
{
- DBG("Not Implemented");
+ struct hid_device *dev;
+ GSList *l;
+ bdaddr_t dst;
+ int fd;
+ uint8_t *req;
+ uint8_t req_size;
- return HAL_STATUS_FAILED;
+ DBG("");
+
+ if (len < sizeof(*cmd))
+ return HAL_STATUS_INVALID;
+
+ android2bdaddr(&cmd->bdaddr, &dst);
+
+ l = g_slist_find_custom(devices, &dst, device_cmp);
+ if (!l)
+ return HAL_STATUS_FAILED;
+
+ dev = l->data;
+ req_size = 1 + cmd->len;
+ req = g_try_malloc0(req_size);
+ if (!req)
+ return HAL_STATUS_NOMEM;
+
+ req[0] = HID_MSG_SET_REPORT | cmd->type;
+ memcpy(req + 1, cmd->data, req_size - 1);
+
+ fd = g_io_channel_unix_get_fd(dev->ctrl_io);
+
+ if (write(fd, req, req_size) < 0) {
+ error("error while querying device protocol");
+ g_free(req);
+ return HAL_STATUS_FAILED;
+ }
+
+ dev->last_hid_msg = HID_MSG_SET_REPORT;
+ g_free(req);
+ return HAL_STATUS_SUCCESS;
}
static uint8_t bt_hid_send_data(struct hal_cmd_hid_send_data *cmd,
--
1.8.1.2
^ permalink raw reply related
* Re: Wireshark and new BlueZ BTSNOOP format
From: Marcel Holtmann @ 2013-11-05 12:25 UTC (permalink / raw)
To: Michal Labedzki; +Cc: linux-bluetooth@vger.kernel.org development
In-Reply-To: <CALkxMhHvbgaS4cxbrrQFGk59W9LoR-R47D-iTDBkrw3TG7sofA@mail.gmail.com>
Hi Michal,
>>> There is a need to add support for latest BTSNOOP format currently
>>> used in BlueZ (5). I have two questions:
>>>
>>> 1. Is BlueZ btsnoop format official and stable? Or invented by BlueZ
>>> team? (stable? safe?)
>>
>> the original btsnoop format was done by Symbian and adopted by Frontline. We started using that as well since it was better than what we had before. These are the ones with 1xxx link types.
>> With BlueZ 5 and kernels 3.5 and newer we introduced a Bluetooth monitor to the kernel that can catch all controllers and can catch early messages as well. Previous hcidump could only read one interface at a time and was not able to catch early init frames.
>>
>> The link type 2001 is stable.
>
> Regarding "all controllers and catch early messages" - if you use
> Bluetooth USB dongle than this is not a problem, because
> Wireshark/libpcap can live capture USB stream. There is ready HCI USB
> transport described in Bluetooth Core specification. Try Wireshark >=
> 1.10 and filter by "hci_usb" . Only non-standard Bluetooth USB dongles
> cannot work with it (however I have non-standard dongle "Broadcom
> Corp. BCM20702A0 Bluetooth 4.0", but it seems to be standard dongle -
> only it present itself as "vendor specific").
>
> Quick Howto:
> 1. [Recommended] Latest Wireshark
> 2. [Recommended] Latest libpcap.
> 3. lsusb # to detect on which "Bus" Bluetooth dongle is connected
> 4. wireshark and select usbmonN, where N is "Bus" ID.
> 5. Filter "hci_usb" (useful if more devices connected to this Bus)
as long as you are on USB. But we do support UART, SDIO, virtual controllers etc. Not everything is on USB. Especially embedded devices do not use USB.
>>> 2. Is there any documentation describes this format?
>>
>> It is documented inside the kernel as include/net/bluetooth/hci_mon.h and that is as close as it gets to documentation. btsnoop v2 takes the BTSnoop header and uses the 2001 link type and then encodes the opcode and index into the flags field. The frame data is always a raw HCI message similar to link type 1001.
>
> Ok, I assume there is no real specification. This is not a problem for me.
>
>>> In code I saw two new magic numbers:
>>> 2001 Bluetooth monitor
>>> 2002 Bluetooth simulator
>>> Is Bluetooth simulator completed now?
>>
>> The simulator is a low-level Low Energy Link Layer simulator. And it is not completed and not stable yet.
>
> Please let me know if will be completed or dropped. Or please create
> feature request on Wireshark Bugzilla:
> https://bugs.wireshark.org/bugzilla/buglist.cgi?resolution=---&query_format=advanced&list_id=11093
It will be completed eventually. However it will take a while since we might extend the format to also handle BR/EDR simulated traffic. All still work on progress. I would not focus on link type 2002 at this point.
>>> For now Wireshark (>= 1.10, trunk is recommended) provide probably
>>> full Bluetooth support, all protocols, colours, filtering,
>>> reassembling. If you find a bug or need new feature please create a
>>> bug at https://bugs.wireshark.org/bugzilla/buglist.cgi?resolution=---&query_format=advanced&list_id=11093
>>
>> What also would be interesting is an integration of Bluetooth monitor socket with libpcap so Wireshark can do live capture.
>
> For now Wireshark can support live capture on old kernel interface (if
> you do not see Bluetooth interfaces than you need newer libpcap). Also
> you can choose more than one interface to capture: for example
> Bluetooth0, Bluetooth1 and usbmon1 (nice duplicated streams do you
> see)
Problem with the old HCI raw format is that it can not catch early traffic. And it does not properly interleave traffic from multiple controllers. You have a few subtle races there. Most of the times they do not matter, except when they do. For example when using Bluetooth high speed where the systems consists of two controllers. One for BR/EDR and one for AMP traffic. Both are HCI. We also fixed the timestamping with the monitor interface to use kernel standard interfaces.
> I will try to add support for new BTSNOOP format and libpcap support
> for new kernel. I think Wireshark can be useful for BlueZ and Android
> developers.
That would be great. As I mentioned on IRC, would I also like to see is if we can export the Bluetooth monitor traces over an ADB channel. So you can start Wireshark on the host and it talks to the Android Debug Bridge channel for Bluetooth traces.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH] android/daemon: Save adapter name on complete event
From: Marcel Holtmann @ 2013-11-05 12:28 UTC (permalink / raw)
To: Andrei Emeltchenko; +Cc: linux-bluetooth@vger.kernel.org development
In-Reply-To: <1383646128-8077-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
Hi Andrei,
> Saving adapter name was missing from set name complete event.
> Refactor code to function and reuse it in both places where
> name is changed.
> ---
> android/adapter.c | 21 ++++++++++++++-------
> 1 file changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/android/adapter.c b/android/adapter.c
> index b6f6096..6b0dc8b 100644
> --- a/android/adapter.c
> +++ b/android/adapter.c
> @@ -88,6 +88,17 @@ static void adapter_name_changed(const uint8_t *name)
> HAL_EV_ADAPTER_PROPS_CHANGED, sizeof(buf), ev, -1);
> }
>
> +static void adapter_set_name(const uint8_t *name)
> +{
> + if (!g_strcmp0(adapter->name, (const char *) name))
> + return;
> +
> + DBG("Cnage name: %s -> %s", adapter->name, name);
> +
> + g_free(adapter->name);
> + adapter->name = g_strdup((const char *) name);
> +}
> +
> static void mgmt_local_name_changed_event(uint16_t index, uint16_t length,
> const void *param, void *user_data)
> {
> @@ -98,13 +109,7 @@ static void mgmt_local_name_changed_event(uint16_t index, uint16_t length,
> return;
> }
>
> - if (!g_strcmp0(adapter->name, (const char *) rp->name))
> - return;
> -
> - DBG("name: %s", rp->name);
> -
> - g_free(adapter->name);
> - adapter->name = g_strdup((const char *) rp->name);
> + adapter_set_name(rp->name);
>
> adapter_name_changed(rp->name);
> }
> @@ -879,6 +884,8 @@ static void set_adapter_name_complete(uint8_t status, uint16_t length,
> return;
> }
>
> + adapter_set_name(rp->name);
> +
> adapter_name_changed(rp->name);
can we feed adapter_set_name and adapter_name_change into a single function. Especially since this is not public API and will never be, please make sure consolidate these things properly. Copies from src/adapter.c are pointless since it does not have to handle any special cases like external hostnamed daemon or plugins.
With most of these function, we need to make to store the value and send out a notification. We never do anything else. So lets keep this simple. No need to spaghetti code.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH] Bluetooth: Fix rejecting SMP security request in slave role
From: Marcel Holtmann @ 2013-11-05 12:33 UTC (permalink / raw)
To: Johan Hedberg; +Cc: linux-bluetooth@vger.kernel.org development
In-Reply-To: <1383643839-2788-1-git-send-email-johan.hedberg@gmail.com>
Hi Johan,
> The SMP security request is for a slave role device to request the
> master role device to initiate a pairing request. If we receive this
> command while we're in the slave role we should reject it appropriately.
>
> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
> ---
> net/bluetooth/smp.c | 3 +++
> 1 file changed, 3 insertions(+)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply
* Re: [PATCH] android/client: Fix build for android 4.3
From: Johan Hedberg @ 2013-11-05 12:56 UTC (permalink / raw)
To: Jerzy Kasenberg; +Cc: linux-bluetooth
In-Reply-To: <1383652121-4121-1-git-send-email-jerzy.kasenberg@tieto.com>
Hi Jerzy,
On Tue, Nov 05, 2013, Jerzy Kasenberg wrote:
> Chagnes in HAL interface from 4.3 to 4.4 result in build failure:
>
> target thumb C: haltest <=
> external/bluetooth/bluez/android/client/if-gatt.c
> external/bluetooth/bluez/android/client/if-gatt.c:225:1:
> error: unknown type name 'btgatt_gatt_id_t'
>
> This patch allows to build GATT for Android 4.3 (api level 18).
> ---
>
> I sent this patch to the mailing list primarily to allow people
> who work on android 4.3 to be able to build GATT.
>
> android/client/if-gatt.c | 27 +++++++++++++++++++++------
> 1 file changed, 21 insertions(+), 6 deletions(-)
Applied. Thanks.
Johan
^ 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