Index: sources/cloudsync/CloudSyncController.h =================================================================== diff -u -r6531fd93584d910ce4313638b868d5fd20e77b68 -r3f60b9a1c0b3a43ec1c5c72955dce0d80354e35c --- sources/cloudsync/CloudSyncController.h (.../CloudSyncController.h) (revision 6531fd93584d910ce4313638b868d5fd20e77b68) +++ sources/cloudsync/CloudSyncController.h (.../CloudSyncController.h) (revision 3f60b9a1c0b3a43ec1c5c72955dce0d80354e35c) @@ -76,23 +76,29 @@ QString _deviceInfoUI = ""; enum Errors_Enum { - eError_Unknown = 500, // Unknown error, initial error before error check + eError_Unknown = 500, // Unknown error, initial error before error check - eError_HeaderCount , - eError_Timestamp , - eError_Sequence , - eError_CRC , - eError_MessageID , - eError_InvalidID , - eError_ParamCount , - eError_Parameter , + eError_HeaderCount , + eError_Timestamp , + eError_Sequence , + eError_CRC , + eError_MessageID , + eError_InvalidID , + eError_ParamCount , + eError_ParamMismatch , + eError_ParamMissing , - eError_NoHistory , + eError_NoHistory , - eError_LogFolder , - eError_LogFileInp , + eError_LogFolder , + eError_LogFileInp , - eError_OutFileEmpty , // Out file has changed from CS2UI but the content is empty. + eError_CredentialMake , + eError_CredentialFile , + eError_CredentialCopy , + eError_CredentialRemove , + + eError_OutFileEmpty , // Out file has changed from CS2UI but the content is empty. }; typedef QHash MessageList; @@ -124,20 +130,19 @@ enum MessageID_Enum { eMessageID_Start = 0, - // [ #1( ID ) <-> #2( ID ) ] Description ( #1 Requests and #2 responses ) + // // [ #1( ID ) <-> #2( ID ) ] Description ( #1 Requests and #2 responses ) // Manufacturing eMessageID_Error = 0, // [ CS(2000) <-> UI(1000) ] Error Report eMessageID_DeviceRegister = 1, // [ UI(1001) -> CS( ) ] Device Registration Request eMessageID_DeviceInfo = 2, // [ CS(2002) <-> UI(1002) ] Device information Request - eMessageID_SaveCredentials = 3, // [ CS(2003) -> UI(1003) ] Save Credentials Request - eMessageID_SendCredentials = 4, // [ CS(2004) <-> UI(1004) ] Send Credentials Request + eMessageID_CredentialsSave = 3, // [ CS(2003) -> UI(1003) ] Save Credentials Request + eMessageID_CredentialsSend = 4, // [ CS(2004) <-> UI(1004) ] Send Credentials Request eMessageID_ResetFactory = 5, // [ CS(2005) <-> UI(1005) ] Reset Factory Request // Deployment eMessageID_DeviceState = 6, // [ CS(2006) <-> UI(1006) ] Device State Request - + // Tx Report eMessageID_TxReport = 7, // [ UI(1007) -> CS(2007) ] TxReport Notify - // // Subject to change so has been commented out for now // @@ -148,6 +153,10 @@ eMessageID_Count }; + QHash paramCount { + { eMessageID_CredentialsSave , 3 }, + }; + enum DeviceInfo_Enum { eDeviceInfo_Ix = 0, // received message data index of each HD, DG. Data index 0 is always the info. eDeviceInfo_HD = 0, // stored index in the UI history. @@ -191,16 +200,16 @@ bool sendUIBuff (const QString &vData ); bool saveUIHistory (const qint32 vAction, const QVariantList &vData); bool sendUIHistory (const qint32 vAction ); - bool sendMessage (const qint32 vAction ); + bool sendMessage (const Message &vMessage ); bool writeInpFile (const QString &vInpBuff ); QString toText (Errors_Enum vErrorID); QString toInfo (Errors_Enum vErrorID, const QVariantList &vInfoItems); void toLog (Errors_Enum vErrorID, const QVariantList &vInfoItems); - qint32 UI2CS (MessageID_Enum vID) { return vID + eUI; } - qint32 CS2UI (MessageID_Enum vID) { return vID - eCS; } + qint32 UI2CS (qint32 vID) { return vID + eUI ; } + qint32 CS2UI (qint32 vID) { return abs(vID - eCS); } // error bool sendError (); // eMessageID_Error @@ -224,8 +233,8 @@ bool doResetFactory (); // eMessageID_ResetFactory bool sendResetFactory (); // eMessageID_ResetFactory - bool sendSaveCredentials (); // eMessageID_SaveCredentials - bool sendSendCredentials (); // eMessageID_SendCredentials + bool sendCredentialsSave (const Message &vMessage); // eMessageID_SaveCredentials + bool sendCredentialsSend (); // eMessageID_SendCredentials bool sendTxReport (); // eMessageID_TxReport };