Ejemplo n.º 1
0
//----------------------------------------------------------------------------
//
TelnetTCPClient::TelnetTCPClient(int SocketDescriptor, QObject *parent)
    : QObject(parent)
{
    strCR = "\r\n";
    strShell = QString(">");

    CommandBuffer.clear();
    isAuthenticated = false;
    SessionID = SocketDescriptor;

    Socket = new QTcpSocket(this);
    if(!Socket->setSocketDescriptor(SessionID))
    {
        std::cerr << SessionID << " Error binding socket\n";
        return;
    }

    telnetLogic = new TelnetLogic(this);

    //connect the signals
    connect( Socket, SIGNAL(readyRead()), this, SLOT(SocketReadyRead()), Qt::DirectConnection);
    connect( Socket, SIGNAL(disconnected()), this, SLOT(SocketDisconnected()), Qt::DirectConnection);

    std::cout << SessionID << " Session Connected.\n";

    SendResponse(QString("[ Command Shell ]") + strCR);
    SendResponse(QString("Enter a password: "));

}
Ejemplo n.º 2
0
RobotControl::RobotControl(QObject *parent) :
    QObject(parent),
    vertSpeed(0),
    moveSpeed(0),
    rotateSpeed(0),
    initialized(false),
    manualControl(false),
    currentState(Stop)
{
    lastEngine = 0;
    connect(&socket, SIGNAL(disconnected()), this, SLOT(SocketDisconnected()));
}
Ejemplo n.º 3
0
void ArduinoThread::Disconnected() {
    sock = 0;

    emit SocketDisconnected();
}
Ejemplo n.º 4
0
 void MessageHandler::HandleDisconnected() {
   SocketDisconnected(); // Emits this signal
 }