Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
mavplugin::FTPPlugin Class Reference

FTP plugin. More...

Inheritance diagram for mavplugin::FTPPlugin:
Inheritance graph
[legend]

List of all members.

Public Types

enum  OpState {
  OP_IDLE, OP_ACK, OP_LIST, OP_OPEN,
  OP_READ, OP_WRITE, OP_CHECKSUM
}
typedef std::vector< uint8_t > V_FileData
 This type used in servicies to store 'data' fileds.

Public Member Functions

void add_dirent (const char *ptr, size_t slen)
bool checksum_cb (mavros::FileChecksum::Request &req, mavros::FileChecksum::Response &res)
void checksum_crc32_file (std::string &path)
bool close_cb (mavros::FileClose::Request &req, mavros::FileClose::Response &res)
bool close_file (std::string &path)
void create_directory (std::string &path)
 FTPPlugin ()
void go_idle (bool is_error_, int r_errno_=0)
 Go to IDLE mode.
void handle_ack_checksum (FTPRequest &req)
void handle_ack_list (FTPRequest &req)
void handle_ack_open (FTPRequest &req)
void handle_ack_read (FTPRequest &req)
void handle_ack_write (FTPRequest &req)
void handle_file_transfer_protocol (const mavlink_message_t *msg, uint8_t sysid, uint8_t compid)
void handle_req_ack (FTPRequest &req)
void handle_req_nack (FTPRequest &req)
bool list_cb (mavros::FileList::Request &req, mavros::FileList::Response &res)
void list_directory (std::string &path)
void list_directory_end ()
bool mkdir_cb (mavros::FileMakeDir::Request &req, mavros::FileMakeDir::Response &res)
bool open_cb (mavros::FileOpen::Request &req, mavros::FileOpen::Response &res)
bool open_file (std::string &path, int mode)
bool read_cb (mavros::FileRead::Request &req, mavros::FileRead::Response &res)
bool read_file (std::string &path, size_t off, size_t len)
void read_file_end ()
bool remove_cb (mavros::FileRemove::Request &req, mavros::FileRemove::Response &res)
void remove_directory (std::string &path)
void remove_file (std::string &path)
bool rename_ (std::string &old_path, std::string &new_path)
bool rename_cb (mavros::FileRename::Request &req, mavros::FileRename::Response &res)
bool reset_cb (std_srvs::Empty::Request &req, std_srvs::Empty::Response &res)
 Reset communication on both sides.
bool rmdir_cb (mavros::FileRemoveDir::Request &req, mavros::FileRemoveDir::Response &res)
void send_any_path_command (FTPRequest::Opcode op, const std::string debug_msg, std::string &path, uint32_t offset)
 Send any command with string payload (usually file/dir path)
void send_calc_file_crc32_command (std::string &path)
void send_create_command ()
void send_create_dir_command (std::string &path)
void send_list_command ()
void send_open_ro_command ()
void send_open_wo_command ()
void send_read_command ()
void send_remove_command (std::string &path)
void send_remove_dir_command (std::string &path)
bool send_rename_command (std::string &old_path, std::string &new_path)
void send_reset ()
void send_terminate_command (uint32_t session)
void send_truncate_command (std::string &path, size_t length)
void send_write_command (const size_t bytes_to_copy)
bool truncate_cb (mavros::FileTruncate::Request &req, mavros::FileTruncate::Response &res)
void truncate_file (std::string &path, size_t length)
bool wait_completion (const int msecs)
size_t write_bytes_to_copy ()
bool write_cb (mavros::FileWrite::Request &req, mavros::FileWrite::Response &res)
bool write_file (std::string &path, size_t off, V_FileData &data)
void write_file_end ()

Static Public Member Functions

static constexpr int compute_rw_timeout (size_t len)

Public Attributes

uint32_t active_session
 session id of current operation
uint32_t checksum_crc32
ros::ServiceServer checksum_srv
ros::ServiceServer close_srv
std::condition_variable cond
 wait condvar
std::mutex cond_mutex
ros::NodeHandle ftp_nh
bool is_error
 error signaling flag (timeout/proto error)
uint16_t last_send_seqnr
 seqNumber for send.
std::vector< mavros::FileEntry > list_entries
uint32_t list_offset
std::string list_path
ros::ServiceServer list_srv
ros::ServiceServer mkdir_srv
OpState op_state
std::string open_path
size_t open_size
ros::ServiceServer open_srv
int r_errno
 store errno from server
V_FileData read_buffer
uint32_t read_offset
size_t read_size
ros::ServiceServer read_srv
ros::ServiceServer remove_srv
ros::ServiceServer rename_srv
ros::ServiceServer reset_srv
ros::ServiceServer rmdir_srv
std::map< std::string, uint32_t > session_file_map
ros::ServiceServer truncate_srv
V_FileData write_buffer
V_FileData::iterator write_it
uint32_t write_offset
ros::ServiceServer write_srv

Static Public Attributes

static constexpr int CHUNK_TIMEOUT_MS = 200
static constexpr int LIST_TIMEOUT_MS = 5000
static constexpr size_t MAX_RESERVE_DIFF = 0x10000
 Maximum difference between allocated space and used.
static constexpr int OPEN_TIMEOUT_MS = 200

Detailed Description

FTP plugin.

Definition at line 206 of file ftp.cpp.


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


mavros
Author(s): Vladimir Ermakov
autogenerated on Wed Aug 26 2015 12:29:13