This commit is contained in:
2023-08-17 14:32:33 +02:00
parent c07db22aba
commit bf75988495
6 changed files with 28 additions and 22 deletions

View File

@@ -6,6 +6,7 @@
#define CID_LENGTH 32
#define CSD_LENGTH 32
const std::string cEzLic_p78ou3_sdinfofilepath = "/sys/block/mmcblk0/device/";
const std::string cEzLic_p78ou3_licencfilepath_f21 = "/mnt/mmc/ez_sys/licence/";
const std::string cEzLic_p78ou3_licencfilepath_f17 = "/home/admin/ez/licence/";
@@ -607,6 +608,16 @@ bool PlcLicence::CreateLicence()
LicenceSourceData licSourceData;
// cout << "size of WORD:" << sizeof(WORD) << endl;
// cout << "size of DWORD:" << sizeof(DWORD) << endl;
// cout << "size of DATE:" << sizeof(DATE) << endl;
// cout << "size of BYTE:" << sizeof(BYTE) << endl;
// cout << "size of int:" << sizeof(int) << endl;
// cout << "size of char:" << sizeof(char) << endl;
// cout << "size of float:" << sizeof(float) << endl;
// cout << "Size of dataToFile: " << sizeof(dataToFile) << endl;
// return true;
if (plcData.licenceType == "EOV" || plcData.licenceType == to_string((int)LicenceType::LicenceEov))
{
licSourceData.licType = 0x1AA2; // 6818 ... proč ?
@@ -657,7 +668,7 @@ bool PlcLicence::CreateLicence()
dataToFile.header.licVersion = 10;
dataToFile.header.licType = licIdent.licIDType;
dataToFile.header.licDate = getLicDate();
dataToFile.header.licDate = getLicDate(); //1692230400; //getLicDate(); //1692144000;// getLicDate();
mainLicDescription += dataToFile.header.licDescription1;
mainLicDescription += " [";
mainLicDescription += dataToFile.header.licDescription2;
@@ -715,6 +726,8 @@ bool PlcLicence::CreateLicence()
unsigned char bdataMainToFileELC1[dataMainLength] = {};
memcpy(bdataMainToFileELC1, &dataMainToFileELC1, dataMainLength);
unsigned char bdataToFile[dataToFileLength] = {};
memcpy(bdataToFile, &dataToFile, dataToFileLength);
unsigned char totalEncryptedArray[totalEncryptedLength] = {};