![]() |
Need Help on: Building a Bluetooth APP in Qt
Hello,
I am NEW to writing apps in Qt. Until now i programmed software for small microcontrollers (like AVR). I also programmed some small apps for console in C. So please forgive me if i have to ask step by step: My Idea: I got a Bluetooth-Module (BlueNiceCom III pdf) and combined it with an AVR. This module is sending Data via SPP-Protokoll. I wan tto write a GIU-APP that converts this data in e.g. bar graph or text in a first step. Until now My brohter helped me out writing a small console app (in C) to see the incoming data in the terminal. We compiled it directly on the N900.. But the compiler and all its parts was so big.. so I had to remove it (and unfortunately reflash my N900). So far i know a bit about how bluetooth as SPP works (own file for the opened connection / rfcomm and so on) Bevore i forget. I have: WondowsXP Nokia Qt SDK MADDE and of course a N900.. ;-) Now I want to start (and go on ;) ) with Qt to get what I need. I had my first experiences in writing a "hello World"-APP and my C++ is getting better. My next step (and my first questions) is to establish a bluetooth connection to a known (MAC-address) bluetooth device. Does anyone have any experiences in connecting a bluetooth-device (via SPP) with Qt?:confused: Is there a lib that i can use? (and how can I?):confused: I found the QBluetooth-lib.. But its only for symbian devices.. I hope I dont get awnsers like : rtfm.. better would be: rtfm "here", "here" and "here" ... ;) TY so far, Markus |
Re: Need Help on: Building a Bluetooth APP in Qt
Hi
I once tried to compile qt bluetooth from qt-extented but i never got it to work. I think it is not working anymore on top of the new bluez version. http://doc.qt.nokia.com/qtextended4....othmodule.html I think that at the moment the only way to use bluetooth is with libbluetooth3 library. |
Re: Need Help on: Building a Bluetooth APP in Qt
@sampppa,
Can i use the libbluetooth3-lib with Qt? How can I install it? (Do I need to install it? ) Quote:
@all Any other ideas? TY so far Markus |
Re: Need Help on: Building a Bluetooth APP in Qt
There's a little mention of it on http://qt.nokia.com/. I guess you have already tried searching there.
Qt 4.7 has some nifty new APIs for mobility. Maybe there is something for you in the Messaging API or the Service Framework. It seems to me that once you pair your N900 with your new hardware device that there ought to be some simple way of addressing it over a socket. |
Re: Need Help on: Building a Bluetooth APP in Qt
There isn't an easy way to do this as far as I know. I am currently doing something similar (attempting to connect to an SPP device over Bluetooth).
The Maemo UI doesn't allow you to conifigure SPP devices. In some limited instances it will set one up, but if you want to use it in your app you have to do it yourself. To do this the best(?) way I have found is to talk to BlueZ over D-Bus. Python is the easiest language to do use for this. In my app I do the following: 1) Connect to bluez and enumerate all paired bluetooth devices 2) for each device I query the services it offers 3) I build a list of every device that reports SerialPort as a service 4) Connect to the SerialPort service on the device - this will establish the SPP connection and will set up a device file for you to access. The Connect() function on the bluez Device D-Bus object will return the name of the file to access. Then it's just like opening a regular device file for serial IO. There may be a way to do all that using some bluez tools (I am pretty sure there is), but I have chosen to do it via code. |
Re: Need Help on: Building a Bluetooth APP in Qt
If you can wait a week or so (leaving town tomorrow) I can post a Bluetooth manager I'm putting together in C++ / QT. It will be able to enumerate BT devices, and make serial connections. That is all, but will show you what you need to do to continue..
|
Re: Need Help on: Building a Bluetooth APP in Qt
Quote:
Until now I don't have a solution. So your input would be very helpful. The application should also work on symbian devices. :o |
Re: Need Help on: Building a Bluetooth APP in Qt
Quote:
|
Re: Need Help on: Building a Bluetooth APP in Qt
Quote:
I am a newbie in BT and it would a great help for me to get the promise C++/Qt example. |
Re: Need Help on: Building a Bluetooth APP in Qt
I'm still very much interested in this... Would appreciate anything you've got working. Better than starting from zero.
|
Re: Need Help on: Building a Bluetooth APP in Qt
Yes, very much interested in this as well, any updates on progress?
|
Re: Need Help on: Building a Bluetooth APP in Qt
I am no expert but there doesn't seem to be any experts helping out. So I may have this all wrong but here is what I have figured out so far:
1. QT has a module in progress for bluetooth connections but it is not complete and is not part of the stuff that is supposed to be delivered by years end. http://qt.nokia.com/developer/qt-roa...nnectivity-api 2. You can establish an RFComm channel and connection through DBUS interactions But I have not been able to locate any C++ examples that make sense to me. The way I am solving the problem for my own personal use is to use the Queen Beecon widget to create a desktop shortcut for the command line "rfcomm bind" command. It is not a good solution to deploy to other people but if you have one or two devices you want to play with like me, it will let you develop the rest of your application while you wait for other solutions. |
Re: Need Help on: Building a Bluetooth APP in Qt
I've done this in Python, but I'm now trying to port over to C++ and I'm stumped :(
|
Re: Need Help on: Building a Bluetooth APP in Qt
QtMobility 1.2 will include this and there seems to be a tech preview out, but I don't know of maemo5 has the backend for it..
|
Re: Need Help on: Building a Bluetooth APP in Qt
The Bluetooth stuff that is being developed for Qt Mobilitys' Connectivity module does have Maemo5/Linux support. I actually had to implement my own version for an app I'm working on. You should be able to just use their sources though. I'll probably try and compile it myself, as now I'm planning to release my app open I can use their code.
|
Re: Need Help on: Building a Bluetooth APP in Qt
Thanks for all the help, still working on this. Some progress, some problems.
I went to the QT git site and cloned the latest to my hard drive. Did ./configure, make, sudo make install. Everything worked after I grabbed the alsa dev library. I went into the examples folder and found a service discovery example for bluetooth. It built just fine on my linux desktop version of QT creator and it displayed the bluetooth mac and names of all the bluetooth devices nearby. That was a big step forward. But it does not build when I select the maemo target, obviously because I only built the examples for my desktop. So the next question is this: Can I somehow "cross compile" the git snapshot I downloaded for Maemo using my desktop or do I have to have the full scratchbox environment installed to build the qt mobility snapshot? Thanks, David |
Re: Need Help on: Building a Bluetooth APP in Qt
OK, here is some code I just got running on my N900. It connected a to a bluetooth rs232 adapter, created a device /dev/rfcomm0 and then disconnected it. Hope it is of some help.
Code:
QString address = "00:12:6F:03:BC:63"; |
Re: Need Help on: Building a Bluetooth APP in Qt
I've generated some classes (mainly lifted from the bluez dbus qt example) and commited them here
https://garage.maemo.org/plugins/scm...ot=maegasquirt Pretty much the same code as before now looks like Code:
|
Re: Need Help on: Building a Bluetooth APP in Qt
May be the solution could be easier.
Taking into account that you want to use a SPP-profile (a virtual serial port), you could consider to read/write this port directly. I use QextSerialPort library ( http://code.google.com/p/qextserialport/ ) on Linux an Windows boxes, including Bluettoth SPP for GPSs. I haven't yet tried to compile it on Maemo, but considering that it is Linux, I think it will work. If other guys consider that this approach could work, I can try it. (No much time now, I'm fighting against telephony extesions for Symbian :confused:). Regards, Àngel |
Re: Need Help on: Building a Bluetooth APP in Qt
I've already got an app that does this, if you can wait I plan on releasing it next week.
|
Re: Need Help on: Building a Bluetooth APP in Qt
Just released my app that provides this functionality, see: http://talk.maemo.org/showthread.php?t=67276
|
All times are GMT. The time now is 16:21. |
vBulletin® Version 3.8.8