1 package GSM::SMS::NBS::Frame;
7 my $class = ref($proto) || $proto;
15 sub destination_port {
18 $self->{destination} = $dest;
23 my ($self, $source)=@_;
25 $self->{source} = $source;
28 sub datagram_reference_number {
35 sub fragment_maximum {
38 $self->{fmax} = $fmax;
41 sub fragment_sequence_number {
42 my ($self, $fsn) = @_;
55 $NBS_HEADER[0] = 11; # header length, without this byte
56 $NBS_HEADER[1] = 5; # Port address information element, 16bit
57 $NBS_HEADER[2] = 4; # Length of the info element
58 $NBS_HEADER[3] = ($self->{destination} & 0xff00) >> 8; # high byte destination
59 $NBS_HEADER[4] = $self->{destination} & 0xff; # low byte destination
60 $NBS_HEADER[5] = ($self->{source} & 0xff00) >> 8; # high byte source
61 $NBS_HEADER[6] = $self->{source} & 0xff; # low byte source
62 $NBS_HEADER[7] = 0; # Fragmentation information element
63 $NBS_HEADER[8] = 3; # Length of Info el
64 $NBS_HEADER[9] = $self->{drn}; # fragment id
65 $NBS_HEADER[10] = $self->{fmax}; # max amount of frags
66 $NBS_HEADER[11] = $self->{fsn}; # sequence number fragment
69 if ($self->{fmax} == 1) {
74 for (my $j=0; $j<$len; $j++) {
76 $out.=sprintf("%02x", $i);
86 GSM::SMS::NBS::Frame - Encapsulates frames for NBS messages.
90 Create a frame for a NBS message.
94 Johan Van den Brande <johan@vandenbrande.com>