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

Possible get card code reverse with command #57

Open
hinkma opened this issue Jan 5, 2022 · 2 comments
Open

Possible get card code reverse with command #57

hinkma opened this issue Jan 5, 2022 · 2 comments

Comments

@hinkma
Copy link

hinkma commented Jan 5, 2022

Have possible give somehow direct card code reverse example 9B3FAA, AA3F9B?
Need new part to software? Example wg.getCode (), HEX / wg.getCodeinv (), HEX
Some reader give data reverse.

@jpliew
Copy link
Collaborator

jpliew commented Jan 20, 2022

Hey @hinkma

There are C routines that does the reversal of bits, some pointers here https://www.google.com/search?client=firefox-b-d&q=c+programming+reverse+bit+order

@mrNo0b
Copy link

mrNo0b commented Nov 16, 2022

I have the same problem...
Why it reads in reverse in the first place? what might cause this issue?
btw I also got 3 pairs of hex chars at first but when used NFC Tools on android to read the same tag I had 4 pairs, I have WG26/34 wire (gray) on my RFID reader so I connected it to ground and now I get full 4 pairs hex (only in reverse...)
I also tried to flip the D0,D1 wires and got completely different code.

Is it possible to add bool parameter to void WIEGAND::begin(int pinD0, int pinD1) that will reverse card code?

Is it possible to read data from tag?

And I think it would be good to turn on discussions for this repository.

Edit:
Found this https://www.geeksforgeeks.org/reverse-bytes-of-a-hexadecimal-number and added the macro to my code
#define REV(n) ((n << 24) | (((n>>16)<<24)>>16) | (((n<<16)>>24)<<16) | (n>>24))
seems to work right, it reads the same code as NFC Tools.

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

No branches or pull requests

3 participants