This is part from main.cpp, that might be helpful. It will wait for card to be attached and then calls for beep() function which you can define yourself
DeviceNFC device;
std::cerr << "[Info] NFC reader: " << device.get_name() << " opened.\n";
while (!device.pool_target()) {
std::cerr << "[Info] Searching card..." << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(1));
}
beep() // Here is your code
This is part from
main.cpp
, that might be helpful. It will wait for card to be attached and then calls forbeep()
function which you can define yourself