LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-12-2004, 05:51 PM   #1
xconspirisist
Member
 
Registered: Dec 2002
Location: United Kingdom
Distribution: Ubuntu
Posts: 276

Rep: Reputation: 30
Device files / Listening for information ?


Hey. Ive got a usb bluetooth dongle on /dev/hci0. Is there anyway I can write a *small* application to get any information incoming from the dongle ? or is this not how you would do it ?

c++ language, btw.
 
Old 03-12-2004, 06:22 PM   #2
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
Code:
int main(void)
{
  int fd;
  char buf[256];

  fd = open("/dev/hci0", O_RDONLY);

  read(buf, sizeof(buf), fd);
}
I'd imagine that's how you do it anyway. Parsing what you're reading in is a whole different ball of wax though
 
Old 03-20-2004, 03:25 PM   #3
xconspirisist
Member
 
Registered: Dec 2002
Location: United Kingdom
Distribution: Ubuntu
Posts: 276

Original Poster
Rep: Reputation: 30
What includes do I need ? Says it doesnt know the function ' open ' :P
 
Old 03-20-2004, 04:46 PM   #4
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
type 'man open' and hit [enter] at the commmand prompt.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Memory slot and device information. atticboy1 Linux - Hardware 5 11-07-2006 11:31 AM
Sharing information between Linuxes with a USB device enemorales Linux - General 2 07-01-2005 08:53 AM
problem in recieving information from a terminal device dinesh_2001 Linux - Networking 0 02-13-2004 09:36 AM
listening to .pls files on RH9 PionexUser Linux - General 1 10-27-2003 03:50 AM
Bind and DNS information conf files and zone files aaronluke Linux - General 1 10-13-2002 09:41 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration