Shop OBEX P1 Docs P2 Docs Learn Events
RFID reader code that waits for the user to scan their badge. — Parallax Forums

RFID reader code that waits for the user to scan their badge.

ipatchipatch Posts: 1
edited 2012-12-13 22:11 in General Discussion
I am in the process of developing an iOS application that interfaces with a parallax RFID reader. The current version of the app can be found here. Right now I have an UIAlertView pop up when the user clicks a button within the application. The part I have difficulty coding is the part where the user scan the RFID badge and inputs the characters to the textfield located with the UIAlertView. I am thinking that I am going to have to use some form of iteration to have the program wait for the user to swipe their badge. I asked a similar / identical question over at stackoverflow.com. It can be found here Any thoughts or suggestions are welcome.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-12-13 22:11
    We're not going to be able to help you, mostly because your issue has really nothing to do with the RFID reader and almost everything to do with jailbroken iOS programming in Objective C. The RFID reader is simple. You need to make DTR high, usually by opening a serial port configured properly to do this. The reader then transmits a line feed (0x0A), followed by 10 hexadecimal characters (0-9 and A-F), followed by a carriage return (0x0D). That's all. The job of your program, once the read is initiated, is to ignore characters until a 0x0A is received, throw the 0x0A away, accumulate the next 10 characters and make sure they're in the range 0-9 and A-F, then check that the next character is 0x0D. If there's an error, the program should reset its state so that it's waiting for a 0x0A again. When done, the program should close the serial port.

    Your program is event-driven and that always complicates things like serial I/O that are dependent on other events (like receiving serial characters). You'll need to get help from Apple's documentation and the various forums for jailbroken iOS users.
Sign In or Register to comment.