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

Diskinfo api for web workflow #7746

Merged
merged 3 commits into from
Mar 21, 2023
Merged

Diskinfo api for web workflow #7746

merged 3 commits into from
Mar 21, 2023

Conversation

FoamyGuy
Copy link
Collaborator

@FoamyGuy FoamyGuy commented Mar 18, 2023

resolves #7637

URL is /cp/diskinfo.json Response sizes are in bytes.

Example of response:

{"free": 212992, "block_size": 512, "total": 963072}

Maybe we don't really need block_size in the results? I can remove it if not. I added it initially in order to test how it's looked up, which is needed to find the correct multiplier to get to bytes units.

Tested successfully with Feather ESP32-S2 TFT.

Thank you to: isacben, Neradoc, and anecdata who all helped me in getting this far on implementing this API. Also Scott for the pointer to t_getfree(), the FatFs docs that were linked were quite helpful as well.

tannewt
tannewt previously approved these changes Mar 20, 2023
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you.

I'd leave block size in case another filesystem is used in the future and has a different size.

@tannewt
Copy link
Member

tannewt commented Mar 20, 2023

Could you bump web api version from 1 to 2? That'll simplify discovery of this endpoint.

@FoamyGuy
Copy link
Collaborator Author

latest commit increases api_version to 2.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tannewt tannewt merged commit c78502d into adafruit:main Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

web workflow API endpoint to return free space on device
2 participants