unleashed-firmware/applications/lfrfid/helpers/rfid-key.cpp
SG 22e1ecb642
New LF-RFID app (#534)
* Hal lfrfid: add read timer pulse and period config fns
* New debug application for lfrfid subsystem
* New lfrfid: app, fix naming
* App lfrfid: assets
* Container view module
* App ibutton: remove unused header
* App lfrfid scenes
* App notification, add yield to blocking operations, add speaker volume control
* App lfrfid: reading key scene
* Assets: placeholder icon
* App lfrfid: reworked container view module
* App lfrfid: new scenes
* App lfrfid: write scene
* App lfrfid: write hid
* App lfrfid: emulate scene
* App lfrfid: save name scene
* App lfrfid: add missing file
2021-06-28 17:42:30 +03:00

45 lines
809 B
C++

#include "rfid-key.h"
#include <furi/check.h>
RfidKey::RfidKey() {
data.fill(0);
for(uint8_t i = 0; i < (LFRFID_KEY_NAME_SIZE + 1); i++) {
name[i] = 0;
}
}
RfidKey::~RfidKey() {
}
void RfidKey::set_type(LfrfidKeyType _type) {
type = _type;
}
void RfidKey::set_data(uint8_t* _data, const uint8_t _data_size) {
furi_assert(_data_size <= data.size());
for(uint8_t i = 0; i < _data_size; i++) {
data[i] = _data[i];
}
}
LfrfidKeyType RfidKey::get_type() {
return type;
}
uint8_t* RfidKey::get_data() {
return &data[0];
}
const char* RfidKey::get_type_text() {
return lfrfid_key_get_type_string(type);
}
const uint8_t RfidKey::get_type_data_count() {
return lfrfid_key_get_type_data_count(type);
}
char* RfidKey::get_name() {
return name;
}