Add stop transfer automatically.
This commit is contained in:
@@ -125,6 +125,7 @@ void DeviceManager::initDevice()
|
||||
mGetScanProgressAction = new DmsAsyncAction(USRV_SCAN, ACT_SCAN_PROGRESS_PASSIVE, this,"responseGetScanProgress(const QString&)", this);
|
||||
mGetSoftwareVersionAction = new DmsAsyncAction(USRV_INFOCFG, ACT_IFCFG_VERINFO, this,"responseGetSoftwareVersion(const QString&)", this);
|
||||
mGetDeviceTemperatureAction = new DmsAsyncAction(USRV_SCAN, ACT_SCAN_TEMP, this, "responseGetDeviceTemperature(const QString&)", this);
|
||||
mStopTransferAction = new DmsAsyncAction(USRV_XFR, ACT_XFR_STOP, this, "responseStopTransfer(const QString&)", this);
|
||||
connect(mGetScanProgressAction, &DmsAsyncAction::timeout, this, &DeviceManager::scanTimeout);
|
||||
|
||||
|
||||
@@ -565,6 +566,9 @@ void DeviceManager::processReceiveDMSInfoResult(int aServerID, int aActionID, co
|
||||
case ACT_XFR_START :
|
||||
emit responseTransfer(aContents);
|
||||
break;
|
||||
case ACT_XFR_STOP :
|
||||
emit responseStopTransfer(aContents);
|
||||
break;
|
||||
case ACT_XFR_PROGRESS_PASSIVE :
|
||||
emit responseGetTransferProgress(aContents);
|
||||
break;
|
||||
@@ -802,6 +806,7 @@ void DeviceManager::startTransfer()
|
||||
int code = jsonObj["code"].toInt();
|
||||
if(code != 0)
|
||||
{
|
||||
mStopTransferAction->execute();
|
||||
QString msg = jsonObj["info"].toString();
|
||||
THROW_ERROR(msg);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user