Documentation ¶
Overview ¶
Constants for eyetoy package
Scan USB devices for the correct eyetoy device
Index ¶
Constants ¶
View Source
const EyeToyPrimaryConfig int = 1 // only one configuration
View Source
const EyeToyPrimaryEndpoint int = 1
View Source
const EyeToyPrimaryInterface int = 0 // only one interface
View Source
const SonyEyeToyProductID uint16 = 340 // 0x0154 Eyetoy Audio Device
View Source
const SonyEyeToyVendorID uint16 = 1356 //0x054c Sony Corp.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EyeToy ¶
EyeToy encapsulates known interactions with the Sony EyeToy
func (*EyeToy) GetContext ¶
func (e *EyeToy) GetContext()
GetContext acquires a new gousb context and injects it into *EyeToy
func (*EyeToy) GetInterfaceEndpoint ¶
GetInterfaceEndpoint returns an interface of the given Alternate with a done/Close function as well as the only endpoint available (0x81 1:IN)
iface, done, endpoint, err := eyetoy.GetInterfaceEndpoint(1) if err != nil { // handle error } buf := make([]byte, endpoint.Desc.MaxPacketSize) readBytes, err := endpoint.Read(buf) done()
func (*EyeToy) Open ¶
Open opens the device with our known VID and PID. It sets autodetach to prevent kernel module interference, then acquires the only known working config for this device and places both inside *EyeToy
e := &EyeToy{} e.GetContext() err := e.Open() if err != nil { // handle error }
func (*EyeToy) ReadEndpoint ¶
ReadEndpoint reads one Packet from the given endpoint
Click to show internal directories.
Click to hide internal directories.