Rename the rest of the constants.

This commit is contained in:
Sebastian Zagrodzki
2017-03-27 22:33:29 +02:00
parent 36241e869e
commit f3b2f37e3a
2 changed files with 29 additions and 29 deletions

View File

@@ -30,22 +30,22 @@ type EndpointInfo struct {
}
func (e EndpointInfo) Number() int {
return int(e.Address) & EndpointNumMask
return int(e.Address & EndpointNumMask)
}
func (e EndpointInfo) TransferType() TransferType {
return TransferType(e.Attributes) & TransferTypeMask
return TransferType(e.Attributes & TransferTypeMask)
}
func (e EndpointInfo) Direction() EndpointDirection {
return EndpointDirection(e.Address) & EndpointDirectionMask
return EndpointDirection(e.Address & EndpointDirectionMask)
}
func (e EndpointInfo) String() string {
return fmt.Sprintf("Endpoint #%d %-3s %s - %s %s [%d %d]",
e.Number(), e.Direction(), e.TransferType(),
IsoSyncType(e.Attributes)&ISO_SYNC_TYPE_MASK,
IsoUsageType(e.Attributes)&ISO_USAGE_TYPE_MASK,
IsoSyncType(e.Attributes)&IsoSyncTypeMask,
IsoUsageType(e.Attributes)&IsoUsageTypeMask,
e.MaxPacketSize, e.MaxIsoPacket,
)
}