00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _C_REMOTECONTROL_H
00021 #define _C_REMOTECONTROL_H
00022
00023 #include "select_t.hpp"
00024
00025 #include "C_TaskControl.hpp"
00026 #include "list_t.hpp"
00027 #include "C_TransportControl.hpp"
00028 #include "C_ProtocolFrame.hpp"
00029 #include "C_GeneratorConfig.hpp"
00030 #include "C_ProtocolControl.hpp"
00031 #include "C_ProtocolText.hpp"
00032 #include "C_GeneratorStats.hpp"
00033
00034
00035 class C_Generator ;
00036
00037
00038 class C_RemoteControl : public C_TaskControl {
00039
00040 public:
00041
00042 C_RemoteControl(C_Generator* P_gen,
00043 C_ProtocolControl* P_protocol_control,
00044 char* P_address) ;
00045 ~C_RemoteControl() ;
00046
00047 void init() ;
00048
00049 private :
00050
00051 C_Generator *m_gen ;
00052
00053 C_Transport *m_transport ;
00054 size_t m_max_event_nb ;
00055 struct timeval m_select_timeout ;
00056 C_GeneratorConfig *m_config ;
00057 T_SelectDef m_call_select ;
00058 T_pC_TransportEvent m_events ;
00059 C_ProtocolControl *m_protocol_ctrl ;
00060 C_ProtocolFrame *m_protocol_frame ;
00061 C_ProtocolText *m_protocol_text ;
00062
00063 T_pRcvMsgCtxtList m_msg_remote_list ;
00064 char *m_address ;
00065
00066 C_GeneratorStats *m_stat ;
00067
00068 int m_command_id, m_uri_id ;
00069
00070
00071
00072
00073 T_GeneratorError TaskProcedure () ;
00074 T_GeneratorError InitProcedure () ;
00075 T_GeneratorError EndProcedure () ;
00076 T_GeneratorError StoppingProcedure () ;
00077 T_GeneratorError ForcedStoppingProcedure () ;
00078
00079 T_GeneratorError receiveControl () ;
00080 void messageReceivedControl () ;
00081
00082 char* execute_command(char *P_cmd, char *P_uri, char **P_result_data);
00083 char* decode_put_uri(char *P_uri);
00084 char* decode_get_uri(char *P_uri, char **P_result_data);
00085
00086 char* decode_uri(char *P_uri);
00087
00088 char* find_directory(char *P_buf,char *P_dir) ;
00089 char* find_file(char *P_buf,char *P_dir) ;
00090 char* find_value(char *P_buf,char *P_dir) ;
00091
00092 void rate(unsigned long P_value);
00093 void ramp(unsigned long P_value, unsigned long P_duration);
00094 char* dump_stat();
00095
00096 void quit();
00097 void pause();
00098 void resume();
00099
00100 char* resultOK();
00101 char* resultKO();
00102
00103 void createRampThread(unsigned long P_duration,
00104 unsigned long P_current_rate,
00105 unsigned long P_sub_rate,
00106 bool P_increase);
00107
00108 C_MessageFrame* analyze_command(C_MessageFrame *P_msg) ;
00109
00110 } ;
00111
00112 #endif // _C_REMOTECONTROL_H
00113
00114
00115
00116
00117
00118