00001 #ifndef _CWIIDMOTIONRECEIVER_H 00002 #define _CWIIDMOTIONRECEIVER_H 00003 00004 #include "AbstractMotionReceiver.h" 00005 #include "util/Error.h" 00006 #include <cwiid.h> 00007 #include <string> 00008 00010 00015 class CWiidMotionReceiver : public AbstractMotionReceiver 00016 { 00017 public: 00021 CWiidMotionReceiver(); 00025 virtual ~CWiidMotionReceiver(); 00026 00031 virtual void start() throw(Error); 00036 virtual void run(); 00040 virtual void stop(); 00041 00047 void setAddr(const std::string a) { m_wiimoteMacAdress = a; } 00051 const std::string getAddr() const { return m_wiimoteMacAdress; } 00052 00053 private: 00054 void handleMessages(union cwiid_mesg *msg); 00055 void handleButtons(struct cwiid_btn_mesg *msg); 00056 void handleAccData(struct cwiid_acc_mesg *msg); 00057 00058 std::string m_wiimoteMacAdress; 00059 cwiid_wiimote_t *m_wiimote; 00060 struct acc_cal m_calibration; 00061 }; 00062 00063 #endif