Пример #1
0
/**
 * Called each time there are data in the input buffer
 */
void UAVTalk::processInputStream()
{
    quint8 tmp;

	while (true)
    {
		mutex->lock();	// Pip
			if (!io)
			{
				mutex->unlock();
				break;
			}
			if (!io->isOpen() || io->bytesAvailable() <= 0)
			{
				mutex->unlock();
				break;
			}
			qint64 bytes_read = io->read((char*)&tmp, sizeof(tmp));
		mutex->unlock();

		if (bytes_read <= 0) break;	// Pip

        processInputByte(tmp);
    }
}
Пример #2
0
/**
 * Called each time there are data in the input buffer
 */
void UAVTalk::processInputStream()
{
    quint8 tmp;

    while (io->bytesAvailable() > 0)
    {
        io->read((char*)&tmp, 1);
        processInputByte(tmp);
    }
}