Index: sources/cloudsync/CloudSyncController.h =================================================================== diff -u -r80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803 -r6445275f6426e45223901364b88de48c5845f2ed --- sources/cloudsync/CloudSyncController.h (.../CloudSyncController.h) (revision 80b5e8f1ebb90c03c37d90d90cd2da3bd95d6803) +++ sources/cloudsync/CloudSyncController.h (.../CloudSyncController.h) (revision 6445275f6426e45223901364b88de48c5845f2ed) @@ -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 + void 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 };