00001 #ifndef _REC_ROBOTINO_SERVER_SERVER_H_
00002 #define _REC_ROBOTINO_SERVER_SERVER_H_
00003
00004 #include "rec/robotino/server/defines.h"
00005 #include "rec/iocontrol/remotestate/SensorState.h"
00006 #include "rec/iocontrol/remotestate/SetState.h"
00007
00008 #include <QTcpServer>
00009
00010 namespace rec
00011 {
00012 namespace robotino
00013 {
00014 namespace server
00015 {
00016 class REC_ROBOTINO_SERVER_EXPORT Server : public QTcpServer
00017 {
00018 Q_OBJECT
00019 public:
00020 Server( QObject* parent );
00021
00022 ~Server();
00023
00027 void setSensorState( const rec::iocontrol::remotestate::SensorState& sensorState );
00028
00029 int numClientsConnected() const;
00030 void disconnectAllClients();
00031
00032 Q_SIGNALS:
00033 void clientConnected( bool isMaster, quint32 address );
00034 void clientDisconnected( bool isMaster, quint32 address );
00035
00036 void error( const QString& );
00037
00038 void setStateReceived( const rec::iocontrol::remotestate::SetState& );
00039
00040 void cameraControlReceived( unsigned int width, unsigned int height );
00041
00042 void clientImageRequest( bool enable, quint32 address, quint16 port );
00043
00044 private:
00045 void incomingConnection( int socketDescriptor );
00046 };
00047 }
00048 }
00049 }
00050
00051 #endif //_REC_ROBOTINO_SERVER_SERVER_H_