usb_protocol.emitters.descriptor module

class usb_protocol.emitters.descriptor.ComplexDescriptorEmitter(collection=None)[source]

Bases: ConstructEmitter

Base class for emitting complex descriptors, which contain nested subordinates.

DESCRIPTOR_FORMAT: DescriptorFormat
add_subordinate_descriptor(subordinate)[source]

Adds a subordinate descriptor to the relevant descriptor.

Parameter:
subordinate – The subordinate descriptor to add; can be an emitter,

or a bytes-like object.

emit(include_subordinates=True)[source]

Emit our descriptor.

Parameters:

include_subordinates – If true or not provided, any subordinate descriptors will be included.