oprava #define direktiv

This commit is contained in:
2024-10-03 11:44:03 +02:00
parent a4e66ddaaf
commit 4dcd40aadf
64 changed files with 268 additions and 114 deletions

View File

@@ -1,15 +1,13 @@
#include "licenceReader.h"
#ifndef EZ_APPLICATION_LICENCE_DISABLE
#define LINUX 1
//#define WINDOWS 1
#include "licenceReader.h"
/// @brief hlavní funkce
/// @param argc
/// @param argv parametry pro generování licence
/// @return
int main9()
int main()
{
// buffer,850client,104client, 104server, web
// kouknout na unikatní klíc pro linux (native uid, i openssl neco má)
@@ -26,31 +24,25 @@ int main9()
initStructure.cid_csd_filePath = ""; // cesta k cidu/csd pro načtení a kontrolu licence
initStructure.uid_filePath = ""; // cesta k souboru machine-id. (/etc/machine-id), takze by mělo být /etc/.
//---------------------------------------- ELC3 ----------------------------------------------------------
//verze ELC 3 pro jeden protokol. Oproti ELC2 je potřeba přidat cestu k uid/machine-id v initStructure
LicenceReader licenceReaderELC3{};
if (licenceReaderELC3.initread(3, initStructure)) // iniciacni nacteni
//verze původní ELC 1, zatím zůstává staré řešení
LicenceReader licenceReaderELC1{};
if (licenceReaderELC1.initread(1, initStructure)) // iniciacni nacteni
{
LicenceELC3Item info; // podle ELC a kompatibility určit strukuru (LicenceInfo1, LicenceInfo2, LicenceInfo3)
// if ()
int protocolId = 7;
if (licenceReaderELC3.getLicenceItemInfo(protocolId, &info))
LicenceELC1Info info; // struktura pro ELC1. Nemá tam asi nic jiného smysl nez true/false
if (licenceReaderELC1.getLicenceInfo(&info))
{
cout << "Pocet licencních bodu pro " << info.protocolId << ": " << info.dataPointsCount << std::endl;
if (info.isValid)
cout << "Platna licence ELC1 \n";
else
cout << "Neplatna licence ELC1\n";
}
else
cout << "Tento protokol nemá body";
cout << "CHYBA: " << licenceReaderELC1.error.message;
}
else
{
cout << "CHYBA: " << licenceReaderELC3.error.message;
cout << "CHYBA: " << licenceReaderELC1.error.message;
}
//---------------------------------------- ELC3 ----------------------------------------------------------
system("pause");
return SUCCES;
// verze ELC 2 pro jeden protokol
LicenceReader licenceReaderELC2{};
@@ -96,6 +88,32 @@ int main9()
cout << "CHYBA: " << licenceReaderELC2.error.message;
}
//---------------------------------------- ELC3 ----------------------------------------------------------
//verze ELC 3 pro jeden protokol. Oproti ELC2 je potřeba přidat cestu k uid/machine-id v initStructure
LicenceReader licenceReaderELC3{};
if (licenceReaderELC3.initread(3, initStructure)) // iniciacni nacteni
{
LicenceELC3Item info; // podle ELC a kompatibility určit strukuru (LicenceInfo1, LicenceInfo2, LicenceInfo3)
// if ()
int protocolId = 7;
if (licenceReaderELC3.getLicenceItemInfo(protocolId, &info))
{
cout << "Pocet licencních bodu pro " << info.protocolId << ": " << info.dataPointsCount << std::endl;
}
else
cout << "Tento protokol nemá body";
}
else
{
cout << "CHYBA: " << licenceReaderELC3.error.message;
}
//---------------------------------------- ELC3 ----------------------------------------------------------
// verze ELC 2 kompletní načtení
/*
LicenceReader licenceReaderCompleteELC2{};