NAME
Bluetooth::Socket - Perl extension for Bluetooth library
SYNOPSIS
use Bluetooth::Socket;
my ($btobj, $btsock);
#example 00:0E:6D:5F:91:31
my $address = $ARGV[0];
$btsock = Bluetooth::Socket->new(BTPROTO_RFCOMM, $address, 10);
$btsock->btwrite("NEMUX");
$btsock->disconnect();
exit 0;
## Bluetooth Channel Scanner could be something like this i suppose
my $address = $ARGV[0];
$btobj = new Bluetooth::Socket;
if ($btobj->check_address($address)) {
for ($chan = 1; $chan <= 30; $chan++) {
if ($btsock = $btobj->socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM) > 0) {
$btobj->bind($btsock, "00:00:00:00:00:00");
if (($btobj->connect($btsock, $address, $chan)) < 0) {
print $chan . " Closed\n";
} else {
print $chan . " Open\n";
}
$btobj->btclose($btsock);
} else {
print "Unable to crate bluetooth socket for channel $chan\n";
}
}
}
exit 0;
DESCRIPTION
TODO
EXPORT
TODO
SEE ALSO
::TODO::
USE IT FOR TEST ONLY!
Contact me if you intend to contribute to the development or for info about it.
::TODO::
AUTHOR
Marco Romano, <nemux@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2005 by Marco Romano
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.