Skip to content

Commit

Permalink
Refine vocabulary and punctuation of firmware update messages
Browse files Browse the repository at this point in the history
Co-authored-by: Johannes Emerich <[email protected]>
  • Loading branch information
krksgbr and knuton authored Apr 22, 2024
1 parent 8e0e4a7 commit 57b821c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/dividat-driver/firmware/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ func UpdateBySerial(ctx context.Context, deviceSerial string, image io.Reader, o
onProgress(fmt.Sprintf("Looking for Senso with specified serial %s", deviceSerial))
match := service.Find(ctx, discoveryTimeout, service.SerialNumberFilter(deviceSerial))
if match == nil {
return fmt.Errorf("Failed to find Senso with serial number %s.\n%s", deviceSerial)
return fmt.Errorf("Failed to find Senso with serial number %s", deviceSerial)
}

onProgress(fmt.Sprintf("Discovered Senso at %s", match.Address))
onProgress(fmt.Sprintf("Found Senso at %s", match.Address))
return update(ctx, *match, image, onProgress)
}

Expand All @@ -60,7 +60,7 @@ func update(parentCtx context.Context, target service.Service, image io.Reader,
})

if err != nil {
return fmt.Errorf("could not send DFU command to Senso at %s: %s", target.Address, err)
return fmt.Errorf("Could not send DFU command to Senso at %s: %s", target.Address, err)
}

onProgress("Looking for Senso in bootloader mode")
Expand All @@ -69,16 +69,16 @@ func update(parentCtx context.Context, target service.Service, image io.Reader,
})

if dfuService == nil {
return fmt.Errorf("Could not rediscover Senso in bootloader mode.")
return fmt.Errorf("Could not find Senso in bootloader mode")
}

target = *dfuService
onProgress(fmt.Sprintf("Re-discovered Senso in bootloader mode at %s", target.Address))
onProgress(fmt.Sprintf("Found Senso in bootloader mode at %s", target.Address))
onProgress("Waiting 10 seconds to ensure proper TFTP startup")
// Wait to ensure proper TFTP startup
time.Sleep(10 * time.Second)
} else {
onProgress("Senso discovered in bootloader mode")
onProgress("Found Senso in bootloader mode")
}

err := putTFTP(target.Address, tftpPort, image, onProgress)
Expand Down Expand Up @@ -119,7 +119,7 @@ func sendDfuCommand(host string, port string, onProgress OnProgress) error {
return fmt.Errorf("Could not send DFU command: %v", err)
}

onProgress(fmt.Sprintf("Sent DFU command to %s:%s.", host, port))
onProgress(fmt.Sprintf("Sent DFU command to %s:%s", host, port))

return nil
}
Expand Down
2 changes: 1 addition & 1 deletion src/dividat-driver/senso/update_firmware.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (handle *Handle) ProcessFirmwareUpdateRequest(command UpdateFirmware, send
send.failure(failureMsg)
handle.log.Error(failureMsg)
} else {
send.success("Firmware successfully transmitted.")
send.success("Firmware successfully transmitted")
}
handle.firmwareUpdate.SetUpdating(false)
}
Expand Down

0 comments on commit 57b821c

Please sign in to comment.