File: rfid.h

package info (click to toggle)
libphidgets 0.3.8-1.2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,996 kB
  • ctags: 257
  • sloc: sh: 8,803; ansic: 1,753; makefile: 276
file content (49 lines) | stat: -rw-r--r-- 1,326 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef __INCLUDED_PHIDGETS_RFID_H__
#define __INCLUDED_PHIDGETS_RFID_H__

#include <phidgets/phidgets.h>

typedef enum phidget_rfid_toggle {
	PHIDGET_RFID_PLUS_FIVE = 0,
	PHIDGET_RFID_EXTERNAL_LED,
	PHIDGET_RFID_ONBOARD_LED,
	PHIDGET_RFID_ENABLE
} phidget_rfid_toggle;

typedef struct PhidgetRFID_t {
	Phidget *phidget;

	/* Timestamp and last tag */
	time_t   time;
	unsigned long long l_tag;

	/* Expanded Bitfield */
	bool		onboard_led;
	bool		plus_five;
	bool		external_led;
	bool		enabled;
} PhidgetRFID;

#ifdef __cplusplus
extern "C" {
#endif

PhidgetRFID* phidget_new_PhidgetRFID();
void phidget_delete_PhidgetRFID(PhidgetRFID** const qsc);
void phidget_reset_PhidgetRFID(PhidgetRFID* const qsc);
phidget_return phidget_rfid_open(PhidgetRFID* const qsc,
	 unsigned int serial, unsigned short retries);
phidget_return phidget_rfid_close(PhidgetRFID* const qsc);
bool phidget_rfid_is_opened(PhidgetRFID const* const qsc);

phidget_return phidget_rfid_set_state(PhidgetRFID* const qsc,
	 bool enable, bool onboard_led, bool external_led, bool plus_five);
phidget_return phidget_rfid_set_toggle(PhidgetRFID* const qsc,
	 phidget_rfid_toggle which, bool state);
phidget_return phidget_rfid_get_tag(PhidgetRFID* const qsc, const int timeout);
		  
#ifdef __cplusplus
}
#endif
		  
#endif /* __INCLUDED_PHIDGETS_RFID_H__ */