-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MFC SE #17
Merged
MFC SE #17
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8faf1a8
14a error handling
bettse 30f4556
Revert "double size of rx buffer"
bettse 460ace1
MFC support
bettse ce15b26
reduce stack size
bettse 60440dd
gets a couple messages in
bettse be81164
gets response for encrypted MFC
bettse 3f83d81
returns at message
bettse 70548ac
reads MFC SE
bettse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#include "../seader_i.h" | ||
#include <dolphin/dolphin.h> | ||
|
||
#define TAG "SceneReadNfc" | ||
|
||
void seader_scene_read_mfc_on_enter(void* context) { | ||
Seader* seader = context; | ||
dolphin_deed(DolphinDeedNfcRead); | ||
|
||
// Setup view | ||
Popup* popup = seader->popup; | ||
popup_set_header(popup, "Detecting\nMFC\ncard", 68, 30, AlignLeft, AlignTop); | ||
popup_set_icon(popup, 0, 3, &I_RFIDDolphinReceive_97x61); | ||
|
||
// Start worker | ||
view_dispatcher_switch_to_view(seader->view_dispatcher, SeaderViewPopup); | ||
|
||
seader->poller = nfc_poller_alloc(seader->nfc, NfcProtocolMfClassic); | ||
|
||
seader->worker->stage = SeaderPollerEventTypeCardDetect; | ||
seader_credential_clear(seader->credential); | ||
seader->credential->type = SeaderCredentialTypeMifareClassic; | ||
|
||
FURI_LOG_W(TAG, "Start poller"); | ||
nfc_poller_start(seader->poller, seader_worker_poller_callback_mfc, seader); | ||
|
||
seader_blink_start(seader); | ||
} | ||
|
||
bool seader_scene_read_mfc_on_event(void* context, SceneManagerEvent event) { | ||
Seader* seader = context; | ||
bool consumed = false; | ||
|
||
if(event.type == SceneManagerEventTypeCustom) { | ||
if(event.event == SeaderCustomEventWorkerExit) { | ||
seader->credential->type = SeaderCredentialTypeMifareClassic; | ||
scene_manager_next_scene(seader->scene_manager, SeaderSceneReadCardSuccess); | ||
consumed = true; | ||
} else if(event.event == SeaderCustomEventPollerSuccess) { | ||
seader->credential->type = SeaderCredentialTypeMifareClassic; | ||
scene_manager_next_scene(seader->scene_manager, SeaderSceneReadCardSuccess); | ||
consumed = true; | ||
} | ||
} else if(event.type == SceneManagerEventTypeBack) { | ||
scene_manager_search_and_switch_to_previous_scene( | ||
seader->scene_manager, SeaderSceneSamPresent); | ||
consumed = true; | ||
} | ||
|
||
return consumed; | ||
} | ||
|
||
void seader_scene_read_mfc_on_exit(void* context) { | ||
Seader* seader = context; | ||
|
||
if(seader->poller) { | ||
nfc_poller_stop(seader->poller); | ||
nfc_poller_free(seader->poller); | ||
} | ||
|
||
// Clear view | ||
popup_reset(seader->popup); | ||
|
||
seader_blink_stop(seader); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was getting out of memory problems. I'm starting to think the threads inside the app that alloc memory are doing so on the heap, or at least separate from this.