/* This code was modified from: -NXT++: http://nxtpp.sourceforge.net -Device::USB: http://search.cpan.org/~gwadej/Device-USB-0.21 Please see these two websites for the appropriate licensing information. */ /** \class NXT_USB_linux * \brief Interface to USB devices for Linux machines, using libusb * * NXT_USB_linux is used by the class NXT_USB to open and close a USB connection * between a Linux computer and a LEGO Mindstorms NXT robot, and also to send * commands to the robot. */ #ifndef __NXT_USB_linux_h #define __NXT_USB_linux_h #include "usb.h" class NXT_USB_linux { public: NXT_USB_linux(); ~NXT_USB_linux(); // functions int OpenLegoUSB(); int CloseLegoUSB(); char * GetDeviceFilename(); int GetIDVendor(); int GetIDProduct(); char * GetStatus(); void SendCommand (char * outbuf, int outbufSize, char * inbuf, int inbufSize); // attributes private: struct usb_dev_handle *pUSBHandleLego; struct usb_device *devLego; int status; }; #endif