GithubHelp home page GithubHelp logo

python-hidraw's People

Contributors

mdealencar avatar vpelletier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

python-hidraw's Issues

Apparently code is not working

I'm trying to use Your code, but I'm stuck right at the beginning.

The following test code (along with several variations):

from pathlib import Path
from pyhidraw import HIDRaw


def get_devices():
    paths = sorted([f for f in Path('/dev/input').iterdir() if f.name.startswith('event')],
                   key=lambda f: int(f.name.replace('event', '')))
    devices = []
    for f in paths:
        with f.open() as fd:
            dev = HIDRaw(fd)
            name = dev.getName()
            desc = dev.getRawReportDescriptor()
        devices.append((str(f), name, desc))
    return devices


dd = get_devices()
for d in dd:
    print(d)

bombs with the following error:

/usr/bin/python3.5 /home/valeria/MyProject/VoCore/trasmissione-telematica/Communications/Client/hidraw.py
Traceback (most recent call last):
  File "/home/valeria/MyProject/VoCore/trasmissione-telematica/Communications/Client/hidraw.py", line 18, in <module>
    dd = get_devices()
  File "/home/valeria/MyProject/VoCore/trasmissione-telematica/Communications/Client/hidraw.py", line 12, in get_devices
    name = dev.getName()
  File "/home/valeria/MyProject/VoCore/trasmissione-telematica/Communications/Client/pyhidraw.py", line 93, in getName
    self._ioctl(_HIDIOCGRAWNAME(length), name, True)
  File "/home/valeria/MyProject/VoCore/trasmissione-telematica/Communications/Client/pyhidraw.py", line 59, in _ioctl
    result = fcntl.ioctl(self._device, func, arg, mutate_flag)
OSError: [Errno 22] Invalid argument

Process finished with exit code 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.