periph/devices

LIRC requires line break for SEND_ONCE

Closed this issue · 0 comments

Describe the bug
Dunno since when but lirc requires a linebreak for SEND_ONCE or It will throw bad send packet error
You can refer the source code https://github.com/aldebaran/lirc/blob/master/daemons/lircd.c#L774

To Reproduce
Steps to reproduce the behavior:

  1. Run program
package main

import (
  "periph.io/x/host/v3"
)

func main() {
  irConn, err := lirc.New()
  err = irConn.Emit("RemoteConfiguredInLIRC", ir.Key("CommandConfiguredInLIRC"))
}
  1. Run it.
  2. See error
    Check syslog and find
    bad send packet
    Or no command was logged as triggered in syslog

Expected behavior
The SEND_ONCE should be triggered and there should have no error like "bad send packet"

Platform (please complete the following information):

  • OS: Ubuntu 20.04
  • Board Raspberry Pi 4

Additional context
Confirmed that change the line lirc.go:67 from
_, err := fmt.Fprintf(c.w, "SEND_ONCE %s %s", remote, key)
to
_, err := fmt.Fprintf(c.w, "SEND_ONCE %s %s\n", remote, key)
will work