|
rllib
1
|
00001 /*************************************************************************** 00002 rlcommandlineinterface.h - description 00003 ------------------- 00004 begin : Sat Mar 27 2010 00005 copyright : (C) 2010 by Rainer Lehrig 00006 email : lehrig@t-online.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This library is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as * 00013 * published by the Free Software Foundation * 00014 * * 00015 ***************************************************************************/ 00016 #ifndef _RL_COMMANDLINE_INTERFACE_H_ 00017 #define _RL_COMMANDLINE_INTERFACE_H_ 00018 00019 #include "rldefine.h" 00020 #include "rlserial.h" 00021 #include "rlspawn.h" 00022 #include "rlsocket.h" 00023 00042 class rlCommandlineInterface 00043 { 00044 public: 00045 rlCommandlineInterface(); 00046 virtual ~rlCommandlineInterface(); 00047 int start(const char *how, const char *command=NULL); 00048 int start(rlSerial *tty); 00049 const char *readLine(int timeout=0); 00050 int readBlock(void *buf, int len, int timeout=0); 00051 int printf(const char *format, ...); 00052 int writeBlock(void *buf, int len); 00053 private: 00054 char line[rl_PRINTF_LENGTH]; 00055 rlSocket *sock; 00056 rlSpawn *spawn; 00057 rlSerial *tty; 00058 }; 00059 #endif 00060
1.7.5.1