Esempio n. 1
0
void ChannelServer::onBufferReceived(const iviLink::Channel::tChannelId channel, iviLink::Buffer const& buffer)
{
    LOG4CPLUS_INFO(logger, "buffer received!");
    if (SMOKE_TEST_ID == currentTest)
    {
        UInt8 a, b, c;
        buffer.read(a);
        buffer.read(b);
        buffer.read(c);
        if(a == 1 && b==2 && c == 3)
        {
            LOG4CPLUS_INFO(logger, "smoke_test bufferReceived success");
            mCliSyncSem.signal();
        }
        else
        {
            LOG4CPLUS_INFO(logger, "smoke_test bufferReceived got corrupted data");
        }
    }

    if (BIG_DATA_TEST_ID == currentTest)
    {
        UInt8 a;
        for(UInt32 i=0; i<getMaxBufSize(); i++)
        {
            buffer.read(a);
            if (1 != a)
            {
                LOG4CPLUS_INFO(logger, "send_big_data_test bufferReceived got corrupted data");
                return;
            }
        }
        LOG4CPLUS_INFO(logger, "send_big_data_test bufferReceived success");
        mCliSyncSem.signal();
    }

    if (SEND_STRESS_TEST_ID == currentTest)
    {
        LOG4CPLUS_INFO(logger, "send_data_stress_test_with_confirmation confirming receiving of data");
        mCliSyncSem.signal();
    }
}