mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-24 05:23:06 +00:00
f4cc9e5de7
if author want their plugin to be removed - create issue, thanks
38 lines
616 B
C++
38 lines
616 B
C++
#include "hid_worker.h"
|
|
|
|
HIDWorker::HIDWorker() {
|
|
}
|
|
|
|
HIDWorker::~HIDWorker() {
|
|
}
|
|
|
|
void HIDWorker::start_read() {
|
|
reader.start();
|
|
}
|
|
|
|
bool HIDWorker::read() {
|
|
static const uint8_t data_size = LFRFID_KEY_SIZE;
|
|
uint8_t data[data_size] = {0};
|
|
LfrfidKeyType type;
|
|
|
|
bool result = reader.read(&type, data, data_size);
|
|
|
|
if(result) {
|
|
key.set_type(type);
|
|
key.set_data(data, data_size);
|
|
};
|
|
|
|
return result;
|
|
}
|
|
|
|
bool HIDWorker::detect() {
|
|
return reader.detect();
|
|
}
|
|
|
|
bool HIDWorker::any_read() {
|
|
return reader.any_read();
|
|
}
|
|
|
|
void HIDWorker::stop_read() {
|
|
reader.stop();
|
|
}
|