beerbox/beerbox.h

50 lines
1.2 KiB
C
Raw Normal View History

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
#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
//######### 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];
int waiting;
int scanning=0;
int maxDrink=0;
int maxID=0;
int personCount=0;
2015-07-13 14:49:36 +00:00
}Beerbox;
//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];
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;
int credits_left;
2015-07-13 14:49:36 +00:00
}Person;