Update of /cvsroot/playerstage/code/player/server/drivers/rfid
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7014/server/drivers/rfid

Modified Files:
        phidgetRFID.cc 
Log Message:
applied patch 1785176

Index: phidgetRFID.cc
===================================================================
RCS file: /cvsroot/playerstage/code/player/server/drivers/rfid/phidgetRFID.cc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** phidgetRFID.cc      18 Oct 2007 21:47:59 -0000      1.3
--- phidgetRFID.cc      18 Oct 2007 22:02:16 -0000      1.4
***************
*** 98,103 ****
  #include <errno.h>
  
! int TagPresent;  //This variable changes to 1 if a tag is in front of the 
reader.
  
  
  //This function returns the difference in mS between two timeval structures
--- 98,107 ----
  #include <errno.h>
  
! struct tagControlS {
!   int tagPresent;               //This variable changes to 1 if a tag is in 
front of the reader.
!   CPhidgetRFIDHandle rfid_present;
! };
  
+ struct tagControlS tagControl;
  
  //This function returns the difference in mS between two timeval structures
***************
*** 179,184 ****
      // Set the phidgetrfid pointer to NULL
      rfid=0;
!     TagPresent=0;
! 
      // Add more code here.
  
--- 183,187 ----
      // Set the phidgetrfid pointer to NULL
      rfid=0;
!     tagControl.tagPresent=0;
      // Add more code here.
  
***************
*** 335,339 ****
      tv_realtime_start = tv_framerate_start;
  
! 
      // The main loop; interact with the device here
      while (true)  {
--- 338,342 ----
      tv_realtime_start = tv_framerate_start;
  
!     int tagPresent=0;
      // The main loop; interact with the device here
      while (true)  {
***************
*** 366,373 ****
          unsigned char tag[20];
          CPhidgetRFID_getLastTag(rfid,tag);
-         //printf("Tag detected: %d\n", rfid->tagPresen);
          int ledstate;
          player_rfid_data_t data_rfid;
!         int tagPresent=TagPresent;
          if (tagPresent!=0) {
              //printf("Tag: %x %x %x %x %x %x\n",tag[0], tag[1], tag[2], 
tag[3], tag[4], tag[5]);
--- 369,377 ----
          unsigned char tag[20];
          CPhidgetRFID_getLastTag(rfid,tag);
          int ledstate;
          player_rfid_data_t data_rfid;
!         if (tagControl.rfid_present==rfid) {
!               tagPresent=tagControl.tagPresent;
!         }
          if (tagPresent!=0) {
              //printf("Tag: %x %x %x %x %x %x\n",tag[0], tag[1], tag[2], 
tag[3], tag[4], tag[5]);
***************
*** 438,447 ****
  //Handler functions to check if there is a new tag there. They are handlers 
as seen on the Phidget library.
  int TagLost(CPhidgetRFIDHandle rfid,void *dummy, unsigned char *usrchar) {
!     TagPresent=0;
      return (0);
  }
  
  int TagFound(CPhidgetRFIDHandle rfid,void *dummy, unsigned char *usrchar) {
!     TagPresent=1;
      return (0);
  }
--- 442,453 ----
  //Handler functions to check if there is a new tag there. They are handlers 
as seen on the Phidget library.
  int TagLost(CPhidgetRFIDHandle rfid,void *dummy, unsigned char *usrchar) {
!     tagControl.rfid_present=rfid;
!     tagControl.tagPresent=0;
      return (0);
  }
  
  int TagFound(CPhidgetRFIDHandle rfid,void *dummy, unsigned char *usrchar) {
!     tagControl.rfid_present=rfid;
!     tagControl.tagPresent=1;
      return (0);
  }


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to