Skip to content

Mifare Classic low level poller#3176

Closed
augustozanellato wants to merge 3 commits intoflipperdevices:devfrom
augustozanellato:mifare_classic_ll_poller
Closed

Mifare Classic low level poller#3176
augustozanellato wants to merge 3 commits intoflipperdevices:devfrom
augustozanellato:mifare_classic_ll_poller

Conversation

@augustozanellato
Copy link
Contributor

What's new

  • Low-level poller for mifare classic, allows for doing custom command chaining in user applications with a sync api.
  • Add support for nested auth in mifare classic poller

Verification

Not sure how to provide verification steps. I developed a small test app that I can either link here or add as part of unit tests, but for that I'll need some advice.

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@augustozanellato
Copy link
Contributor Author

A thing to be noted: calling mf_classic_poller_ll_free without having called mf_classic_poller_ll_halt before will result in an hang.
That is kinda intended, adding a field to the poller ctx to manage auto halt on free makes the code a lil bit uglier IMHO, and anyone touching something named "ll" as in "low level" should be careful about what/how they do stuff.

@skotopes skotopes added NFC NFC-related New Feature Contains an IMPLEMENTATION of a new feature labels Oct 31, 2023
@gornekich
Copy link
Member

Hello @augustozanellato !
I can see that you want to add an opportunity to turn on field, execute some MFC commands and turn off the field after that. Your solution is good, but I had an idea to expose mifare_classic_poller_async* API, so that user could start Iso14443-3a poller and write custom state machine.

Let's think together on improving the API. It would be helpful to see the application you mentioned which works with your changes

@augustozanellato
Copy link
Contributor Author

I can see that you want to add an opportunity to turn on field, execute some MFC commands and turn off the field after that.

Yeah, that’s the idea.

I had an idea to expose mifare_classic_poller_async* API, so that user could start Iso14443-3a poller and write custom state machine.

That would also work, in that case I’ll probably close this PR and make another with just the first commit taken from this one in order to allow for nested auth.

It would be helpful to see the application you mentioned which works with your changes

It’s doesn’t do much, it was made just to test if the api was working correctly, especially nested auth, I’ll share it tomorrow.

@augustozanellato augustozanellato force-pushed the mifare_classic_ll_poller branch from 26d6d2f to 6251404 Compare November 1, 2023 14:35
@augustozanellato
Copy link
Contributor Author

@gornekich here's the test app I used to verify that the api was working correctly: https://github.com/augustozanellato/flipper_mfc_ll_test

I also merged in the latest dev changes and removed a leftover debug print statement.

@gornekich
Copy link
Member

Hello @augustozanellato . Thanks for sending test app. I need some time to think about better API and come back a littler bit later.

@augustozanellato
Copy link
Contributor Author

augustozanellato commented Nov 2, 2023

I need some time to think about better API and come back a littler bit later.

No problem with that! In case you’d ever need an opinion from the perspective of an api consumer feel free to hit me up, here or on discord.

@gornekich
Copy link
Member

Hello @augustozanellato !
Just finished working on #3214 . I introduced nfc_poller_start_ex() API, which can be used to start MfClassic poller and process Iso14443_3a events. Also many internal pollers functions were exposed.

I believe that these changes make writing custom pollers for all protocols much easier. I would be glad if you have a look on my PR and let me know if it solves your issues.

From this PR I really want nested authentication implementation. However I would prefer to have separate mf_classic_auth_nested() function rather than add extra parameter in mf_classi_auth() function

@augustozanellato
Copy link
Contributor Author

Hello @augustozanellato ! Just finished working on #3214 . I introduced nfc_poller_start_ex() API, which can be used to start MfClassic poller and process Iso14443_3a events. Also many internal pollers functions were exposed.

I believe that these changes make writing custom pollers for all protocols much easier. I would be glad if you have a look on my PR and let me know if it solves your issues.

Sorry for the delay, it has been a busy week. I’ll probably be able to provide you with feedback early next week, probably on Monday.

From this PR I really want nested authentication implementation. However I would prefer to have separate mf_classic_auth_nested() function rather than add extra parameter in mf_classi_auth() function

Sure, I’ll close this PR and make another one against updated dev branch next week, probably also on Monday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Feature Contains an IMPLEMENTATION of a new feature NFC NFC-related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants