Thread
:
Need Help on: Building a Bluetooth APP in Qt
View Single Post
nilsbenson
2010-09-23 , 01:07
Posts: 19 | Thanked: 7 times | Joined on Jan 2010 @ dallas, tx usa
#
5
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.
Quote & Reply
|
nilsbenson
View Public Profile
Send a private message to nilsbenson
Find all posts by nilsbenson