ac-real-io/acrealio/Reader.h

52 lines
1.5 KiB
C
Raw Permalink Normal View History

2013-09-07 10:46:05 -04:00
#ifndef READER_H
#define READER_H
#include "Arduino.h"
#include "Cipher.h"
#include "Node.h"
#include "RfidModule.h"
class Reader : public Node
{
public:
Reader(); //contructor
2017-01-25 16:08:41 -05:00
void setrCode(const char* rCode, byte cmd61 = 0);
2013-09-07 10:46:05 -04:00
void init();
2017-01-25 15:59:19 -05:00
void update(); //update things like keypadstate and rfid
2013-09-07 10:46:05 -04:00
void setkeypadpins(int col1, int col2, int col3, int row1, int row2, int row3, int row4);
void readKeypad();
void setRfidModule(RfidModule* mod);
2017-01-25 15:59:19 -05:00
2013-09-07 10:46:05 -04:00
short processRequest(byte* request, byte* sendBuff);
2017-01-25 15:59:19 -05:00
2013-09-07 10:46:05 -04:00
virtual void getStatus(byte* buf);
void readRfid();
2013-11-07 06:43:23 -05:00
private:
2013-09-07 10:46:05 -04:00
boolean acceptcard; // reader state, accepting cards or not (for emulating old readers)
boolean holdcard; // reader state, holding card or not (for emulating old readers)
2013-11-07 06:43:23 -05:00
byte uid[8]; // store uid of holding card (for emulating old readers)
2017-01-25 15:59:19 -05:00
2013-09-07 10:46:05 -04:00
2013-11-07 06:43:23 -05:00
boolean keypadInitDone;
2013-09-07 10:46:05 -04:00
word keypad; // keys currently pressed
word keypad_old; // keys pressed before last read
byte keydown; // used to indicated rising edge on keys
byte keycpt; // this cpt is incremented each time a key is pressed
short colPins[3]; // matrix has 3 cols...
short rowPins[4]; // ...and 4 rows
2017-01-25 15:59:19 -05:00
byte cmd61; //used to specify behaviour on command 0x61
2013-09-07 10:46:05 -04:00
boolean new_reader; //set to true in case new wave pass card reader behaviour is requested from game
2017-01-25 15:59:19 -05:00
Cipher crypt;
2013-09-07 10:46:05 -04:00
RfidModule* rfmodule;
2017-01-25 15:59:19 -05:00
2013-09-07 10:46:05 -04:00
};
#endif
2017-01-25 15:59:19 -05:00