summaryrefslogtreecommitdiff
path: root/src/rfid_layer2_iso14443a.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rfid_layer2_iso14443a.c')
-rw-r--r--src/rfid_layer2_iso14443a.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/rfid_layer2_iso14443a.c b/src/rfid_layer2_iso14443a.c
index 429577c..4716018 100644
--- a/src/rfid_layer2_iso14443a.c
+++ b/src/rfid_layer2_iso14443a.c
@@ -280,6 +280,13 @@ iso14443a_setopt(struct rfid_layer2_handle *handle, int optname,
speed = *(unsigned int *)optval;
ret = rdr->iso14443a.set_speed(handle->rh, 1, speed);
break;
+ case RFID_OPT_14443A_WUPA:
+ if((unsigned int*)optval)
+ handle->flags |= RFID_OPT_LAYER2_WUP;
+ else
+ handle->flags &= ~RFID_OPT_LAYER2_WUP;
+ ret = 0;
+ break;
};
return ret;
@@ -287,17 +294,22 @@ iso14443a_setopt(struct rfid_layer2_handle *handle, int optname,
static int
iso14443a_getopt(struct rfid_layer2_handle *handle, int optname,
- void *optval, unsigned int optlen)
+ void *optval, unsigned int *optlen)
{
int ret = -EINVAL;
struct iso14443a_handle *h = &handle->priv.iso14443a;
struct iso14443a_atqa *atqa = optval;
+ int *wupa = optval;
switch (optname) {
case RFID_OPT_14443A_ATQA:
*atqa = h->atqa;
ret = 0;
break;
+ case RFID_OPT_14443A_WUPA:
+ *wupa = ((handle->flags & RFID_OPT_LAYER2_WUP) != 0);
+ ret = 0;
+ break;
};
return ret;
personal git repositories of Harald Welte. Your mileage may vary