summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2006-10-08 01:05:50 +0000
committerlaforge <laforge@e0336214-984f-0b4b-a45f-81c69e1f0ede>2006-10-08 01:05:50 +0000
commit6e87a007525b313dcf2da194977bb1abdf62026f (patch)
tree0d4d3d8947bffe5fd69cede516241e923f938276 /src
parent1db4b3b435b8e79c36ac12515152168a45e5ac8e (diff)
- fix segfault during rfid_scan()
- add accessor functions for protocol and layer2 names - print l2 and proto name + uid after successful scan git-svn-id: https://svn.gnumonks.org/trunk/librfid@1899 e0336214-984f-0b4b-a45f-81c69e1f0ede
Diffstat (limited to 'src')
-rw-r--r--src/rfid_layer2.c5
-rw-r--r--src/rfid_protocol.c5
-rw-r--r--src/rfid_scan.c6
3 files changed, 14 insertions, 2 deletions
diff --git a/src/rfid_layer2.c b/src/rfid_layer2.c
index 7461d87..a6ee43f 100644
--- a/src/rfid_layer2.c
+++ b/src/rfid_layer2.c
@@ -132,3 +132,8 @@ rfid_layer2_setopt(struct rfid_layer2_handle *ph, int optname,
}
return 0;
}
+
+char *rfid_layer2_name(struct rfid_layer2_handle *l2h)
+{
+ return l2h->l2->name;
+}
diff --git a/src/rfid_protocol.c b/src/rfid_protocol.c
index 46dc48d..b24243a 100644
--- a/src/rfid_protocol.c
+++ b/src/rfid_protocol.c
@@ -111,3 +111,8 @@ rfid_protocol_register(struct rfid_protocol *p)
return 0;
}
+
+char *rfid_protocol_name(struct rfid_protocol_handle *ph)
+{
+ return ph->proto->name;
+}
diff --git a/src/rfid_scan.c b/src/rfid_scan.c
index 1abb4df..f50bee6 100644
--- a/src/rfid_scan.c
+++ b/src/rfid_scan.c
@@ -51,6 +51,7 @@ rfid_layer2_scan(struct rfid_reader_handle *rh)
#define RFID_LAYER2_MAX 16
for (i = 0; i < RFID_LAYER2_MAX; i++) {
+ DEBUGP("testing l2 %u\n", i);
l2h = rfid_layer2_scan1(rh, i);
if (l2h)
return l2h;
@@ -87,6 +88,7 @@ rfid_protocol_scan(struct rfid_layer2_handle *l2h)
#define RFID_PROTOCOL_MAX 16
for (i = 0; i < RFID_PROTOCOL_MAX; i++) {
+ DEBUGP("testing proto %u\n", i);
ph = rfid_protocol_scan1(l2h, i);
if (ph)
return ph;
@@ -105,9 +107,9 @@ int rfid_scan(struct rfid_reader_handle *rh,
if (!*l2h)
return 0;
- *ph = rfid_protocol_scan(l2h);
+ *ph = rfid_protocol_scan(*l2h);
if (!*ph)
return 2;
-
+
return 3;
}
personal git repositories of Harald Welte. Your mileage may vary