Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 (libs): Pass tag_detected_callback static #981

Merged
merged 2 commits into from
Aug 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libs/RFIDKit/include/ISO14443A.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ constexpr Command<2> command_read_register_4 = {.data = {0x30, 0x04},
.flags = leka::rfid::Flag::crc | leka::rfid::Flag::sb_8};

constexpr auto ATQA_answer_size = 2;
constexpr auto initial_polynomial_value = uint16_t {0x6363};
constexpr auto initial_polynomial_value = uint32_t {0x6363};
constexpr auto register_answer_size = size_t {18};
constexpr auto expected_ATQA_answer = std::array<uint8_t, ATQA_answer_size> {0x44, 0x00};

Expand Down Expand Up @@ -87,7 +87,7 @@ inline auto atqaReceived(interface::RFIDReader &rfidreader) -> bool

inline auto registerReceived(interface::RFIDReader &rfidreader) -> bool
{
if (!rfidreader.didTagCommunicationSucceed(ATQA_answer_size)) {
if (!rfidreader.didTagCommunicationSucceed(register_answer_size)) {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion libs/RFIDKit/source/RFIDKit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void RFIDKit::init()
{
using namespace rfid::sm;

auto tag_detected_callback = [this]() { state_machine.process_event(event::tag_response_available {}); };
static auto tag_detected_callback = [this]() { state_machine.process_event(event::tag_response_available {}); };

_rfid_reader.registerOnTagDetectedCallback(tag_detected_callback);
registerMagicCard();
Expand Down