summaryrefslogtreecommitdiff
path: root/openpicc/application/tc_recv.h
blob: 4f2392b9d88145ad2afb51080bd98e8c1bf443bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef TC_RECV_H_
#define TC_RECV_H_

#include "iso14443.h"

#define TC_RECV_NUMBER_OF_FRAME_BUFFERS 10

struct tc_recv_handle;
typedef struct tc_recv_handle *tc_recv_handle_t;

typedef enum {
	TC_RECV_CALLBACK_RX_FRAME_ENDED,    // *data is iso14443_frame *frame
	TC_RECV_CALLBACK_SETUP,             // *data is tc_recv_handle_t th
	TC_RECV_CALLBACK_TEARDOWN,          // *data is tc_recv_handle_t th
} tc_recv_callback_reason;
typedef void (*tc_recv_callback_t)(tc_recv_callback_reason reason, void *data);

extern int tc_recv_init(tc_recv_handle_t *th, int pauses_count, tc_recv_callback_t callback);
extern int tc_recv_receive(tc_recv_handle_t th, iso14443_frame* *frame, unsigned int timeout);

#endif /*TC_RECV_H_*/
personal git repositories of Harald Welte. Your mileage may vary