HowTo/Bluetooth/UsingNH: bt.pl

File bt.pl, 723 bytes (added by harisk, 17 years ago)

Perl script to setup Bluetooth connection - needed until Bluetooth is fully integrated with NodeHandler

Line 
1#!/usr/bin/perl
2#
3# Login to the nodes and setup Bluetooth
4#
5
6# MAC of the master node
7$mac='00:0A:3A:53:D4:82';
8print "Master MAC address $mac \n";
9
10system("ssh root\@node1-10 pand --listen -role NAP --master --autozap");
11print "ssh root\@node1-10 pand --listen -role NAP --master --autozap \n";
12sleep 10;
13
14system("ssh root\@node4-10 pand --connect $mac --service NAP --autozap");
15print "ssh root\@node4-10 pand --connect $mac --service NAP --autozap \n";
16sleep 10;
17
18system("ssh root\@node4-10 ifconfig bnep0 192.169.1.2; exit");
19print "ssh root\@node4-10 ifconfig bnep0 192.169.1.2; exit \n";
20
21system("ssh root\@node1-10 ifconfig bnep0 192.169.1.1; exit");
22print "ssh root\@node1-10 ifconfig bnep0 192.169.1.1; exit \n";