irremote

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2023 License: BSD-3-Clause Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandHandler

type CommandHandler func(data Data)

CommandHandler defines the callback function used to provide IR data received by the ReceiverDevice.

type Data

type Data struct {
	// Code is the raw IR data received.
	Code uint32
	// Address is the decoded address from the IR data received.
	Address uint16
	// Command is the decoded command from the IR data recieved
	Command uint16
	// Flags provides additional information about the IR data received. See DataFlags
	Flags DataFlags
}

Data encapsulates the data received by the ReceiverDevice.

type DataFlags

type DataFlags uint16

DataFlags provides bitwise flags representing various information about recieved IR data.

const (
	// DataFlagIsRepeat set indicates that the IR data is a repeat commmand
	DataFlagIsRepeat DataFlags = 1 << iota
)

Valid values for DataFlags

type ReceiverDevice

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

ReceiverDevice is the device for receiving IR commands

func NewReceiver

func NewReceiver(pin machine.Pin) ReceiverDevice

NewReceiver returns a new IR receiver device

func (*ReceiverDevice) Configure

func (ir *ReceiverDevice) Configure()

Configure configures the input pin for the IR receiver device

func (*ReceiverDevice) SetCommandHandler

func (ir *ReceiverDevice) SetCommandHandler(ch CommandHandler)

SetCommandHandler is used to start or stop receiving IR commands via a callback function (pass nil to stop)

Jump to

Keyboard shortcuts

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