pupil-labs / pyuvc

python binding to libuvc
Other
117 stars 51 forks source link

Allows for specification of per-device XUs #97

Closed domstoppable closed 4 months ago

domstoppable commented 4 months ago

This adds a mechanism to support reading/writing XUs per device. Example usage looks like this:

extended_controls = [
    {
        'display_name': 'Primary Sensor Exposure',
        'unit': 'ffffffff-ffff-ffff-ffff-ffffffffffff',
        'control_id': 0x01,
        'bit_mask': 0xffff,
        'offset': 0,
        'data_len': 4,
        'buffer_len': 4,
        'min_val': 10,
        'max_val': 49,
        'step':None,
        'def_val':None,
        'd_type': int,
        'doc': ''
    },{
        'display_name': 'Secondary Sensor Exposure',
        'unit': 'ffffffff-ffff-ffff-ffff-ffffffffffff',
        'control_id': 0x02,
        'bit_mask': 0xffff,
        'offset': 0,
        'data_len': 4,
        'buffer_len': 4,
        'min_val': 10,
        'max_val': 49,
        'step':None,
        'def_val':None,
        'd_type': int,
        'doc': ''
    },
]

capture = uvc.Capture(uid, extended_controls)

These controls then have the same API as standard controls