Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 4th January 2008, 02:43 PM
AbubakarMalik Offline
Registered User
 
Join Date: Jan 2008
Posts: 1
How to Write commands in a C Program?

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
Reply With Quote
Reply

Tags
commands, program, write

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
School Project: Write a Basic Linux program. IIpLaYmAkErII Programming & Packaging 9 16th October 2009 07:20 PM
Kmail in Gnome: Can't Type, Write, or Use Key Commands jdrouin Using Fedora 3 30th March 2009 01:16 AM
How to write commands for Linux? tech291083 Using Fedora 3 27th November 2008 01:18 PM
how to write a shell program for file copy rajdey1 Using Fedora 8 18th August 2008 04:51 AM
Write a script to run several commands ??? wahaha Using Fedora 2 14th April 2007 09:00 AM


Current GMT-time: 09:08 (Sunday, 26-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat