Skip to content

Possibly remove dependence on Zadig installer on Windows #12

@nanoparticle

Description

@nanoparticle

Hi, I just found your project, and it looks pretty cool so I thought I'd give a couple of suggestions:

  • It looks like there is a python package that contains compiled libusb binaries for major operating systems, and I have tested it to work out of the box on windows 10 with no separate installation needed. One caveat is that it seemed to require pyusb to be installed before it would enumerate all my usb devices, but it looks like you are using that already so likely not a problem.
  • I would highly recommend using some sort of virtual environment system for python, as this really helps with dependency management and version control, for making sure each user that installs your software has the same intended behavior. My preferred choice is poetry, but there are several options, none of which I could confidently say is the best.
  • Here is a custom enum definition that encapsulates the length field within DeviceInfoType:
class DeviceInfoType(enum.IntEnum):
    def __new__(cls, value: int, length: int):
        obj = int.__new__(cls, value)
        obj._value_ = value
        return obj
    
    def __init__(self, value: int, length: int):
        self.length = length
    
    DEV_INFO_CHIP_ID = (0, 8)
    DEV_INFO_FW_COMPILE_DATE = (1, 8)
    DEV_INFO_DEV_QUALIFICATION = (2, 8)
    DEV_INFO_IR_INFO = (3, 26)
    DEV_INFO_PROJECT_INFO = (4, 4)
    DEV_INFO_FW_BUILD_VERSION_INFO = (5, 50)
    DEV_INFO_GET_PN = (6, 48)
    DEV_INFO_GET_SN = (7, 16)
    DEV_INFO_GET_SENSOR_ID = (8, 4)

You can still use the enum member as before to retrieve the index as an int, but now if you call DeviceInfoType.DEV_INFO_GET_PN.length, it will retrieve the length instead.

Hope this helps!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions