Skip to content

Commit 66c06e9

Browse files
committed
fix ota regression on mysensors
Signed-off-by: Jeeva Kandasamy <jkandasa@gmail.com>
1 parent 838f2a6 commit 66c06e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugin/gateway/provider/mysensors_v2/ota_impl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (p *Provider) executeFirmwareRequest(msg *msgTY.Message) (string, error) {
106106

107107
startAddr := fwReq.Block * firmwareBlockSize
108108
endAddr := startAddr + firmwareBlockSize
109-
if int(endAddr) >= len(fwRaw.Data) {
109+
if int(endAddr) > len(fwRaw.Data) {
110110
p.logger.Error("requested block is not available", zap.Uint16("startAddr", startAddr), zap.Uint16("endAddr", endAddr), zap.Int("maxAvailableAddr", len(fwRaw.Data)))
111111
return "", fmt.Errorf("requested block is not available: %v", endAddr)
112112
}

0 commit comments

Comments
 (0)