48 lines
1.1 KiB
Go
48 lines
1.1 KiB
Go
//go:build windows
|
|
|
|
package usbip
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
|
|
"github.com/duffy/usb-server/internal/usb"
|
|
)
|
|
|
|
// Server is a stub on Windows - USB/IP server requires Linux usbdevfs.
|
|
type Server struct{}
|
|
|
|
func NewServer(dev *usb.Device) *Server {
|
|
return &Server{}
|
|
}
|
|
|
|
func (s *Server) Attach() error {
|
|
return fmt.Errorf("USB/IP server not supported on Windows")
|
|
}
|
|
|
|
func (s *Server) Detach() {}
|
|
|
|
func (s *Server) BuildDeviceDescriptor() DeviceDescriptor {
|
|
return DeviceDescriptor{}
|
|
}
|
|
|
|
func (s *Server) BuildInterfaceDescriptors() []InterfaceDescriptor {
|
|
return nil
|
|
}
|
|
|
|
func (s *Server) HandleConnection(r io.Reader, w io.Writer) error {
|
|
return fmt.Errorf("USB/IP server not supported on Windows")
|
|
}
|
|
|
|
func (s *Server) HandleDevlistRequest() ([]byte, error) {
|
|
return nil, fmt.Errorf("USB/IP server not supported on Windows")
|
|
}
|
|
|
|
func (s *Server) HandleImportRequest(requestedBusID string) ([]byte, error) {
|
|
return nil, fmt.Errorf("USB/IP server not supported on Windows")
|
|
}
|
|
|
|
func (s *Server) ReadManagementRequest(r io.Reader) (response []byte, startTransfer bool, err error) {
|
|
return nil, false, fmt.Errorf("USB/IP server not supported on Windows")
|
|
}
|