Fixed command error handling

This commit is contained in:
Gregor Riepl 2021-05-05 23:21:02 +02:00
parent f07440429a
commit ddb626ac4f

View file

@ -31,7 +31,10 @@ func (c *Can) DisplayWrite(line int, a []byte) error {
// print in separate chunks, as one frame payload is limited to 7 bytes
// the display has only 16 characters per line, so we truncate there
for i := 0; i < len(a) && i < 16; i += 7 {
return c.bus.Publish(DisplayCommand{addr, a[i:i+7]}.Encode())
err := c.bus.Publish(DisplayCommand{addr, a[i:i+7]}.Encode())
if err != nil {
return err
}
}
return nil
}