/* Copyright (C) 2006 Cole Krumbholz */ /* */ /* This is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ /* */ /* This program is distributed in the hope that it will be useful, but */ /* WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU */ /* General Public License for more details. */ /* This library provides an interface for tabletop application builders to access tracking updates from the lambdatracker cluster. This API only handles track update messages, not calibration messages. Currently calibration must be performed using the cal-interface electro script. */ #ifndef __TABLETRACKER_H #define __TABLETRACKER_H /* ----------------------------------------------------------------------- */ /* error codes returned by below functions */ #define TT_OK 0 #define TT_ERR_SOCK 1 /* a new socket could not be opened */ #define TT_ERR_BIND 2 /* a socket could not be bound to the specified port */ #define TT_ERR_MESG 3 /* malformed track update message received */ /* ----------------------------------------------------------------------- */ /* tracker functions */ int TT_open(unsigned short port); /* Opens a UDP socket and begins listening for new track update messages */ /* returns TT_ERR_SOCK, TT_ERR_BIND, or TT_OK */ int TT_poll(unsigned int timeout); /* Checks to see if any new UDP traffic has been received */ /* Returns 1 if a new message is waiting, or 0 if not */ int TT_get(int *id, double *xpos, double *ypos, double *angle, int *type); /* Grabs the next update message. */ /* Returns TT_ERR_MESG or TT_OK */ void TT_close(); /* Closes the UDP socket */ /* ----------------------------------------------------------------------- */ /* future implementation: int TT_set_flags(unsigned short flags); // for things like track smoothing */ #endif