From e23137cf7ef51b0d8c3838087ddb598efbf8ae56 Mon Sep 17 00:00:00 2001 From: Eric Betts Date: Sun, 8 Mar 2026 16:41:54 -0700 Subject: [PATCH] Remove old requestPacs ref #31 --- sam_api.c | 37 +++---------------------------------- seader_i.h | 1 - 2 files changed, 3 insertions(+), 35 deletions(-) diff --git a/sam_api.c b/sam_api.c index edd37d0..a2b2afc 100644 --- a/sam_api.c +++ b/sam_api.c @@ -180,10 +180,8 @@ static void seader_sam_set_state( static SeaderSamIntent seader_sam_card_intent(const Seader* seader) { if(seader->credential->type == SeaderCredentialTypeConfig) { return SeaderSamIntentConfig; - } else if(seader->is_debug_enabled) { - return SeaderSamIntentReadPacs2; } else { - return SeaderSamIntentReadPacs; + return SeaderSamIntentReadPacs2; } } @@ -500,24 +498,6 @@ void seader_send_response( seader_send_payload(seader, &payload, from, to, replyTo); } -void seader_send_request_pacs(Seader* seader) { - RequestPacs_t requestPacs = {0}; - requestPacs.contentElementTag = ContentElementTag_implicitFormatPhysicalAccessBits; - - SamCommand_t samCommand = {0}; - samCommand.present = SamCommand_PR_requestPacs; - seader_sam_set_state( - seader, SeaderSamStateConversation, SeaderSamIntentReadPacs, samCommand.present); - samCommand.choice.requestPacs = requestPacs; - - Payload_t payload = {0}; - payload.present = Payload_PR_samCommand; - payload.choice.samCommand = samCommand; - - seader_send_payload( - seader, &payload, ExternalApplicationA, SAMInterface, ExternalApplicationA); -} - void seader_send_request_pacs2(Seader* seader) { OCTET_STRING_t oid = { .buf = (uint8_t*)seader_oid, @@ -884,15 +864,7 @@ bool seader_parse_sam_response(Seader* seader, SamResponse_t* samResponse) { switch(seader->sam_state) { case SeaderSamStateConversation: case SeaderSamStateFinishing: - if(seader->sam_intent == SeaderSamIntentReadPacs) { - FURI_LOG_I(TAG, "samResponse read PACS"); - if(seader_unpack_pacs(seader, samResponse->buf, samResponse->size)) { - view_dispatcher_send_custom_event( - seader->view_dispatcher, SeaderCustomEventPollerSuccess); - seader_sam_set_state( - seader, SeaderSamStateIdle, SeaderSamIntentNone, SamCommand_PR_NOTHING); - } - } else if(seader->sam_intent == SeaderSamIntentConfig) { + if(seader->sam_intent == SeaderSamIntentConfig) { FURI_LOG_I(TAG, "samResponse config"); seader_worker->stage = SeaderPollerEventTypeFail; seader_sam_set_state( @@ -919,8 +891,6 @@ bool seader_parse_sam_response(Seader* seader, SamResponse_t* samResponse) { seader_send_process_config_card(seader); } else if(seader->sam_intent == SeaderSamIntentReadPacs2) { seader_send_request_pacs2(seader); - } else if(seader->sam_intent == SeaderSamIntentReadPacs) { - seader_send_request_pacs(seader); } else { FURI_LOG_W(TAG, "Unexpected detect intent=%d", seader->sam_intent); seader_abort_active_read(seader); @@ -1377,8 +1347,7 @@ void seader_parse_nfc_off(Seader* seader) { seader_send_response(seader, &response, ExternalApplicationA, SAMInterface, 0); if(seader->sam_state == SeaderSamStateConversation && - (seader->sam_intent == SeaderSamIntentReadPacs || - seader->sam_intent == SeaderSamIntentReadPacs2 || + (seader->sam_intent == SeaderSamIntentReadPacs2 || seader->sam_intent == SeaderSamIntentConfig)) { seader_sam_set_state( seader, SeaderSamStateFinishing, seader->sam_intent, seader->samCommand); diff --git a/seader_i.h b/seader_i.h index de5f92b..535e8b6 100644 --- a/seader_i.h +++ b/seader_i.h @@ -110,7 +110,6 @@ typedef enum { typedef enum { SeaderSamIntentNone, - SeaderSamIntentReadPacs, SeaderSamIntentReadPacs2, SeaderSamIntentConfig, SeaderSamIntentMaintenance,