Hi! I am unable to read info from UDP using this source on my phone. It connects to my PC and reads info from a game. The app works fine in Qt debugger when running on PC, however on the phone it doesn't work. I also don't see a Wi-Fi logo on the phone, when running.
I tried to set up QNetwork, and connect to the default access point, but that wouldn't start on the phone when installed. It just displayed the loading mark, and never opened. In Debugger when launching on phone it says "Could not start application: General OS-related error" But If I remove the network parts, it starts.
and my .pro:PHP Code:#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QtNetwork/QUdpSocket>
#include <QtNetwork/QHostAddress>
#include <QtNetwork>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
MainWindow::setUpOG();
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::setUpOG()
{
//ui->label->setText("Hi!");
MainWindow::setWindowTitle("SymGauge");
MainWindow::udpSocket = new QUdpSocket(this);
MainWindow::udpSocket->bind(QHostAddress::Any, 30000);
connect(MainWindow::udpSocket, SIGNAL(readyRead()), this, SLOT(readPendingDatagrams()));
}
void MainWindow::readPendingDatagrams()
{
while (MainWindow::udpSocket->hasPendingDatagrams())
{
if(MainWindow::udpSocket->pendingDatagramSize() == 92) //Check if the incoming packet is 92 bytes long.
{
QByteArray datagram;
datagram.resize(udpSocket->pendingDatagramSize());
QHostAddress sender;
quint16 senderPort;
udpSocket->readDatagram(datagram.data(), datagram.size(),
&sender, &senderPort);
ui->label->setText("Received datagram");
processTheDatagram(datagram);
}
else { MainWindow::udpSocket->readDatagram(NULL, 0, NULL, NULL); }
}
}
Thanks.PHP Code:#-------------------------------------------------
#
# Project created by QtCreator 2010-12-19T11:52:41
#
#-------------------------------------------------
QT += core gui network
TARGET = gauuuge
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
CONFIG += mobility
MOBILITY += bearer
symbian {
TARGET.UID3 = 0xe52771aa
TARGET.CAPABILITY += NetworkServices
TARGET.EPOCSTACKSIZE = 0x14000
TARGET.EPOCHEAPSIZE = 0x020000 0x800000
}
symbian: include($$QT_SOURCE_TREE/examples/symbianpkgrules.pri)
symbian:TARGET.CAPABILITY = NetworkServices





