Support for long file names in file transfer
Posted: Sat Dec 16, 2023 9:24 pm
During my work to implement and debug the file transfer mechanism in my project, I figured out a method to support long filenames from the microcontroller side.
In the function GetFileName within SDFatFileManager.h, I changed the definition of a local char array to be larger:
Where m_maxFilenameLength is defined in the header file as:
Note that this only enables long filenames from the microcontroller side to the PC, but it does work nicely.
In the function GetFileName within SDFatFileManager.h, I changed the definition of a local char array to be larger:
Code: Select all
virtual const char* GetFilename(SdfmFile hFile) override
{
//static char achFilenameBuffer[13];
static char achFilenameBuffer[m_maxFilenameLength]; // edited CDS 14-12-23
hFile.getName(achFilenameBuffer, sizeof(achFilenameBuffer));
return achFilenameBuffer;
};
Code: Select all
static const int m_maxFilenameLength = 100;