pw_transfer API reference#
This API reference is a work-in-progress. The full
pw_transfer API is
not yet documented on this page.
class AtomicFileTransferHandler : public ReadWriteHandler#
- #include <atomic_file_transfer_handler.h>
AtomicFileTransferHandleris intended to be used as a transfer handler for files. It ensures that the target file of the transfer is always in a correct state. In particular, the transfer is first done to a temporary file and once complete, the original targeted file is updated.
inline AtomicFileTransferHandler(uint32_t resource_id, std::string_view file_path)#
resource_id – [in] An ID for the resource that’s being transferred.
file_path – [in] The target file to update.
Status PrepareRead() override#
AtomicFileTransferHandlerfor a read transfer.
void FinalizeRead(Status) override#
Handler function that is called by the transfer thread after a read transfer completes.
Status – A
pw::Statusobject provided by the transfer thread indicating whether the transfer succeeded.
The read transfer is done before the call to this method.
Status PrepareWrite() override#
AtomicFileTransferHandlerfor a write transfer.
- inline AtomicFileTransferHandler(uint32_t resource_id, std::string_view file_path)#
- class AtomicFileTransferHandler : public ReadWriteHandler#