*
* 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
*/
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
-
-// #define DEBUG_LIBRFID
+#ifdef __MINGW32__
+#include <windows.h>
+#endif/*__MINGW32__*/
#include <librfid/rfid.h>
#include <librfid/rfid_layer2.h>
unsigned char cmd,
struct iso14443a_atqa *atqa)
{
- struct rfid_reader *rdr = handle->rh->reader;
+ const struct rfid_reader *rdr = handle->rh->reader;
return rdr->iso14443a.transceive_sf(handle->rh, cmd, atqa);
}
struct iso14443a_anticol_cmd *acf,
unsigned int *bit_of_col)
{
- struct rfid_reader *rdr = handle->rh->reader;
+ const struct rfid_reader *rdr = handle->rh->reader;
return rdr->iso14443a.transceive_acf(handle->rh, acf, bit_of_col);
}
const void *optval, unsigned int optlen)
{
int ret = -EINVAL;
- struct rfid_reader *rdr = handle->rh->reader;
+ const struct rfid_reader *rdr = handle->rh->reader;
unsigned int speed;
switch (optname) {
memset(h, 0, sizeof(*h));
+#ifdef __MINGW32__
+ randctx[0] ^= GetTickCount();
+#endif/*__MINGW32__*/
+ for(ret=0;ret<23;ret++)
+ random_bit();
+
h->l2 = &rfid_layer2_iso14443a;
h->rh = rh;
h->priv.iso14443a.state = ISO14443A_STATE_NONE;