Net::OBEX::Packet::Headers::Byte4 - construct "4-byte sequence" OBEX headers.
package Net::OBEX::Packet::Headers; use strict; use warnings; use base 'Net::OBEX::Packet::Headers::Base'; our $VERSION = '0.001'; sub make { my $self = shift; my $value = $self->value; unless ( length $value ) { return $self->hi . "\x00\x03"; } $value = pack 'n*', unpack 'U*', encode_utf8($value); my $header = $self->hi; # header code $header .= pack 'n', 4 + length $value; $header .= $value . "\x00"; return $self->header($header); } 1; __END__
WARNING!!! This module is still in alpha stage. Use it for test purposes only as interface might change in the future.
The module is a base class for OBEX packet headers.
It defines new(), make(), header(), value() and hi() methods. The default make() method is:
new()
make()
header()
value()
hi()
sub make { my $self = shift; my $value = $self->value; unless ( length $value ) { return $self->hi; } my $header = $self->hi . $value; return $self->header($header); }
Refer to the documentation of either: Net::OBEX::Packet::Headers::Byte1, Net::OBEX::Packet::Headers::Byte4, Net::OBEX::Packet::Headers::ByteSeq or Net::OBEX::Packet::Headers::Unicode for the documentation of the methods.
Fork this module on GitHub: https://github.com/zoffixznet/Net-OBEX
To report bugs or request features, please use https://github.com/zoffixznet/Net-OBEX/issues
If you can't access GitHub, you can email your request to bug-Net-OBEX at rt.cpan.org
bug-Net-OBEX at rt.cpan.org
Zoffix Znet <zoffix at cpan.org> (http://zoffix.com/, http://haslayout.net/)
You can use and distribute this module under the same terms as Perl itself. See the LICENSE file included in this distribution for complete details.
LICENSE
To install Net::OBEX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::OBEX
CPAN shell
perl -MCPAN -e shell install Net::OBEX
For more information on module installation, please visit the detailed CPAN module installation guide.