mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-26 03:39:58 -07:00
plugins & badusb
if author want their plugin to be removed - create issue, thanks
This commit is contained in:
38
applications/hid_analyzer/helpers/hid_worker.cpp
Normal file
38
applications/hid_analyzer/helpers/hid_worker.cpp
Normal file
@@ -0,0 +1,38 @@
|
||||
#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();
|
||||
}
|
||||
Reference in New Issue
Block a user