2015-07-13 14:49:36 +00:00
|
|
|
#define NUM_OF_DRINKS 10
|
|
|
|
#define DRINK_NAME_MAX_LENGTH 13
|
2015-09-19 09:46:46 +00:00
|
|
|
#define FILE_NAME_LEN 8
|
|
|
|
#define FILE_EXTENSION_LEN 3
|
2015-09-25 11:19:26 +00:00
|
|
|
#define FILE_EXTENSION ".per"
|
2015-07-13 14:49:36 +00:00
|
|
|
#define NAME_LEN 10
|
|
|
|
|
2015-11-19 19:38:42 +00:00
|
|
|
#define led 4
|
2015-07-13 14:49:36 +00:00
|
|
|
|
2015-09-25 11:19:26 +00:00
|
|
|
//######### 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
|
|
|
|
//#######################
|
|
|
|
|
|
|
|
|
2015-07-13 14:49:36 +00:00
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
/*Drink spevifier*/
|
|
|
|
char name[DRINK_NAME_MAX_LENGTH + 1];
|
|
|
|
/*Value in cents*/
|
|
|
|
int price;
|
|
|
|
}Drink;
|
|
|
|
|
|
|
|
typedef struct{
|
|
|
|
Drink drinks[NUM_OF_DRINKS];
|
2015-09-24 18:01:51 +00:00
|
|
|
int waiting;
|
2016-07-08 10:51:21 +00:00
|
|
|
int scanning=0;
|
2016-07-07 07:52:14 +00:00
|
|
|
int maxDrink=0;
|
|
|
|
int maxID=0;
|
2016-07-08 10:51:21 +00:00
|
|
|
int personCount=0;
|
2015-07-13 14:49:36 +00:00
|
|
|
}Beerbox;
|
|
|
|
|
2015-09-24 18:01:51 +00:00
|
|
|
//this shall always just exist in a short term!
|
2015-07-13 14:49:36 +00:00
|
|
|
typedef struct{
|
|
|
|
char file_name[FILE_NAME_LEN + 1];
|
2015-09-24 18:01:51 +00:00
|
|
|
int drinks_taken[NUM_OF_DRINKS];
|
2015-07-13 14:49:36 +00:00
|
|
|
char name[NAME_LEN + 1];
|
2015-07-13 17:32:39 +00:00
|
|
|
char rfid_uuid[13];
|
|
|
|
uint8_t finger_uuid;
|
2016-07-08 10:51:21 +00:00
|
|
|
int credits_left;
|
2015-07-13 14:49:36 +00:00
|
|
|
}Person;
|
|
|
|
|
|
|
|
|