54 lines
1.1 KiB
C++
54 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "pico/stdlib.h"
|
|
#include "pico/unique_id.h"
|
|
#include <vector>
|
|
#include <string>
|
|
#include "RPEnums.h"
|
|
#include "RC522Types.h"
|
|
#include "FreeRTOS.h"
|
|
//#include "task.h"
|
|
#include "semphr.h"
|
|
#include "git.h"
|
|
|
|
class Global
|
|
{
|
|
public:
|
|
struct credentialRequest_t
|
|
{
|
|
RC522::TagInfo tag;
|
|
uint8_t blockData[50];
|
|
uint8_t blockDataSize;
|
|
bool cardReady = false;
|
|
//bool cardPresent = false;
|
|
SemaphoreHandle_t mutex;
|
|
};
|
|
static Global::credentialRequest_t credentialRequest;
|
|
|
|
static RP::RPStatus readerStatus;
|
|
|
|
static uint8_t readerID;
|
|
|
|
static RC522::MIFARE_Key sectorKeyA;
|
|
static RC522::MIFARE_Key sectorKeyB;
|
|
|
|
static std::string GitVersion()
|
|
{
|
|
std::string version;
|
|
version.append(git::Describe());
|
|
if (git::AnyUncommittedChanges())
|
|
{
|
|
version.append("-dirty");
|
|
}
|
|
return version;
|
|
}
|
|
|
|
static std::string UniqueId()
|
|
{
|
|
char id[2 * PICO_UNIQUE_BOARD_ID_SIZE_BYTES + 1];
|
|
pico_get_unique_board_id_string(id, sizeof(id));
|
|
return std::string(id);
|
|
}
|
|
|
|
private:
|
|
}; |