|
|
|
/*
|
|
* DLink SSH Connection API
|
|
* Alejandro Antúnez - SODITEC S.L
|
|
* (C) 2015 - 2016 */
|
|
|
|
#ifndef DLINKPASSWORDGEN_H
|
|
#define DLINKPASSWORDGEN_H
|
|
|
|
#define COMMAND_SSH "nvram set wl0_wpa_psk=%1"
|
|
|
|
#include <stdlib.h>
|
|
#include <qsshsocket.h>
|
|
#include <stdio.h>
|
|
#include <QQueue>
|
|
|
|
|
|
class DLinkPasswordGen : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit DLinkPasswordGen(QObject *parent = 0);
|
|
~DLinkPasswordGen();
|
|
|
|
public:
|
|
bool Ready = false;
|
|
|
|
private:
|
|
QQueue<int> operations;
|
|
QSshSocket *ssh;
|
|
|
|
public:
|
|
QString HOST_ROUTER = "192.168.0.1";
|
|
QString USER_DEFAULT= "root";
|
|
QString PWD_DEFAULT ="TexFono1";
|
|
QString GetSystemPWD();
|
|
void ConnectRouter();
|
|
void DisconnectRouter();
|
|
void DesconectarWIFI();
|
|
void ConectarWIFI();
|
|
void GeneratePWD(QString routerUser, QString routerPass, char pass[]);
|
|
void QueSsidAsync();
|
|
void QuePassAsync();
|
|
void HayWifiAsync();
|
|
void testConsulta(QString respuesta);
|
|
|
|
signals:
|
|
void onLoginSuccess();
|
|
void onSuccessPWDChanged();
|
|
void onErrorPWDChanged();
|
|
void onWifiStateAsyncResponse(bool estado);
|
|
void onWifiSSIDAsyncResponse(QString SSID);
|
|
void onWifiPassAsyncResponse(QString Pass);
|
|
|
|
private slots:
|
|
void error(QSshSocket::SshError err);
|
|
void successLog();
|
|
void onRouterResponse(QString response);
|
|
};
|
|
|
|
#endif // DLINKPASSWORDGEN_H
|