rfplayer

package module
v0.0.0-...-c22b3fa Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 10 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

Help is available via the command line:

rfplayer --help

Record a signal (parrot):

rfplayer record --action ON --id 1 --metadata "zonwering-1-1"

Change the frequency band of the RFPlayer:

rfplayer setfreq --band H --freq 868350
rfplayer setfreq --band L --freq 433420

Troubleshooting

If you need to use sudo to access the serial port, you can add your user to the dialout group:

sudo usermod -aG dialout $USER

Then, log out and log back in for the changes to take effect.

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 connected to the given serial port.

func NewWithPort

func NewWithPort(port io.ReadWriteCloser) *RFPlayer

NewWithPort creates a new RFPlayer instance with a custom io.ReadWriteCloser.

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
rfplayer command

Jump to

Keyboard shortcuts

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