From a02edcc24764ce6f18007b885eb51ea2d5c2d601 Mon Sep 17 00:00:00 2001 From: Nonoo Date: Sun, 25 Oct 2020 12:55:41 +0100 Subject: [PATCH] Move frame length constant --- serial-linux.go | 2 +- serialstream.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/serial-linux.go b/serial-linux.go index 6926b1e..7da99a2 100644 --- a/serial-linux.go +++ b/serial-linux.go @@ -50,7 +50,7 @@ func (s *serialPortStruct) writeLoop() { func (s *serialPortStruct) readLoop() { s.read = make(chan []byte) - b := make([]byte, 80) // Max. frame length according to Hamlib. + b := make([]byte, maxSerialFrameLength) for { n, err := s.pty.Master.Read(b) if err != nil { diff --git a/serialstream.go b/serialstream.go index 4623c44..ff9bef3 100644 --- a/serialstream.go +++ b/serialstream.go @@ -4,6 +4,8 @@ import ( "github.com/nonoo/kappanhang/log" ) +const maxSerialFrameLength = 80 // Max. frame length according to Hamlib. + type serialStream struct { common streamCommon