1 |
joko |
1.1 |
package Data::Storage::Handler::Cellphone::API; |
2 |
|
|
|
3 |
|
|
use strict; |
4 |
|
|
use warnings; |
5 |
|
|
|
6 |
|
|
use Data::Dumper; |
7 |
|
|
|
8 |
|
|
|
9 |
|
|
sub transport_setup_safe { |
10 |
|
|
my $self = shift; |
11 |
|
|
if (!$self->{connected}) { |
12 |
|
|
$self->{connected}++; |
13 |
|
|
$self->{Cellphone}->transport_setup(); |
14 |
|
|
} |
15 |
|
|
} |
16 |
|
|
|
17 |
|
|
sub send { |
18 |
|
|
my $self = shift; |
19 |
|
|
my $attribs = shift; |
20 |
|
|
my $inner = shift; |
21 |
|
|
|
22 |
|
|
if ($self->{connected}) { |
23 |
|
|
my $arg1 = $inner->[0]->{content}; |
24 |
|
|
print "$arg1: "; |
25 |
|
|
print $self->{Cellphone}->send($arg1), "\n"; |
26 |
|
|
} else { |
27 |
|
|
die("Cellphone not connected"); |
28 |
|
|
} |
29 |
|
|
} |
30 |
|
|
|
31 |
|
|
1; |
32 |
|
|
__END__ |