Thread sub richtig aufrufen
(19 answers)
Opened by atragator at 2008-02-18 12:30
Hallo, hab schon wieder so ein ähnliches Problem und zwar will ich diese sub aufrufen, weiß aber nicht wie bzw was ich ihr mitgeben muss.
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 #package GSM::SMS::PDU # decode a SMSSubmit message (experimental!) sub SMSSubmit_decode { my ($self, $data) = @_; my @msg = split //, $data; # Get service center my $sca = $self->getServiceCenterAddress(\@msg); # Get PDU type my $pdu = $self->getoctet(\@msg); # message ref my $mref = $self->getoctet(\@msg); # destination address my $da = $self->getOriginatingAddress(\@msg); # protocol identifier my $pi = $self->getoctet(\@msg); # data scheme my $ds = $self->getoctet(\@msg); # vp my $vp = $self->getoctet(\@msg); # length my $dl = $self->getoctet(\@msg); my $udh; my $payload; # print join "|", @msg; # print "\n"; if ($pdu=~/51/) { # we have a user data header my $udhl = hex($msg[0].$msg[1]); # print "udhl ($msg[0]): $udhl\n"; $udh = $self->getoctet(\@msg, $udhl+1); $payload = join("", @msg); } else { $payload = $self->decode_7bit( join("", @msg), 160 ); } # print "da : $da\n"; # print "pdu type : $pdu\n"; # print "data scheme : $ds\n"; # print "length : $dl\n"; # print "udh : $udh\n"; # print "pay : $payload\n"; return ($da, $pdu, $ds, $udh, $payload); } |