čištění a další upravy

This commit is contained in:
2023-12-08 10:30:44 +01:00
parent f92b2c708f
commit 892ae13bf2
26 changed files with 294 additions and 72 deletions

View File

@@ -115,6 +115,8 @@ bool LicenceELC21::createLicence()
privateContent.push_back(crcComplete & 0xFF);
privateContent.push_back((crcComplete >> 8) & 0xFF);
privateContentEncrypted = cryptPrivateContent(privateContent);
#ifdef DEB
@@ -162,22 +164,19 @@ bool LicenceELC21::createLicence()
bool LicenceELC21::readLicence(LicenceInfoGeneral * licences)
{
try
{
// sdCard = SDCard("9f544930303030300000000b47015423", "400e00325b5900003a0d7f800a40008d");
sdCard = SDCard(this->cid_cdsPath);
if (sdCard.isLoaded == false)
throw LicenceException((int)Error21::SDCardReadError, "Chyba při čtení SD karty, cesta: " + cid_cdsPath);
if (sdCard.isLoaded == false) throw LicenceException((int)Error21::SDCardReadError, "Chyba při čtení SD karty, cesta: " + cid_cdsPath);
string licFileName = getLicenceName();
string licFilePath = this->licenceFilePath+licFileName;
// Create an unsigned char vector to store the file data
vector<char> content;
if (readFile(licFilePath, content) == false)
{
throw LicenceException((int)GeneralError::FileOpenError, "Chyba otevření souboru licence.");
throw LicenceException((int)GeneralError::FileOpenError, "Chyba otevření souboru licence: " + licFilePath);
}
this->licBody.licId.licIdent[0] = content[0];
@@ -266,15 +265,6 @@ bool LicenceELC21::readLicence(LicenceInfoGeneral * licences)
this->licenceInfo.licences.insert(pair<int, int>(item.protoId, item.licCount));
licences->licences.insert(pair<int, int>(item.protoId, item.licCount));
}
}
catch (const LicenceException &ex)
{
errorMessage.code = ex.getErrorCode();
errorMessage.message = ex.getErrorMessage();
return false;
}
return true;
}