Use sent bytes to check if transfer complete

This commit is contained in:
Elara 2021-10-23 19:36:23 -07:00
parent 4d35912466
commit 44dc5f8e47
2 changed files with 2 additions and 1 deletions

View File

@ -73,7 +73,7 @@ var upgradeCmd = &cobra.Command{
// Set amount of bytes received in progress bar
bar.SetCurrent(event.Received)
// If transfer finished, break
if event.Received == event.Total {
if event.Sent == event.Total {
break
}
}

View File

@ -65,6 +65,7 @@ type ReqDataNotify struct {
type DFUProgress struct {
Received int64 `mapstructure:"recvd"`
Total int64 `mapstructure:"total"`
Sent int64 `mapstructure:"sent"`
}
type MotionValues struct {