This commit is contained in:
henne 2025-08-09 12:38:24 +02:00
parent a9c10c8332
commit f66d5d3224
No known key found for this signature in database

View file

@ -60,9 +60,10 @@ func (r *Radar) decodeInput(buf []byte) {
valid = "yes"
}
log.Printf("Speed: %dkm/h (%s, Over: %s, Valid: %s)", buf[3], dir, overspeed, valid)
r.speedHandler(int(buf[3]))
if overspeed == "yes" && valid == "yes" {
if r.speedHandler != nil {
r.speedHandler(int(buf[3]))
}
if overspeed == "yes" && valid == "yes" && r.handler != nil {
r.handler(int(buf[3]))
}
return