19
19
* INCLUDE
20
20
******************************************************************************/
21
21
22
- #include " OTAStorage_MKRMEM .h"
22
+ #include " OTAStorage_SFU .h"
23
23
#if OTA_STORAGE_MKRMEM
24
24
25
25
#include < Arduino_DebugUtils.h>
28
28
* CTOR/DTOR
29
29
******************************************************************************/
30
30
31
- OTAStorage_MKRMEM::OTAStorage_MKRMEM ()
31
+ OTAStorage_SFU::OTAStorage_SFU ()
32
32
: _file{nullptr }
33
33
{
34
34
@@ -38,56 +38,56 @@ OTAStorage_MKRMEM::OTAStorage_MKRMEM()
38
38
* PUBLIC MEMBER FUNCTIONS
39
39
******************************************************************************/
40
40
41
- bool OTAStorage_MKRMEM ::init ()
41
+ bool OTAStorage_SFU ::init ()
42
42
{
43
43
flash.begin ();
44
44
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 ());
46
46
return false ;
47
47
}
48
48
49
49
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 ());
51
51
return false ;
52
52
}
53
53
54
54
return true ;
55
55
}
56
56
57
- bool OTAStorage_MKRMEM ::open (char const * file_name)
57
+ bool OTAStorage_SFU ::open (char const * file_name)
58
58
{
59
59
filesystem.clearerr ();
60
60
_file = new File (filesystem.open (file_name, CREATE | WRITE_ONLY| TRUNCATE));
61
61
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 ());
63
63
delete _file;
64
64
return false ;
65
65
}
66
66
return true ;
67
67
}
68
68
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)
70
70
{
71
71
return _file->write (const_cast <uint8_t *>(buf), num_bytes);
72
72
}
73
73
74
- void OTAStorage_MKRMEM ::close ()
74
+ void OTAStorage_SFU ::close ()
75
75
{
76
76
_file->close ();
77
77
delete _file;
78
78
}
79
79
80
- void OTAStorage_MKRMEM ::remove (char const * file_name)
80
+ void OTAStorage_SFU ::remove (char const * file_name)
81
81
{
82
82
filesystem.remove (file_name);
83
83
}
84
84
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)
86
86
{
87
87
return (SPIFFS_OK == filesystem.rename (old_file_name, new_file_name));
88
88
}
89
89
90
- void OTAStorage_MKRMEM ::deinit ()
90
+ void OTAStorage_SFU ::deinit ()
91
91
{
92
92
filesystem.unmount ();
93
93
}
0 commit comments