File: device_discovery

package info (click to toggle)
libnet-bluetooth-perl 0.40-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 164 kB
  • ctags: 15
  • sloc: perl: 131; makefile: 7
file content (17 lines) | stat: -rwxr-xr-x 785 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use Net::Bluetooth;
                                                                                                                   
	#### list all remote devices in the area
	my $device_ref = get_remote_devices();
	foreach $addr (keys %$device_ref) {
		print "Address: $addr Name: $device_ref->{$addr}\n";
	}

	#### Note: Windows will not immediately return the device name
	#### if it is not already cached. Also there is no mechinism
	#### to alert the system when it has acquired the device name.
	#### Therefore you may have to call get_remote_devices() twice
	#### before the name shows up. (Yeah it is lame, but even the 
	#### samples that come with the Windows SDK show them putting
	#### a Sleep() call in to get around the problem.

	#### BlueZ does not have this issue.