projects
/
librfid
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* add missing header files to distributed tarball
[librfid]
/
src
/
rfid_proto_mifare_ul.c
diff --git
a/src/rfid_proto_mifare_ul.c
b/src/rfid_proto_mifare_ul.c
index
7243c89
..
d90ac63
100644
(file)
--- a/
src/rfid_proto_mifare_ul.c
+++ b/
src/rfid_proto_mifare_ul.c
@@
-17,7
+17,7
@@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
*
* 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., 5
9 Temple Place, Suite 330, Boston, MA 02111-1307
USA
+ * Foundation, Inc., 5
1 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
USA
*/
#include <stdio.h>
#include <stdlib.h>
*/
#include <stdio.h>
#include <stdlib.h>
@@
-99,27
+99,18
@@
mful_write(struct rfid_protocol_handle *ph, unsigned int page,
return ret;
}
return ret;
}
-static int
-mful_transceive(struct rfid_protocol_handle *ph,
- const unsigned char *tx_data, unsigned int tx_len,
- unsigned char *rx_data, unsigned int *rx_len,
- unsigned int timeout, unsigned int flags)
-{
- return -EINVAL;
-}
-
static int
mful_getopt(struct rfid_protocol_handle *ph, int optname, void *optval,
unsigned int *optlen)
{
int ret = -EINVAL;
static int
mful_getopt(struct rfid_protocol_handle *ph, int optname, void *optval,
unsigned int *optlen)
{
int ret = -EINVAL;
- u_int16_t atqa;
unsigned int *size = optval;
switch (optname) {
case RFID_OPT_PROTO_SIZE:
ret = 0;
unsigned int *size = optval;
switch (optname) {
case RFID_OPT_PROTO_SIZE:
ret = 0;
- *size = 512;
+ /* we have to return the size in bytes, not bits */
+ *size = 512/8;
break;
}
break;
}
@@
-131,7
+122,7
@@
static struct rfid_protocol_handle *
mful_init(struct rfid_layer2_handle *l2h)
{
struct rfid_protocol_handle *ph;
mful_init(struct rfid_layer2_handle *l2h)
{
struct rfid_protocol_handle *ph;
- u_int
16_t atqa
;
+ u_int
8_t atqa[2]
;
unsigned int atqa_len = sizeof(atqa);
if (l2h->l2->id != RFID_LAYER2_ISO14443A)
unsigned int atqa_len = sizeof(atqa);
if (l2h->l2->id != RFID_LAYER2_ISO14443A)
@@
-139,8
+130,8
@@
mful_init(struct rfid_layer2_handle *l2h)
/* According to "Type Identification Procedure Rev. 1.3" */
rfid_layer2_getopt(l2h, RFID_OPT_14443A_ATQA,
/* According to "Type Identification Procedure Rev. 1.3" */
rfid_layer2_getopt(l2h, RFID_OPT_14443A_ATQA,
-
&
atqa, &atqa_len);
- if (atqa
!= 0x0044
)
+ atqa, &atqa_len);
+ if (atqa
[0] != 0x44 || atqa[1] != 0x00
)
return NULL;
/* according to "Functional Specification Rev. 3.0 */
return NULL;
/* according to "Functional Specification Rev. 3.0 */