*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
memcpy(rx, rxbuf+sizeof(*rxhdr), rc-sizeof(*rxhdr));
- return 0;
+ return rxhdr->cmd;
}
struct pegoda_handle *pegoda_open(void)
unsigned char rbuf[256];
unsigned int rlen = sizeof(rbuf);
struct pegoda_handle *ph;
+ int i;
ph = pegoda_open();
if (!ph)
pegoda_transceive(ph, PEGODA_CMD_PICC_CASC_SELECT,
buf, 5, rbuf, &rlen);
- pegoda_auth_key(ph, 0, "\xff\xff\xff\xff\xff\xff");
- pegoda_read16(ph, 0, rbuf);
- printf("read16 = %s\n", hexdump(rbuf, 16));
+ for (i = 0; i < 16; i++) {
+ int j;
+ pegoda_auth_key(ph, i, "\xff\xff\xff\xff\xff\xff");
+ for (j = 0; j < 4; j++) {
+ pegoda_read16(ph, (i*4)+j, rbuf);
+ printf("read16[%u:%u] = %s\n", i,j,hexdump(rbuf, 16));
+ }
+ }
exit(0);
}