serial port connection and qt
hi, i can’t find example how to send datas over SPP:/
now i have write simple console app:
- #include <QtCore/QCoreApplication>
- #include <QtMobility/qmobilityglobal.h>
- #include <qbluetoothsocket.h>
- #include <QDebug>
- int main(int argc, char *argv)
- QCoreApplication a(argc, argv);
- QBluetoothSocket socket(QBluetoothSocket::RfcommSocket) ;
- qDebug()<<socket.peerName() ;
- return a.exec();
and this code connect me with my bluetooth module, but how to send datas? I have tried “socket.write(const char * data, qint64 maxSize) but it is not working:/
The Bluetooth Chat Example [doc.qt.nokia.com] is en example on how to use the SPP since you send data to others through serial port.
It is quite well written but if you still have any question just ask.
thx for reply. I started with Bluetooth Chat Example and btscanner:)..I implemented a simple code on my AVR which works as follows: I send “char” and microcontroller return “[char]” and my code works-I have checked it with minicom.
….and 3 minutes ago I have changed btchatexample and it works! I don’t know why I had prooblem with that:) please follow these topic, because I think I will have some problem in near future:)…oh, i see one: some chars are not returned in longer words:/..but I thing I will deal with that.
Hello, could you please share me your code.
I have been playing around with QT quick components bluetooth that is very simple. I allthough seems that i can send a long string from N9 to PC terminal, from BluetoothModule (controlled by dsPic) to PC terminal, from Terminal to Bluetooth module BUT NOT FROM N9 to Bluetooth module. I haven’t tried sending data from BT module to N9 since i do not need that for now. I read somewhere that the QT quick => QTconnectivity bluetooth component uses some data type that can be handled by most devices, but maybe there is something that either my dsPIC wont understand => Or the BT module that uses RN-41 chip.
I have a working example for E72 (symbian 3rd) that works with the BT module but that code does not use any ready components (QT quick, connectivity etc…)
If you are willing to share your code i would appreciate it. I tried once the BT chat example but it didn’t work…
either to email@example.com or in this forum…