memset(&atqa, 0, sizeof(atqa));
memset(&acf, 0, sizeof(acf));
- ret = iso14443a_transceive_sf(handle, ISO14443A_SF_CMD_REQA, &atqa);
+ if (handle->flags & RFID_OPT_LAYER2_WUP)
+ ret = iso14443a_transceive_sf(handle, ISO14443A_SF_CMD_WUPA, &atqa);
+ else
+ ret = iso14443a_transceive_sf(handle, ISO14443A_SF_CMD_REQA, &atqa);
if (ret < 0) {
h->state = ISO14443A_STATE_REQA_SENT;
DEBUGP("error during transceive_sf: %d\n", ret);
if (!h)
return NULL;
+ memset(h, 0, sizeof(*h));
+
h->l2 = &rfid_layer2_iso14443a;
h->rh = rh;
h->priv.iso14443a.state = ISO14443A_STATE_NONE;