Public Types | Public Member Functions | Static Public Member Functions | List of all members
uavcan::IFileServerBackend Class Referenceabstract

#include <file_server.hpp>

Inheritance diagram for uavcan::IFileServerBackend:
Inheritance graph
[legend]

Public Types

enum  { ReadSize = protocol::file::Read::Response::FieldTypes::data::MaxSize }
 
typedef protocol::file::EntryType EntryType
 
typedef protocol::file::Error Error
 
typedef protocol::file::Path::FieldTypes::path Path
 

Public Member Functions

virtual int16_t getDirectoryEntryInfo (const Path &directory_path, const uint32_t entry_index, EntryType &out_type, Path &out_entry_full_path)
 
virtual int16_t getInfo (const Path &path, uint64_t &out_size, EntryType &out_type)=0
 
virtual int16_t read (const Path &path, const uint64_t offset, uint8_t *out_buffer, uint16_t &inout_size)=0
 
virtual int16_t remove (const Path &path)
 
virtual int16_t write (const Path &path, const uint64_t offset, const uint8_t *buffer, const uint16_t size)
 
virtual ~IFileServerBackend ()
 

Static Public Member Functions

static char getPathSeparator ()
 

Detailed Description

The file server backend should implement this interface. Note that error codes returned by these methods are defined in uavcan.protocol.file.Error; these are not the same as libuavcan-internal error codes defined in uavcan.error.hpp.

Definition at line 26 of file file_server.hpp.

Member Typedef Documentation

◆ EntryType

typedef protocol::file::EntryType uavcan::IFileServerBackend::EntryType

Definition at line 30 of file file_server.hpp.

◆ Error

typedef protocol::file::Error uavcan::IFileServerBackend::Error

Definition at line 31 of file file_server.hpp.

◆ Path

typedef protocol::file::Path::FieldTypes::path uavcan::IFileServerBackend::Path

Definition at line 29 of file file_server.hpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

All read operations must return this number of bytes, unless end of file is reached.

Enumerator
ReadSize 

Definition at line 36 of file file_server.hpp.

Constructor & Destructor Documentation

◆ ~IFileServerBackend()

virtual uavcan::IFileServerBackend::~IFileServerBackend ( )
inlinevirtual

Definition at line 103 of file file_server.hpp.

Member Function Documentation

◆ getDirectoryEntryInfo()

virtual int16_t uavcan::IFileServerBackend::getDirectoryEntryInfo ( const Path directory_path,
const uint32_t  entry_index,
EntryType out_type,
Path out_entry_full_path 
)
inlinevirtual

Backend for uavcan.protocol.file.GetDirectoryEntryInfo. Refer to uavcan.protocol.file.EntryType for the list of available bit flags. Implementation of this method is NOT required; by default it returns uavcan.protocol.file.Error.NOT_IMPLEMENTED. On success the method must return zero.

Definition at line 93 of file file_server.hpp.

◆ getInfo()

virtual int16_t uavcan::IFileServerBackend::getInfo ( const Path path,
uint64_t out_size,
EntryType out_type 
)
pure virtual

Backend for uavcan.protocol.file.GetInfo. Refer to uavcan.protocol.file.EntryType for the list of available bit flags. Implementation of this method is required. On success the method must return zero.

◆ getPathSeparator()

static char uavcan::IFileServerBackend::getPathSeparator ( )
inlinestatic

Shortcut for uavcan.protocol.file.Path.SEPARATOR.

Definition at line 41 of file file_server.hpp.

◆ read()

virtual int16_t uavcan::IFileServerBackend::read ( const Path path,
const uint64_t  offset,
uint8_t out_buffer,
uint16_t inout_size 
)
pure virtual

Backend for uavcan.protocol.file.Read. Implementation of this method is required. inout_size is set to ReadSize; read operation is required to return exactly this amount, except if the end of file is reached. On success the method must return zero.

◆ remove()

virtual int16_t uavcan::IFileServerBackend::remove ( const Path path)
inlinevirtual

Backend for uavcan.protocol.file.Delete. ('delete' is a C++ keyword, so 'remove' is used instead) Implementation of this method is NOT required; by default it returns uavcan.protocol.file.Error.NOT_IMPLEMENTED. On success the method must return zero.

Definition at line 81 of file file_server.hpp.

◆ write()

virtual int16_t uavcan::IFileServerBackend::write ( const Path path,
const uint64_t  offset,
const uint8_t buffer,
const uint16_t  size 
)
inlinevirtual

Backend for uavcan.protocol.file.Write. Implementation of this method is NOT required; by default it returns uavcan.protocol.file.Error.NOT_IMPLEMENTED. On success the method must return zero.

Definition at line 67 of file file_server.hpp.


The documentation for this class was generated from the following file:


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:04