From 44dc5f8e4759476e6282da31cf32ee0df3c3704b Mon Sep 17 00:00:00 2001 From: Arsen Musayelyan Date: Sat, 23 Oct 2021 19:36:23 -0700 Subject: [PATCH] Use sent bytes to check if transfer complete --- cmd/itctl/firmware/upgrade.go | 2 +- internal/types/types.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/itctl/firmware/upgrade.go b/cmd/itctl/firmware/upgrade.go index 18f5372..7df69dd 100644 --- a/cmd/itctl/firmware/upgrade.go +++ b/cmd/itctl/firmware/upgrade.go @@ -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 } } diff --git a/internal/types/types.go b/internal/types/types.go index cf6a47f..98ea75b 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -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 {