Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client of FirmwareUpgradeManager has no way of knowing which images will be uploaded #181

Open
daltonclaybrook opened this issue Dec 4, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@daltonclaybrook
Copy link

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.

@philips77 philips77 added the enhancement New feature or request label Jan 15, 2024
@philips77
Copy link
Member

Thank you for a feedback. We'll discuss it internally.

@dinesharjani
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants