You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today, if you initialize a FirmwareUpgradeManager, invoke FirmwareUpgradeManager.start(images:), and provide more than one image, it seems impossible for the client/delegate of FirmwareUpgradeManager to know which of the images will be uploaded and which ones won't. This makes it difficult to display a progress bar to the user. My recommendation would be to make the following changes to FirmwareUpgradeDelegate:
Add a new method called willUploadImagesWithSizes(_ imageSizes: [Int]). This method will inform the delegate if only a subset of images will be uploaded, and what their sizes will be.
Change uploadProgressDidChange to include the index of the images currently being uploaded. For example: uploadProgressDidChange(imageIndex: Int, bytesSent: Int, imageSize: Int, timestamp: Date)
Please let me know if there's already a different way of obtaining the information I need.
The text was updated successfully, but these errors were encountered:
You have a point, @daltonclaybrook . This was an oversight of the API since, as you can see in many corners of it, nobody thought about 'multiple images' having to be sent. The way we do it in our apps, is we use the imageSize to know to which image the progress is referring to. And if the bytes sent flips back to a value lower than the previous call, we also know the image being sent is different (in the very unlikely case multiple binaries have the exact same imageSize byte count)
As for - "just change the API, you've done plenty of changes already" ... we try hard not to change it. We do. If you 100% believe it's rather better to change it, I can do it for sure.
Today, if you initialize a
FirmwareUpgradeManager
, invokeFirmwareUpgradeManager.start(images:)
, and provide more than one image, it seems impossible for the client/delegate ofFirmwareUpgradeManager
to know which of the images will be uploaded and which ones won't. This makes it difficult to display a progress bar to the user. My recommendation would be to make the following changes toFirmwareUpgradeDelegate
:willUploadImagesWithSizes(_ imageSizes: [Int])
. This method will inform the delegate if only a subset of images will be uploaded, and what their sizes will be.uploadProgressDidChange
to include the index of the images currently being uploaded. For example:uploadProgressDidChange(imageIndex: Int, bytesSent: Int, imageSize: Int, timestamp: Date)
Please let me know if there's already a different way of obtaining the information I need.
The text was updated successfully, but these errors were encountered: