summaryrefslogtreecommitdiff
path: root/software/communication/interface.go
diff options
context:
space:
mode:
Diffstat (limited to 'software/communication/interface.go')
-rw-r--r--software/communication/interface.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/software/communication/interface.go b/software/communication/interface.go
index d124a48..df089f2 100644
--- a/software/communication/interface.go
+++ b/software/communication/interface.go
@@ -1,11 +1,12 @@
package communication
import (
- "fmt"
+ "log"
)
type SerialInterface struct {
phy physical
+ dl dataLink
}
func NewSerialInterface() (SerialInterface, error) {
@@ -17,16 +18,19 @@ func NewSerialInterface() (SerialInterface, error) {
return iface, err
}
+ iface.dl = newDataLink()
+
return iface, nil
}
func (i *SerialInterface) Start() {
i.phy.start()
+ i.dl.start(i.phy.rx)
}
func (i *SerialInterface) Cat() {
for {
- data := <-i.phy.rx
- fmt.Printf("%s", string(data))
+ data := <-i.dl.rx
+ log.Printf("RX: '%v'\n", data)
}
}