IOS-nRF-Connect-Device-Manager
IOS-nRF-Connect-Device-Manager copied to clipboard
(question) Does FileSystemManager support uploading one file after the other (provided that each file-upload completes first)
Essentially what the title says. I'm trying to upload multiple file one after the other making sure that each next upload is submitted if and only if the previous has completed. However I realized that the FileSystemManager is completely frozen upon trying to upload the second file.
BUT if I dispose of the FileSystemManager and re-instantiate it from scratch then the uploads are performed normally as intended which is weird.
_fileSystemManager = FileSystemManager(transporter: _transporter)
_fileSystemManager.logDelegate = self
var success = _fileSystemManager.upload(
name: "/remote/file/path/here/1.txt",
data: data1,
delegate: self
)
if !success {
return false
}
// wait for the first upload to complete
success = _fileSystemManager.upload( // this one is submitted without errors but nothing happens - the file doesnt get uploaded at all
name: "/remote/file/path/here/2.txt",
data: data2,
delegate: self
)
if !success { // success=true
return false
}
If I switch over to this approach everything works:
_fileSystemManager = FileSystemManager(transporter: _transporter)
_fileSystemManager.logDelegate = self
var success = _fileSystemManager.upload(
name: "/remote/file/path/here/1.txt",
data: data1,
delegate: self
)
if !success {
return false
}
// wait for the first upload to complete
_fileSystemManager = FileSystemManager(transporter: _transporter) // REINSTANTIATION
_fileSystemManager.logDelegate = self
success = _fileSystemManager.upload( // with this approach everything works flawlessly
name: "/remote/file/path/here/2.txt",
data: data2,
delegate: self
)
if !success { // success=true
return false
}
This works but it's not optimal. We should be able to reuse the original instance of FileSystemManager right?
Am I missing something?