hidapi: upgrade debugging in udev
This commit is contained in:
parent
ad110498a6
commit
50ddb54466
|
@ -99,6 +99,8 @@ def exit():
|
|||
# It is given the bus id, vendor id, and product id and returns a dictionary
|
||||
# with the required hid_driver and usb_interface and whether this is a receiver or device.
|
||||
def _match(action, device, filterfn):
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug(f'Dbus event {action} {device}')
|
||||
hid_device = device.find_parent('hid')
|
||||
if not hid_device: # only HID devices are of interest to Solaar
|
||||
return
|
||||
|
@ -125,7 +127,7 @@ def _match(action, device, filterfn):
|
|||
return
|
||||
except Exception as e: # if can't process report descriptor fall back to old scheme
|
||||
hidpp_short = hidpp_long = None
|
||||
logger.warning(
|
||||
logger.info(
|
||||
'Report Descriptor not processed for DEVICE %s BID %s VID %s PID %s: %s', device.device_node, bid, vid, pid, e
|
||||
)
|
||||
|
||||
|
@ -281,6 +283,8 @@ def monitor_glib(callback, filterfn):
|
|||
GLib.io_add_watch(m, GLib.IO_IN, _process_udev_event, callback, filterfn)
|
||||
# print ("did io_add_watch")
|
||||
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug('Starting dbus monitoring')
|
||||
m.start()
|
||||
|
||||
|
||||
|
@ -293,6 +297,8 @@ def enumerate(filterfn):
|
|||
:returns: a list of matching ``DeviceInfo`` tuples.
|
||||
"""
|
||||
|
||||
if logger.isEnabledFor(logging.DEBUG):
|
||||
logger.debug('Starting dbus enumeration')
|
||||
for dev in _Context().list_devices(subsystem='hidraw'):
|
||||
dev_info = _match('add', dev, filterfn)
|
||||
if dev_info:
|
||||
|
|
Loading…
Reference in New Issue