40 #include "../mavlink_bridge_header.h" 41 #include "../mavlink_ftp.h" 76 virtual void _init(
void);
95 void _setup_ftp_msg(
const MavlinkFTP::PayloadHeader *payload_header, uint8_t size,
const uint8_t *
data,
96 mavlink_message_t *
msg);
97 bool _decode_message(
const mavlink_file_transfer_protocol_t *ftp_msg,
const MavlinkFTP::PayloadHeader **payload);
101 const MavlinkFTP::PayloadHeader **payload_reply);
MAVLink remote file server. Support FTP like commands using MAVLINK_MSG_ID_FILE_TRANSFER_PROTOCOL mes...
static void receive_message_handler_generic(const mavlink_file_transfer_protocol_t *ftp_req, void *worker_data)
Static method used as callback from MavlinkFTP for generic use.
bool _receive_message_handler_burst(const mavlink_file_transfer_protocol_t *ftp_req, BurstInfo *burst_info)
void _receive_message_handler_generic(const mavlink_file_transfer_protocol_t *ftp_req)
bool _decode_message(const mavlink_file_transfer_protocol_t *ftp_msg, const MavlinkFTP::PayloadHeader **payload)
Decode and validate the incoming message.
uint16_t _expected_seq_number
void _cleanup_microsd(void)
Cleans up an files created on microsd during testing.
virtual void _cleanup(void)
Called after every test to take down the FTP Server.
static const char _unittest_microsd_file[]
static const uint8_t clientSystemId
System ID for client.
bool _list_eof_test(void)
Tests for correct response to a List command on a valid directory, but with an offset that is beyond ...
bool _open_badfile_test(void)
Tests for correct response to an Open command on a file which does not exist.
static const char _unittest_microsd_dir[]
bool _send_receive_msg(MavlinkFTP::PayloadHeader *payload_header, uint8_t size, const uint8_t *data, const MavlinkFTP::PayloadHeader **payload_reply)
Sends the specified FTP message to the server and returns response.
Base class to be used for unit tests.
void _setup_ftp_msg(const MavlinkFTP::PayloadHeader *payload_header, uint8_t size, const uint8_t *data, mavlink_message_t *msg)
Initializes an FTP message into a mavlink message.
bool _read_test(void)
Tests for correct reponse to a Read command on an open session.
Worker data for stream handler.
static void receive_message_handler_burst(const mavlink_file_transfer_protocol_t *ftp_req, void *worker_data)
Static method used as callback from MavlinkFTP for stream download testing.
bool _removedirectory_test(void)
virtual void _init(void)
Called before every test to initialize the FTP Server.
MavlinkFtpTest * ftp_test_class
static char msg[NUM_MSG][CONFIG_USART1_TXBUFSIZE]
static const uint8_t clientComponentId
Component ID for client.
bool _bad_opcode_test(void)
Tests for correct response to an invalid opcpde.
bool mavlink_ftp_test(void)
mavlink_file_transfer_protocol_t _reply_msg
bool _removefile_test(void)
static const DownloadTestCase _rgDownloadTestCases[]
The set of test cases for download testing.
bool _bad_datasize_test(void)
Tests for correct reponse to a payload which an invalid data size field.
bool _open_terminate_test(void)
Tests for correct reponse to an Open command on a file, followed by Terminate.
virtual ~MavlinkFtpTest()=default
virtual bool run_tests(void)
Runs all the unit tests.
bool _createdirectory_test(void)
static const uint8_t serverChannel
Channel to send to.
bool _terminate_badsession_test(void)
Tests for correct reponse to a Terminate command on an invalid session.
bool _ack_test(void)
Tests for correct behavior of an Ack response.
MavlinkFtpTest & operator=(const MavlinkFtpTest &)
bool _read_badsession_test(void)
Tests for correct reponse to a Read command on an invalid session.
static const uint8_t serverSystemId
System ID for server.
A single download test case.
bool _burst_test(void)
Tests for correct reponse to a Read command on an open session.
static const uint8_t serverComponentId
Component ID for server.