From 8f3c91e91b634adaca77dac6cf314445cceefc78 Mon Sep 17 00:00:00 2001 From: Jonathan McCrohan Date: Fri, 19 Oct 2012 19:38:06 +0100 Subject: Imported Upstream version 2.1.8.20120912 --- cphidgetrfid.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'cphidgetrfid.c') diff --git a/cphidgetrfid.c b/cphidgetrfid.c index 04e0358..718653d 100644 --- a/cphidgetrfid.c +++ b/cphidgetrfid.c @@ -363,7 +363,7 @@ CPHIDGETDATA(RFID) { int dataLength = 0; int data[RFID_MAX_DATA_PER_PACKET]; - switch(buffer[0] & 0x80) + switch(buffer[0] & 0x40) { case RFID_READ_DATA_IN_PACKET: gotData = PTRUE; @@ -924,8 +924,8 @@ static int HitagS_WRITE(CPhidgetRFIDHandle phid, int page, unsigned char *data, phid->manLockedIn = 1; phid->manReadPtr = phid->manWritePtr; - //Send a Hitag S AC Sequence Command - res = CPhidgetRFID_writeRaw(phid, buf, 20, 9, 9, 9, 13, 19); + //Send a Hitag S Command + res = CPhidgetRFID_writeRaw(phid, buf, 20, 7, 7, 7, 13, 21); //Don't send it again for at least 100ms setTimeNow(&phid->hitagReqTime); @@ -962,8 +962,8 @@ static int HitagS_READ(CPhidgetRFIDHandle phid, int page, unsigned char blockRea phid->manLockedIn = 1; phid->manReadPtr = phid->manWritePtr; - //Send a Hitag S AC Sequence Command - res = CPhidgetRFID_writeRaw(phid, buf, 20, 9, 9, 9, 13, 19); + //Send a Hitag S Command + res = CPhidgetRFID_writeRaw(phid, buf, 20, 7, 7, 7, 13, 21); //Don't send it again for at least 100ms setTimeNow(&phid->hitagReqTime); @@ -1006,7 +1006,7 @@ static int HitagS_SELECT(CPhidgetRFIDHandle phid, unsigned char *UID) phid->manReadPtr = phid->manWritePtr; //Send a Hitag S AC Sequence Command - res = CPhidgetRFID_writeRaw(phid, buf, k, 9, 9, 9, 13, 19); + res = CPhidgetRFID_writeRaw(phid, buf, k, 7, 7, 7, 13, 21); //Don't send it again for at least 100ms setTimeNow(&phid->hitagReqTime); @@ -1033,7 +1033,7 @@ static int HitagS_UID_REQUEST(CPhidgetRFIDHandle phid) phid->hitagACList = NULL; resetHitagACBuffer(phid); - res = CPhidgetRFID_writeRaw(phid, buf, 5, 9, 9, 9, 13, 19); + res = CPhidgetRFID_writeRaw(phid, buf, 5, 7, 7, 7, 13, 21); //Don't send it again for at least 100ms setTimeNow(&phid->hitagReqTime); @@ -1070,7 +1070,7 @@ static int HitagS_AC_SEQUENCE(CPhidgetRFIDHandle phid, CPhidgetRFID_HitagACHandl phid->hitagState = RFID_HITAG_STATE_AC_SEQUENCE; resetHitagACBuffer(phid); - res = CPhidgetRFID_writeRaw(phid, buf, k, 9, 9, 9, 13, 19); + res = CPhidgetRFID_writeRaw(phid, buf, k, 7, 7, 7, 13, 21); //Don't send it again for at least 100ms setTimeNow(&phid->hitagReqTime); @@ -2331,8 +2331,8 @@ CSET(RFID,AntennaOn,int) phid->antennaState = newVal; if(newVal) { - phid->_4097Conf = RFID_4097_AmpDemod | RFID_4097_Active | RFID_4097_DataOut | RFID_4097_IntPLL | RFID_4097_FastStart | RFID_4097_Gain960; - //phid->_4097Conf = RFID_4097_AmpDemod | RFID_4097_Active | RFID_4097_DataOut | RFID_4097_IntPLL | RFID_4097_FastStart | RFID_4097_Gain120; + //phid->_4097Conf = RFID_4097_AmpDemod | RFID_4097_Active | RFID_4097_DataOut | RFID_4097_IntPLL | RFID_4097_FastStart | RFID_4097_Gain960; + phid->_4097Conf = RFID_4097_AmpDemod | RFID_4097_Active | RFID_4097_DataOut | RFID_4097_IntPLL | RFID_4097_FastStart | RFID_4097_Gain120; } else { @@ -2642,7 +2642,7 @@ PHIDGET21_API int CCONV CPhidgetRFID_read(CPhidgetRFIDHandle phid, char *tagStri { HitagS_READ(phid, i, PTRUE); - wait_return = CThread_wait_on_event(&phid->respEvent, 500); + wait_return = CThread_wait_on_event(&phid->respEvent, 1000); switch (wait_return) { case WAIT_TIMEOUT: return EPHIDGET_TIMEOUT; -- cgit v1.2.3