summaryrefslogtreecommitdiff
path: root/rfid_iso14443_common.c
diff options
context:
space:
mode:
authorlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2005-11-08 08:34:15 +0000
committerlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2005-11-08 08:34:15 +0000
commit05c7e304271bcf88901da3782fcd3f28a0c7c9cf (patch)
treec7972af3be2f8a6619af551faa980cd699399b1e /rfid_iso14443_common.c
parentea11c6e508eb88d18847f4027bbc0a5ced0200b3 (diff)
use autoconf/automake
git-svn-id: https://svn.gnumonks.org/trunk/librfid@1658 e0336214-984f-0b4b-a45f-81c69e1f0ede
Diffstat (limited to 'rfid_iso14443_common.c')
-rw-r--r--rfid_iso14443_common.c58
1 files changed, 0 insertions, 58 deletions
diff --git a/rfid_iso14443_common.c b/rfid_iso14443_common.c
deleted file mode 100644
index 38fed6b..0000000
--- a/rfid_iso14443_common.c
+++ /dev/null
@@ -1,58 +0,0 @@
-
-/*
- * 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
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-
-static unsigned int fsdi_table[] = { 16, 24, 32, 40, 48, 64, 96, 128, 256 };
-
-int iso14443_fsdi_to_fsd(unsigned int *fsd, unsigned char fsdi)
-{
- /* ISO 14443-4:2000(E) Section 5.1. */
- if (fsdi > sizeof(fsdi_table)/sizeof(unsigned int))
- return -1;
-
- *fsd = fsdi_table[fsdi];
- return 0;
-}
-
-int iso14443_fsd_to_fsdi(unsigned char *fsdi, unsigned int fsd)
-{
- int i;
-
- for (i = 0; i < sizeof(fsdi_table)/sizeof(unsigned int); i++) {
- if (fsdi_table[i] == fsd) {
- *fsdi = i;
- return 0;
- }
- }
-
- return -1;
-}
-
-/* calculate the fsd that is equal or the closest smaller value
- * that can be coded as fsd */
-unsigned int iso14443_fsd_approx(unsigned int fsd)
-{
- unsigned int tbl_size = sizeof(fsdi_table)/sizeof(unsigned int);
- int i;
-
- for (i = tbl_size-1; i >= 0; i--) {
- if (fsdi_table[i] <= fsd)
- return fsdi_table[i];
- }
- /* not reached: return smallest possible FSD */
- return fsdi_table[0];
-}
-
personal git repositories of Harald Welte. Your mileage may vary