iCub-main
Loading...
Searching...
No Matches
firmwareupdatercore.h
Go to the documentation of this file.
1#ifndef FIRMWAREUPDATERCORE_H
2#define FIRMWAREUPDATERCORE_H
3
4#include <QObject>
5#include <QVariantMap>
6#include <yarp/os/all.h>
7//#include <EthUpdater.h>
8#include <EthMaintainer.h>
9#include <downloader.h>
10#include <yarp/dev/all.h>
11#include <QMutex>
12
13using namespace yarp::os;
14
15#define DEFAULT_IP_ADDRESS "10.0.1.104"
16#define DEFAULT_IP_PORT 3333
17
18class FirmwareUpdaterCore : public QObject
19{
20 Q_OBJECT
21public:
22 explicit FirmwareUpdaterCore(QObject *parent = 0);
23
24 bool init(Searchable& config, int port, QString address, int VerbositY);
25 bool setVerbosity(int verb);
26 QStringList getDevicesName();
27 QList<QPair<QString,QVariant> > getDevices();
28 int connectTo(QString device, QString id);
29 bool isBoardInMaintenanceMode(QString ip);
30 void disconnectFrom(QString device, QString id);
32 void setSelectedEthBoard(int index,bool selected);
33 void setSelectedEthBoard(QString boardIp,bool selected);
34 void setSelectedCanBoard(int index, bool selected, QString ethAddress = "", int deviceId = -1);
35 void setSelectedCanBoards(QList <sBoard> selectedBoards, QString address, int deviceId = -1);
36 boardInfo2_t getMoreDetails(int boardNum = EthMaintainer::ipv4OfAllSelected, QString *infoString = NULL, eOipv4addr_t *address = NULL);
37 QList<sBoard> getCanBoardsFromEth(QString address, QString *retString, int canID = CanPacket::everyCANbus, bool force = false);
38 QList<sBoard> getCanBoardsFromDriver(QString driver, int networkId, QString *retString, bool force = false);
39 void blinkEthBoards();
40 QString getEthBoardInfo(int index);
41 QString getEthBoardAddress(int index);
42 bool setEthBoardInfo(int index, QString newInfo);
43 void setCanBoardInfo(int bus, int id, QString newInfo, QString ethAddress = "", int deviceId = -1, QString *resultString = NULL);
44 bool setEthBoardAddress(int index, QString newAddress);
45 bool setCanBoardAddress(int bus, int id, int canType, QString newAddress, QString ethAddress = "", int deviceId = -1, QString *resultString = NULL);
46 void restartEthBoards();
48 void bootFromUpdater();
49 bool uploadEthApplication(QString filename, QString *resultString);
50 bool uploadCanApplication(QString filename, QString *resultString, bool ee, QString address = "", int deviceId = -1, QList<sBoard> *resultCanBoards = NULL);
51 bool uploadLoader(QString filename, QString *resultString);
52 bool uploadUpdater(QString filename, QString *resultString);
53 //void updateProgressCallback(float);
54 bool jumpToUpdater();
55 bool goToApplication();
56 bool goToMaintenance();
57 bool eraseEthEprom();
58 void eraseCanEprom();
59 QString getProcessFromUint(uint8_t id, bool isMultiCore = false);
60
62
63
64private:
65 bool compile_ip_addresses(const char* addr,unsigned int *remoteAddr,unsigned int *localAddr);
66 bool isValidIpAddress(QString addr);
67private:
68
69 QList < QPair<QString,QVariant> > devices;
70 //EthUpdater gUpdater;
71 EthMaintainer gMNT;
72 cDownloader downloader;
73 QMutex mutex;
74 QString currentAddress;
75 QString currentDriver;
76 int currentId;
77 QList <sBoard> canBoards;
78 int verbosity;
79 eOipv4addr_t hostIPaddress;
80
81signals:
82 void updateProgress(float);
84
85public slots:
86};
87
88#endif // FIRMWAREUPDATERCORE_H
@ everyCANbus
Definition driver.h:51
static const eOipv4addr_t ipv4OfAllSelected
QList< sBoard > getCanBoardsFromDriver(QString driver, int networkId, QString *retString, bool force=false)
int connectTo(QString device, QString id)
void setSelectedCanBoards(QList< sBoard > selectedBoards, QString address, int deviceId=-1)
bool setEthBoardAddress(int index, QString newAddress)
bool uploadCanApplication(QString filename, QString *resultString, bool ee, QString address="", int deviceId=-1, QList< sBoard > *resultCanBoards=NULL)
QString getProcessFromUint(uint8_t id, bool isMultiCore=false)
QString getEthBoardInfo(int index)
QList< sBoard > getCanBoardsFromEth(QString address, QString *retString, int canID=CanPacket::everyCANbus, bool force=false)
void setSelectedEthBoard(int index, bool selected)
void disconnectFrom(QString device, QString id)
void setSelectedCanBoard(int index, bool selected, QString ethAddress="", int deviceId=-1)
QString getEthBoardAddress(int index)
boardInfo2_t getMoreDetails(int boardNum=EthMaintainer::ipv4OfAllSelected, QString *infoString=NULL, eOipv4addr_t *address=NULL)
QList< QPair< QString, QVariant > > getDevices()
void updateProgress(float)
bool setEthBoardInfo(int index, QString newInfo)
bool uploadUpdater(QString filename, QString *resultString)
bool isBoardInMaintenanceMode(QString ip)
void setCanBoardInfo(int bus, int id, QString newInfo, QString ethAddress="", int deviceId=-1, QString *resultString=NULL)
bool setCanBoardAddress(int bus, int id, int canType, QString newAddress, QString ethAddress="", int deviceId=-1, QString *resultString=NULL)
bool uploadEthApplication(QString filename, QString *resultString)
bool uploadLoader(QString filename, QString *resultString)
bool init(Searchable &config, int port, QString address, int VerbositY)
int canID
Definition main.cpp:152
unsigned int remoteAddr
Definition main.cpp:154
unsigned int localAddr
Definition main.cpp:153
int networkId
Definition main.cpp:151