oddělení, čištění, kontrola ELC1

This commit is contained in:
2024-02-05 15:04:22 +01:00
parent 5229f16c9d
commit 37d02abd3f
54 changed files with 368 additions and 374 deletions

View File

@@ -47,15 +47,6 @@ enum class GeneralError
ItemsCountMismatch = 61
};
// unordered_map<GeneralError, string> mapGeneralErrors = {
// {GeneralError::SDCardReadError, "Nepodařilo se načíst SD kartu."},
// {GeneralError::ItemsCountMismatch, "Nesouhlasí počet položek licence."},
// {GeneralError::LicenceSizeMismatch, "Nesouhlasí velikost souboru licence."},
// {GeneralError::LicenceSizeCardMismatch, "Nesouhlasí velikost SD karty."},
// {GeneralError::LicenceMismatch, "Nesouhlasí licence."},
// {GeneralError::ItemsCountMismatch, "Nesouhlasí počet položek licence."}
// };
enum class ELCType
{
ELC1 = 1,
@@ -120,14 +111,19 @@ struct LicenceIdentification
uint8_t licenceVersion = 1; // verze licence, určuje kodování, pojmenování souborů
uint8_t licenceIndex = 0;
uint8_t revision;
uint8_t licCompatibility = 1; // identikator hlavního ELC
uint8_t licCompatibility = 0; // identikator hlavního ELC. 0 = nedefinová a vrací se defaultní k danému ELC
uint16_t licItemsCount = 0;
string cid_cds_path = "";
string licenceFilePath = "";
};
/// @brief obecná struktura pro reader
struct LicenceInfoGeneral
{
int reqDataPointsCount = 0;
unordered_map<int, int> licences = {};
};
/// @brief obecná struktura polozky licence, defaultní kompatibilita
struct LicenceItem
{
@@ -135,103 +131,54 @@ struct LicenceItem
int dataPointsCount = 0;
};
/// @brief struktura polozky licence, kompatibilita 1
struct LicenceItemCompatibility1
{
int protocolId = -1;
int dataPointsCount = 0;
};
/// @brief struktura polozky licence, kompatibilita 2
struct LicenceItemCompatibility2
{
int protocolId = -1;
int dataPointsCount = 0;
};
/// @brief struktura polozky licence, kompatibilita 3
struct LicenceItemCompatibility3
{
int protocolId = -1;
int dataPointsCount = 0;
};
struct LicenceItem11
{
int protocolId = -1;
int dataPointsCount = 0;
};
struct LicenceItem21
{
int protocolId = -1;
int dataPointsCount = 0;
};
struct LicenceItem31
{
int protocolId = -1;
int dataPointsCount = 0;
};
/// @brief základní struktura, seznam polozek licencí
struct LicenceInfo
{
int reqDataPointsCount = 0;
unordered_map<int, int> licences = {};
};
/// @brief základní struktura, seznam polozek licencí, kompatibilita 1
struct LicenceInfoCompatibility1
{
int reqDataPointsCount = 0;
unordered_map<int, int> licences = {};
};
/// @brief základní struktura, seznam polozek licencí, kompatibilita 2
struct LicenceInfoCompatibility2
{
int reqDataPointsCount = 0;
unordered_map<int, int> licences = {};
};
/// @brief základní struktura, seznam polozek licencí, kompatibilita 3
struct LicenceInfoCompatibility3
{
int reqDataPointsCount = 0;
unordered_map<int, int> licences = {};
};
struct LicenceInfo1
/* struktury pro ELC 1 */
//defaultní struktura pro ELC 1
struct LicenceELC1Info
{
bool isValid {false};
};
struct LicenceInfo11
//struktura ELC1, kompatibilita 1
struct LicenceELC1Info_1
{
int reqDataPointsCount = 0;
unordered_map<int, int> licences = {};
};
struct LicenceInfo21
//defaultni struktura polozky licence ELC 1
struct LicenceELC1Item
{
int protocolId = -1;
int dataPointsCount = 0;
};
/* struktury pro ELC 2 */
//defaultní struktura pro ELC 2
struct LicenceELC2Info
{
int reqDataPointsCount = 0;
unordered_map<int, int> licences = {};
};
struct LicenceInfo31
struct LicenceELC2Info_1
{
int reqDataPointsCount = 0;
unordered_map<int, int> licences = {};
};
struct LicenceInfoGeneral
//defaultni struktura polozky ELC 2
struct LicenceELC2Item
{
int reqDataPointsCount = 0;
unordered_map<int, int> licences = {};
int protocolId = -1;
int dataPointsCount = 0;
};
//struktura polozky ELC 2,
struct LicenceELC2Item_1
{
int protocolId = -1;
int dataPointsCount = 0;
};
class LicenceException : public std::exception
{
public: