|
This is a short how2 on using a Sony Ericsson P900 mobile phone on an IBM Thinkpad T41p using GPRS through Bluetooth.
I assume that you have Bluetooth set up correctly. There are plenty of resources on the internet on how to do this.
Here is a Perl script that wraps a pppd call to initiate the connection:
#!/usr/bin/perl -w
#
# This is a script that connects to the gprs network.
#
# (c) 2004, Matthias Nott, MN Soft Branchensoftware
use strict;
use warnings;
# Make sure the rfcomm module is loaded.
# Make sure that bluetooth is restarted.
system("/etc/rc.d/bluetooth restart");
# Make sure no devices are locked.
# Detect the channel that the phone is working on.
# We do not detect the phone in the first place,
# to find out its MAC address, as this takes a
# long time. We can do so manually using the
# command
#
# hcitool scan
#
# from the command line.
my $channel = -2;
for(`sdptool browser 00:0A:D9:E9:2C:78`) {
next if($channel == -2 && !/^Service Name: Dial-up Networking.*$/);
$channel = -1;
next if($channel == -1 && !/^.*Channel: (\d+).*$/);
$channel = $1;
last if($channel >= 0);
}
print "The Mobile is having a modem on channel #$channel.\n";
# Bind the rfcomm communication channel to the mobile's
# communication channel.
system("rfcomm bind 0 00:0A:D9:E9:2C:78 $channel");
# We now have to wait for some time for the connection to
# be established.
# Finally, we open the connection.
print "Opening the connection. Press Ctrl+C to hangup.\n";
00:0A:D9:E9:2C:78 is the Bluetooth ID of the mobile phone. When you connect, you'll have to allow the incoming connection from BlueZ on the Mobile (you can set this to "always").
For the connect scripts, cf. www.mnsoft.org/319.0.html
|