added isochronous modus

This commit is contained in:
2026-02-18 22:42:52 +01:00
parent 170f5dabcc
commit 99d9242264
7 changed files with 428 additions and 60 deletions
+21 -5
View File
@@ -24,13 +24,29 @@ type Device struct {
// Interface represents a USB interface
type Interface struct {
Number uint8 `json:"number"`
Class uint8 `json:"class"`
SubClass uint8 `json:"sub_class"`
Protocol uint8 `json:"protocol"`
Driver string `json:"driver"`
Number uint8 `json:"number"`
Class uint8 `json:"class"`
SubClass uint8 `json:"sub_class"`
Protocol uint8 `json:"protocol"`
Driver string `json:"driver"`
Endpoints []Endpoint `json:"endpoints"`
}
// Endpoint represents a USB endpoint
type Endpoint struct {
Address uint8 `json:"address"` // bEndpointAddress (bit 7=direction, bits 3:0=number)
TransferType uint8 `json:"transfer_type"` // 0=control, 1=iso, 2=bulk, 3=interrupt
MaxPacketSize uint16 `json:"max_packet_size"`
}
// USB transfer types (from bmAttributes)
const (
TransferTypeControl = 0
TransferTypeIsochronous = 1
TransferTypeBulk = 2
TransferTypeInterrupt = 3
)
// DevID returns the USB/IP device ID (busnum << 16 | devnum)
func (d *Device) DevID() uint32 {
return (d.BusNum << 16) | d.DevNum