Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

LGmixin.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_LGmixin_h_
00003 #define INCLUDED_LGmixin_h_
00004 
00005 #include "Wireless/Wireless.h"
00006 #include "DualCoding/Sketch.h"
00007 
00008 //! Mix-in for the BehaviorBase or StateNode class to give access to Looking Glass variables.
00009 class LGmixin {
00010  protected:
00011   static unsigned int instanceCount; //!< count of LGmixin instances -- when this hits zero, close the socket
00012   static Socket *LGsock; //!< socket to talk to Looking Glass server
00013 
00014  public:
00015   //! Constructor
00016   LGmixin();
00017 
00018   //! Destructor
00019   virtual ~LGmixin();
00020 
00021   //! Upload a file from the AIBO to the Looking Glass client
00022   static void uploadFile(const std::string &filename, bool display=false, bool isImage=false);
00023 
00024   //! Display an HTML file on the Looking Glass
00025   static void displayHtmlFile(const std::string &remoteFilename);
00026 
00027   //! Display a single image file on the Looking Glass (creates a dummy HTML file)
00028   static void displayImageFile(const std::string &remoteFilename);
00029 
00030   //! Display HTML string on the Looking Glass (creates a dummy HTML file)
00031   static void displayHtmlText(const std::string &text);
00032 
00033   //! Upload current camera image to the Looking Glass client as a JPEG file
00034   static void uploadCameraImage(const std::string &remoteFileName);
00035 
00036   //! For debugging: send an arbitrary command string to the Looking Glass client
00037   static void sendCommand(const std::string &command);
00038 
00039   //! Upload a sketch as a JPEG file to the Looking Glass client
00040   static void uploadSketch(const DualCoding::Sketch<DualCoding::uchar> &sketch, const std::string &remoteFilename);
00041 
00042  private:
00043   //! used so static member functions can access non-static members
00044   static LGmixin* theOne;
00045 
00046   LGmixin (const LGmixin&);  //!< never call this
00047   LGmixin& operator=(const LGmixin&); //!< never call this
00048 
00049   static const unsigned int LGbufferSize = 80000; //!< maximum send buffer size
00050   static const unsigned int LGport = 10100; //!< port number to listen on
00051 
00052 };
00053 
00054 #endif

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:43 2016 by Doxygen 1.6.3