lircbackend

package
v0.0.0-...-a1a5cdc Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Code   uint64
	Repeat int
	Button string
	Remote string
}

Event represents the IR Remote Key Press Event

type Handle

type Handle func(Event)

Handle is a function that can be registered to handle an lirc Event

type Reply

type Reply struct {
	Command    string
	Success    int
	DataLength int
	Data       []string
}

Reply received when a command is sent

type Router

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

Router manages sending and receiving of commands / data

func Init

func Init(path string) (*Router, error)

Init initializes the connection to lirc daemon

func (*Router) Close

func (l *Router) Close()

Close the connection to lirc daemon

func (*Router) Command

func (l *Router) Command(command string) Reply

Command - Send any command to lircd

func (*Router) Handle

func (l *Router) Handle(remote string, button string, handle Handle)

Handle registers a new event handler for a defined key

func (*Router) Run

func (l *Router) Run(killChan chan struct{})

Run this in a go routine to listen for IR Key Press Events

func (*Router) Send

func (l *Router) Send(command string) error

Send a SEND_ONCE command

func (*Router) SendLong

func (l *Router) SendLong(command string, delay time.Duration) error

SendLong sends a SEND_START command followed by a delay and SEND_STOP`

func (*Router) SetDefaultHandle

func (l *Router) SetDefaultHandle(handle Handle)

Jump to

Keyboard shortcuts

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