Skip to content

Commit

Permalink
fix(nfc): Error code variable is incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
amanCypherock committed Oct 23, 2023
1 parent b28a044 commit f7504a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/manager_app/card_training.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,14 @@ void manager_card_training(manager_query_t *query) {

instruction_scr_init(UI_TEXT_TAP_CARD_TO_TEST, NULL);

check_pairing_result_t pair_result = {false, 0, {0}};
check_pairing_result_t pair_result = {false, 0, {0}, 0};
manager_train_card_response_t result = MANAGER_TRAIN_CARD_RESPONSE_INIT_ZERO;
result.which_response = MANAGER_TRAIN_CARD_RESPONSE_RESULT_TAG;
card_error_type_e status = card_check_pairing(&pair_result);
if (CARD_OPERATION_SUCCESS != status) {
LOG_SWV("%s (%d)\n", __func__, __LINE__);
manager_send_error(ERROR_COMMON_ERROR_CARD_ERROR_TAG,
get_card_error_from_nfc_status(status));
get_card_error_from_nfc_status(pair_result.error_code));
return;
}
result.result.card_paired = pair_result.is_paired;
Expand Down
3 changes: 3 additions & 0 deletions src/card_operations/check_pairing.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,8 @@ card_error_type_e card_check_pairing(check_pairing_result_t *result) {
result->is_paired = true;
}
}

result->error_code = operation_data.nfc_data.status;

return status;
}
1 change: 1 addition & 0 deletions src/card_operations/check_pairing.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ typedef struct check_pairing_result {
bool is_paired;
uint8_t card_number;
uint8_t family_id[FAMILY_ID_SIZE];
uint32_t error_code;
} check_pairing_result_t;

/*****************************************************************************
Expand Down

0 comments on commit f7504a0

Please sign in to comment.