Skip to content
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

add: split PacketResponseNG status into status and reason #2537

Merged
merged 3 commits into from
Oct 4, 2024

Conversation

douniwan5788
Copy link
Contributor

No description provided.

@iceman1001
Copy link
Collaborator

Not sure about this one.
In which way do we need both status and reason that one field don't express today?

@douniwan5788
Copy link
Contributor Author

Not sure about this one. In which way do we need both status and reason that one field don't express today?

The status is a too general error code, it doesn't cover command-specific details. I can see that almost every card type is using something like isok to return another error code. We can unify this to reason.

@iceman1001
Copy link
Collaborator

Ok, if we don't handle this fine grained status / reasons on the client side then this exercise is pointless.

Second concern I have is how this change influences going from older firmware to newer and back again.
This has to be proven to work smooth and without hiccups

@douniwan5788
Copy link
Contributor Author

douniwan5788 commented Sep 24, 2024

Ok, if we don't handle this fine grained status / reasons on the client side then this exercise is pointless.

Second concern I have is how this change influences going from older firmware to newer and back again. This has to be proven to work smooth and without hiccups

The original interface reply_ng and reply_mix initialize the reason to -1, and we don't have any PM3_xx code lower than -128. So, the final packet data is exactly the same when not using a reason.

old firmware -> new client
reason will be -1 and it should be interpreted as a 'generic/unknown reason'.

new firmware -> old client
cmds not reply reason : final packet data is exactly the same when not using a reason.
cmds do reply reason : most client code checks status == PM3_SUCCESS, so error statuses should be handled as an unknown error code.

@douniwan5788 douniwan5788 changed the title add: split PacketResponseNG status to status and reason add: split PacketResponseNG status into status and reason Sep 24, 2024
Signed-off-by: Iceman <iceman@iuse.se>
Signed-off-by: Iceman <iceman@iuse.se>
@iceman1001 iceman1001 merged commit b2e4daf into RfidResearchGroup:master Oct 4, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants