merge
This commit is contained in:
parent
e82e5729aa
commit
13bbc2d1b1
@ -44,8 +44,8 @@ typedef struct{
|
|||||||
|
|
||||||
char file_name[FILE_NAME_LEN + 1];
|
char file_name[FILE_NAME_LEN + 1];
|
||||||
char name[NAME_LEN + 1];
|
char name[NAME_LEN + 1];
|
||||||
int rfid_uuid;
|
char rfid_uuid[13];
|
||||||
int finger_uuid;
|
uint8_t finger_uuid;
|
||||||
|
|
||||||
int drinks_taken[NUM_OF_DRINKS];
|
int drinks_taken[NUM_OF_DRINKS];
|
||||||
|
|
||||||
|
14
beerbox.ino
14
beerbox.ino
@ -174,9 +174,11 @@ Person read_person(Beerbox *box, char *filename){
|
|||||||
|
|
||||||
read_line_from_file(read, tmp, sizeof(tmp));
|
read_line_from_file(read, tmp, sizeof(tmp));
|
||||||
strcpy(aperson.name, tmp);
|
strcpy(aperson.name, tmp);
|
||||||
|
|
||||||
|
memset(aperson.rfid_uuid, 0, 13);
|
||||||
|
|
||||||
read_line_from_file(read, tmp, sizeof(tmp));
|
read_line_from_file(read, tmp, sizeof(tmp));
|
||||||
sscanf(tmp, " %*s %d", &aperson.rfid_uuid);
|
sscanf(tmp, " %*s %12s", aperson.rfid_uuid);
|
||||||
Serial.print(aperson.rfid_uuid);
|
Serial.print(aperson.rfid_uuid);
|
||||||
|
|
||||||
read_line_from_file(read, tmp, sizeof(tmp));
|
read_line_from_file(read, tmp, sizeof(tmp));
|
||||||
@ -231,9 +233,9 @@ void print_person(Beerbox *box, Person *aperson){
|
|||||||
|
|
||||||
sprintf(leckmich,"\nPerson is called \"%s\" and has the filename \"%s\".\n", aperson->name, tmp_filename);
|
sprintf(leckmich,"\nPerson is called \"%s\" and has the filename \"%s\".\n", aperson->name, tmp_filename);
|
||||||
Serial.write(leckmich);
|
Serial.write(leckmich);
|
||||||
sprintf(leckmich, "rfid_uuid: %d\n", aperson->rfid_uuid);
|
sprintf(leckmich, "rfid_uuid: %s\n", aperson->rfid_uuid);
|
||||||
Serial.write(leckmich);
|
Serial.write(leckmich);
|
||||||
sprintf(leckmich, "finger_uuid: %d\n", aperson->finger_uuid);
|
sprintf(leckmich, "finger_uuid: %u\n", aperson->finger_uuid);
|
||||||
Serial.print(leckmich);
|
Serial.print(leckmich);
|
||||||
|
|
||||||
|
|
||||||
@ -279,9 +281,9 @@ int update_pers_file(Beerbox *box, Person *aperson){
|
|||||||
|
|
||||||
sprintf(leckmich, " %s\n", aperson->name);
|
sprintf(leckmich, " %s\n", aperson->name);
|
||||||
write.write(tmp, strlen(tmp));
|
write.write(tmp, strlen(tmp));
|
||||||
sprintf(leckmich, "rfid_uuid: %d\n", aperson->rfid_uuid);
|
sprintf(leckmich, "rfid_uuid: %s\n", aperson->rfid_uuid);
|
||||||
write.write(tmp, strlen(tmp));
|
write.write(tmp, strlen(tmp));
|
||||||
sprintf(leckmich, "finger_uuid: %d\n", aperson->finger_uuid);
|
sprintf(leckmich, "finger_uuid: %u\n", aperson->finger_uuid);
|
||||||
write.write(tmp, strlen(tmp));
|
write.write(tmp, strlen(tmp));
|
||||||
|
|
||||||
for(i = 0; i < NUM_OF_DRINKS; i++){
|
for(i = 0; i < NUM_OF_DRINKS; i++){
|
||||||
|
Loading…
Reference in New Issue
Block a user