QGCUASFileManager.h 958 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
#ifndef QGCUASFILEMANAGER_H
#define QGCUASFILEMANAGER_H

#include <QObject>
#include "UASInterface.h"

class QGCUASFileManager : public QObject
{
    Q_OBJECT
public:
    QGCUASFileManager(QObject* parent, UASInterface* uas);

signals:
Lorenz Meier's avatar
Lorenz Meier committed
14
    void statusMessage(const QString& msg);
15
    void resetStatusMessages();
16 17

public slots:
Lorenz Meier's avatar
Lorenz Meier committed
18
    void receiveMessage(LinkInterface* link, mavlink_message_t message);
19
    void nothingMessage();
Lorenz Meier's avatar
Lorenz Meier committed
20 21
    void listRecursively(const QString &from);
    void downloadPath(const QString& from, const QString& to);
22 23 24

protected:
    UASInterface* _mav;
Lorenz Meier's avatar
Lorenz Meier committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38
    quint16 _encdata_seq;

    struct RequestHeader
        {
            uint8_t		magic;
            uint8_t		session;
            uint8_t		opcode;
            uint8_t		size;
            uint32_t	crc32;
            uint32_t	offset;
            uint8_t		data[];
        };

    static quint32 crc32(const uint8_t *src, unsigned len, unsigned state);
39 40 41 42

};

#endif // QGCUASFILEMANAGER_H