rfplayer

package module
v0.0.0-...-3213eaf Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 9 Imported by: 0

README

RFPlayer-Go

CLI tool and API for RFPlayer, in Go. This CLI tool allows to configure the RFPlayer and to send commands to it via the CLI and see the configured devices via HomeKit.

Installation

go install github.com/julienrbrt/rfplayer-go/cmd/rfplayer@latest

How to use

rfplayer --help

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParrotDevice

type ParrotDevice struct {
	ID       int
	Name     string
	Protocol string
}

ParrotDevice represents a Parrot device from the RFPlayer.

func GetParrotDevices

func GetParrotDevices(rf *RFPlayer) ([]ParrotDevice, error)

GetParrotDevices returns a list of Parrot devices from the RFPlayer.

type RFDeviceAccessory

type RFDeviceAccessory struct {
	*accessory.A
	Switch *accessory.Switch
	// contains filtered or unexported fields
}

RFDeviceAccessory represents a HomeKit accessory for an RF device.

func NewRFDeviceAccessory

func NewRFDeviceAccessory(info accessory.Info, rf *RFPlayer, id int, protocol string) (*RFDeviceAccessory, error)

NewRFDeviceAccessory creates a new RFDeviceAccessory instance.

type RFPlayer

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

func New

func New(portName string) (*RFPlayer, error)

New creates a new RFPlayer instance

func (*RFPlayer) Close

func (r *RFPlayer) Close() error

Close closes the serial connection

func (*RFPlayer) EmitSignal

func (r *RFPlayer) EmitSignal(protocol string, id int, action string) (string, error)

EmitSignal sends a signal using the RFPlayer

func (*RFPlayer) EnableReceiver

func (r *RFPlayer) EnableReceiver(protocols ...string) (string, error)

EnableReceiver enables specific protocols for receiving

func (*RFPlayer) FactoryReset

func (r *RFPlayer) FactoryReset(all bool) error

FactoryReset performs a factory reset on the RFPlayer

func (*RFPlayer) GetStatus

func (r *RFPlayer) GetStatus(statusType string, format string) (string, error)

GetStatus retrieves the status of the RFPlayer

func (*RFPlayer) Hello

func (r *RFPlayer) Hello() (string, error)

Hello sends the HELLO command to the RFPlayer and returns the response

func (*RFPlayer) ParrotRemapping

func (r *RFPlayer) ParrotRemapping(protocol string, startID int) (string, error)

ParrotRemapping remaps Parrot entries to another protocol

func (*RFPlayer) Ping

func (r *RFPlayer) Ping() error

Ping sends a PING command to the RFPlayer and checks for a PONG response

func (*RFPlayer) RecordSignal

func (r *RFPlayer) RecordSignal(id int, action, metadata string) (string, error)

RecordSignal puts the RFPlayer in learning mode to record a signal

func (*RFPlayer) SendCommand

func (r *RFPlayer) SendCommand(cmd string) (string, error)

SendCommand sends a command to the RFPlayer and returns the response

func (*RFPlayer) SetFormat

func (r *RFPlayer) SetFormat(format string) (string, error)

SetFormat sets the format for received RF frames

func (*RFPlayer) SetFrequency

func (r *RFPlayer) SetFrequency(band string, freq int) (string, error)

SetFrequency sets the frequency for the RFPlayer

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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