From 6f2826c134bbe9411490364baaa37ff877275071 Mon Sep 17 00:00:00 2001 From: Nonoo Date: Sun, 18 Oct 2020 21:35:36 +0200 Subject: [PATCH] Cleanup --- audiostream.go | 3 +-- controlstream.go | 3 +-- pkt7.go | 3 ++- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/audiostream.go b/audiostream.go index 88273a7..e55f5a7 100644 --- a/audiostream.go +++ b/audiostream.go @@ -89,8 +89,7 @@ func (s *audioStream) start() { s.timeoutTimer = time.NewTimer(audioTimeoutDuration) - s.common.pkt7.sendSeq = 1 - s.common.pkt7.startPeriodicSend(&s.common) + s.common.pkt7.startPeriodicSend(&s.common, 1) s.audioSendSeq = 1 diff --git a/controlstream.go b/controlstream.go index ef259ee..efa43d9 100644 --- a/controlstream.go +++ b/controlstream.go @@ -241,8 +241,7 @@ func (s *controlStream) start() { s.sendPkt0() s.sendRequestSerialAndAudio() - s.common.pkt7.sendSeq = 5 - s.common.pkt7.startPeriodicSend(&s.common) + s.common.pkt7.startPeriodicSend(&s.common, 5) pkt0SendTicker := time.NewTicker(100 * time.Millisecond) reauthTicker := time.NewTicker(60 * time.Second) diff --git a/pkt7.go b/pkt7.go index b6d49f8..6ec6604 100644 --- a/pkt7.go +++ b/pkt7.go @@ -98,7 +98,8 @@ func (p *pkt7Type) sendReply(s *streamCommon, replyID []byte, seq uint16) { p.sendDo(s, replyID, seq) } -func (p *pkt7Type) startPeriodicSend(s *streamCommon) { +func (p *pkt7Type) startPeriodicSend(s *streamCommon, firstSeqNo uint16) { + p.sendSeq = firstSeqNo p.lastConfirmedSeq = p.sendSeq - 1 p.sendTicker = time.NewTicker(100 * time.Millisecond)