From b0fef13efe84d8601a9496098429b4a080e20c9e Mon Sep 17 00:00:00 2001 From: laforge Date: Sun, 29 May 2005 18:05:31 +0000 Subject: move librfid to new location in repository git-svn-id: https://svn.gnumonks.org/trunk/librfid@1181 e0336214-984f-0b4b-a45f-81c69e1f0ede --- include/rfid/rfid_protocol.h | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 include/rfid/rfid_protocol.h (limited to 'include/rfid/rfid_protocol.h') diff --git a/include/rfid/rfid_protocol.h b/include/rfid/rfid_protocol.h new file mode 100644 index 0000000..93b89c3 --- /dev/null +++ b/include/rfid/rfid_protocol.h @@ -0,0 +1,53 @@ +#ifndef _RFID_PROTOCOL_H +#define _RFID_PROTOCOL_H + +#include + +#include + +struct rfid_protocol_handle; + +struct rfid_protocol { + struct rfid_protocol *next; + unsigned int id; + char *name; + struct { + struct rfid_protocol_handle *(*init)(struct rfid_layer2_handle *l2h); + int (*open)(struct rfid_protocol_handle *ph); + int (*close)(struct rfid_protocol_handle *ph); + int (*fini)(struct rfid_protocol_handle *ph); + int (*transcieve)(struct rfid_protocol_handle *ph, + const unsigned char *tx_buf, + unsigned int tx_len, + unsigned char *rx_buf, + unsigned int *rx_len, + unsigned int timeout, + unsigned int flags); + } fn; +}; + +struct rfid_protocol_handle { + struct rfid_layer2_handle *l2h; + union { + struct tcl_handle tcl; + } priv; + struct rfid_protocol *proto; +}; + +struct rfid_protocol_handle * +rfid_protocol_init(struct rfid_layer2_handle *l2h, unsigned int id); +int rfid_protocol_open(struct rfid_protocol_handle *ph); +int rfid_protocol_transcieve(struct rfid_protocol_handle *ph, + const unsigned char *tx_buf, unsigned int tx_len, + unsigned char *rx_buf, unsigned int *rx_len, + unsigned int timeout, unsigned int flags); +int rfid_protocol_fini(struct rfid_protocol_handle *ph); +int rfid_protocol_close(struct rfid_protocol_handle *ph); + +int rfid_protocol_register(struct rfid_protocol *p); + +enum rfid_protocol_id { + RFID_PROTOCOL_UNKNOWN, + RFID_PROTOCOL_TCL, +}; +#endif -- cgit v1.2.3