diff options
author | laforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede> | 2006-10-07 20:55:16 +0000 |
---|---|---|
committer | laforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede> | 2006-10-07 20:55:16 +0000 |
commit | fe4ffab6d97f2e2696bf7f1fb52a175342611aec (patch) | |
tree | 528bd408acafde03001e6d9296069badba9dcffb /src/rfid.c | |
parent | 2f426580fa990c1e190d09f9d6a4a7fc9b6d25c3 (diff) |
- use C99 compiler flags
- implement some getopt/setopt functions for UID and layer2 specific parameters
- basic rfid scanning support
- add commandline arguments for layer2 / scanning to librfid-tool
- try to detect both supported readers automatically in librfid-tool
- add new 'l2_supported' and 'proto_supported members to rfid_reader
git-svn-id: https://svn.gnumonks.org/trunk/librfid@1895 e0336214-984f-0b4b-a45f-81c69e1f0ede
Diffstat (limited to 'src/rfid.c')
-rw-r--r-- | src/rfid.c | 52 |
1 files changed, 51 insertions, 1 deletions
@@ -1,4 +1,6 @@ -/* +/* librfid core + * (C) 2005-2006 by Harald Welte <laforge@gnumonks.org> + * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation @@ -40,6 +42,54 @@ rfid_hexdump(const void *data, unsigned int len) return string; } +#if 0 +int rfid_setopt(struct rfid_handle *rh, unsigned int level, + unsigned int optname, + const void *opt, unsigned int *optlen) +{ + switch (level) { + case RFID_LEVEL_ASIC: + case RFID_LEVEL_READER: + return -EINVAL; + break; + case RFID_LEVEL_LAYER2: + return rfid_layer2_setopt(optname, opt, optlen); + break; + case RFID_LEVEL_LAYER3: + return rfid_layer3_setopt(optname, opt, optlen); + break; + default: + return -EINVAL; + break; + } + + return 0; +} + +int rfid_getopt(struct rfid_handle *rh, unsigned int level, + unsigned int optname, + void *opt, unsigned int *optlen) +{ + switch (level) { + case RFID_LEVEL_ASIC: + case RFID_LEVEL_READER: + return -EINVAL; + break; + case RFID_LEVEL_LAYER2: + return rfid_layer2_getopt(optname, opt, optlen); + break; + case RFID_LEVEL_LAYER3: + return rfid_layer3_getopt(optname, opt, optlen); + break; + default: + return -EINVAL; + break; + } + + return 0; +} +#endif + int rfid_init() { rfid_reader_register(&rfid_reader_cm5121); |