def inspect
if self.revoked?
"\#<#{self.class} revoked>"
else
endpoint_address = self.bEndpointAddress
num = endpoint_address & 0b00001111
inout = (endpoint_address & 0b10000000) == 0 ? "OUT" : "IN "
bits = self.bmAttributes
transfer_type = %w[Control Isochronous Bulk Interrupt][0b11 & bits]
type = [transfer_type]
if transfer_type == 'Isochronous'
synchronization_type = %w[NoSynchronization Asynchronous Adaptive Synchronous][(0b1100 & bits) >> 2]
usage_type = %w[Data Feedback ImplicitFeedback ?][(0b110000 & bits) >> 4]
type << synchronization_type << usage_type
end
"\#<#{self.class} #{num} #{inout} #{type.join(" ")}>"
end
end