2013-09-07 10:46:05 -04:00
|
|
|
#ifndef RR10_H
|
|
|
|
|
#define RR10_H
|
|
|
|
|
|
|
|
|
|
#include "Arduino.h"
|
|
|
|
|
#include "RfidModule.h"
|
|
|
|
|
|
|
|
|
|
class RR10 : public RfidModule
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
RR10();
|
2013-09-26 13:15:22 -04:00
|
|
|
void setPins(int sensor, HardwareSerial* serialid);
|
2013-09-07 10:46:05 -04:00
|
|
|
void read();
|
2017-01-25 15:59:19 -05:00
|
|
|
void update();
|
2013-10-09 00:41:48 -04:00
|
|
|
byte isCardPresent();
|
2017-01-25 15:59:19 -05:00
|
|
|
void getUID(byte* uid);
|
2013-10-09 00:41:48 -04:00
|
|
|
private:
|
|
|
|
|
void sendCmd(byte* cmd);
|
|
|
|
|
boolean cmdUpdate();
|
2013-09-07 10:46:05 -04:00
|
|
|
|
|
|
|
|
private:
|
2013-10-09 00:41:48 -04:00
|
|
|
byte card; // 0 : no card 1:ISO15693 2:Felica
|
2013-09-07 10:46:05 -04:00
|
|
|
byte uid[8];
|
|
|
|
|
HardwareSerial* rfSerial; // rfid Serial
|
|
|
|
|
boolean pinset; // pin init done flag
|
|
|
|
|
boolean readcmd; // read request from host flag
|
2017-01-25 15:59:19 -05:00
|
|
|
|
2013-10-09 00:41:48 -04:00
|
|
|
boolean incmd; // command is being processed
|
|
|
|
|
byte command[256]; //command
|
|
|
|
|
byte comstatus; // 0 : idle, 1 : handshake sent , 2 : command sent , 3 : handshake sent back, waiting for answer
|
2017-01-25 15:59:19 -05:00
|
|
|
byte readstatus; // 0 : nothing read, 1 : ISO15693 read, reading Felica
|
2013-10-09 00:41:48 -04:00
|
|
|
unsigned long timesent;
|
|
|
|
|
byte rfidp[256]; // rfid response buffer
|
|
|
|
|
byte rf_i; //response buffer size
|
2013-09-07 10:46:05 -04:00
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|
2017-01-25 15:59:19 -05:00
|
|
|
|