« Return to Thread: Reading Mifare 1K

Re: Reading Mifare 1K

by josergc :: Rate this Message:

Reply to Author | View in Thread

Hi Gerald,

I forwarded your questions to BenQ and I got the answer. They say if you are trying to read a Mifare tag, it will throw an exception of read the manufacturer sector (first sector) because it cannot be read or write. This implementation don't read the fourth block of each sector and the first block of the first sector.

In this case, your code will look like

...

 // go thru all 3 block in each sector
                    for (int j = 0; j < 3; j++) {



if (k != 0 || j != 0) { // we don't read the fourth block of each sector and the first block of the first sector


                              input = new Vector();
                              // do the read
                            input.addElement(new Integer(2));
...

                              // print the ouptut of the reading
                              byte[] x = (byte[]) out.elementAt(0);
                              form.append("READ: #" + j + "Data: " + arrayToHex(x) + "\n");

} // if (k != 0 || j != 0)


                    }

...

Can you check if this works?

Greetings!

José

 « Return to Thread: Reading Mifare 1K