This commit is contained in:
2017-06-28 20:40:01 +02:00
parent 76dd61f48b
commit 8d2b664149
41 changed files with 5225 additions and 0 deletions

31
kawaii/rfid_reader.hpp Normal file
View File

@@ -0,0 +1,31 @@
#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