Now 4a listener invokes upper level callback on Halt and FieldOff

This commit is contained in:
RebornedBrain 2024-08-27 17:46:49 +03:00
parent 913a86bbec
commit b0c4600115
2 changed files with 10 additions and 0 deletions

View file

@ -84,6 +84,15 @@ static NfcCommand iso14443_4a_listener_run(NfcGenericEvent event, void* context)
iso14443_3a_event->type == Iso14443_3aListenerEventTypeHalted ||
iso14443_3a_event->type == Iso14443_3aListenerEventTypeFieldOff) {
instance->state = Iso14443_4aListenerStateIdle;
instance->iso14443_4a_event.type = iso14443_3a_event->type ==
Iso14443_3aListenerEventTypeHalted ?
Iso14443_4aListenerEventTypeHalted :
Iso14443_4aListenerEventTypeFieldOff;
if(instance->callback) {
command = instance->callback(instance->generic_event, instance->context);
}
command = NfcCommandContinue;
}

View file

@ -12,6 +12,7 @@ typedef struct Iso14443_4aListener Iso14443_4aListener;
typedef enum {
Iso14443_4aListenerEventTypeHalted,
Iso14443_4aListenerEventTypeFieldOff,
Iso14443_4aListenerEventTypeReceivedData,
} Iso14443_4aListenerEventType;