summaryrefslogtreecommitdiff
path: root/src/rhctl/audio_switch.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/rhctl/audio_switch.go')
-rw-r--r--src/rhctl/audio_switch.go46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/rhctl/audio_switch.go b/src/rhctl/audio_switch.go
new file mode 100644
index 0000000..8202e60
--- /dev/null
+++ b/src/rhctl/audio_switch.go
@@ -0,0 +1,46 @@
+//
+// rhctl
+//
+// Copyright (C) 2009-2016 Christian Pointner <equinox@helsinki.at>
+//
+// This file is part of rhctl.
+//
+// rhctl is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// any later version.
+//
+// rhctl is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with rhctl. If not, see <http://www.gnu.org/licenses/>.
+//
+
+package main
+
+import (
+ "fmt"
+)
+
+type AudioSwitch struct {
+ port *SerialPort
+}
+
+func (sw *AudioSwitch) Run() {
+ rhdl.Printf("running audio switch")
+ sw.port.tx <- "hello switch"
+}
+
+func SwitchInit(dev string, rate Baudrate) (sw *AudioSwitch, err error) {
+ sw = &AudioSwitch{}
+
+ if sw.port, err = SerialOpenAndHandle(dev, rate); err != nil {
+ err = fmt.Errorf("Error opening switch port: %s", err)
+ return
+ }
+
+ return
+}