| 135 | } |
| 136 | |
| 137 | bool FileSharing::appendToFile(FileSharing::Message fileMessage) { |
| 138 | FS *fs; |
| 139 | if (!getFsStorage(fs)) return false; |
| 140 | |
| 141 | if (recvFileName == "") createFilename(fs, fileMessage); |
| 142 | |
| 143 | File file = (*fs).open(recvFileName, FILE_APPEND); |
| 144 | if (!file) return false; |
| 145 | |
| 146 | file.write((const uint8_t *)fileMessage.data, fileMessage.dataSize); |
| 147 | file.close(); |
| 148 | |
| 149 | return true; |
| 150 | } |
| 151 | |
| 152 | void FileSharing::createFilename(FS *fs, FileSharing::Message fileMessage) { |
| 153 | String messageFilename = String(fileMessage.filename); |
nothing calls this directly
no test coverage detected