To use the node in your project you should have the cesars/rc522 library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.
C++ implementation
node {
CStringView _error = "❌";
CStringView _found = "✔️";
uint8_t version = 0xFF;
void evaluate(Context ctx) {
emitValue<output_522U0027>(ctx, getValue<input_522>(ctx));
if (!isInputDirty<input_INIT>(ctx))return;
auto rfid = getValue<input_522>(ctx);
version = rfid->getFirmwareVersion();
if ((version == 0xFF) || (version == 0xEE) || (version == 0x00)) {
emitValue<output_CHECK>(ctx, XString(&_error));
}else{
emitValue<output_CHECK>(ctx, XString(&_found));
emitValue<output_Firmw>(ctx, version);
}
emitValue<output_522U0027>(ctx, rfid);
}
}