Skip to content

Commit 5dbf415

Browse files
committed
Minor changes to comments and code structure
1 parent de43294 commit 5dbf415

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎evdev/device.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def __init__(self, dev):
144144
#: The physical topology of the device.
145145
self.phys = info_res[5]
146146

147-
#: The unique address of the device
147+
#: The unique address of the device.
148148
self.uniq = info_res[6]
149149

150150
#: The evdev protocol version.

‎evdev/input.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,13 @@ ioctl_devinfo(PyObject *self, PyObject *args)
226226
if (ioctl(fd, EVIOCGID, &iid) < 0) goto on_err;
227227
if (ioctl(fd, EVIOCGNAME(sizeof(name)), name) < 0) goto on_err;
228228

229-
ioctl(fd, EVIOCGUNIQ(sizeof(uniq)), uniq);
230-
231229
// Some devices do not have a physical topology associated with them
232230
ioctl(fd, EVIOCGPHYS(sizeof(phys)), phys);
233231

232+
// Some kernels have started reporting bluetooth controller MAC as phys.
233+
// This lets us get the real physical address. As with phys, it may be blank.
234+
ioctl(fd, EVIOCGUNIQ(sizeof(uniq)), uniq);
235+
234236
return Py_BuildValue("hhhhsss", iid.bustype, iid.vendor, iid.product, iid.version,
235237
name, phys, uniq);
236238

0 commit comments

Comments
 (0)