.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Device::Gsm::Pdu 3" .TH Device::Gsm::Pdu 3 2023-07-25 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Device::Gsm::Pdu \- library to manage PDU encoded data for GSM messaging .SH WARNING .IX Header "WARNING" .Vb 3 \& This is C software, still needs extensive testing and \& support for custom GSM commands, so use it at your own risk, \& and without C warranty! Have fun. .Ve .SH NOTICE .IX Header "NOTICE" .Vb 2 \& This module is meant to be used internally by C class, \& so you probably do not want to use it directly. .Ve .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Device::Gsm::Pdu; \& \& # DA is destination address \& $DA = Device::Gsm::Pdu::encode_address(\*(Aq+39347101010\*(Aq); \& $number = Device::Gsm::Pdu::decode_address( $DA ); \& \& # Encode 7 bit text to send messages \& $text = Device::Gsm::Pdu::encode_text7(\*(Aqhello\*(Aq); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" \&\f(CW\*(C`Device::Gsm::Pdu\*(C'\fR module includes a few basic functions to deal with SMS in PDU mode, such as encoding GSM addresses (phone numbers) and, for now only, 7 bit text. .SH FUNCTIONS .IX Header "FUNCTIONS" .SS "decode_address( pdu_encoded_address )" .IX Subsection "decode_address( pdu_encoded_address )" Takes a PDU encoded address and decodes into human-readable mobile number. If number type is international, result will be prepended with a `+' sign. .PP Clearly, it is intended as an internal function. .PP \fIExample\fR .IX Subsection "Example" .PP .Vb 2 \& print Device::Gsm::Pdu::decode_address( \*(Aq0B919343171010F0\*(Aq ); \& # prints \`+39347101010\*(Aq; .Ve .SS "encode_address( mobile_number )" .IX Subsection "encode_address( mobile_number )" Takes a mobile number and encodes it as DA (destination address). If it begins with a `+', as in `+39328101010', it is treated as an international number. .PP \fIExample\fR .IX Subsection "Example" .PP .Vb 2 \& print Device::Gsm::Pdu::encode_address( \*(Aq+39347101010\*(Aq ); \& # prints \`0B919343171010F0\*(Aq .Ve .SS "encode_text7( text_string )" .IX Subsection "encode_text7( text_string )" Encodes some text ASCII string in 7 bits PDU format, including a header byte which tells the length is septets. This is the only 100% supported mode to encode text. .PP \fIExample\fR .IX Subsection "Example" .PP .Vb 2 \& print Device::Gsm::Pdu::encode_text7( \*(Aqhellohello\*(Aq ); \& # prints \`0AE832...\*(Aq .Ve .SS pdu_to_latin1($pdu) .IX Subsection "pdu_to_latin1($pdu)" Converts a PDU (without the initial length octet) into a latin1 string. .PP \fIExample\fR .IX Subsection "Example" .PP .Vb 3 \& my $pdu = \*(AqCAFA9C0E0ABBDF7474590E8296E56C103A3C5E97E5\*(Aq; \& print Device::Gsm::Pdu::pdu_to_latin1($pdu); \& # prints \`Just another Perl hacker\*(Aq .Ve .SS latin1_to_pdu($text) .IX Subsection "latin1_to_pdu($text)" Converts a text string in latin1 encoding (ISO\-8859\-1) into a PDU string. .PP \fIExample\fR .IX Subsection "Example" .PP .Vb 3 \& my $text = "Just another Perl hacker"; \& print Device::Gsm::Pdu::latin1_to_pdu($text); \& # prints \`CAFA9C0E0ABBDF7474590E8296E56C103A3C5E97E5\*(Aq .Ve .SH AUTHOR .IX Header "AUTHOR" Cosimo Streppone, cosimo@cpan.org .SH COPYRIGHT .IX Header "COPYRIGHT" This library is free software; you can redistribute it and/or modify it only under the terms of Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBDevice::Gsm\fR\|(3), \fBperl\fR\|(1)