LinuxQuestions.org
Help answer threads with 0 replies.
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 08-26-2009, 11:49 PM   #1
dracoid4
LQ Newbie
 
Registered: Aug 2009
Posts: 3

Rep: Reputation: 0
C/C++ code to listen and act of BlueZ HCI event packet


I trying to program a C/C++ software to interact with the BlueZ HCI.

Created a HCI socket
sock = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);

Set socket option for HCI event and stack
hci_filter_set_ptype(HCI_EVENT_PKT, &flt);
hci_filter_set_event(EVT_STACK_INTERNAL, &flt);
setsockopt(hcid.sock, SOL_HCI, HCI_FILTER, &flt, sizeof(flt));

Bind it to dev = 0
addr.hci_family = AF_BLUETOOTH;
addr.hci_dev = 0;
bind(sock, (struct sockaddr *) &addr, sizeof(addr));

How do I listen to the HCI event packet and execute command on it. I basically need some pairing sequence and code for my local device to pair with remote device or vice versa.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to convert this pf packet code for ipv6 packets linuxnewbie1234 Linux - Networking 0 03-13-2009 05:11 AM
packet fragmentation in packet forwarding code cranium2004 Linux - Networking 0 05-16-2005 05:05 AM
listen the packet in router becky_starr Programming 0 02-18-2004 09:13 AM
Requesting Packet Sniffer source code Volcom Programming 3 07-05-2003 12:48 PM
how to fire mouse event using 'C' code karthikeyan Linux - Software 2 03-08-2003 12:35 PM

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

All times are GMT -5. The time now is 03:02 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