3 * UCC (University [of WA] Computer Club) Electronic Accounting System
5 * handler_doror.c - Door Relay code
7 * This file is licenced under the 3-clause BSD Licence. See the file
8 * COPYING for full details.
20 int Door_InitHandler();
21 int Door_CanDispense(int User, int Item);
22 int Door_DoDispense(int User, int Item);
25 tHandler gDoor_Handler = {
31 //char *gsDoor_SerialPort = "/dev/ttyS0";
32 // int giDoor_SerialFD;
35 int Door_InitHandler()
37 // printf("connecting to door...\n");
38 // giDoor_SerialFD = open(gsDoor_SerialPort, O_RDWR);
39 // if( giDoor_SerialFD == -1 ) {
40 // fprintf(stderr, "ERROR: Unable to open coke serial port ('%s')\n", gsDoor_SerialPort);
47 int Door_CanDispense(int User, int Item)
50 if( Item == 0 ) return -1;
56 * \brief Actually do a dispense from the coke machine
58 int Door_DoDispense(int User, int Item)
62 if( Item != 0 ) return -1;
64 // Check if user is in door