Revision 532ba0bd toolbox/rfid.h

View differences:

toolbox/rfid.h
15 15
/* Should be called before anything else */
16 16
void rfid_init();
17 17

  
18
/* Reads the serial number of an rfid tag into an internal buffer, accessible
19
 * with rfid_get_serno */
20
void rfid_read();
18
/* Sends the read command to the rfid reader. After, you should call rfid_poll
19
 * until it returns nonzero */
20
void rfid_start_read();
21

  
22
/* Should only be called after rfid_start_read. Keep calling until it returns
23
 * nonzero, which means it is finished reading the serial number, and
24
 * rfid_get_serno can be called */
25
char rfid_poll();
21 26

  
22 27
/* Attempts to read the serial number multiple times, and only accepts it if it
23
 * is the same every time. Use rfid_read instead until this one is proven
24
 * necessary */
28
 * is the same every time. Don't use it */
25 29
void rfid_read_safe();
26 30

  
27
/* Call this only after calling rfid_read. This will copy the value it read
28
 * into serno, which should be at least RFID_SERNO_SIZE bytes */
31
/* Call this only after rfid_poll returns nonzero. This will copy the value it
32
 * read into serno, which should be at least RFID_SERNO_SIZE bytes */
29 33
void rfid_get_serno(char *serno);
30 34

  
31
/* Call this only after calling rfid_read. Returns 1 if serno matches the
32
 * internal buffer of the most recently read serial number */
35
/* Call this only after rfid_poll returns nonzero. Returns 1 if serno matches
36
 * the internal buffer of the most recently read serial number */
33 37
char rfid_check_serno(char *serno);
34 38

  
35
/* Call this only after calling rfid_read. Returns 1 if the internal buffer is
36
 * nonzero, meaning a serial number was successfully read from an rfid tag */
39
/* Call this only after rfid_poll returns nonzero. Returns 1 if the internal
40
 * buffer is nonzero, meaning a serial number was successfully read from an
41
 * rfid tag */
37 42
char rfid_nonzero();
38 43

  
39 44
#endif

Also available in: Unified diff