|
@@ -8,9 +8,10 @@ ELCommThread171::ELCommThread171(QObject *parent) : QThread(parent)
|
|
|
connect(timer,&QTimer::timeout,this,&ELCommThread171::time_out);
|
|
|
timer->start(1000);
|
|
|
|
|
|
- m_client = new QMQTT::Client(QHostAddress("124.70.160.158"),1883,this);
|
|
|
+ //m_client = new QMQTT::Client(QHostAddress("124.70.160.158"), 1883, this);
|
|
|
+ m_client = new QMQTT::Client(QHostAddress("123.60.11.86"), 1883, this);
|
|
|
m_client->setUsername("admin");
|
|
|
- m_client->setPassword("public");
|
|
|
+ m_client->setPassword("a10vE0s73g5");
|
|
|
connect(m_client,&QMQTT::Client::connected,this,&ELCommThread171::onConnected);
|
|
|
connect(m_client,&QMQTT::Client::received,this,&ELCommThread171::onReceived);
|
|
|
m_client->connectToHost();
|
|
@@ -36,8 +37,8 @@ void ELCommThread171::time_out()
|
|
|
|
|
|
void ELCommThread171::onConnected()
|
|
|
{
|
|
|
- m_client->subscribe("/ewoogi/data/a1TdT9qm7vu/+/property",0);
|
|
|
- m_client->subscribe("/ewoogi/session/a1RFQGoAewM/+/combine/login",0);
|
|
|
+ m_client->subscribe("/ewoogi/ubqd/data/Hz171EwoogiD/+/property",0);
|
|
|
+ m_client->subscribe("/ewoogi/ubqd/session/Hz158EwoogiD/+/combine/login",0);
|
|
|
}
|
|
|
|
|
|
void ELCommThread171::onReceived(const QMQTT::Message &message)
|
|
@@ -54,9 +55,9 @@ void ELCommThread171::onReceived(const QMQTT::Message &message)
|
|
|
//subSOE login->login_reply->down_raw
|
|
|
QString login = topic.split("/").last();
|
|
|
if(login.compare("login")==0){
|
|
|
- QString company = topic.split("/").at(3);
|
|
|
- QString deviceCode = topic.split("/").at(4);
|
|
|
- QString loginTopic = QString("/ewoogi/session/%1/%2/combine/login_reply").arg(company).arg(deviceCode);
|
|
|
+ QString company = topic.split("/").at(4);
|
|
|
+ QString deviceCode = topic.split("/").at(5);
|
|
|
+ QString loginTopic = QString("/ewoogi/ubqd/session/%1/%2/combine/login_reply").arg(company).arg(deviceCode);
|
|
|
QString data1 = QString("{\"code\":200}");
|
|
|
m_client->publish(QMQTT::Message(loginIdx++,loginTopic,data1.toUtf8()));
|
|
|
if(loginIdx>9999)
|