1
0
beerbox/beerbox.h
Lukas Bachschwell 1bb6704d6e Fixed Wrong files getting detected as persons
Added HardwareSerial* as parameter to print person
Fixed bug in check for file

Added RFID and Finger revoke mechanisms
Added user scan
Added set user credits
Enabled creditsystem
2016-07-08 12:51:21 +02:00

50 lines
1.2 KiB
C

#define NUM_OF_DRINKS 10
#define DRINK_NAME_MAX_LENGTH 13
#define FILE_NAME_LEN 8
#define FILE_EXTENSION_LEN 3
#define FILE_EXTENSION ".per"
#define NAME_LEN 10
#define led 4
//######### RFID CONSTANTS ##########
const int startZeichen = 02; // Chip-Kennung beginnt mit 02
const int endeZeichen = 03; // ASCII CR bendet Code
const int kennungLaenge = 12; // Laenge Chip-Code 10 ASCII-Zeichen
const int gesamtKennungLaenge = 14; // Code-Laenge + Start- und Ende-Byte
char code[kennungLaenge + 1]; // fuer den Code und abschliessende Null
int bytesGelesen = 0;
int zaehlerFehlerCode = 0;
String zugang = "000000000000"; // zugangscode zwischenspeicher, Standard
//#######################
typedef struct{
/*Drink spevifier*/
char name[DRINK_NAME_MAX_LENGTH + 1];
/*Value in cents*/
int price;
}Drink;
typedef struct{
Drink drinks[NUM_OF_DRINKS];
int waiting;
int scanning=0;
int maxDrink=0;
int maxID=0;
int personCount=0;
}Beerbox;
//this shall always just exist in a short term!
typedef struct{
char file_name[FILE_NAME_LEN + 1];
int drinks_taken[NUM_OF_DRINKS];
char name[NAME_LEN + 1];
char rfid_uuid[13];
uint8_t finger_uuid;
int credits_left;
}Person;