Index: sources/device/DeviceController.cpp =================================================================== diff -u -r0932b2beee9cc169291cbf69161f902f805237b1 -r574c7c5fb48b1fcb72337f5fb4c0119a20288815 --- sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 0932b2beee9cc169291cbf69161f902f805237b1) +++ sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 574c7c5fb48b1fcb72337f5fb4c0119a20288815) @@ -578,7 +578,7 @@ } /*! - * \brief DeviceController::onProcessBrightnessFinished + * \brief DeviceController::processBrightnessResponse * \details Called when the process to set the brightness has finished * \param vExitCode (int) the exit code * \note exit code -> 0 : set Accept [MBase] -> Log -> emit @@ -588,7 +588,7 @@ * 3 - get no error when in onProcessBrightnessExitCode : MDeviceResponse.toString() * - in case 3 the specific model _data has to be filled prior to the toString to have it in the log. */ -void DeviceController::onProcessBrightnessExitCode(int vExitCode, QProcess::ExitStatus vStatus) +void DeviceController::processBrightnessResponse(int vExitCode, QProcess::ExitStatus vStatus, QProcess::ProcessChannel /*vChannel*/) { //DEBUG qDebug() << __FUNCTION__ << vExitCode << vStatus; @@ -647,7 +647,7 @@ } /*! - * \brief DeviceController::onProcessRootSSHAccessExitCode + * \brief DeviceController::processRootSSHAccessResponse * \details Called when the process to set the RootSSHAccess has finished * \param vExitCode (int) the exit code * \note exit code -> 0 : set Accept [MBase] -> Log -> emit @@ -657,7 +657,7 @@ * 3 - get no error when in onProcessRootSSHAccessExitCode : MDeviceResponse.toString() * - in case 3 the specific model _data has to be filled prior to the toString to have it in the log. */ -void DeviceController::onProcessRootSSHAccessExitCode(int vExitCode, QProcess::ExitStatus) +void DeviceController::processRootSSHAccessResponse(int vExitCode, QProcess::ExitStatus, QProcess::ProcessChannel /*vChannel*/) { if ( ! checkError(static_cast(vExitCode), _deviceRootSSHAccessResponse, _deviceRootSSHAccessResponse.toString()) ) { // has no error if (_deviceRootSSHAccessRequest._data.mIsGet) { @@ -733,11 +733,11 @@ } /*! - * \brief DeviceController::onProcessCryptSetupExitCode + * \brief DeviceController::processCryptSetupResponse * \param vExitCode * \param vStatus */ -void DeviceController::onProcessCryptSetupExitCode(int vExitCode, QProcess::ExitStatus vStatus) +void DeviceController::processCryptSetupResponse(int vExitCode, QProcess::ExitStatus vStatus, QProcess::ProcessChannel /*vChannel*/) { const int ERR_CRYPTSETUP_MOUNT_ISMOUNT=134; // is used in crypt_setup.sh do not modify @@ -807,7 +807,7 @@ timedProcess->start(); } -void DeviceController::onProcessBluetoothPairedResetExitCode(int vExitCode, QProcess::ExitStatus vStatus) +void DeviceController::processBluetoothPairedResetResponse(int vExitCode, QProcess::ExitStatus vStatus, QProcess::ProcessChannel /*vChannel*/) { // TODO: review the usage and definition of this object _deviceBluetoothPairedResetResponse. do we need it any more? MDeviceBluetoothPairedResetResponse model; @@ -839,7 +839,7 @@ timedProcess->start(); } -void DeviceController::onProcessBluetoothPairedQueryExitCode(int vExitCode, QProcess::ExitStatus vStatus) +void DeviceController::processBluetoothPairedQueryResponse(int vExitCode, QProcess::ExitStatus vStatus, QProcess::ProcessChannel /*vChannel*/) { // The Exit code in this script is not used. // any other checking is done by UI Software at the moment this script is called. @@ -1160,11 +1160,11 @@ } /*! - * \brief DeviceController::onProcessFactoryResetExitCode + * \brief DeviceController::processFactoryResetResponse * \param vExitCode - the script exit code. * \param vStatus - the script echoed message. */ -void DeviceController::onProcessFactoryResetExitCode(int vExitCode, QProcess::ExitStatus vStatus) +void DeviceController::processFactoryResetResponse(int vExitCode, QProcess::ExitStatus vStatus, QProcess::ProcessChannel /*vChannel*/) { // The Exit code in this script is not used. // any other checking is done by UI Software at the moment this script is called. @@ -1211,11 +1211,11 @@ } /*! - * \brief DeviceController::onProcessDecommissionExitCode + * \brief DeviceController::processDecommissionResponse * \param vExitCode * \param vStatus */ -void DeviceController::onProcessDecommissionExitCode(int vExitCode, QProcess::ExitStatus vStatus) +void DeviceController::processDecommissionResponse(int vExitCode, QProcess::ExitStatus vStatus, QProcess::ProcessChannel /*vChannel*/) { // The Exit code in this script is not used. // any other checking is done by UI Software at the moment this script is called. @@ -1273,11 +1273,11 @@ } /*! - * \brief DeviceController::onProcessUSBMountExitCode + * \brief DeviceController::processUSBMountResponse * \param vExitCode * \param vStatus */ -void DeviceController::onProcessUSBMountExitCode(int vExitCode, QProcess::ExitStatus vStatus) +void DeviceController::processUSBMountResponse(int vExitCode, QProcess::ExitStatus vStatus, QProcess::ProcessChannel /*vChannel*/) { MDeviceUSBMountResponse model; QByteArray deviceInfo; @@ -1356,15 +1356,22 @@ } /*! - * \brief DeviceController::onProcessUSBMountExitCode + * \brief DeviceController::processUSBMountResponse * \param vExitCode * \param vStatus */ -void DeviceController::onProcessWifiListExitCode(int vExitCode, QProcess::ExitStatus vStatus) +void DeviceController::processWifiListResponse(int vExitCode, QProcess::ExitStatus vStatus, QProcess::ProcessChannel vChannel) { //DEBUG - qDebug() << __FUNCTION__ << vExitCode << vStatus; + qDebug() << " 1 ---------- " << __FUNCTION__ << vExitCode << vStatus << vChannel; + if ( vExitCode < 0 ) { + switch (vChannel) { + case QProcess::StandardOutput : processWifiListReadyOut(); return; + case QProcess::StandardError : processWifiListReadyErr(); return; + } + } + MDeviceWifiListResponse model; model._data.mCompleted = true; QByteArray deviceInfo; @@ -1377,7 +1384,7 @@ // log error and exit if ( ! ok ) { - LOG_DEBUG(QString("WiFi list scan filed [%1]").arg(vExitCode)); + LOG_DEBUG(QString("WiFi list scan failed [%1]").arg(vExitCode)); } return; }