line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package SMS::Send::DeviceGsm; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
72665
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
32
|
|
5
|
1
|
|
|
1
|
|
4
|
use base qw(SMS::Send::Driver); |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
968
|
|
6
|
1
|
|
|
1
|
|
1763
|
use Device::Gsm; |
|
1
|
|
|
|
|
317605
|
|
|
1
|
|
|
|
|
46
|
|
7
|
1
|
|
|
1
|
|
17
|
use vars qw($VERSION); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
265
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$VERSION = '1.06'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
0
|
|
|
0
|
1
|
|
my $package = shift; |
13
|
0
|
|
|
|
|
|
my %opts = @_; |
14
|
0
|
|
|
|
|
|
$opts{lc $_} = delete $opts{$_} for keys %opts; |
15
|
0
|
|
|
|
|
|
my $self = bless { }, $package; |
16
|
0
|
0
|
|
|
|
|
my $gsm = Device::Gsm->new( log => $self, ( $opts{_port} ? ( port => $opts{_port} ) : () ) ); |
17
|
0
|
|
|
|
|
|
$self->{gsm} = $gsm; |
18
|
0
|
0
|
0
|
|
|
|
return $self if $gsm and $gsm->connect( ( $opts{_baudrate} ? ( baudrate => $opts{_baudrate} ) : () ) ); |
|
|
0
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
return; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub send_sms { |
23
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
24
|
0
|
|
|
|
|
|
my %opts = @_; |
25
|
0
|
|
|
|
|
|
my $sent = $self->{gsm}->send_sms( |
26
|
|
|
|
|
|
|
content => $opts{text}, |
27
|
|
|
|
|
|
|
recipient => $opts{to}, |
28
|
|
|
|
|
|
|
); |
29
|
0
|
|
|
|
|
|
return $sent; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub write { |
33
|
0
|
|
|
0
|
0
|
|
1; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
__END__ |