#ifndef RFIDREADER_HPP_
#define RFIDREADER_HPP_

#include <cstdint>
#include <thread>
#include <chrono>
#include <atomic>

#include "measure.hpp"
#include "MFRC522.h"

class rfid_reader
{
public:
	uint32_t last_id() const;
	rfid_reader();
	rfid_reader(const rfid_reader &) = delete;
	rfid_reader(const rfid_reader &&) = delete;
	~rfid_reader();
	void loop();
private:
	MFRC522 mfrc;
	std::atomic<uint32_t> uid;
	std::thread thread;
	bool stop_thread;
	measure measurement;
};



#endif
