Metadata-Version: 2.1
Name: uhid-freebsd
Version: 1.2.2
Summary: Get information on FreeBSD uhid devices.
Home-page: https://github.com/grembo/uhid-freebsd
Author: Michael Gmelin
Author-email: freebsd@grem.de
Maintainer: Michael Gmelin
Maintainer-email: freebsd@grem.de
License: BSD 2-Clause
Platform: FreeBSD
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: POSIX :: BSD :: FreeBSD
Classifier: Programming Language :: Python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development
Description-Content-Type: text/x-rst
License-File: LICENSE

==============
 uhid-freebsd
==============

uhid-freebsd is a Python library to retrieve information on USB HID devices
on FreeBSD (`/dev/uhid*`).


Installation
------------

.. code-block:: bash

   pkg install py38-uhid-freebsd

.. code-block:: bash

   cd /usr/ports/devel/py-uid-freebsd
   make install clean


Usage
-----

.. code-block:: python

   from __future__ import print_function

   import uhid_freebsd as uhid
   import os

   for dev in uhid.enumerate():
       print("Device:", dev["device"])
       print("  Path:", dev["path"])
       print("  VendorId: 0x%04x" % dev["vendor_id"])
       print("  ProductId: 0x%04x" % dev["product_id"])
       print("  ProductDesc:", dev["product_desc"])
       print("  SerialNumber:", dev["serial_number"])
       fd = os.open(dev["path"], os.O_RDONLY)
       out = uhid.get_report_data(fd, 3)
       os.close(fd)
       print("  ReportData: " +
             " ".join([("%02x" % (x)) for x in out]))


Contributing
------------

Pull requests are welcome.  For major changes, please open an issue first to
discuss what you would like to change.

Please make sure to update tests as appropriate.

License
-------
`BSD 2-Clause <https://choosealicense.com/licenses/bsd-2-clause/>`__
