aboutsummaryrefslogtreecommitdiffstats
path: root/cphidgetrfid.c
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2012-10-19 19:38:06 +0100
committerJonathan McCrohan <jmccrohan@gmail.com>2012-10-19 19:38:06 +0100
commit8f3c91e91b634adaca77dac6cf314445cceefc78 (patch)
tree8a779a28ccfbbfae413f6f7df21fb0a8650d3747 /cphidgetrfid.c
parentbd7a4f258643bf72d5e97f86f0f2272b381ed1ba (diff)
downloadlibphidget21-8f3c91e91b634adaca77dac6cf314445cceefc78.tar.gz
Imported Upstream version 2.1.8.20120912upstream/2.1.8.20120912
Diffstat (limited to 'cphidgetrfid.c')
-rw-r--r--cphidgetrfid.c22
1 files changed, 11 insertions, 11 deletions
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;