Skip to content

Commit

Permalink
nfc: Rename enum member to align with existing convention
Browse files Browse the repository at this point in the history
  • Loading branch information
GMMan committed Aug 8, 2022
1 parent b025258 commit a1af295
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion applications/nfc/scenes/nfc_scene_mf_ultralight_emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ bool nfc_mf_ultralight_emulate_worker_callback(NfcWorkerEvent event, void* conte

if(event == NfcWorkerEventSuccess)
state |= NfcSceneMfUltralightEmulateStateDataChanged;
else if(event == NfcWorkerEventPwdAuth) {
else if(event == NfcWorkerEventMfUltralightPwdAuth) {
// Don't update if we're exiting
if(nfc_worker_get_state(nfc->worker) != NfcWorkerStateStop) {
// Event data is only available for the duration of this callback, so we're updating the
Expand Down
2 changes: 1 addition & 1 deletion lib/nfc/nfc_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ void nfc_worker_emulate_mf_ultralight(NfcWorker* nfc_worker) {
if(emulator.auth_attempted) {
nfc_worker->event_data = &emulator.auth_attempt;
if(nfc_worker->callback) {
nfc_worker->callback(NfcWorkerEventPwdAuth, nfc_worker->context);
nfc_worker->callback(NfcWorkerEventMfUltralightPwdAuth, nfc_worker->context);
}
emulator.auth_attempted = false;
nfc_worker->event_data = NULL;
Expand Down
4 changes: 2 additions & 2 deletions lib/nfc/nfc_worker.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ typedef enum {
NfcWorkerEventFoundKeyB,

// Mifare Ultralight/NTAG events
NfcWorkerEventMfUltralightPassKey,
NfcWorkerEventPwdAuth,
NfcWorkerEventMfUltralightPassKey, // NFC worker requesting manual key
NfcWorkerEventMfUltralightPwdAuth, // Reader sent auth command
} NfcWorkerEvent;

typedef bool (*NfcWorkerCallback)(NfcWorkerEvent event, void* context);
Expand Down
2 changes: 1 addition & 1 deletion lib/nfc/protocols/mifare_ultralight.c
Original file line number Diff line number Diff line change
Expand Up @@ -1758,7 +1758,7 @@ bool mf_ul_prepare_emulation_response(
&buff_rx[1],
sizeof(emulator->auth_attempt.pwd.raw));
emulator->auth_attempted = true;

uint16_t scaled_authlim = mf_ultralight_calc_auth_count(&emulator->data);
if(scaled_authlim != 0 && emulator->data.curr_authlim >= scaled_authlim) {
if(emulator->data.curr_authlim != UINT16_MAX) {
Expand Down

0 comments on commit a1af295

Please sign in to comment.