summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2008-05-15 22:10:04 +0000
committerOlivier Blin <oblin@mandriva.com>2008-05-15 22:10:04 +0000
commitec987949cb05f01906983fe1a4cafea0c9dec85d (patch)
tree47427ba2a1dfa2cafcc4686caad5d8d697fe0aee
parent20e7229a7664a938d5f11e27942b727fb22e51ad (diff)
downloaddrakx-net-ec987949cb05f01906983fe1a4cafea0c9dec85d.tar
drakx-net-ec987949cb05f01906983fe1a4cafea0c9dec85d.tar.gz
drakx-net-ec987949cb05f01906983fe1a4cafea0c9dec85d.tar.bz2
drakx-net-ec987949cb05f01906983fe1a4cafea0c9dec85d.tar.xz
drakx-net-ec987949cb05f01906983fe1a4cafea0c9dec85d.zip
extract set_ppp_settings functions, to be called to apply network selection only
-rw-r--r--lib/network/connection/cellular.pm1
-rw-r--r--lib/network/connection/cellular_bluetooth.pm12
-rw-r--r--lib/network/connection/cellular_card.pm16
3 files changed, 18 insertions, 11 deletions
diff --git a/lib/network/connection/cellular.pm b/lib/network/connection/cellular.pm
index 5ecd2f8..ad4e68d 100644
--- a/lib/network/connection/cellular.pm
+++ b/lib/network/connection/cellular.pm
@@ -53,6 +53,7 @@ sub get_access_settings {
sub write_settings {
my ($self) = @_;
$self->write_cellular_settings;
+ $self->set_ppp_settings;
$self->SUPER::write_settings;
}
diff --git a/lib/network/connection/cellular_bluetooth.pm b/lib/network/connection/cellular_bluetooth.pm
index 77bf964..0f89b2c 100644
--- a/lib/network/connection/cellular_bluetooth.pm
+++ b/lib/network/connection/cellular_bluetooth.pm
@@ -70,6 +70,14 @@ sub search_services {
@services;
}
+sub set_ppp_settings {
+ my ($self) = @_;
+
+ my $cid = 1;
+ $self->{access}{at_commands} = [ qq(AT+CGDCONT=$cid,"IP","$self->{access}{apn}") ];
+ $self->{access}{dial_number} = "*99***$cid#";
+}
+
sub write_settings {
my ($self) = @_;
@@ -83,10 +91,6 @@ rfcomm$dev {
}
));
- my $cid = 1;
- $self->{access}{at_commands} = [ qq(AT+CGDCONT=$cid,"IP","$self->{access}{apn}") ];
- $self->{access}{dial_number} = "*99***$cid#";
-
$self->SUPER::write_settings;
}
diff --git a/lib/network/connection/cellular_card.pm b/lib/network/connection/cellular_card.pm
index cd51f8a..4d7c1f5 100644
--- a/lib/network/connection/cellular_card.pm
+++ b/lib/network/connection/cellular_card.pm
@@ -104,14 +104,8 @@ sub build_peer {
#- $self->{access}{peer}->{init} = "comgt -d $dev < $pin_file"
}
-sub write_settings {
+sub set_ppp_settings {
my ($self) = @_;
-
- my $interface = $self->get_interface;
- my $pin_file = "/etc/sysconfig/network-scripts/pin-$interface";
-
- output_with_perm($pin_file, 0600, $self->{hardware}{pin} . "\n");
-
my $cid = 3;
$self->{access}{at_commands} = [
"AT+CPIN?",
@@ -124,6 +118,14 @@ sub write_settings {
"AT+CGATT?",
];
$self->{access}{dial_number} = "*99***$cid#";
+}
+
+sub write_settings {
+ my ($self) = @_;
+
+ my $interface = $self->get_interface;
+ my $pin_file = "/etc/sysconfig/network-scripts/pin-$interface";
+ output_with_perm($pin_file, 0600, $self->{hardware}{pin} . "\n");
$self->SUPER::write_settings;
}