コード例 #1
0
int read733(VolInfo* volInfo, unsigned* value)
{
    int rc;
    unsigned char both[8];
    
    rc = readRead(volInfo, both, 8);
    if(rc != 8)
        return rc;
    
    read733FromCharArray(both, value);
    
    return rc;
}
コード例 #2
0
int read721(VolInfo* volInfo, unsigned short* value)
{
    int rc;
    unsigned char array[2];
    
    rc = readRead(volInfo, array, 2);
    if(rc != 2)
        return rc;
    
    *value = array[1];
    *value <<= 8;
    *value |= array[0];
    
    return rc;
}
コード例 #3
0
ファイル: HandShakeTask.cpp プロジェクト: tianhu9102/piss
//!
//! \brief HandShakeTask::run
//!
void HandShakeTask::run(){



    socket = new QTcpSocket();

    //set the ID
    if(!socket->setSocketDescriptor(this->socketDescriptor)){
        emit error (socket->error());
        return;
    }
    qDebug()<<"HandShakeTask Thread Start";
    connect(socket,SIGNAL(readyRead()),this,SLOT(readRead()),Qt::DirectConnection);
    connect(socket,SIGNAL(disconnected()),this,SLOT(disconnected()));

    exec();
}
コード例 #4
0
int read731(VolInfo* volInfo, unsigned* value)
{
    int rc;
    unsigned char array[4];
    
    rc = readRead(volInfo, array, 4);
    if(rc != 4)
        return rc;
    
    *value = array[3];
    *value <<= 8;
    *value |= array[2];
    *value <<= 8;
    *value |= array[1];
    *value <<= 8;
    *value |= array[0];
    
    return rc;
}
コード例 #5
0
ファイル: mytcpsocket.cpp プロジェクト: hkutangyu/QTDemo
int MyTcpSocket::doConnect(QString regMsg)
{
    this->regMsg = regMsg;
    socket = new QTcpSocket(this);

    connect(socket,SIGNAL(connected()),this,SLOT(connected()));
    connect(socket,SIGNAL(disconnected()),this,SLOT(disconnected()));
    connect(socket,SIGNAL(readyRead()),this,SLOT(readRead()));

    // this is not blocking call
    socket->connectToHost("127.0.0.1",12345);

    // we need to wait...
    if(!socket->waitForConnected(5000))
    {
        qDebug()<<"Error: "<<socket->errorString();
        return 1;
    }
    else{
        return 0;
    }
}
コード例 #6
0
int read711(VolInfo* volInfo, unsigned char* value)
{
    return readRead(volInfo, value, 1);
}