Hi everybody,
I am quite new in Linux (Fedora), C language and Bluetooth management as well but I have a school project to finish. I am trying my best to do this for last one month almost but still couldn't finish it completely. I hope I will get my answer here.
I already have found console commands to send and receive files from computer to phone and phone to computer as well through Bluetooth and they are working perfectly. But I don't know how can I use these commands to write a program or function which I can call under the click event of a button. In short I don't know how to use these commands in pure programming format??
Please give me a solution in C, C++ or Python language.
For more details I am using following commands to scan, connect, send and receive files to and from a phone using Bluetooth;
Detecting the mobile
hcitool scan
Here is the output obtained on my machine:
Scanning ...
00:0E:6D:9A:57:48 Dijkstra
Pairing the mobile
sh /etc/init.d/bluetooth stop
sh /etc/init.d/bluetooth start
Transferring files from Fedora PC to Mobile
sdptool browse 00:0E:6D:9A:57:48
obex_push 9 00:0e:6d:9a:57:48 a.txt
Transferring files from to Mobile Fedora PC
1. Select Applications -> System Tools -> Bluetooth File Sharing. Nothing will appear to have happened, but in fact, a new icon will have been added to the notification area. This does nothing apart from indicate your computer is ready for incoming Bluetooth connections.
2. On the Bluetooth device from which you wish to send the file, start the file transfer. On the mobile, I selected the file and clicked Send -> Via Bluetooth.
3. When the file transfer is initiated, a dialog box will appear on your computer asking if you wish to accept the file. Click OK. (If the two devices are paired, the file transfer may happen instantly without the confirmation dialog box.) The file will be saved to your /home directory.
Regards,
Abubakar Malik