Fixed command error handling
This commit is contained in:
parent
f07440429a
commit
ddb626ac4f
1 changed files with 4 additions and 1 deletions
|
@ -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
|
// 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
|
// the display has only 16 characters per line, so we truncate there
|
||||||
for i := 0; i < len(a) && i < 16; i += 7 {
|
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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue