feat: Add Recon State read to ReconManager
This commit is contained in:
@@ -39,7 +39,7 @@ RequestResult ReconClient::CheckActive()
|
||||
auto resp = mRequest.post(mHost + STATE_URL, content, mHeaders);
|
||||
if (resp.httpCode() == 200)
|
||||
{
|
||||
return RequestResult::Success();
|
||||
return RequestResult::Success(resp.getContent());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <QTimer>
|
||||
#include "QDebug"
|
||||
#include "json/cJSON.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
@@ -100,6 +101,11 @@ void ReconManager::queryReconStatus(const QStringList& aScanIDs)
|
||||
void ReconManager::checkReconConnection()
|
||||
{
|
||||
auto response = mReconClient->CheckActive();
|
||||
cJSON* json = cJSON_Parse(response.message().data());
|
||||
cJSON* stateProperty = cJSON_GetObjectItem(json, "State");
|
||||
int state = stateProperty->valueint;
|
||||
cJSON_Delete(json);
|
||||
qDebug()<<"Recon State:"<<state;
|
||||
if(mIsConnected != response.good())
|
||||
{
|
||||
emit checkReconConnectionResponsed(response.good());
|
||||
|
||||
Reference in New Issue
Block a user