Documentation ¶
Overview ¶
Package hid implements iap over hid transport
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultReportDefs = ReportDefs{ ReportDef{ID: 0x01, Len: 12, Dir: ReportDirAccIn}, ReportDef{ID: 0x02, Len: 14, Dir: ReportDirAccIn}, ReportDef{ID: 0x03, Len: 20, Dir: ReportDirAccIn}, ReportDef{ID: 0x04, Len: 63, Dir: ReportDirAccIn}, ReportDef{ID: 0x05, Len: 8, Dir: ReportDirAccIn}, ReportDef{ID: 0x06, Len: 10, Dir: ReportDirAccIn}, ReportDef{ID: 0x07, Len: 14, Dir: ReportDirAccIn}, ReportDef{ID: 0x08, Len: 20, Dir: ReportDirAccIn}, ReportDef{ID: 0x09, Len: 63, Dir: ReportDirAccIn}, }
DefaultReportDefs is a default set of report types for use with ipod-gadget
View Source
var LegacyReportDefs = ReportDefs{ ReportDef{ID: 0x01, Len: 5, Dir: ReportDirAccIn}, ReportDef{ID: 0x02, Len: 9, Dir: ReportDirAccIn}, ReportDef{ID: 0x03, Len: 13, Dir: ReportDirAccIn}, ReportDef{ID: 0x04, Len: 17, Dir: ReportDirAccIn}, ReportDef{ID: 0x05, Len: 25, Dir: ReportDirAccIn}, ReportDef{ID: 0x06, Len: 49, Dir: ReportDirAccIn}, ReportDef{ID: 0x07, Len: 95, Dir: ReportDirAccIn}, ReportDef{ID: 0x08, Len: 193, Dir: ReportDirAccIn}, ReportDef{ID: 0x09, Len: 257, Dir: ReportDirAccIn}, ReportDef{ID: 0x0A, Len: 385, Dir: ReportDirAccIn}, ReportDef{ID: 0x0B, Len: 513, Dir: ReportDirAccIn}, ReportDef{ID: 0x0C, Len: 767, Dir: ReportDirAccIn}, ReportDef{ID: 0x0D, Len: 5, Dir: ReportDirAccOut}, ReportDef{ID: 0x0E, Len: 9, Dir: ReportDirAccOut}, ReportDef{ID: 0x0F, Len: 13, Dir: ReportDirAccOut}, ReportDef{ID: 0x10, Len: 17, Dir: ReportDirAccOut}, ReportDef{ID: 0x11, Len: 25, Dir: ReportDirAccOut}, ReportDef{ID: 0x12, Len: 49, Dir: ReportDirAccOut}, ReportDef{ID: 0x13, Len: 95, Dir: ReportDirAccOut}, ReportDef{ID: 0x14, Len: 193, Dir: ReportDirAccOut}, ReportDef{ID: 0x15, Len: 255, Dir: ReportDirAccOut}, }
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
func NewDecoder(r ReportReader, defs ReportDefs) *Decoder
func NewDecoderDefault ¶
func NewDecoderDefault(r ReportReader) *Decoder
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
func NewEncoder ¶
func NewEncoder(w ReportWriter, defs ReportDefs) *Encoder
func NewEncoderDefault ¶
func NewEncoderDefault(w ReportWriter) *Encoder
func (*Encoder) WriteFrame ¶
type LinkControl ¶
type LinkControl byte
const ( LinkControlDone LinkControl = 0x00 LinkControlContinue LinkControl = 0x01 LinkControlMoreToFollow LinkControl = 0x02 )
type Report ¶
type Report struct { ID byte LinkControl LinkControl Data []byte }
type ReportDef ¶
type ReportDef struct { // id ID int // lenth of the report not including the id. Len int // direction Dir ReportDir }
ReportDef represents a hid report type from the descriptor
func (ReportDef) MaxPayload ¶
MaxPayload returns the maximum payload that a report can fit
type ReportDefs ¶
type ReportDefs []ReportDef
ReportDefs is a collection of ReportDef
type ReportReader ¶
func NewReportReader ¶
func NewReportReader(r io.Reader) ReportReader
type ReportWriter ¶
func NewReportWriter ¶
func NewReportWriter(w io.Writer) ReportWriter
type SingleReport ¶
type SingleReport []byte
func (SingleReport) ReadReport ¶
func (s SingleReport) ReadReport() (Report, error)
type Transport ¶
func NewTransport ¶
func NewTransport(r ReportReader, w ReportWriter, defs ReportDefs) *Transport
Click to show internal directories.
Click to hide internal directories.