summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-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;
}