Why not adopt me?
NAME
Net::OBEX::Packet::Headers::Byte4 - construct "4-byte sequence" OBEX headers.
SYNOPSIS
use strict;
use warnings;
use Net::OBEX::Packet::Headers::Byte4;
my $raw = Net::OBEX::Packet::Headers::Byte4->new(
connection_id => '1234',
)->make;
DESCRIPTION
WARNING!!! This module is still in alpha stage. Use it for test purposes only as interface might change in the future.
The module provides means to create OBEX protocol 0xC0
(4 byte quantity - transmitted in network byte order (high byte first)) packet headers. Unless you are making a custom header you probably want to use Net::OBEX::Packet::Headers instead.
CONSTRUCTOR
new
# "Connection ID" header
my $header
= Net::OBEX::Packet::Headers::Byte4->new( connection_id => 'foos' );
# Custom header with HI of 0xC9
my $header
= Net::OBEX::Packet::Headers::Byte4->new( "\xC9" => 'foos' );
Constructs and returns a Net::OBEX::Packet::Headers::Byte4 obect. Two arguments: first is the byte of the HI identifier of the header and second argument is the 1 byte value of the header. Note: instead of the HI identifier byte you may use one of the names of standard OBEX headers. The possible names you can use are as follows:
- count
-
The
Count
header (Number of objects (used by Connect)) - length
-
The
Length
header (the length of the object in bytes) - timeb
-
(note the 'b') The
Time
header (date/time stamp - 4 byte version (for compatibility only)) Seetime
in Net::OBEX::Packet::Headers::ByteSeq for the prefered time header. - connection_id
-
The
Connection ID
header (an identifier used for OBEX connection multiplexing)
METHODS
make
my $raw_header = $header->make;
Takes no arguments, returns a raw data of the header suitable to go down the wire.
header
my $raw_header = $header->header;
Must be called after a call to make()
. Takes no arguments, return value is the return of make()
, the only difference is that data has been "made" already.
value
my $old_value = $header->value;
$header->value( $new_value );
Returns the currently set header value (see new()
method). If called with an optional argument will set the header value to the value of the argument, and the following calls to make()
will produce headers with this new value.
hi
my $old_hi = $header->hi;
$header->hi( "\xC9" );
Returns the currently set header HI identifier. If called with an optional argument will set the header HI identifier to the value of the argument, and the following calls to make()
will produce headers with this new HI.
AUTHOR
Zoffix Znet, <zoffix at cpan.org>
(http://zoffix.com, http://haslayout.net)
BUGS
Please report any bugs or feature requests to bug-net-obex-packet-headers at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-OBEX-Packet-Headers. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Net::OBEX::Packet::Headers::Byte4
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-OBEX-Packet-Headers
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
COPYRIGHT & LICENSE
Copyright 2008 Zoffix Znet, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.