1919 * INCLUDE
2020 ******************************************************************************/
2121
22- #include " OTAStorage_MKRMEM .h"
22+ #include " OTAStorage_SFU .h"
2323#if OTA_STORAGE_MKRMEM
2424
2525#include < Arduino_DebugUtils.h>
2828 * CTOR/DTOR
2929 ******************************************************************************/
3030
31- OTAStorage_MKRMEM::OTAStorage_MKRMEM ()
31+ OTAStorage_SFU::OTAStorage_SFU ()
3232: _file{nullptr }
3333{
3434
@@ -38,56 +38,56 @@ OTAStorage_MKRMEM::OTAStorage_MKRMEM()
3838 * PUBLIC MEMBER FUNCTIONS
3939 ******************************************************************************/
4040
41- bool OTAStorage_MKRMEM ::init ()
41+ bool OTAStorage_SFU ::init ()
4242{
4343 flash.begin ();
4444 if (SPIFFS_OK != filesystem.mount ()) {
45- Debug.print (DBG_ERROR, " OTAStorage_MKRMEM ::init - mount() failed with error code %d" , filesystem.err ());
45+ Debug.print (DBG_ERROR, " OTAStorage_SFU ::init - mount() failed with error code %d" , filesystem.err ());
4646 return false ;
4747 }
4848
4949 if (SPIFFS_OK != filesystem.check ()) {
50- Debug.print (DBG_ERROR, " OTAStorage_MKRMEM ::init - check() failed with error code %d" , filesystem.err ());
50+ Debug.print (DBG_ERROR, " OTAStorage_SFU ::init - check() failed with error code %d" , filesystem.err ());
5151 return false ;
5252 }
5353
5454 return true ;
5555}
5656
57- bool OTAStorage_MKRMEM ::open (char const * file_name)
57+ bool OTAStorage_SFU ::open (char const * file_name)
5858{
5959 filesystem.clearerr ();
6060 _file = new File (filesystem.open (file_name, CREATE | WRITE_ONLY| TRUNCATE));
6161 if (SPIFFS_OK != filesystem.err ()) {
62- Debug.print (DBG_ERROR, " OTAStorage_MKRMEM ::open - open() failed with error code %d" , filesystem.err ());
62+ Debug.print (DBG_ERROR, " OTAStorage_SFU ::open - open() failed with error code %d" , filesystem.err ());
6363 delete _file;
6464 return false ;
6565 }
6666 return true ;
6767}
6868
69- size_t OTAStorage_MKRMEM ::write (uint8_t const * const buf, size_t const num_bytes)
69+ size_t OTAStorage_SFU ::write (uint8_t const * const buf, size_t const num_bytes)
7070{
7171 return _file->write (const_cast <uint8_t *>(buf), num_bytes);
7272}
7373
74- void OTAStorage_MKRMEM ::close ()
74+ void OTAStorage_SFU ::close ()
7575{
7676 _file->close ();
7777 delete _file;
7878}
7979
80- void OTAStorage_MKRMEM ::remove (char const * file_name)
80+ void OTAStorage_SFU ::remove (char const * file_name)
8181{
8282 filesystem.remove (file_name);
8383}
8484
85- bool OTAStorage_MKRMEM ::rename (char const * old_file_name, char const * new_file_name)
85+ bool OTAStorage_SFU ::rename (char const * old_file_name, char const * new_file_name)
8686{
8787 return (SPIFFS_OK == filesystem.rename (old_file_name, new_file_name));
8888}
8989
90- void OTAStorage_MKRMEM ::deinit ()
90+ void OTAStorage_SFU ::deinit ()
9191{
9292 filesystem.unmount ();
9393}
0 commit comments