Example program to read HID ProxCards using the gatech BuzzCard format with a HID ProxPoint Plus 6005BG00.
Dependencies: HID_Wiegand mbed USBDevice
See library: http://mbed.org/users/cbookman3/code/HID_Wiegand/wiki/Homepage
main.cpp@1:093dffbd107b, 2014-04-22 (annotated)
- Committer:
- cbookman3
- Date:
- Tue Apr 22 17:56:04 2014 +0000
- Revision:
- 1:093dffbd107b
- Parent:
- 0:59e72754e5b6
- Child:
- 2:cbbc69f00a81
added comments
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
cbookman3 | 0:59e72754e5b6 | 1 | #include "mbed.h" |
cbookman3 | 0:59e72754e5b6 | 2 | #include "Wiegand.h" |
cbookman3 | 0:59e72754e5b6 | 3 | |
cbookman3 | 0:59e72754e5b6 | 4 | Serial pc(USBTX, USBRX); // tx, rx |
cbookman3 | 0:59e72754e5b6 | 5 | void onCardRead(); |
cbookman3 | 1:093dffbd107b | 6 | // (PinName pdata0, PinName pdata1, PinName pHold, void (*onCardRead)()); |
cbookman3 | 1:093dffbd107b | 7 | Wiegand rfid(p30 , p29 , p28 , &onCardRead); |
cbookman3 | 0:59e72754e5b6 | 8 | |
cbookman3 | 0:59e72754e5b6 | 9 | int main() { |
cbookman3 | 0:59e72754e5b6 | 10 | while(1) { |
cbookman3 | 1:093dffbd107b | 11 | rfid.doEvents(); //check if RFID Reader has read all data |
cbookman3 | 0:59e72754e5b6 | 12 | } |
cbookman3 | 0:59e72754e5b6 | 13 | } |
cbookman3 | 0:59e72754e5b6 | 14 | |
cbookman3 | 0:59e72754e5b6 | 15 | void onCardRead() { |
cbookman3 | 0:59e72754e5b6 | 16 | uint64_t data; |
cbookman3 | 0:59e72754e5b6 | 17 | data = rfid.getBits(14, 33); |
cbookman3 | 0:59e72754e5b6 | 18 | pc.printf("\nRead id of: %lld",data); |
cbookman3 | 0:59e72754e5b6 | 19 | |
cbookman3 | 0:59e72754e5b6 | 20 | } |