Documentation ¶
Index ¶
- Constants
- type CBS
- type CBW
- type CommandDataBuffer
- type DataTransferDirection
- type DeviceInformation
- type Host
- func (h *Host) IPodDeviceInformation() (*DeviceInformation, error)
- func (h *Host) IPodFinalize(reset bool) error
- func (h *Host) IPodRepartition(targetSize int) error
- func (h *Host) IPodUpdateEnd() error
- func (h *Host) IPodUpdateSendChunk(data []byte) error
- func (h *Host) IPodUpdateSendFull(kind IPodUpdateKind, data []byte) error
- func (h *Host) IPodUpdateStart(kind IPodUpdateKind, size uint32) error
- func (h *Host) InquiryVPD(page uint8, allocation uint16) ([]byte, error)
- func (h *Host) RawCommand(cbd *CommandDataBuffer) error
- type IPodUpdateKind
- type OperationCode
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CBW ¶
type CommandDataBuffer ¶
type CommandDataBuffer struct { OperationCode OperationCode // Request contains the OperationCode-specific request parameters Request []byte // ServiceAction can (for certain CDB encodings) contain an additional // qualification for the OperationCode. ServiceAction *uint8 // Control contains common CDB metadata Control uint8 // DataTransferDirection contains the direction(s) of the data transfer(s) // to be made. DataTransferDirection DataTransferDirection // Data contains the data to be transferred. If data needs to be received // from the device, a buffer needs to be provided here. Data []byte // Timeout can contain an optional timeout (0 = no timeout) for the command Timeout time.Duration }
CommandDataBuffer represents a command
func (*CommandDataBuffer) Bytes ¶
func (c *CommandDataBuffer) Bytes() ([]byte, error)
Bytes returns the raw CDB to be sent to the device
type DataTransferDirection ¶
type DataTransferDirection uint8
const ( DataTransferNone DataTransferDirection = iota DataTransferToDevice DataTransferFromDevice DataTransferBidirectional )
type DeviceInformation ¶
type Host ¶
type Host struct { InEndpoint *gousb.InEndpoint OutEndpoint *gousb.OutEndpoint Tag uint32 }
func (*Host) IPodDeviceInformation ¶
func (h *Host) IPodDeviceInformation() (*DeviceInformation, error)
func (*Host) IPodFinalize ¶
func (*Host) IPodRepartition ¶
func (*Host) IPodUpdateEnd ¶
func (*Host) IPodUpdateSendChunk ¶
func (*Host) IPodUpdateSendFull ¶
func (h *Host) IPodUpdateSendFull(kind IPodUpdateKind, data []byte) error
func (*Host) IPodUpdateStart ¶
func (h *Host) IPodUpdateStart(kind IPodUpdateKind, size uint32) error
func (*Host) RawCommand ¶
func (h *Host) RawCommand(cbd *CommandDataBuffer) error
type IPodUpdateKind ¶
type IPodUpdateKind uint8
var ( IPodUpdateBootloader IPodUpdateKind = 1 IPodUpdateFirmware IPodUpdateKind = 0 )
type OperationCode ¶
type OperationCode uint8
const ( InquiryOp OperationCode = 0x12 ReadDefectDataOp OperationCode = 0x37 LogSenseOp OperationCode = 0x4d )
Click to show internal directories.
Click to hide internal directories.