Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: UAVCAN UAVCAN_Subscriber
IFileServerBackend Class Reference
The file server backend should implement this interface. More...
#include <file_server.hpp>
Inherited by TestFileServerBackend, and BasicFileServerBackend.
Public Types | |
| enum | |
All read operations must return this number of bytes, unless end of file is reached. More... | |
Public Member Functions | |
| virtual int16_t | getInfo (const Path &path, uint64_t &out_size, EntryType &out_type)=0 |
| Backend for uavcan.protocol.file.GetInfo. | |
| virtual int16_t | read (const Path &path, const uint64_t offset, uint8_t *out_buffer, uint16_t &inout_size)=0 |
| Backend for uavcan.protocol.file.Read. | |
| virtual int16_t | write (const Path &path, const uint64_t offset, const uint8_t *buffer, const uint16_t size) |
| Backend for uavcan.protocol.file.Write. | |
| virtual int16_t | remove (const Path &path) |
| Backend for uavcan.protocol.file.Delete. | |
| virtual int16_t | getDirectoryEntryInfo (const Path &directory_path, const uint32_t entry_index, EntryType &out_type, Path &out_entry_full_path) |
| Backend for uavcan.protocol.file.GetDirectoryEntryInfo. | |
Static Public Member Functions | |
| static char | getPathSeparator () |
| Shortcut for uavcan.protocol.file.Path.SEPARATOR. | |
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 Enumeration Documentation
| anonymous enum |
All read operations must return this number of bytes, unless end of file is reached.
Definition at line 36 of file file_server.hpp.
Member Function Documentation
| virtual int16_t getDirectoryEntryInfo | ( | const Path & | directory_path, |
| const uint32_t | entry_index, | ||
| EntryType & | out_type, | ||
| Path & | out_entry_full_path | ||
| ) | [virtual] |
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.
| virtual int16_t 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.
Implemented in BasicFileServerBackend.
| static char getPathSeparator | ( | ) | [static] |
Shortcut for uavcan.protocol.file.Path.SEPARATOR.
Definition at line 41 of file file_server.hpp.
| virtual int16_t 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.
Implemented in BasicFileServerBackend.
| virtual int16_t remove | ( | const Path & | path ) | [virtual] |
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.
| virtual int16_t write | ( | const Path & | path, |
| const uint64_t | offset, | ||
| const uint8_t * | buffer, | ||
| const uint16_t | size | ||
| ) | [virtual] |
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.
Generated on Tue Jul 12 2022 17:17:37 by
1.7.2