Duet3D / RepRapFirmware

OO C++ RepRap Firmware
GNU General Public License v3.0
945 stars 535 forks source link

[FeatureRequest]: Functions to list directory contents (emulating M20) #950

Open owendare opened 9 months ago

owendare commented 9 months ago

Is your feature request related to a problem? Please describe.

It would be handy if we had a function that emulated M20, but put the list into an array. I recently did macro to allow the list of filaments to be displayed on a panelDue so the user can change filaments. But there's no way to dynamically create the array based on the contents of the filaments directory.

Describe the solution you propose.

Either extend M20 with a parameter option to save the contents into a specified array or create a dedicated function(s) which can be called in code. Perhaps dirList() and/or fileList()

Describe alternatives you've considered

None seem possible as there is no way to parse a json response in a met command

Provide any additional context or information.

Ex. Photos, mockups, etc.

T3P3 commented 9 months ago

To avoid running out of RAM will need to be bounded in chucks.