From 455ae83f0f9c5a303c5393d5763ea7df7e715cd3 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 26 Mar 2016 21:32:41 +0100 Subject: reading from audio switch serial works now diff --git a/src/rhctl/audio_switch.go b/src/rhctl/audio_switch.go index 5fc9fac..4464a10 100644 --- a/src/rhctl/audio_switch.go +++ b/src/rhctl/audio_switch.go @@ -35,11 +35,13 @@ func (sw *AudioSwitch) Run() { stop := make(chan bool) sw.port.Run(stop) - select { - case <-stop: - return - case data := <-sw.port.rx: - rhl.Printf("got data from audio switch: %q", data) + for { + select { + case <-stop: + return + case data := <-sw.port.rx: + rhl.Printf("got data from audio switch: %q", data) + } } } diff --git a/src/rhctl/serial_port.go b/src/rhctl/serial_port.go index e809484..7a0af2c 100644 --- a/src/rhctl/serial_port.go +++ b/src/rhctl/serial_port.go @@ -146,11 +146,10 @@ func serialReader(c chan<- string, port *sio.Port, stop chan<- bool) { if len(data) == 0 { continue } - c <- string(data) + c <- data } if err := scanner.Err(); err != nil { rhl.Printf("device(%s): read error: %s", port.LocalAddr(), err) - panic(err.Error()) } else { rhl.Printf("device(%s): closed", port.LocalAddr()) } -- cgit v0.10.2