codec

package
v3.0.33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2021 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATE_NEC_HEADER_PULSE necstate = iota
	STATE_NEC_HEADER_SPACE
	STATE_NEC_PULSE
	STATE_NEC_SPACE
	STATE_NEC_REPEAT
	STATE_NEC_TRAILER
	STATE_NEC_KEYPRESS
	STATE_NEC_KEYREPEAT
)
View Source
const (
	NEC_TOLERANCE = 25     // 25% tolerance on values
	APPLETV_CODE  = 0x77E1 // The device code used by the AppleTV
)
View Source
const (
	RC5_EXPECT_FIRST_PULSE rc5state = iota
	RC5_EXPECT_PULSE
	RC5_EXPECT_SPACE
)
View Source
const (
	RC5_TOLERANCE = 35 // 35% tolerance on values
)

Variables

View Source
var (
	NEC_HEADER_PULSE        = NewMarkSpace(gopi.LIRC_TYPE_PULSE, 9000, NEC_TOLERANCE) // 9ms
	NEC_HEADER_SPACE        = NewMarkSpace(gopi.LIRC_TYPE_SPACE, 4500, NEC_TOLERANCE) // 4.5ms
	NEV_HEADER_REPEAT_SPACE = NewMarkSpace(gopi.LIRC_TYPE_SPACE, 2250, NEC_TOLERANCE) // 2.25ms

	NEC_BIT_PULSE  = NewMarkSpace(gopi.LIRC_TYPE_PULSE, 563, NEC_TOLERANCE)  // 650ns
	NEC_ONE_SPACE  = NewMarkSpace(gopi.LIRC_TYPE_SPACE, 1688, NEC_TOLERANCE) // 1.6ms
	NEC_ZERO_SPACE = NewMarkSpace(gopi.LIRC_TYPE_SPACE, 563, NEC_TOLERANCE)  // 500ns
)

Functions

This section is empty.

Types

type Codec

type Codec interface {
	Run(ctx context.Context, publisher gopi.Publisher) error
}

type CodecEvent

type CodecEvent struct {
	Type   gopi.InputType
	Device gopi.InputDeviceType
	Code   uint32
}

func (*CodecEvent) Name

func (this *CodecEvent) Name() string

func (*CodecEvent) String

func (this *CodecEvent) String() string

type MarkSpace

type MarkSpace struct {
	Type            gopi.LIRCType
	Value, Min, Max uint32
}

A mark or space value

func NewMarkSpace

func NewMarkSpace(t gopi.LIRCType, value, tolerance uint32) *MarkSpace

func (*MarkSpace) GreaterThan

func (m *MarkSpace) GreaterThan(evt gopi.LIRCEvent) bool

func (*MarkSpace) LessThan

func (m *MarkSpace) LessThan(evt gopi.LIRCEvent) bool

func (*MarkSpace) Matches

func (m *MarkSpace) Matches(evt gopi.LIRCEvent) bool

func (*MarkSpace) Set

func (m *MarkSpace) Set(value, tolerance uint32)

type NEC

type NEC struct {
	// contains filtered or unexported fields
}

func NewNEC

func NewNEC(codec gopi.InputDeviceType) *NEC

func (*NEC) Process

func (this *NEC) Process(evt gopi.LIRCEvent, publisher gopi.Publisher)

func (*NEC) Run

func (this *NEC) Run(ctx context.Context, publisher gopi.Publisher) error

type RC5

type RC5 struct {
	// contains filtered or unexported fields
}

func NewRC5

func NewRC5(codec gopi.InputDeviceType) *RC5

func (*RC5) Process

func (this *RC5) Process(evt gopi.LIRCEvent, publisher gopi.Publisher)

func (*RC5) Reset

func (this *RC5) Reset()

func (*RC5) Run

func (this *RC5) Run(ctx context.Context, publisher gopi.Publisher) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL