Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Programing] Bluez ping by user [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
hadogenes
Tux's lil' helper
Tux's lil' helper


Joined: 05 Jan 2005
Posts: 107
Location: Poland, Poznan

PostPosted: Thu Nov 03, 2011 2:47 pm    Post subject: [Programing] Bluez ping by user [SOLVED] Reply with quote

Hi,
Is there some simple way to "ping" bluetooth device?

I tried to run connect on L2_CAP stack (l2ping) but it require root permissions.
I know I could run scan but then the device has to be visible and it takes some time (about 12 s).

Hadogenes

// Edit
I've found it, I use the hci_read_remote_name function
Code:
bdaddr_t addr;
char name[248] = { 0 };

int sk = hci_open_dev(hci_get_route(NULL));

str2ba(argv[1], &addr);

if (hci_read_remote_name(sk, &addr, sizeof(name), name, 0) => 0)
  /* Is in range */
else
  /* Not in range */
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum