Skip to content

Commit

Permalink
feat(plc4go/cbus): add more tracing, increase receive timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Mar 28, 2023
1 parent 65414b2 commit 39d5e59
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plc4go/internal/cbus/MessageCodec.go
Expand Up @@ -187,19 +187,23 @@ lookingForTheEnd:
if newPackageHash == m.lastPackageHash {
m.hashEncountered++
}
log.Trace().Msgf("new hash %x, last hash %x, seen %d times", newPackageHash, m.lastPackageHash, m.hashEncountered)
m.lastPackageHash = newPackageHash
if m.hashEncountered < 9 {
if m.hashEncountered < 11 {
log.Trace().Msg("Waiting for more data")
return nil, nil
} else {
// after 90ms we give up finding a lf
// after 110ms we give up finding a lf
m.lastPackageHash, m.hashEncountered = 0, 0
if indexOfCR >= 0 {
log.Trace().Msg("setting requestToPci")
requestToPci = true
}
}
}
if !pciResponse && !requestToPci && !confirmation {
// Apparently we have not found any message yet
log.Trace().Msg("no message found yet")
return nil, nil
}

Expand Down

0 comments on commit 39d5e59

Please sign in to comment.