* Re: Wireshark
From: Andrei Emeltchenko @ 2012-09-28 13:57 UTC (permalink / raw)
To: Michal.Labedzki; +Cc: linux-bluetooth
In-Reply-To: <E50901D4F2CF69428D43141B7C8586792CFACCF505@EXMB03.eu.tieto.com>
Hi Michał,
On Fri, Sep 28, 2012 at 04:07:44PM +0300, Michal.Labedzki@tieto.com wrote:
> Hello All,
>
> I am trying to add full Bluetooth support to a Wireshark. Wireshark can be
> used as replacement for "hcidump" or other GUI applications for displaying
> Bluetooth frames/packets.
>
> Currently Wireshark support:
> 1. Sniffing via Bluetooth dongle
> 2. Protocols/Profiles:
> HCI (without BLE)
HCI also does not have full support for AMP HCI commands. I can send that
log.
Best regards
Andrei Emeltchenko
^ permalink raw reply
* [PATCHv2] Bluetooth: A2MP: Correct assoc_len size
From: Andrei Emeltchenko @ 2012-09-28 13:55 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <1348832490-13448-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Correct assoc_len and fix warning for x86-64 by using %zu specifier
reported by Fengguang Wu <fengguang.wu@intel.com>.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
v2: make assoc_len type of size_t
net/bluetooth/a2mp.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
index a55449e..d4946b5 100644
--- a/net/bluetooth/a2mp.c
+++ b/net/bluetooth/a2mp.c
@@ -381,12 +381,15 @@ static int a2mp_getampassoc_rsp(struct amp_mgr *mgr, struct sk_buff *skb,
struct hci_dev *hdev;
struct amp_ctrl *ctrl;
struct hci_conn *hcon;
+ size_t assoc_len;
if (len < sizeof(*rsp))
return -EINVAL;
- BT_DBG("id %d status 0x%2.2x assoc len %lu", rsp->id, rsp->status,
- len - sizeof(*rsp));
+ assoc_len = len - sizeof(*rsp);
+
+ BT_DBG("id %d status 0x%2.2x assoc len %zu", rsp->id, rsp->status,
+ assoc_len);
if (rsp->status)
return -EINVAL;
@@ -394,7 +397,7 @@ static int a2mp_getampassoc_rsp(struct amp_mgr *mgr, struct sk_buff *skb,
/* Save remote ASSOC data */
ctrl = amp_ctrl_lookup(mgr, rsp->id);
if (ctrl) {
- u8 *assoc, assoc_len = len - sizeof(*rsp);
+ u8 *assoc;
assoc = kzalloc(assoc_len, GFP_KERNEL);
if (!assoc) {
@@ -468,7 +471,8 @@ static int a2mp_createphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb,
}
if (ctrl) {
- u8 *assoc, assoc_len = le16_to_cpu(hdr->len) - sizeof(*req);
+ size_t assoc_len = le16_to_cpu(hdr->len) - sizeof(*req);
+ u8 *assoc;
ctrl->id = rsp.remote_id;
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH] hciconfig: Clarify what oobdata command do
From: Johan Hedberg @ 2012-09-28 13:51 UTC (permalink / raw)
To: Szymon Janc; +Cc: linux-bluetooth
In-Reply-To: <1348833533-25427-1-git-send-email-szymon.janc@tieto.com>
Hi Szymon,
On Fri, Sep 28, 2012, Szymon Janc wrote:
> oobdata command results in reading new local OOB data and invalidates
> previously read data. Current command description is misleading.
>
> ---
> tools/hciconfig.8 | 2 +-
> tools/hciconfig.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
Applied. Thanks.
Johan
^ permalink raw reply
* Re: Wireshark
From: Johan Hedberg @ 2012-09-28 13:39 UTC (permalink / raw)
To: Michal.Labedzki; +Cc: linux-bluetooth
In-Reply-To: <E50901D4F2CF69428D43141B7C8586792CFACCF505@EXMB03.eu.tieto.com>
Hi Michal,
On Fri, Sep 28, 2012, Michal.Labedzki@tieto.com wrote:
> I am trying to add full Bluetooth support to a Wireshark. Wireshark can be
> used as replacement for "hcidump" or other GUI applications for displaying
> Bluetooth frames/packets.
>
> Currently Wireshark support:
> 1. Sniffing via Bluetooth dongle
> 2. Protocols/Profiles:
> HCI (without BLE)
> L2CAP
> SDP (little broken)
> RFCOMM 1.1
> OBEX (so all OBEX profiles can be treat as supported)
> AMP
> HID 1.0
> SAP 1.1
> BNEP 1.0
> AVCTP 1.4
> AVRCP 1.5
>
> At this moment I am working on: (finishing)
> 1. ATT
> 2. HCRP
> 3. MCAP
> 4. AVDTP/A2DP/VDP
Have you looked into supporting the new HCI_CHANNEL_MONITOR available in
recent kernels? There's a very simple "btmon" command-line tool for it
in bluez.git (see e.g. monitor/control.c) but it can't do any kind of
high-level decoding (e.g. profiles). It'd be interesting to know if it
could be easily supported in wireshark since right now there doesn't
seem to be a viable way of porting decoders from hcidump to btmon due to
their very different ways of handling buffers etc.
One of the big benefits of the monitor channel compared traditional HCI
sockets is that you get dynamic notifications of added and removed
adapters including the very early HCI traffic that occurs. In the long
run I think the idea is to add also "replay" connection events for
existing ACL and L2CAP links so that you'd get the right protocol
decoded even if you start logging when the connection already exists.
Johan
^ permalink raw reply
* Re: [PATCH v2] Cycling Speed and Cadence profile (CSCP) API
From: Johan Hedberg @ 2012-09-28 13:26 UTC (permalink / raw)
To: Andrzej Kaczmarek; +Cc: linux-bluetooth
In-Reply-To: <1348585647-25458-2-git-send-email-andrzej.kaczmarek@tieto.com>
Hi Andrzej,
On Tue, Sep 25, 2012, Andrzej Kaczmarek wrote:
> + Possible values: "Other", "Top of shoe", "In shoe",
> + "Hip", "Front Wheel", "Left Crank",
> + "Right Crank", "Left Pedal",
> + "Right Pedal", "Front Hub",
> + "Rear Dropout", "Chainstay",
> + "Rear Wheel", "Rear Hub"
As I've pointed out in a couple of other (unrelated) patch reviews keep
string dict values lower-case. Also leave the spaces out. So you'll end
up getting stuff like "top-of-shoe", "in-shoe", "hip", etc.
Johan
^ permalink raw reply
* Re: [PATCH BlueZ v1 2/2] hog: Add support for multiple instances
From: Johan Hedberg @ 2012-09-28 13:24 UTC (permalink / raw)
To: Claudio Takahasi; +Cc: linux-bluetooth
In-Reply-To: <1348837062-17226-1-git-send-email-claudio.takahasi@openbossa.org>
Hi Claudio,
On Fri, Sep 28, 2012, Claudio Takahasi wrote:
> This patch adds support for multiple HID services instances exposed by
> the same remote device.
> ---
> profiles/input/hog_device.c | 90 +++++++++++---------------------------------
> profiles/input/hog_device.h | 3 +-
> profiles/input/hog_manager.c | 41 ++++++++++++--------
> 3 files changed, 48 insertions(+), 86 deletions(-)
Applied. Thanks.
Johan
^ permalink raw reply
* Re: [PATCH v8 00/13] Heart Rate Profile plugin
From: Johan Hedberg @ 2012-09-28 13:16 UTC (permalink / raw)
To: Christian Cier-Zniewski; +Cc: linux-bluetooth
In-Reply-To: <50659E54.5010206@gmx.de>
Hi,
On Fri, Sep 28, 2012, Christian Cier-Zniewski wrote:
> Hello Johan,
>
> On 28.09.2012 12:25, Johan Hedberg wrote:
> > Heart Rate Profile (HRP) client API
> >
> > Makefile.am | 9 +-
> >
> >All patches in this set have been applied. Thanks.
> >
> >
>
>
> I had to apply the following patch to get the heart rate profile working.
> It is currently missing in HEAD although it was present in the
> patchset provided by Andrzej.
>
> Christian
>
> ---
>
> diff --git a/Makefile.am b/Makefile.am
> index 3b37198..c27eb01 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -212,7 +212,7 @@ endif
>
> if GATTMODULES
> builtin_modules += thermometer alert time gatt_example proximity
> deviceinfo \
> - gatt scanparam
> + gatt scanparam heartrate
> builtin_sources += profiles/thermometer/main.c \
> profiles/thermometer/manager.h \
> profiles/thermometer/manager.c \
>
The Makefile.am changes had conflicts because of other GATT profiles I
applied earlier, so I had to completely manually fix this and probably
made some mistake. Could you please send a proper git patch for this and
I'll apply it?
Johan
^ permalink raw reply
* Re: [RFC] Convert storage to use per-remote device directories
From: Frederic Danis @ 2012-09-28 13:12 UTC (permalink / raw)
To: Anderson Lizardo; +Cc: linux-bluetooth@vger.kernel.org
In-Reply-To: <CAJdJm_NbPw0jwWvuUiu7L=wzxc+qxfF_4i2vj7U1G06b=BE2qw@mail.gmail.com>
Hello Anderson,
On 28/09/2012 12:56, Anderson Lizardo wrote:
> Hi Frederic,
>
> On Thu, Sep 27, 2012 at 5:59 AM, Frederic Danis
> <frederic.danis@intel.com> wrote:
>> Hi everyone,
>>
>> Here is my proposal for new storage directory structure using ini-file
>> format.
>
> Do you know if the INI parser in glib allows for multiple groups with
> same name?
Following glib documentation:
"groups in key files may contain the same key multiple times; the last
entry wins. Key files may also contain multiple groups with the same
name; they are merged together."
So, I do not think this meet our needs.
> In LE we can have services with same UUID (not sure if this
> is valid for BR/EDR also), and they are differentiated by other means
> (e.g. a "Description" descriptor with different value, besides the
> different handle).
For BDEDR, it is easy to retrieve info related to a profile as profile's
UUIDs are unique.
Are "Description" descriptors for a profile well-know or implementation
dependent ?
Do you think we can use [<UUID>,<Description>] as group name ?
> Regarding LE, we have two kinds of storage needs: server profiles, and
> client profiles.
>
> For server profiles, we need to store the attribute database.
Is it possible to save it as we did for SDP records (record entry in
profile group) ?
> Currently we don't do this, but we need to implement it, or have
> ServiceChanged characteristic notifying that the service ranges have
> changed every time BlueZ restarts (which adds overhead as service
> discovery is triggered on the client side). I suggest we store the
> attribute database into a "attribute_db.conf" file containing the
> attribute name/value/uuid triples.
Isn't it possible to save it in [<uuid>] group of device.conf file ?
> Additionally, we also need to store
> the Client Characteristic Configuration descriptor values (which are
> specific to each bonded device), currently stored into a "ccc" file.
> We could have one group just for them into attribute_db.conf.
>
> For client profiles, I think the storage needs are specific to each
> profile. From memory, only the generic GATT client and the GAP plugin
> use storage currently (other profiles eventually need to use storage
> to avoid full service discovery every time a bonded device
> re-connects). The generic GATT client stores service/characteristics
> handles/uuids ("primaries" and "characteristics" files), and the GAP
> plugin stores appearance data ("appearances" file).
My first thought for LE data in device.conf is:
[<Primary UUID>#<Description>]
Handle=
Characteristic=
Attribute=
CCC=
I think we can easily add other key entries when needed.
Regards
Fred
--
Frederic Danis Open Source Technology Center
frederic.danis@intel.com Intel Corporation
^ permalink raw reply
* Wireshark
From: Michal.Labedzki @ 2012-09-28 13:07 UTC (permalink / raw)
To: linux-bluetooth
Hello All,
I am trying to add full Bluetooth support to a Wireshark. Wireshark can be
used as replacement for "hcidump" or other GUI applications for displaying
Bluetooth frames/packets.
Currently Wireshark support:
1. Sniffing via Bluetooth dongle
2. Protocols/Profiles:
HCI (without BLE)
L2CAP
SDP (little broken)
RFCOMM 1.1
OBEX (so all OBEX profiles can be treat as supported)
AMP
HID 1.0
SAP 1.1
BNEP 1.0
AVCTP 1.4
AVRCP 1.5
At this moment I am working on: (finishing)
1. ATT
2. HCRP
3. MCAP
4. AVDTP/A2DP/VDP
So I need a lot of Bluetooth logs to test them. Could you send me all your
logs? Profile or protocol there is not important [SAP? OK!], but only
BT SNOOP format is requires, of course PCAP too. Please share your logs, to my e-mail or wherever you want,.
I guess logs may be useful for other BlueZ developer too (so... logs database?)
I will be very happy if somebody send me AVDTP/A2DP/VDP logs where used all
known codecs (mean MPEG12_AUDIO//MPEG24_AAC/ATRAC/ H263/MPEG4)
Try Wireshark :)
PS. "tshark -r hcidump.log" is similar to "hcidump"
Regards / Pozdrawiam
-------------------------------------------------------------------------------------------------------------
Michał Łabędzki
ASCII: Michal Labedzki
e-mail: michal.labedzki@tieto.com
---
Tieto Corporation / Tieto Poland
http://www.tieto.com / http://www.tieto.pl
---
Tieto Poland spółka z ograniczoną odpowiedzialnością z siedzibą w Szczecinie, ul. Malczewskiego 26. Zarejestrowana w Sądzie Rejonowym Szczecin-Centrum w Szczecinie, XIII Wydział Gospodarczy Krajowego Rejestru Sądowego pod numerem 0000124858. NIP: 8542085557. REGON: 812023656. Kapitał zakładowy: 4 271500 PLN
^ permalink raw reply
* [PATCH BlueZ v1 2/2] hog: Add support for multiple instances
From: Claudio Takahasi @ 2012-09-28 12:57 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
In-Reply-To: <1348083222-15294-2-git-send-email-claudio.takahasi@openbossa.org>
This patch adds support for multiple HID services instances exposed by
the same remote device.
---
profiles/input/hog_device.c | 90 +++++++++++---------------------------------
profiles/input/hog_device.h | 3 +-
profiles/input/hog_manager.c | 41 ++++++++++++--------
3 files changed, 48 insertions(+), 86 deletions(-)
diff --git a/profiles/input/hog_device.c b/profiles/input/hog_device.c
index a558110..d0912f5 100644
--- a/profiles/input/hog_device.c
+++ b/profiles/input/hog_device.c
@@ -46,13 +46,13 @@
#include "../src/adapter.h"
#include "../src/device.h"
-#include "hog_device.h"
-
#include "att.h"
#include "gattrib.h"
#include "attio.h"
#include "gatt.h"
+#include "hog_device.h"
+
#define HOG_INFO_UUID 0x2A4A
#define HOG_REPORT_MAP_UUID 0x2A4B
#define HOG_REPORT_UUID 0x2A4D
@@ -72,7 +72,7 @@
#define HID_INFO_SIZE 4
struct hog_device {
- char *path;
+ uint16_t id;
struct btd_device *device;
GAttrib *attrib;
guint attioid;
@@ -147,8 +147,8 @@ static void report_value_cb(const uint8_t *pdu, uint16_t len,
if (write(hogdev->uhid_fd, &ev, sizeof(ev)) < 0)
error("uHID write failed: %s", strerror(errno));
else
- DBG("Report from HoG device %s written to uHID fd %d",
- hogdev->path, hogdev->uhid_fd);
+ DBG("Report from HoG device 0x%04X written to uHID fd %d",
+ hogdev->id, hogdev->uhid_fd);
}
static void report_ccc_written_cb(guint8 status, const guint8 *pdu,
@@ -428,14 +428,14 @@ static void proto_mode_read_cb(guint8 status, const guint8 *pdu, guint16 plen,
if (value == HOG_PROTO_MODE_BOOT) {
uint8_t nval = HOG_PROTO_MODE_REPORT;
- DBG("HoG device %s is operating in Boot Procotol Mode",
- hogdev->path);
+ DBG("HoG device 0x%04X is operating in Boot Procotol Mode",
+ hogdev->id);
gatt_write_char(hogdev->attrib, hogdev->proto_mode_handle, &nval,
sizeof(nval), NULL, NULL);
} else if (value == HOG_PROTO_MODE_REPORT)
- DBG("HoG device %s is operating in Report Protocol Mode",
- hogdev->path);
+ DBG("HoG device 0x%04X is operating in Report Protocol Mode",
+ hogdev->id);
}
static void char_discovered_cb(GSList *chars, guint8 status, gpointer user_data)
@@ -548,8 +548,8 @@ static void forward_report(struct hog_device *hogdev,
report = l->data;
- DBG("Sending report type %d to device %s handle 0x%X", type,
- hogdev->path, report->decl->value_handle);
+ DBG("Sending report type %d to device 0x%04X handle 0x%X", type,
+ hogdev->id, report->decl->value_handle);
if (report->decl->properties & ATT_CHAR_PROPER_WRITE)
gatt_write_char(hogdev->attrib, report->decl->value_handle,
@@ -633,20 +633,8 @@ static void attio_disconnected_cb(gpointer user_data)
hogdev->attrib = NULL;
}
-struct hog_device *hog_device_find(GSList *list, const char *path)
-{
- for (; list; list = list->next) {
- struct hog_device *hogdev = list->data;
-
- if (!strcmp(hogdev->path, path))
- return hogdev;
- }
-
- return NULL;
-}
-
static struct hog_device *hog_device_new(struct btd_device *device,
- const char *path)
+ uint16_t id)
{
struct hog_device *hogdev;
@@ -654,31 +642,12 @@ static struct hog_device *hog_device_new(struct btd_device *device,
if (!hogdev)
return NULL;
- hogdev->path = g_strdup(path);
+ hogdev->id = id;
hogdev->device = btd_device_ref(device);
return hogdev;
}
-static gint primary_uuid_cmp(gconstpointer a, gconstpointer b)
-{
- const struct gatt_primary *prim = a;
- const char *uuid = b;
-
- return g_strcmp0(prim->uuid, uuid);
-}
-
-static struct gatt_primary *load_hog_primary(struct btd_device *device)
-{
- GSList *primaries, *l;
-
- primaries = btd_device_get_primaries(device);
-
- l = g_slist_find_custom(primaries, HOG_UUID, primary_uuid_cmp);
-
- return (l ? l->data : NULL);
-}
-
static void report_free(void *data)
{
struct report *report = data;
@@ -690,38 +659,27 @@ static void hog_device_free(struct hog_device *hogdev)
{
btd_device_unref(hogdev->device);
g_slist_free_full(hogdev->reports, report_free);
- g_free(hogdev->path);
g_free(hogdev->hog_primary);
g_free(hogdev);
}
struct hog_device *hog_device_register(struct btd_device *device,
- const char *path, int *perr)
+ struct gatt_primary *prim)
{
- struct gatt_primary *prim;
struct hog_device *hogdev;
GIOCondition cond = G_IO_IN | G_IO_ERR | G_IO_NVAL;
GIOChannel *io;
- int err;
- prim = load_hog_primary(device);
- if (!prim) {
- err = -EINVAL;
- goto failed;
- }
-
- hogdev = hog_device_new(device, path);
- if (!hogdev) {
- err = -ENOMEM;
- goto failed;
- }
+ hogdev = hog_device_new(device, prim->range.start);
+ if (!hogdev)
+ return NULL;
hogdev->uhid_fd = open(UHID_DEVICE_FILE, O_RDWR | O_CLOEXEC);
if (hogdev->uhid_fd < 0) {
- err = -errno;
- error("Failed to open uHID device: %s", strerror(-err));
+ error("Failed to open uHID device: %s(%d)", strerror(errno),
+ errno);
hog_device_free(hogdev);
- goto failed;
+ return NULL;
}
io = g_io_channel_unix_new(hogdev->uhid_fd);
@@ -740,12 +698,6 @@ struct hog_device *hog_device_register(struct btd_device *device,
device_set_auto_connect(device, TRUE);
return hogdev;
-
-failed:
- if (perr)
- *perr = err;
-
- return NULL;
}
int hog_device_unregister(struct hog_device *hogdev)
@@ -779,7 +731,7 @@ int hog_device_set_control_point(struct hog_device *hogdev, gboolean suspend)
if (hogdev->attrib == NULL)
return -ENOTCONN;
- DBG("%s HID Control Point: %s", hogdev->path, suspend ?
+ DBG("0x%4X HID Control Point: %s", hogdev->id, suspend ?
"Suspend" : "Exit Suspend");
if (hogdev->ctrlpt_handle == 0)
diff --git a/profiles/input/hog_device.h b/profiles/input/hog_device.h
index 03f1c90..d1bfc08 100644
--- a/profiles/input/hog_device.h
+++ b/profiles/input/hog_device.h
@@ -28,7 +28,6 @@
struct hog_device;
struct hog_device *hog_device_register(struct btd_device *device,
- const char *path, int *perr);
+ struct gatt_primary *prim);
int hog_device_unregister(struct hog_device *hogdev);
-struct hog_device *hog_device_find(GSList *list, const char *path);
int hog_device_set_control_point(struct hog_device *hogdev, gboolean suspend);
diff --git a/profiles/input/hog_manager.c b/profiles/input/hog_manager.c
index 2d72444..362c38a 100644
--- a/profiles/input/hog_manager.c
+++ b/profiles/input/hog_manager.c
@@ -29,6 +29,9 @@
#include <errno.h>
#include <stdbool.h>
+#include <bluetooth/bluetooth.h>
+#include <bluetooth/uuid.h>
+
#include "log.h"
#include "../src/adapter.h"
#include "../src/device.h"
@@ -38,6 +41,9 @@
#include "hcid.h"
#include "device.h"
#include "suspend.h"
+#include "att.h"
+#include "gattrib.h"
+#include "gatt.h"
#include "hog_device.h"
static gboolean suspend_supported = FALSE;
@@ -73,36 +79,41 @@ static int hog_device_probe(struct btd_profile *p, struct btd_device *device,
GSList *uuids)
{
const char *path = device_get_path(device);
- struct hog_device *hogdev;
- int err;
+ GSList *primaries, *l;
DBG("path %s", path);
- hogdev = hog_device_find(devices, path);
- if (hogdev)
- return -EALREADY;
+ primaries = btd_device_get_primaries(device);
+ if (primaries == NULL)
+ return -EINVAL;
- hogdev = hog_device_register(device, path, &err);
- if (hogdev == NULL)
- return err;
+ for (l = primaries; l; l = g_slist_next(l)) {
+ struct gatt_primary *prim = l->data;
+ struct hog_device *hogdev;
- devices = g_slist_append(devices, hogdev);
+ hogdev = hog_device_register(device, prim);
+ if (hogdev == NULL)
+ continue;
+
+ devices = g_slist_append(devices, hogdev);
+ }
return 0;
}
+static void remove_device(gpointer hogdev, gpointer b)
+{
+ devices = g_slist_remove(devices, hogdev);
+ hog_device_unregister(hogdev);
+}
+
static void hog_device_remove(struct btd_profile *p, struct btd_device *device)
{
const gchar *path = device_get_path(device);
- struct hog_device *hogdev;
DBG("path %s", path);
- hogdev = hog_device_find(devices, path);
- if (hogdev) {
- devices = g_slist_remove(devices, hogdev);
- hog_device_unregister(hogdev);
- }
+ g_slist_foreach(devices, remove_device, NULL);
}
static struct btd_profile hog_profile = {
--
1.7.12
^ permalink raw reply related
* Re: [PATCH v8 00/13] Heart Rate Profile plugin
From: Christian Cier-Zniewski @ 2012-09-28 12:55 UTC (permalink / raw)
To: johan.hedberg, linux-bluetooth
In-Reply-To: <20120928102503.GA25415@x220>
Hello Johan,
On 28.09.2012 12:25, Johan Hedberg wrote:
> Heart Rate Profile (HRP) client API
>
> Makefile.am | 9 +-
>
> All patches in this set have been applied. Thanks.
>
>
I had to apply the following patch to get the heart rate profile working.
It is currently missing in HEAD although it was present in the patchset
provided by Andrzej.
Christian
---
diff --git a/Makefile.am b/Makefile.am
index 3b37198..c27eb01 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -212,7 +212,7 @@ endif
if GATTMODULES
builtin_modules += thermometer alert time gatt_example proximity
deviceinfo \
- gatt scanparam
+ gatt scanparam heartrate
builtin_sources += profiles/thermometer/main.c \
profiles/thermometer/manager.h \
profiles/thermometer/manager.c \
^ permalink raw reply related
* Re: [RFC] Convert storage to use per-remote device directories
From: Frederic Danis @ 2012-09-28 12:36 UTC (permalink / raw)
To: Johan Hedberg, linux-bluetooth@vger.kernel.org
In-Reply-To: <20120928093729.GA1415@x220>
Hello Johan,
On 28/09/2012 11:37, Johan Hedberg wrote:
<snip>
>> So the directory structure should be:
>> /var/lib/bluetooth/<adapter address>/
>> ./config
>> ./<remote device address#type>/
>> ./config
>> ./linkkey
>> ./<remote device address#type>/
>> ./config
>> ./linkkey
>> ...
>
> So far this all looks good, though maybe we should follow the convention
> of having .conf suffixes like with our other INI files. Or maybe that's
> not needed?
OK, I will rename adapter config file to adapter.conf, and device config
file to device.conf.
>> I attached sample of adapter and device config files.
>
>> [adapter]
>> name=desktop-0
>> class=0x780011
>> pairable=yes
>> onmode=discoverable
>> mode=discoverable
>
> I hope you've looked at our existing INI files like audio.conf and
> main.conf. You should have noticed that we use CamelCase for the section
> and variable names, so at least that needs fixing.
OK, I will do this.
>> [device]
>> name=MyPhone
>> alias=Fred's phone
>> class=0x180204
>> device_id=FFFF 0000 0000 0000
>> eir=040D040218
>> manufacturer=15
>> lmp_version=2
>> lmp_subversion=777
>> features=FFFE0D0008080000
>> lastseen=2012-09-26 11:19:40 GMT
>> lastused=2012-09-26 11:43:42 GMT
>> trusted=yes
>> profiles=00001101-0000-1000-8000-00805f9b34fb;00001103-0000-1000-8000-00805f9b34fb
>>
>> [00001101-0000-1000-8000-00805f9b34fb]
>> handle=10001
>> record=35470900000A000100010900013503191101090004350C350319010035051900030802090005350319100209000935083506191101090100090100250C53657269616C20506F727400
>>
>> [00001103-0000-1000-8000-00805f9b34fb]
>> handle=10002
>> record=35530900000A000100020900013503191103090004350C35031901003505190003080309000535031910020900093508350619110309010009010025134469616C2D7570204E6574776F726B696E67000903052800
>
> This looks ok too, except for the lack of CamelCase naming. One of the
> most interesting files I was waiting to see is the linkkey one since in
> the existing storage we've crammed lots of separate variables into the
> same entry. Could you send a proposal for this too in your next
> revision? Since we also need storage for LTK's maybe it'd make sense to
> have a single "keys" file with [LinkKey] and [LongTermKey] sections? Or
> do you think those should be separate files?
Current linkkeys file is only accessible by root, this is why I kept it
separated.
Should LTKs be world readable or only accessible by root ?
Keys file should be named keys.conf and looks like:
[LinkKey]
Key=9EF4BDFA68C5438A176DF42ACD59816C
Type=0
Length=4
[LongTermKey]
Key=
Authenticated=
EncSize=
EDiv=
Rand=
> Also, it seems you've left out all LE-specific information from this
> initial proposal, like the conversion of the existing primaries file.
Currently I do not have LE devices, so I am not sure of what should be
LE-specific infos.
I need to dig into it before I send a new proposal.
Fred
--
Frederic Danis Open Source Technology Center
frederic.danis@intel.com Intel Corporation
^ permalink raw reply
* [PATCH] hciconfig: Clarify what oobdata command do
From: Szymon Janc @ 2012-09-28 11:58 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
oobdata command results in reading new local OOB data and invalidates
previously read data. Current command description is misleading.
---
tools/hciconfig.8 | 2 +-
tools/hciconfig.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/hciconfig.8 b/tools/hciconfig.8
index 35956c4..6397427 100644
--- a/tools/hciconfig.8
+++ b/tools/hciconfig.8
@@ -223,7 +223,7 @@ This command deletes the stored link key for
from the device.
.TP
.BI oobdata
-Display local OOB data.
+Get local OOB data (invalidates previously read data).
.TP
.BI commands
Display supported commands.
diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index f1458b9..64f2650 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -1924,7 +1924,7 @@ static struct {
{ "scomtu", cmd_scomtu, "<mtu:pkt>", "Set SCO MTU and number of packets" },
{ "putkey", cmd_putkey, "<bdaddr>", "Store link key on the device" },
{ "delkey", cmd_delkey, "<bdaddr>", "Delete link key from the device" },
- { "oobdata", cmd_oob_data, 0, "Display local OOB data" },
+ { "oobdata", cmd_oob_data, 0, "Get local OOB data" },
{ "commands", cmd_commands, 0, "Display supported commands" },
{ "features", cmd_features, 0, "Display device features" },
{ "version", cmd_version, 0, "Display version information" },
--
1.7.9.5
^ permalink raw reply related
* [PATCH] Bluetooth: Use %zu print specifier for size_t type
From: Andrei Emeltchenko @ 2012-09-28 11:44 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <20120928011624.GB5522@localhost>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Correct warnings reported by Fengguang Wu <fengguang.wu@intel.com>.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
net/bluetooth/hci_event.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 3151d85..82e478a 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -883,7 +883,7 @@ static void hci_cc_read_local_amp_assoc(struct hci_dev *hdev,
rem_len = __le16_to_cpu(rp->rem_len);
if (rem_len > frag_len) {
- BT_DBG("frag_len %ld rem_len %ld", frag_len, rem_len);
+ BT_DBG("frag_len %zu rem_len %zu", frag_len, rem_len);
memcpy(assoc->data + assoc->offset, rp->frag, frag_len);
assoc->offset += frag_len;
--
1.7.9.5
^ permalink raw reply related
* [PATCH] Bluetooth: A2MP: Correct assoc_len size
From: Andrei Emeltchenko @ 2012-09-28 11:41 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <20120928011706.GC5522@localhost>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Correct assoc_len and fix warning for x86-64 by using %zu specifier
reported by Fengguang Wu <fengguang.wu@intel.com>.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
net/bluetooth/a2mp.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
index a55449e..82ccedf 100644
--- a/net/bluetooth/a2mp.c
+++ b/net/bluetooth/a2mp.c
@@ -381,12 +381,15 @@ static int a2mp_getampassoc_rsp(struct amp_mgr *mgr, struct sk_buff *skb,
struct hci_dev *hdev;
struct amp_ctrl *ctrl;
struct hci_conn *hcon;
+ u16 assoc_len;
if (len < sizeof(*rsp))
return -EINVAL;
- BT_DBG("id %d status 0x%2.2x assoc len %lu", rsp->id, rsp->status,
- len - sizeof(*rsp));
+ assoc_len = len - sizeof(*rsp);
+
+ BT_DBG("id %d status 0x%2.2x assoc len %zu", rsp->id, rsp->status,
+ assoc_len);
if (rsp->status)
return -EINVAL;
@@ -394,7 +397,7 @@ static int a2mp_getampassoc_rsp(struct amp_mgr *mgr, struct sk_buff *skb,
/* Save remote ASSOC data */
ctrl = amp_ctrl_lookup(mgr, rsp->id);
if (ctrl) {
- u8 *assoc, assoc_len = len - sizeof(*rsp);
+ u8 *assoc;
assoc = kzalloc(assoc_len, GFP_KERNEL);
if (!assoc) {
@@ -468,7 +471,8 @@ static int a2mp_createphyslink_req(struct amp_mgr *mgr, struct sk_buff *skb,
}
if (ctrl) {
- u8 *assoc, assoc_len = le16_to_cpu(hdr->len) - sizeof(*req);
+ u16 assoc_len = le16_to_cpu(hdr->len) - sizeof(*req);
+ u8 *assoc;
ctrl->id = rsp.remote_id;
--
1.7.9.5
^ permalink raw reply related
* [PATCH 3/3] Bluetooth: btmrvl: Fix skb buffer overflow
From: Andrei Emeltchenko @ 2012-09-28 11:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: bzhao
In-Reply-To: <1348832170-13250-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add extra check to avoid skb buffer overflow. Fixes crash below:
[ 101.030427] ------------[ cut here ]------------
[ 101.030459] kernel BUG at net/core/skbuff.c:127!
[ 101.030486] invalid opcode: 0000 [#1] SMP
...
[ 101.030806] Pid: 2010, comm: btmrvl_main_ser Not tainted 3.5.0+ #80 Laptop
[ 101.030859] EIP: 0060:[<c14f2ba9>] EFLAGS: 00010282 CPU: 0
[ 101.030894] EIP is at skb_put+0x99/0xa0
[ 101.030919] EAX: 00000080 EBX: f129380b ECX: ef923540 EDX: 00000001
[ 101.030956] ESI: f00a4000 EDI: 00001003 EBP: ed4a5efc ESP: ed4a5ecc
[ 101.030992] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[ 101.031024] CR0: 8005003b CR2: 08fca014 CR3: 30960000 CR4: 000407f0
[ 101.031062] DR0: 00000000 DR1: 00000000 DR2: 00000000 DR3: 00000000
[ 101.031100] DR6: ffff0ff0 DR7: 00000400
[ 101.031125] Process btmrvl_main_ser (pid: 2010, ti=ed4a4000 task=ef923540 task.ti=ed4a4000)
[ 101.031174] Stack:
[ 101.031188] c18126f8 c1651938 f853f8d2 00001003 00001003 f1292800 f1292808 f129380b
[ 101.031250] f1292940 f00a4000 eddb1280 efc0f9c0 ed4a5f44 f853f8d2 00000040 00000000
[ 101.031312] ef923540 c15ee096 ef923540 eddb12d4 00000004 f00a4000 00000040 00000000
[ 101.031376] Call Trace:
[ 101.031396] [<f853f8d2>] ? btmrvl_sdio_process_int_status+0x272/0x3d0 [btmrvl_sdio]
[ 101.031444] [<f853f8d2>] btmrvl_sdio_process_int_status+0x272/0x3d0 [btmrvl_sdio]
[ 101.031488] [<c15ee096>] ? _raw_spin_unlock_irqrestore+0x36/0x70
[ 101.031526] [<f85a46e4>] btmrvl_service_main_thread+0x244/0x300 [btmrvl]
[ 101.031568] [<f853fb50>] ? btmrvl_sdio_poll_card_status.isra.6.constprop.7+0x90/0x90 [btmrvl_sdio]
[ 101.031619] [<c107eda0>] ? try_to_wake_up+0x270/0x270
[ 101.031648] [<f85a44a0>] ? btmrvl_process_event+0x3b0/0x3b0 [btmrvl]
[ 101.031686] [<c106d19d>] kthread+0x7d/0x90
[ 101.031713] [<c106d120>] ? flush_kthread_work+0x150/0x150
[ 101.031745] [<c15f5a82>] kernel_thread_helper+0x6/0x10
...
[ 101.032008] EIP: [<c14f2ba9>] skb_put+0x99/0xa0 SS:ESP 0068:ed4a5ecc
[ 101.056125] ---[ end trace a0bd01d1a9a796c8 ]---
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
drivers/bluetooth/btmrvl_sdio.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c
index ec5c456..1896e91 100644
--- a/drivers/bluetooth/btmrvl_sdio.c
+++ b/drivers/bluetooth/btmrvl_sdio.c
@@ -552,7 +552,16 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
*/
buf_len = payload[0];
- buf_len |= (u16) payload[1] << 8;
+ buf_len |= payload[1] << 8;
+ buf_len |= payload[2] << 16;
+
+ if (buf_len > blksz * num_blocks) {
+ BT_ERR("Skip incorrect packet: hdrlen %d buffer %d",
+ buf_len, blksz * num_blocks);
+ ret = -EIO;
+ goto exit;
+ }
+
type = payload[3];
switch (type) {
--
1.7.9.5
^ permalink raw reply related
* [PATCH 2/3] Bluetooth: btmrvl: Use DIV_ROUND_UP macro
From: Andrei Emeltchenko @ 2012-09-28 11:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: bzhao
In-Reply-To: <1348832170-13250-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The kernel.h macro DIV_ROUND_UP performs the computation
(((n) + (d) - 1) / (d))
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
drivers/bluetooth/btmrvl_sdio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c
index 645b42e..ec5c456 100644
--- a/drivers/bluetooth/btmrvl_sdio.c
+++ b/drivers/bluetooth/btmrvl_sdio.c
@@ -514,7 +514,7 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
}
blksz = SDIO_BLOCK_SIZE;
- num_blocks = (buf_len + blksz - 1) / blksz;
+ num_blocks = DIV_ROUND_UP(buf_len, blksz);
if (buf_len <= SDIO_HEADER_LEN
|| (num_blocks * blksz) > ALLOC_BUF_SIZE) {
--
1.7.9.5
^ permalink raw reply related
* [PATCH 1/3] Bluetooth: btmrvl: Correct num_block name
From: Andrei Emeltchenko @ 2012-09-28 11:36 UTC (permalink / raw)
To: linux-bluetooth; +Cc: bzhao
In-Reply-To: <20120927205145.GC15463@joana>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Make code readable by correcting name from buf_block_len to num_blocks
since it represent number of blocks; NOT a length of a block buffer.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
drivers/bluetooth/btmrvl_sdio.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/bluetooth/btmrvl_sdio.c b/drivers/bluetooth/btmrvl_sdio.c
index 3f4bfc8..645b42e 100644
--- a/drivers/bluetooth/btmrvl_sdio.c
+++ b/drivers/bluetooth/btmrvl_sdio.c
@@ -492,7 +492,7 @@ done:
static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
{
u16 buf_len = 0;
- int ret, buf_block_len, blksz;
+ int ret, num_blocks, blksz;
struct sk_buff *skb = NULL;
u32 type;
u8 *payload = NULL;
@@ -514,18 +514,17 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
}
blksz = SDIO_BLOCK_SIZE;
- buf_block_len = (buf_len + blksz - 1) / blksz;
+ num_blocks = (buf_len + blksz - 1) / blksz;
if (buf_len <= SDIO_HEADER_LEN
- || (buf_block_len * blksz) > ALLOC_BUF_SIZE) {
+ || (num_blocks * blksz) > ALLOC_BUF_SIZE) {
BT_ERR("invalid packet length: %d", buf_len);
ret = -EINVAL;
goto exit;
}
/* Allocate buffer */
- skb = bt_skb_alloc(buf_block_len * blksz + BTSDIO_DMA_ALIGN,
- GFP_ATOMIC);
+ skb = bt_skb_alloc(num_blocks * blksz + BTSDIO_DMA_ALIGN, GFP_ATOMIC);
if (skb == NULL) {
BT_ERR("No free skb");
goto exit;
@@ -541,7 +540,7 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
payload = skb->data;
ret = sdio_readsb(card->func, payload, card->ioport,
- buf_block_len * blksz);
+ num_blocks * blksz);
if (ret < 0) {
BT_ERR("readsb failed: %d", ret);
ret = -EIO;
@@ -590,7 +589,7 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
default:
BT_ERR("Unknown packet type:%d", type);
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, payload,
- blksz * buf_block_len);
+ blksz * num_blocks);
kfree_skb(skb);
skb = NULL;
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH v3 BlueZ 1/4] gatt: Add support for find included services
From: Johan Hedberg @ 2012-09-28 11:32 UTC (permalink / raw)
To: Anderson Lizardo; +Cc: Vinicius Costa Gomes, linux-bluetooth
In-Reply-To: <CAJdJm_PPjxkXoL+Q=f-3AozUnUErCrD-cQ2KzO1WQSvxJWyRrg@mail.gmail.com>
Hi Lizardo,
On Fri, Sep 28, 2012, Anderson Lizardo wrote:
> On Fri, Sep 28, 2012 at 7:08 AM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> > Btw, if you guys are wondering why the stricter coding style checks,
> > I've added the following to .git/hooks/pre-{commit,applypatch}:
> >
> > git diff --cached | ~/src/linux/scripts/checkpatch.pl --no-signoff --ignore INITIALISED_STATIC,NEW_TYPEDEFS,VOLATILE --show-types --mailback -
> >
> > You might want to do the same (with the correct path to checkpatch.pl)).
> > And thanks to Luiz for the idea (he's using the same when applying
> > patches).
>
> Thanks for the very useful tip! But which checkpatch.pl version are
> you using? Mine (from bluetooth-next tree) lacks --ignore and
> --show-types options.
I'm using Linus' tree.
Johan
^ permalink raw reply
* [PATCH] Bluetooth: A2MP: Fix potential NULL dereference
From: Andrei Emeltchenko @ 2012-09-28 11:28 UTC (permalink / raw)
To: linux-bluetooth
In-Reply-To: <20120928012323.GG5522@localhost>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Return INVALID_CTRL_ID for unknown AMP controller and for BR/EDR
controller and fixes dereference possible NULL pointer.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
---
net/bluetooth/a2mp.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c
index 61e657a..a55449e 100644
--- a/net/bluetooth/a2mp.c
+++ b/net/bluetooth/a2mp.c
@@ -278,7 +278,7 @@ static int a2mp_getinfo_req(struct amp_mgr *mgr, struct sk_buff *skb,
BT_DBG("id %d", req->id);
hdev = hci_dev_get(req->id);
- if (!hdev) {
+ if (!hdev || hdev->dev_type != HCI_AMP) {
struct a2mp_info_rsp rsp;
rsp.id = req->id;
@@ -286,14 +286,16 @@ static int a2mp_getinfo_req(struct amp_mgr *mgr, struct sk_buff *skb,
a2mp_send(mgr, A2MP_GETINFO_RSP, hdr->ident, sizeof(rsp),
&rsp);
- }
- if (hdev->dev_type != HCI_BREDR) {
- mgr->state = READ_LOC_AMP_INFO;
- hci_send_cmd(hdev, HCI_OP_READ_LOCAL_AMP_INFO, 0, NULL);
+ goto done;
}
- hci_dev_put(hdev);
+ mgr->state = READ_LOC_AMP_INFO;
+ hci_send_cmd(hdev, HCI_OP_READ_LOCAL_AMP_INFO, 0, NULL);
+
+done:
+ if (hdev)
+ hci_dev_put(hdev);
skb_pull(skb, sizeof(*req));
return 0;
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH v3 BlueZ 1/4] gatt: Add support for find included services
From: Anderson Lizardo @ 2012-09-28 11:28 UTC (permalink / raw)
To: Vinicius Costa Gomes, linux-bluetooth
In-Reply-To: <20120928110833.GB14450@x220>
Hi Johan,
On Fri, Sep 28, 2012 at 7:08 AM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> Btw, if you guys are wondering why the stricter coding style checks,
> I've added the following to .git/hooks/pre-{commit,applypatch}:
>
> git diff --cached | ~/src/linux/scripts/checkpatch.pl --no-signoff --ignore INITIALISED_STATIC,NEW_TYPEDEFS,VOLATILE --show-types --mailback -
>
> You might want to do the same (with the correct path to checkpatch.pl)).
> And thanks to Luiz for the idea (he's using the same when applying
> patches).
Thanks for the very useful tip! But which checkpatch.pl version are
you using? Mine (from bluetooth-next tree) lacks --ignore and
--show-types options.
Regards,
--
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
^ permalink raw reply
* Re: [PATCH 07/14] thermometer: Reformat MeasurementReceived description
From: Johan Hedberg @ 2012-09-28 11:27 UTC (permalink / raw)
To: Santiago Carot; +Cc: Andrzej Kaczmarek, linux-bluetooth
In-Reply-To: <CACLukzLZGEbA-3pSqbutRrjb5WXJo7az+DydQ1Vph5bAnD0kdQ@mail.gmail.com>
Hi Santiago,
On Fri, Sep 28, 2012, Santiago Carot wrote:
> 2012/9/28 Johan Hedberg <johan.hedberg@gmail.com>:
> > Hi Andrzej,
> >
> > On Tue, Sep 25, 2012, Andrzej Kaczmarek wrote:
> >> + Measurement:
> >> +
> >> + int16 Exponent:
> >> + int32 Mantissa:
> >> +
> >> + Measurement value is calculated as
> >> + (Mantissa) x (10^Exponent)
> >> +
> >> + In case of invalid or missing data,
> >> + Exponent is set to 0 and Mantissa is
> >> + set to 2^23-1 (0x7FFFFF hexadecimal).
> >
> > Why aren't we using the D-Bus DOUBLE type for this? For invalid/missing
> > data just leave out these values from the dict. No need to try to
> > brute-force a 1:1 mapping from the protocol to D-Bus.
>
> We don't use double type here because these information is valuable
> for upper profiles implementing a IEE11073-20601 protocol layer. This
> fact is scarcely commented in HTP and better explained in former
> specification where there is a need to pack both values (mantissa and
> exponent) in special kind of APDUs. Of course we could provide the
> double value here, but there will remain the need to know when an
> special case occurs: NRes, NaN,INFINITY, -INFINITY.
>
> Furthermore, providing a double value here will force to upper
> profiles to do extra stuff to calculate the mantissa and the exponent
> values in order to create APDUs, beside they will have to deal with
> impreccisions derivated to comparate float point numbers and so it
> might make difficult to check when a special case has happened.
>
> these are, as far as I remember, the reasons which we did it in this
> way. We were already talking about this fact in the mailing list in
> the past but I don't find the thread right now. sorry
This is good enough as a justification. I remembered we had discussed
this before but for the details I needed to get my memory refreshed.
Thanks.
Johan
^ permalink raw reply
* Re: [PATCH BlueZ v0 2/2] hog: Add support for multiple instances
From: Johan Hedberg @ 2012-09-28 11:17 UTC (permalink / raw)
To: Claudio Takahasi; +Cc: linux-bluetooth
In-Reply-To: <1348083222-15294-2-git-send-email-claudio.takahasi@openbossa.org>
Hi Claudio,
On Wed, Sep 19, 2012, Claudio Takahasi wrote:
> This patch adds support for multiple HID services instances exposed by
> the same remote device.
> ---
>
> *** Apply after "[PATCH BlueZ v2 0/6] HoG Suspend/Resume" series
>
> profiles/input/hog_device.c | 90 +++++++++++---------------------------------
> profiles/input/hog_device.h | 3 +-
> profiles/input/hog_manager.c | 41 ++++++++++++--------
> 3 files changed, 48 insertions(+), 86 deletions(-)
Patch 1/2 has been applied but this 2/2 doesn't apply even though I did
already push the HoG Suspend/Resume patches upstream. Please fix and
resend.
Johan
^ permalink raw reply
* Re: [PATCH BlueZ v3 4/6] hog: Create a FIFO for dummy suspend
From: Johan Hedberg @ 2012-09-28 11:14 UTC (permalink / raw)
To: Claudio Takahasi, linux-bluetooth
In-Reply-To: <20120928095814.GC2518@x220>
Hi Claudio,
On Fri, Sep 28, 2012, Johan Hedberg wrote:
> Hi Claudio,
>
> On Tue, Sep 25, 2012, Claudio Takahasi wrote:
> > This patch creates a FIFO on "/tmp/hogsuspend" to allow the users to
> > test the HoG suspend(HID Control Point) when the dummy back-end is
> > enabled.
> > ---
> > profiles/input/suspend-dummy.c | 102 ++++++++++++++++++++++++++++++++++++++++-
> > 1 file changed, 101 insertions(+), 1 deletion(-)
>
> Patches 1-3 have been applied but this one has issues:
>
> Applying: hog: Create a FIFO for dummy suspend
> WARNING:LONG_LINE: line over 80 characters
> #64: FILE: profiles/input/suspend-dummy.c:84:
> + * or output operation. When the remote closes the channel, hup signal is
>
> Please fix and resend.
Nevermind. I decided to fix this myself since I wanna move forward with
merging more patches that depend on this.
Johan
^ permalink raw reply
* Re: [PATCH hcidump] amp: Decode Read Data Block Size HCI cmd
From: Johan Hedberg @ 2012-09-28 11:11 UTC (permalink / raw)
To: Andrei Emeltchenko; +Cc: linux-bluetooth
In-Reply-To: <1346331979-3837-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
Hi Andrei,
On Thu, Aug 30, 2012, Andrei Emeltchenko wrote:
> From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
>
> Decode Read Data Block Size HCI command and command status.
>
> < HCI Command: Read Data Block Size (0x04|0x000a) plen 0
> > HCI Event: Command Complete (0x0e) plen 10
> Read Data Block Size (0x04|0x000a) ncmd 1
> status 0x00
> Max ACL 1492 Block len 1492 Num blocks 4
> ---
> lib/hci.h | 8 ++++++++
> parser/hci.c | 24 +++++++++++++++++++++++-
> 2 files changed, 31 insertions(+), 1 deletion(-)
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