mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2025-02-20 23:38:32 +00:00
Now 4a listener invokes upper level callback on Halt and FieldOff
This commit is contained in:
parent
913a86bbec
commit
b0c4600115
2 changed files with 10 additions and 0 deletions
lib/nfc/protocols/iso14443_4a
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ typedef struct Iso14443_4aListener Iso14443_4aListener;
|
|||
|
||||
typedef enum {
|
||||
Iso14443_4aListenerEventTypeHalted,
|
||||
Iso14443_4aListenerEventTypeFieldOff,
|
||||
Iso14443_4aListenerEventTypeReceivedData,
|
||||
} Iso14443_4aListenerEventType;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue