|
orca-robotics INTRODUCTION Overview Download and Install Documentation REPOSITORY Interfaces Drivers Libraries Utilities Software Map DEVELOPER Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
humaninput2dkbdtermio/driver.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef ORCA2_HUMANINPUT2D_KEYBOARD_TERMIO_H 00012 #define ORCA2_HUMANINPUT2D_KEYBOARD_TERMIO_H 00013 00014 #include <termio.h> 00015 00016 #include <hydrointerfaces/humaninput2d.h> 00017 00018 namespace humaninput2dkbdtermio 00019 { 00020 00021 class Driver : public hydrointerfaces::HumanInput2d 00022 { 00023 public: 00024 00025 Driver( const hydroutil::Context &context ); 00026 00027 virtual int enable(); 00028 virtual int disable(); 00029 00030 // Blocks untill new data is available 00031 virtual int read( Command& command ); 00032 00033 private: 00034 00035 bool enableStepInputs_; 00036 00037 // obscure keyboard stuff 00038 int kfd_; 00039 struct termio cooked_; 00040 00041 hydroutil::Context context_; 00042 }; 00043 00044 // Used for dynamically loading driver 00045 class Factory : public hydrointerfaces::HumanInput2dFactory 00046 { 00047 public: 00048 hydrointerfaces::HumanInput2d *createDriver( 00049 const hydroutil::Context &context ) const 00050 { 00051 return new Driver( context ); 00052 } 00053 }; 00054 00055 } // namespace 00056 00057 // Used for dynamically loading driver 00058 extern "C" { 00059 hydrointerfaces::HumanInput2dFactory *createDriverFactory(); 00060 } 00061 00062 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)
1.4.5