diff options
author | Petri Gynther <pgynther@google.com> | 2014-03-06 15:00:55 -0800 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-03-07 09:01:54 +0200 |
commit | cd4ed91a4cca697ee1209a3035152c46fe5826ad (patch) | |
tree | de88f3a02a62d4bb95df5b6c6807fdab7e960b83 /profiles | |
parent | a70432827c745e5dc378ab6548ce1cf366cc4460 (diff) | |
download | bluez-cd4ed91a4cca697ee1209a3035152c46fe5826ad.tar.gz |
hog: Fill ev.u.create.{phys,uniq} for UHID_CREATE
Fill ev.u.create.{phys,uniq} fields when uHID device is created.
These values are copied to kernel hid_device structure.
linux/include/linux/hid.h:
struct hid_device {
...
char name[128]; /* Device name */
char phys[64]; /* Device physical location */
char uniq[64]; /* Device unique identifier (serial #) */
Diffstat (limited to 'profiles')
-rw-r--r-- | profiles/input/hog.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/profiles/input/hog.c b/profiles/input/hog.c index a9830aafc..fd72e360c 100644 --- a/profiles/input/hog.c +++ b/profiles/input/hog.c @@ -348,6 +348,7 @@ static void report_map_read_cb(guint8 status, const guint8 *pdu, guint16 plen, gpointer user_data) { struct hog_device *hogdev = user_data; + struct btd_adapter *adapter = device_get_adapter(hogdev->device); uint8_t value[HOG_REPORT_MAP_MAX_SIZE]; struct uhid_event ev; uint16_t vendor_src, vendor, product, version; @@ -397,6 +398,8 @@ static void report_map_read_cb(guint8 status, const guint8 *pdu, guint16 plen, sizeof(ev.u.create.name)); else strcpy((char *) ev.u.create.name, "bluez-hog-device"); + ba2str(btd_adapter_get_address(adapter), (char *) ev.u.create.phys); + ba2str(device_get_address(hogdev->device), (char *) ev.u.create.uniq); ev.u.create.vendor = vendor; ev.u.create.product = product; ev.u.create.version = version; |