Commit 8f978a25 by “liusq”

修改请求远程配置超时问题

parent 8bd021ba
......@@ -161,7 +161,7 @@ vides_data::response *HttpService::httpFindCameras(QString &serialNumber,vides_d
}else{
qInfo()<<m_httpClient.errorCode();
resp->code=2;
resp->msg=OPERATION_FAILED;
resp->msg=m_httpClient.errorCode();
}
return resp;
}
......
......@@ -7,7 +7,7 @@ HttpClient::HttpClient(QObject *parent)
{
m_networkAccessManager = new QNetworkAccessManager(this);
m_timer = new QTimer(this);
m_timer->setInterval(6000);
m_timer->setInterval(8000);
m_timer->setSingleShot(true);
connect(m_timer, SIGNAL(timeout()), &m_eventLoop, SLOT(quit()));
}
......
......@@ -500,10 +500,10 @@ void MainWindow::startCamera(const QString &httpurl){
}
vides_data::responseConfig cloudConfig;
httpService.setHttpUrl(httpurl);
vides_data::response *res_config= httpService.httpDeviceConfig(serialNumber,cloudConfig);
HttpService http_config(httpurl);
vides_data::response *res_config= http_config.httpDeviceConfig(serialNumber,cloudConfig);
if(res_config->code!=0){
qInfo()<<"请求远程商户配置失败";
qInfo()<<"请求远程商户配置失败"<<res_config->msg<<res_config->code;
instace.deleteObj(res_config);
return ;
}
......@@ -516,12 +516,10 @@ void MainWindow::startCamera(const QString &httpurl){
QString ipAddress= QString("%1.%2.%3.%4").arg(localDevice->HostIP.c[0]).arg(localDevice->HostIP.c[1]).arg(localDevice->HostIP.c[2]).arg(localDevice->HostIP.c[3]);
//this->gatewayRandomIp(ipAddress);
QString key = ipAddress + ":" + QString::number(localDevice->TCPPort);
httpService.setHttpUrl(httpurl);
HttpService http_device(httpurl);
vides_data::responseConfig devConfig;
vides_data::response *devRes=httpService.httpDeviceConfig(device.sSn,devConfig);
vides_data::response *devRes=http_device.httpDeviceConfig(device.sSn,devConfig);
if(devRes->code!=0){
qInfo()<<"请求相机配置失败";
instace.deleteObj(devRes);
......@@ -581,9 +579,8 @@ void MainWindow::startCamera(const QString &httpurl){
// 清空 localDevices 容器
localDevices.clear();
}
httpService.setHttpUrl(httpurl);
vides_data::response *res=httpService.httpPostDeviceStatus(reStatus);
HttpService http_div(httpurl);
vides_data::response *res=http_div.httpPostDeviceStatus(reStatus);
if(res->code!=0){
qInfo()<<"盒子状态上报失败 code:"<<res->code<<"msg:"<<res->msg;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment