[player] Update for new phidget RFID API

rmattes rmattes at fedoraproject.org
Sat Jan 26 20:15:24 UTC 2013


commit 5fe198a435593d5683ffce3cc92f6b6cc7c7e951
Author: Rich Mattes <richmattes at gmail.com>
Date:   Sat Jan 26 15:15:15 2013 -0500

    Update for new phidget RFID API

 player-3.0.2.phidgetrfid.patch |   61 ++++++++++++++++++++++++++++++++++++++++
 player.spec                    |   11 +++++--
 2 files changed, 69 insertions(+), 3 deletions(-)
---
diff --git a/player-3.0.2.phidgetrfid.patch b/player-3.0.2.phidgetrfid.patch
new file mode 100644
index 0000000..4b61041
--- /dev/null
+++ b/player-3.0.2.phidgetrfid.patch
@@ -0,0 +1,61 @@
+diff -up ./server/drivers/rfid/phidgetRFID.cc.phidgetrfid ./server/drivers/rfid/phidgetRFID.cc
+--- ./server/drivers/rfid/phidgetRFID.cc.phidgetrfid	2013-01-26 12:56:48.934013187 -0500
++++ ./server/drivers/rfid/phidgetRFID.cc	2013-01-26 13:32:31.206068369 -0500
+@@ -109,8 +109,8 @@ inline float timediffms(struct timeval s
+     return(end.tv_sec*1000.0 + end.tv_usec/1000.0 - (start.tv_sec*1000.0 + start.tv_usec/1000.0));
+ }
+ 
+-int TagLost(CPhidgetRFIDHandle rfid,void *hola, unsigned char *usrchar);
+-int TagFound(CPhidgetRFIDHandle rfid,void *hola, unsigned char *usrchar);
++int TagLost(CPhidgetRFIDHandle rfid, void *hola, char *usrchar, CPhidgetRFID_Protocol protocol);
++int TagFound(CPhidgetRFIDHandle rfid, void *hola, char *usrchar,  CPhidgetRFID_Protocol protocol);
+ 
+ 
+ 
+@@ -220,8 +220,8 @@ int Phidgetrfid::MainSetup() {
+         PLAYER_MSG0(1,"Connection granted to the PhidgetRFID Reader.");
+     }
+ 
+-    CPhidgetRFID_set_OnTagLost_Handler(rfid,TagLost,NULL);
+-    CPhidgetRFID_set_OnTag_Handler(rfid,TagFound,NULL);
++    CPhidgetRFID_set_OnTagLost2_Handler(rfid,TagLost,NULL);
++    CPhidgetRFID_set_OnTag2_Handler(rfid,TagFound,NULL);
+     //Turning on the Antena.
+     CPhidgetRFID_setAntennaOn(rfid,1);
+     CPhidgetRFID_setLEDOn(rfid,1);
+@@ -361,8 +361,9 @@ void Phidgetrfid::Main() {
+ 
+ 
+ 
+-        unsigned char tag[20];
+-        CPhidgetRFID_getLastTag(rfid,tag);
++        char* tag = new char [20];
++        CPhidgetRFID_Protocol proto = PHIDGET_RFID_PROTOCOL_PHIDGETS;
++        CPhidgetRFID_getLastTag2(rfid,&tag,&proto);
+         int ledstate;
+         player_rfid_data_t data_rfid;
+         data_rfid.tags = new player_rfid_tag_t[1];
+@@ -397,6 +398,7 @@ void Phidgetrfid::Main() {
+             }
+             CPhidgetRFID_setLEDOn(rfid,0);
+         }
++        delete [] tag;
+ 
+ 
+         //Publishing data.
+@@ -439,13 +441,13 @@ void Phidgetrfid::Main() {
+ }
+ 
+ //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) {
++int TagLost(CPhidgetRFIDHandle rfid, void *dummy, char *usrchar, CPhidgetRFID_Protocol protocol) {
+     tagControl.rfid_present=rfid;
+     tagControl.tagPresent=0;
+     return (0);
+ }
+ 
+-int TagFound(CPhidgetRFIDHandle rfid,void *dummy, unsigned char *usrchar) {
++int TagFound(CPhidgetRFIDHandle rfid, void *dummy, char *usrchar, CPhidgetRFID_Protocol protocol) {
+     tagControl.rfid_present=rfid;
+     tagControl.tagPresent=1;
+     return (0);
diff --git a/player.spec b/player.spec
index 5110061..07a0a6a 100644
--- a/player.spec
+++ b/player.spec
@@ -21,6 +21,7 @@ Patch6:         %{name}-3.0.2.boostutc.patch
 Patch7:         %{name}-3.0.2.gzfile.patch
 Patch8:         %{name}-3.0.2.gbx10.patch
 Patch9:         %{name}-3.0.2.boost150.patch
+Patch10:        %{name}-3.0.2.phidgetrfid.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 # Sort order: build tools, feature libs, within alphabetically, group related
@@ -141,6 +142,7 @@ are experimental.
 %patch7 -p0
 %patch8 -p2 -b .gbx10
 %patch9 -p2 -b .boost150
+%patch10 -p0 -b .phidgetrfid
 find . -name '*.c' -exec chmod -x {} \;
 find . -name '*.cc' -exec chmod -x {} \;
 find . -name '*.cpp' -exec chmod -x {} \;
@@ -223,6 +225,9 @@ rm -rf $RPM_BUILD_ROOT
 %{ruby_vendorarchdir}/*.so
 
 %changelog
+* Sat Jan 26 2013 Rich Mattes <richmattes at gmain.com> - 3.0.2-24
+- Update for new phidget RFID API
+
 * Fri Jan 25 2013 Devrim GÜNDÜZ <devrim at gunduz.org> - 3.0.2-24
 - Rebuild against geos 3.3.7.
 
@@ -309,7 +314,7 @@ rm -rf $RPM_BUILD_ROOT
 - Remove more supurious BuildRequires
 - Add BuildRequires to enable more features
 
-* Sun Jun 26 2010 Rich Mattes <richmattes at gmail.com> - 3.0.1-7
+* Sat Jun 26 2010 Rich Mattes <richmattes at gmail.com> - 3.0.1-7
 - Rebuild for OpenCV soname change
 - Remove unnecessary BuildRequires
 
@@ -320,7 +325,7 @@ rm -rf $RPM_BUILD_ROOT
 - Rebuild for Gearbox drivers
 - Added missing Requires for devel package
 
-* Sun Mar 01 2010 Tim Niemueller <tim at niemueller.de> - 3.0.1-4
+* Mon Mar 01 2010 Tim Niemueller <tim at niemueller.de> - 3.0.1-4
 - Bump EVR for proper F-12 to F-13 upgrade path
 
 * Fri Jan 22 2010 Rahul Sundaram <sundaram at fedoraproject.org> - 3.0.1-2
@@ -383,7 +388,7 @@ rm -rf $RPM_BUILD_ROOT
 - Added libtool BR
 - Added autotools BR, needed because for patches of .am files
 
-* Mon Aug 08 2008 Jef Spaleta <jspaleta at fedoraproject dot org> - 2.1.1-3
+* Fri Aug 08 2008 Jef Spaleta <jspaleta at fedoraproject dot org> - 2.1.1-3
 - Review clean-ups
 
 * Tue Aug 05 2008 Tim Niemueller <tim at niemueller.de> - 2.1.1-2


More information about the scm-commits mailing list