Skip to content

Commit

Permalink
chore: improve variable name
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <[email protected]>
  • Loading branch information
zhaojh329 committed Sep 25, 2022
1 parent 5b10a09 commit 1193295
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ func (br *broker) run() {
log.Error().Msg("Invalid token from terminal device")
msg = "Invalid token"
err = 1
} else if dev.proto < rttyProto {
if dev.proto < rttyProto {
log.Error().Msgf("%s: unsupported protocol version: %d, need %d", dev.id, dev.proto, rttyProto)
} else if dev.proto < rttyProtoRequired {
if dev.proto < rttyProtoRequired {
log.Error().Msgf("%s: unsupported protocol version: %d, need %d", dev.id, dev.proto, rttyProtoRequired)
msg = "unsupported protocol"
err = 1
}
Expand Down
3 changes: 2 additions & 1 deletion device.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ const (
msgTypeFileAbort
)

const rttyProto uint8 = 3
// Minimum protocol version requirements of rtty
const rttyProtoRequired uint8 = 3
const heartbeatInterval = time.Second * 5

type device struct {
Expand Down

0 comments on commit 1193295

Please sign in to comment.