Skip to content

Commit

Permalink
add log for reader; TODO:delay/wtxm config
Browse files Browse the repository at this point in the history
  • Loading branch information
leommxj committed Apr 15, 2024
1 parent de380a6 commit cbd68ae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion as_card_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ AsCardWorker* as_card_worker_alloc(NfcRelay* nfc_relay) {
as_card_worker->dev_data = iso14443_4a_alloc();
as_card_worker->bitbuffer = bit_buffer_alloc(256);
as_card_worker->buff_tx = malloc(256);
as_card_worker->delayus = 2000;
// TODO: Make the following two configurable
as_card_worker->delayus = 3500;
CMD_14A_WTX[1] = 1;
nfca_append_crc16(&CMD_14A_WTX[0], 2);

return as_card_worker;
}
Expand Down
4 changes: 3 additions & 1 deletion as_reader_worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ static NfcCommand as_reader_worker_poller_trx_callback(NfcGenericEvent event, vo
event.instance,
as_reader_worker->bitbuffer_tx,
as_reader_worker->bitbuffer_rx);
trace_bit_buffer_hexdump(TAG, "Emu Reader TX", as_reader_worker->bitbuffer_tx);
if(err == Iso14443_4aErrorNone) {
trace_bit_buffer_hexdump(TAG, "Emu Reader RX", as_reader_worker->bitbuffer_rx);
FURI_LOG_D(TAG, "Card Found, Recv RX");
NfcRelayPacket* packet = packet_alloc_data(
NfcRelayPacketApduResp,
Expand Down Expand Up @@ -170,7 +172,7 @@ int32_t as_reader_worker_task(void* context) {
// drop PCB
bit_buffer_copy_bytes(
as_reader_worker->bitbuffer_tx, &recv_packet->buf[1], recv_packet->len - 1);
trace_bit_buffer_hexdump(TAG, "Emu Reader TX", as_reader_worker->bitbuffer_tx);
trace_bit_buffer_hexdump(TAG, "Reader apdu recv", as_reader_worker->bitbuffer_tx);
free(recv_packet);
recv_packet = NULL;
as_reader_worker->apdu_ready = true;
Expand Down

0 comments on commit cbd68ae

Please sign in to comment.