Index: sources/cloudsync/CloudSyncController.cpp =================================================================== diff -u -r80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803 -rdff4ac319c6619a1ccb894c7d6079e8e4a46b776 --- sources/cloudsync/CloudSyncController.cpp (.../CloudSyncController.cpp) (revision 80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803) +++ sources/cloudsync/CloudSyncController.cpp (.../CloudSyncController.cpp) (revision dff4ac319c6619a1ccb894c7d6079e8e4a46b776) @@ -108,6 +108,8 @@ connect(&_DeviceController , SIGNAL(didWatchFileChange (const QString &)), this , SLOT( onWatchFileChange (const QString &))); + connect(&_DeviceController , SIGNAL(didFactoryReset (bool)), + this , SLOT( onFactoryReset (bool))); connect(&_MessageDispatcher , SIGNAL(didActionReceive (GuiActionType , const QVariantList &)), this , SLOT( onActionReceive (GuiActionType , const QVariantList &))); connect(&_TreatmentLog , SIGNAL(didTxPending (const QString &)), @@ -210,6 +212,19 @@ } /*! + * \brief CloudSyncController::onFactoryReset + * \details this slot will be called when the DeviceController is done with the Factory Reset + * to let the UI request CS to do the Factory Reset and clean up all the Tokens. + * \param vPass - Device controller factory reset was successful. + */ +void CloudSyncController::onFactoryReset(bool vPass) +{ + if ( vPass ) { + csFactoryReset(); + } +} + +/*! * \brief CloudSyncController::onWatchFileChange * \details This slot will be called when the Device Controller identifies any changes in the watched files. * \param vFile - watched file @@ -278,15 +293,14 @@ buffer = lines.last(); // DEBUG: LOG_DEBUG(QString("CS [%1]").arg(buffer)); - items = buffer.split(_separator); count = items.count(); // check the required message length if ( count < eMessage_Count ) { error = eError_HeaderCount ; ok = false; goto lErr; } index = eMessage_Timestamp ; message.timestamp = items[index].toUInt(&ok); if (!ok) { error = eError_Timestamp ; ok = false; goto lErr; } index = eMessage_Sequence ; message.sequence = items[index].toUInt(&ok); if (!ok) { error = eError_Sequence ; ok = false; goto lErr; } - index = eMessage_CRC ; message.crc = items[index].toUInt(&ok); if (!ok) { error = eError_CRC ; ok = false; goto lErr; } + index = eMessage_CRC ; message.crc = items[index].toUInt(&ok); if (!ok) { error = eError_CSCRC ; ok = false; goto lErr; } index = eMessage_MessageID ; message.id = items[index].toInt (&ok); if (!ok) { error = eError_MessageID ; ok = false; goto lErr; } index = eMessage_ParamCount; message.paramCount = items[index].toUInt(&ok); if (!ok) { error = eError_ParamCount ; ok = false; goto lErr; } @@ -296,9 +310,8 @@ // check missing parameters id = CS2UI(message.id); if ( ! paramCount.contains(id)) paramCount[id] = 0; - if ( paramCount[id] != message.paramCount ) { error = eError_ParamMissing ; ok = false; goto lErr; } + if ( message.paramCount < paramCount[id] ) { error = eError_ParamMissing ; ok = false; goto lErr; } - // convert the message id and check its validity message.id = CS2UI(static_cast(message.id)); if ( eMessageID_Start > message.id || message.id > eMessageID_Count ) { error = eError_InvalidID ; ok = false; goto lErr; } @@ -319,7 +332,7 @@ case eError_HeaderCount : args = { count , eMessage_Count }; break; case eError_Timestamp : args = { items[index].trimmed() }; break; case eError_Sequence : args = { items[index].trimmed() }; break; - case eError_CRC : args = { items[index].trimmed() }; break; + case eError_CSCRC : args = { items[index].trimmed() }; break; case eError_MessageID : args = { items[index].trimmed() }; break; case eError_InvalidID : args = { items[index].trimmed() }; break; case eError_ParamCount : args = { items[index].trimmed() }; break; @@ -344,31 +357,44 @@ QString text = tr( "CS Unknown Error" ) ; if ( vErrorID == 0 ) return text; switch (vErrorID) { - case eError_Unknown : /* "CS Unknown Error" */ ; break; - case eError_OutFileEmpty : text = tr( "CS Out buffer empty" ) ; break; - case eError_HeaderCount : text = tr( "CS Incorrect header" ) ; break; - case eError_Timestamp : text = tr( "CS Incorrect timestamp" ) ; break; - case eError_Sequence : text = tr( "CS Incorrect sequence" ) ; break; - case eError_CRC : text = tr( "CS Incorrect CRC" ) ; break; - case eError_MessageID : text = tr( "CS Incorrect ID" ) ; break; - case eError_ParamCount : text = tr( "CS Incorrect parameter count" ) ; break; - case eError_InvalidID : text = tr( "CS Invalid ID" ) ; break; - case eError_ParamMismatch : text = tr( "CS Mismatch parameter count" ) ; break; - case eError_ParamMissing : text = tr( "CS Missing parameter" ) ; break; - case eError_NoHistory : text = tr( "CS No history available" ) ; break; - case eError_Duplicate : text = tr( "CS Duplicate data" ) ; break; - case eError_LogFolder : text = tr( "CS The log folder cannot be created." ) ; break; - case eError_LogFileInp : text = tr( "CS Error writing to the input file." ) ; break; - case eError_CredentialFile : text = tr( "CS The credentials file does not exist." ) ; break; - case eError_CredentialPath : text = tr( "CS The credentials folder is incorrect." ) ; break; - case eError_CredentialCount : text = tr( "CS No credential file name provided." ) ; break; - case eError_CredentialEmpty : text = tr( "CS The credentials folder is empty." ) ; break; - case eError_TxCodeNoParam : text = tr( "CS No Treatment Code provided." ) ; break; - case eError_TxCodeEmpty : text = tr( "CS The provided Treatment Code is empty." ) ; break; - case eError_NotRegistered : text = tr( "CS Not Sent, Device not registered." ) ; break; + case eError_Unknown : /* "CS Unknown Error" */ ; break; + // CS Errors + case eError_Registration : text = tr( "CS The device registration failed" ) ; break; + case eError_DeviceState : text = tr( "CS Invalid Device State" ) ; break; + case eError_TxReport : text = tr( "CS The treatment report delivery failed" ) ; break; + case eError_UICRC : text = tr( "CS Invalid UI Message CRC" ) ; break; + case eError_DeviceValidation : text = tr( "CS DRT device registration failed" ) ; break; + case eError_PatientAssociation : text = tr( "CS Patient association failed" ) ; break; + case eError_GetNewTokenCert : text = tr( "CS New token certification failed" ) ; break; + case eError_VerifyToken : text = tr( "CS Token verification failed" ) ; break; + case eError_ValidateDevice : text = tr( "CS Cloud device validation failed" ) ; break; + case eError_PatientIdExists : text = tr( "CS Patient ID does not exists" ) ; break; + case eError_TemporaryPatient : text = tr( "CS Temporary patient ID creation failed" ) ; break; + case eError_SaveCredentials : text = tr( "CS Save credentials failed" ) ; break; + case eError_UnknownDeviceState : text = tr( "CS Unknown device state" ) ; break; + // UI Errors + case eError_OutFileEmpty : text = tr( "CS Out buffer empty" ) ; break; + case eError_HeaderCount : text = tr( "CS Incorrect header" ) ; break; + case eError_Timestamp : text = tr( "CS Incorrect timestamp" ) ; break; + case eError_Sequence : text = tr( "CS Incorrect sequence" ) ; break; + case eError_CSCRC : text = tr( "CS Incorrect CRC" ) ; break; + case eError_MessageID : text = tr( "CS Incorrect ID" ) ; break; + case eError_ParamCount : text = tr( "CS Incorrect parameter count" ) ; break; + case eError_InvalidID : text = tr( "CS Invalid ID" ) ; break; + case eError_ParamMismatch : text = tr( "CS Mismatch parameter count" ) ; break; + case eError_ParamMissing : text = tr( "CS Missing parameter" ) ; break; + case eError_NoHistory : text = tr( "CS No history available" ) ; break; + case eError_Duplicate : text = tr( "CS Duplicate data" ) ; break; + case eError_LogFolder : text = tr( "CS The log folder cannot be created." ) ; break; + case eError_LogFileInp : text = tr( "CS Error writing to the input file." ) ; break; + case eError_CredentialFile : text = tr( "CS The credentials file does not exist." ) ; break; + case eError_CredentialPath : text = tr( "CS The credentials folder is incorrect." ) ; break; + case eError_CredentialCount : text = tr( "CS No credential file name provided." ) ; break; + case eError_CredentialEmpty : text = tr( "CS The credentials folder is empty." ) ; break; + case eError_TxCodeNoParam : text = tr( "CS No Treatment Code provided." ) ; break; + case eError_TxCodeEmpty : text = tr( "CS The provided Treatment Code is empty." ) ; break; + case eError_NotRegistered : text = tr( "CS Not Sent, Device not registered." ) ; break; - case eError_Registration : text = tr( "CS The device registration failed." ) ; break; - case eError_TxReport : text = tr( "CS The treatment report delivery failed." ) ; break; } return text; } @@ -386,32 +412,45 @@ // It means it is designed to not throw out of bound error and just use "~" as a missing info argument. auto item = [=](uint i) { return vInfoItems.value(i,"~").toString(); }; - QString info = QString( "[%1]" ).arg( vErrorID ) ; + QString info = QString( "[%1]" ).arg( vErrorID ) ; switch (vErrorID) { - case eError_Unknown : ; break; - case eError_OutFileEmpty : ; break; - case eError_HeaderCount : info = QString( "[%1:%2/%3]" ).arg( vErrorID ).arg( item(0) ).arg( item(1) ) ; break; - case eError_Timestamp : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_Sequence : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_CRC : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_MessageID : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_InvalidID : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_ParamCount : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_ParamMismatch : info = QString( "[%1:%2/%3]" ).arg( vErrorID ).arg( item(0) ).arg( item(1) ) ; break; - case eError_ParamMissing : info = QString( "[%1:%2/%3]" ).arg( vErrorID ).arg( item(0) ).arg( item(1) ) ; break; - case eError_NoHistory : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_Duplicate : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_LogFolder : ; break; - case eError_LogFileInp : ; break; - case eError_CredentialFile : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_CredentialPath : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_CredentialCount : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_CredentialEmpty : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_TxCodeNoParam : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_TxCodeEmpty : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_NotRegistered : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_Registration : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; - case eError_TxReport : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_Unknown : ; break; + // CS Errors + case eError_Registration : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_DeviceState : ; break; + case eError_TxReport : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_UICRC : /* info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) */ ; break; + case eError_DeviceValidation : ; break; + case eError_PatientAssociation : ; break; + case eError_GetNewTokenCert : ; break; + case eError_VerifyToken : ; break; + case eError_ValidateDevice : ; break; + case eError_PatientIdExists : ; break; + case eError_TemporaryPatient : ; break; + case eError_SaveCredentials : ; break; + case eError_UnknownDeviceState : ; break; + // UI Errors + case eError_OutFileEmpty : ; break; + case eError_HeaderCount : info = QString( "[%1:%2/%3]" ).arg( vErrorID ).arg( item(0) ).arg( item(1) ) ; break; + case eError_Timestamp : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_Sequence : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_CSCRC : /* info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) */ ; break; + case eError_MessageID : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_InvalidID : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_ParamCount : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_ParamMismatch : info = QString( "[%1:%2/%3]" ).arg( vErrorID ).arg( item(0) ).arg( item(1) ) ; break; + case eError_ParamMissing : info = QString( "[%1:%2/%3]" ).arg( vErrorID ).arg( item(0) ).arg( item(1) ) ; break; + case eError_NoHistory : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_Duplicate : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_LogFolder : ; break; + case eError_LogFileInp : ; break; + case eError_CredentialFile : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_CredentialPath : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_CredentialCount : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_CredentialEmpty : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_TxCodeNoParam : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_TxCodeEmpty : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; + case eError_NotRegistered : info = QString( "[%1:%2]" ).arg( vErrorID ).arg( item(0) ) ; break; } return info; } @@ -677,9 +716,9 @@ } } -void CloudSyncController::onTxPending(const QString &vFileName) +void CloudSyncController::sendPendingLog(const QString &vFileName) { - bool ok = true; Q_UNUSED(ok); + bool ok = true; Q_UNUSED(ok) QVariantList args ; Errors_Enum error = eError_Unknown; qint32 messageID = UI2CS(static_cast( eMessageID_TxReport )); @@ -692,6 +731,11 @@ toLog(error, args); } +void CloudSyncController::onTxPending(const QString &vFileName) +{ + sendPendingLog(vFileName); +} + /*! * \brief CloudSyncController::sendMessage * \details Makes and Sends the appropriate message for the vAction. @@ -707,7 +751,7 @@ case eMessageID_DeviceInfo : ok = sendDeviceInfo ( ); break; case eMessageID_CredentialsSave : ok = sendCredentialsSave( vMessage ); break; - case eMessageID_ResetFactory : ok = sendResetFactory ( ); break; + case eMessageID_UIFactoryReset : ok = sendFactoryReset ( ); break; case eMessageID_DeviceState : ok = sendDeviceState ( ); break; case eMessageID_TxCodeDisplay : ok = sendTxCodeDisplay ( vMessage ); break; @@ -744,12 +788,31 @@ return ok; } +void CloudSyncController::csFactoryReset() +{ + bool ok = true; Q_UNUSED(ok) + QVariantList args ; + Errors_Enum error = eError_Unknown; + qint32 messageID = UI2CS(static_cast( eMessageID_CSFactoryReset )); + + if ( ! isRegistered() ) { error = eError_NotRegistered ; args = { vFileName }; ok = false; goto lErr; } + sendUIBuff(makeUIBuff( messageID , { } )); + + return; +lErr: + toLog(error, args); +} + +void CloudSyncController::onFactoryReset() { + csFactoryReset(); +} + /*! - * \brief CloudSyncController::doResetFactory + * \brief CloudSyncController::factoryReset * \details does the reset factory * \return true on successful reset */ -bool CloudSyncController::doResetFactory() +bool CloudSyncController::uiFactoryReset() { // reset factory has not been implemented yet. bool ok = true; @@ -759,17 +822,17 @@ } /*! - * \brief CloudSyncController::sendResetFactory + * \brief CloudSyncController::sendFactoryReset * \details sends the factory reset response to CloudSync * \return true on successful send. */ -bool CloudSyncController::sendResetFactory() +bool CloudSyncController::sendFactoryReset() { enum { eSucceed, eFailed }; bool ok = false; - ok = doResetFactory(); + ok = uiFactoryReset(); // if ( ! ok ) { } /* Not defined */ - qint32 messageID = UI2CS(eMessageID_ResetFactory); + qint32 messageID = UI2CS(eMessageID_UIFactoryReset); // TODO : Store registration success in here ok = sendUIBuff({ QString("%1").arg( messageID ) ,"1", QString("%1").arg( ok ? eSucceed : eFailed ) }); return ok; Index: sources/cloudsync/CloudSyncController.h =================================================================== diff -u -r80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803 -rdff4ac319c6619a1ccb894c7d6079e8e4a46b776 --- sources/cloudsync/CloudSyncController.h (.../CloudSyncController.h) (revision 80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803) +++ sources/cloudsync/CloudSyncController.h (.../CloudSyncController.h) (revision dff4ac319c6619a1ccb894c7d6079e8e4a46b776) @@ -79,43 +79,52 @@ enum Errors_Enum { // CS : 900 - 949 // UI : 950 - 999 - eError_Unknown = 900, // Unknown error, initial error before error check + eError_Unknown = 900, // Unknown error, initial error before error check - // CS to UI Error start - eError_Registration = 901, - eError_TxReport = 902, + eError_Registration = 901, // CS_REQ_REGISTRATION_ERROR = 901 + eError_DeviceState = 906, // CS_SEND_DEVICE_STATE_ERROR = 906 + eError_TxReport = 907, // CS_SEND_TREATMENT_REPORT_ERROR = 907 + eError_UICRC = 910, // CS_BAD_CRC_ERROR = 910 + eError_DeviceValidation = 920, // CS_DEVICE_VALIDATION_RESULT_ERROR = 920 + eError_PatientAssociation = 921, // CS_SET_PATIENT_DEVICE_ASSOCIATION_ERROR = 921 + eError_GetNewTokenCert = 922, // CS_GET_NEW_TOKEN_WITH_CERT_ERROR = 922 + eError_VerifyToken = 923, // CS_VERIFY_TOKEN_ERROR + eError_ValidateDevice = 924, // CS_VALIDATE_DEVICE_ERROR = 924 + eError_PatientIdExists = 925, // CS_CHECK_IF_PATIENT_WITH_EMR_ID_EXISTS_ERROR = 925 + eError_TemporaryPatient = 926, // CS_CREATE_TEMPORARY_PATIENT_ERROR = 926 + eError_SaveCredentials = 927, // CS_SAVE_CREDENTIALS_ERROR = 927 + eError_UnknownDeviceState = 928, // CS_UNKNOWN_DEVICE_STATE_ERROR = 928 - // UI to CS Error start - // eError_UI_Base = 950, // No Used - eError_HeaderCount = 951, - eError_Timestamp = 952, - eError_Sequence = 953, - eError_CRC = 954, - eError_MessageID = 955, - eError_InvalidID = 956, - eError_ParamCount = 957, - eError_ParamMismatch = 958, - eError_ParamMissing = 959, + // eError_UI_Base = 950, // Base, not used + eError_HeaderCount = 951, + eError_Timestamp = 952, + eError_Sequence = 953, + eError_CSCRC = 954, + eError_MessageID = 955, + eError_InvalidID = 956, + eError_ParamCount = 957, + eError_ParamMismatch = 958, + eError_ParamMissing = 959, - eError_NoHistory = 960, - eError_Duplicate = 961, + eError_NoHistory = 960, + eError_Duplicate = 961, - eError_LogFolder = 962, - eError_LogFileInp = 963, + eError_LogFolder = 962, + eError_LogFileInp = 963, - eError_CredentialPath = 964, // the UI vault folder for cloudsync credentials is not what is expected. - eError_CredentialFile = 965, // the credential files sent to UI can't be find or read or doesn't exist.. - eError_CredentialCount = 966, // No credential file sent to UI in the message. - eError_CredentialEmpty = 967, // the UI folder doesn't have credential files. + eError_CredentialPath = 964, // the UI vault folder for cloudsync credentials is not what is expected. + eError_CredentialFile = 965, // the credential files sent to UI can't be find or read or doesn't exist.. + eError_CredentialCount = 966, // No credential file sent to UI in the message. + eError_CredentialEmpty = 967, // the UI folder doesn't have credential files. - eError_TxCodeNoParam = 969, // the received Tx Code not provided - eError_TxCodeEmpty = 970, // the received Tx Code is empty + eError_TxCodeNoParam = 969, // the received Tx Code not provided + eError_TxCodeEmpty = 970, // the received Tx Code is empty - eError_OutFileEmpty = 971, // Out file has changed from CS2UI but the content is empty. + eError_OutFileEmpty = 971, // Out file has changed from CS2UI but the content is empty. - eError_NotRegistered = 972, // avoid sending any message other than the device registration, when device is not registered. + eError_NotRegistered = 972, // avoid sending any message other than the device registration, when device is not registered. }; typedef QHash MessageList; @@ -152,15 +161,16 @@ eMessageID_DeviceRegister = 1, // [ UI(1001) -> CS( ) ] Device Registration Request eMessageID_DeviceInfo = 2, // [ CS(2002) <-> UI(1002) ] Device information Request eMessageID_CredentialsSave = 3, // [ CS(2003) <-> UI(1003) ] Save Credentials Request/Response - // Removed CredentialsSend = 4, // [ CS(2004) <-> UI(1004) ] Send Credentials Request - eMessageID_ResetFactory = 5, // [ CS(2005) <-> UI(1005) ] Reset Factory Request + //// Not Used 4, + eMessageID_UIFactoryReset = 5, // [ CS(2005) <-> UI(1005) ] Factory Reset Request // Deployment eMessageID_DeviceState = 6, // [ CS(2006) <-> UI(1006) ] Device State Request // Tx Report eMessageID_TxReport = 7, // [ UI(1007) -> CS(2007) ] TxReport Notify // Tx Code eMessageID_TxCodeDisplay = 8, // [ CS(2008) -> UI( ) ] Display TxCode Request + eMessageID_CSFactoryReset = 9, // [ UI(1009) <-> CS(2009) ] Factory Reset Request // // Subject to change so has been commented out for now // @@ -176,7 +186,7 @@ QHash paramCount { { eMessageID_CredentialsSave , 3 }, { eMessageID_TxCodeDisplay , 1 }, - { eMessageID_Error , 4 }, + { eMessageID_Error , 2 }, }; enum DeviceInfo_Enum { @@ -204,6 +214,7 @@ void onInitComplete (); void onPOSTCloudSync (bool vPass ); void onCryptSetupMount (bool vPass ); + void onFactoryReset (bool vPass ); signals: void didInitComplete (); @@ -248,6 +259,7 @@ // error bool sendError (); // eMessageID_Error + bool errorHandler ( const Message &vMessage ); // eMessageID_Error // device information bool saveDeviceInfo (GuiActionType vAction, const QVariantList &vData); // eMessageID_DeviceInfo @@ -266,14 +278,19 @@ bool saveDeviceState (const QVariantList &vData); bool sendDeviceState (); // eMessageID_DeviceState - // reset Factory - bool doResetFactory (); // eMessageID_ResetFactory - bool sendResetFactory (); // eMessageID_ResetFactory - bool sendCredentialsSave (const Message &vMessage); // eMessageID_SaveCredentials + // Factory Reset + bool csFactoryReset (); // eMessageID_FactoryReset + bool uiFactoryReset (); // eMessageID_FactoryReset + bool sendFactoryReset (); // eMessageID_FactoryReset + + + // credentials + bool sendCredentialsSave (const Message &vMessage ); // eMessageID_SaveCredentials bool sendCredentialsResponse(); - bool sendTxCodeDisplay (const Message &vMessage); // eMessageID_TxCodeDisplay + // pending log + void sendPendingLog ( const QString &vFileName ); // eMessageID_TxReport + bool sendTxCodeDisplay ( const Message &vMessage ); // eMessageID_TxCodeDisplay - bool errorHandler (const Message &vMessage); // eMessageID_Error }; Index: sources/device/DeviceController.cpp =================================================================== diff -u -r689177edf29dee6f10bebfed42f6bbadeb7ce8a8 -rdff4ac319c6619a1ccb894c7d6079e8e4a46b776 --- sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision 689177edf29dee6f10bebfed42f6bbadeb7ce8a8) +++ sources/device/DeviceController.cpp (.../DeviceController.cpp) (revision dff4ac319c6619a1ccb894c7d6079e8e4a46b776) @@ -950,7 +950,9 @@ else deviceInfo = _processFactoryReset.readAll(); model.fromByteArray( deviceInfo, &vExitCode ); // DEBUG: qDebug() << model._data.mMessage << deviceInfo; - didAttributeResponse(model.data()); + emit didAttributeResponse(model.data()); + emit didFactoryReset(model._data.mAccepted); + LOG_APPED_UI(model.data().mMessage); } Index: sources/device/DeviceController.h =================================================================== diff -u -r80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803 -rdff4ac319c6619a1ccb894c7d6079e8e4a46b776 --- sources/device/DeviceController.h (.../DeviceController.h) (revision 80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803) +++ sources/device/DeviceController.h (.../DeviceController.h) (revision dff4ac319c6619a1ccb894c7d6079e8e4a46b776) @@ -252,6 +252,13 @@ * to notify the ApplicationController to call initSettings */ void didCryptSetupMount ( bool vPass ); + /*! + * \brief didFactoryReset + * \details will be emitted when the factory reset is done, + * to notify the CloudSyncController to do the FactoryReset/TokenRemoval. + * \param vPass + */ + void didFactoryReset ( bool vPass ); private: // ----- USB