Hello,
i managed to read data using QSocketNotifier and it works fine, here is the code snippet:
int socfd;
socfd = open("/dev/rfcomm0", O_RDONLY|O_NONBLOCK);
connect(note, SIGNAL(activated(int)), this, SLOT(readbytes()));
QSocketNotifier *note;
int socfd;
socfd = open("/dev/rfcomm0", O_RDONLY|O_NONBLOCK);
note = new QSocketNotifier(socfd, QSocketNotifier::Read, this);
connect(note, SIGNAL(activated(int)), this, SLOT(readbytes()));
To copy to clipboard, switch view to plain text mode
but still cant manage to open the device file using QLocalSocket.
what i did is:
QLocalSocket *Socket;
Socket = new QLocalSocket(this);
Socket
->connectToServer
("/dev/rfcomm0",
QIODevice::ReadOnly);
connect(Socket, SIGNAL(readyRead()), this, SLOT(readSocket()));
QLocalSocket *Socket;
Socket = new QLocalSocket(this);
Socket->connectToServer("/dev/rfcomm0", QIODevice::ReadOnly);
connect(Socket, SIGNAL(readyRead()), this, SLOT(readSocket()));
To copy to clipboard, switch view to plain text mode
the connections was not established at all. any hints?
Thanks
Bookmarks