Add HardwareRfid class implementation and integrate with main loop
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#include <MFRC522.h>
|
||||
#include <functional>
|
||||
#include "hardware.pb.h"
|
||||
|
||||
typedef std::function<void(const hardware_SensorToControlMessage&)> RfidCallback;
|
||||
|
||||
class HardwareRfid {
|
||||
public:
|
||||
HardwareRfid(uint8_t ssPin, uint8_t rstPin);
|
||||
void begin();
|
||||
void end();
|
||||
void update();
|
||||
void setCallback(RfidCallback cb);
|
||||
|
||||
private:
|
||||
MFRC522 _mfrc;
|
||||
RfidCallback _callback;
|
||||
};
|
||||
Reference in New Issue
Block a user