Why not adopt me?
NAME
Net::OBEX::Packet::Request::SetPath - create OBEX protocol SetPath
request packets.
SYNOPSIS
use Net::OBEX::Packet::Request::SetPath;
my $pack= Net::OBEX::Packet::Request::SetPath->new(
headers => [ $bunch, $of, $raw, $headers ],
);
my $setpath_packet = $pack->make;
$pack->headers([]); # reset headers.
$pack->do_up(1); # set the "backup a level before applying name"
$pack->no_create(0); # unset the "don't create" flag
my $empty_abort = $aborts->make;
DESCRIPTION
WARNING!!! This module is in an early alpha stage. It is recommended that you use it only for testing.
The module provides means to create OBEX protocol SetPath
(0x85
) packets. It is used internally by Net::OBEX::Packet::Request module and you probably want to use that instead.
CONSTRUCTOR
new
$pack = Net::OBEX::Packet::Request::SetPath->new;
$pack2 = Net::OBEX::Packet::Request::SetPath->new(
do_up => 0,
no_create => 1,
constants => "\x00",
headers => [ $some, $raw, $headers ],
);
Returns a Net::OBEX::Packet::Request::SetPath object, takes several optional arguments which are as follows:
headers
$pack2 = Net::OBEX::Packet::Request::SetPath->new(
headers => [ $some, $raw, $headers ],
);
Optional. Takes an arrayref as a value, elements of which are raw OBEX packet headers. See Net::OBEX::Packet::Headers if you want to create those. Defaults to: []
(no headers)
do_up
$pack2 = Net::OBEX::Packet::Request::SetPath->new( do_up => 1 );
Optional. Indicates whether or not the backup a level before applying name flag bit should be set. Defaults to: 0
no_create
$pack2 = Net::OBEX::Packet::Request::SetPath->new( no_create => 0 );
Optional. Indicates whether or not the don't create directory if it does not exist, return an error instead flag bit should be set. Defaults to: 1
constants
$pack2 = Net::OBEX::Packet::Request::SetPath->new(
constants => "\x00",
);
Optional. Takes a byte representing packet constants. Currently those are reserved so you probably shouldn't be using this. Defaults to: "\x00"
(all bits set to zero)
METHODS
make
my $raw_packet = $pack->make;
Takes no arguments, returns a raw OBEX packet ready to go down the wire.
raw
my $raw_packet = $pack->raw;
Takes no arguments, must be called after make()
call, returns the raw OBEX packet which was made with last make()
(i.e. the last return value of make()
).
ACCESSORS/MUTATORS
headers
my $headers_ref = $pack->headers;
$pack->headers( [ $bunch, $of, $raw, $headers ] );
Returns an arrayref of currently set OBEX packet headers. Takes one optional argument which is an arrayref, elements of which are raw OBEX packet headers. See Net::OBEX::Packet::Headers if you want to create those. If you want a packet with no headers use an empty arrayref as an argument.
do_up
my $old_do_up_flag = $pack->do_up;
$pack->do_up( 1 );
Returns either true or false value indicating whether or not the backup a level before applying name flag bit is set. Takes one optional argument which is either a true or false value indicating whether or not the backup a level before applying name flag bit should be set in the next generated packet.
no_create
my $old_no_create_flag = $pack->no_create;
$pack->no_create(0);
Returns either true or false value indicating whether or not the don't create directory if it does not exist, return an error instead flag bit is set. Takes one optional argument which is either a true or false value indicating whether or not the don't create directory if it does not exist, return an error instead flag bit should be set in the next generated packet.
constants
my $old_constants = $pack->constants;
$pack->constants( "\x00" );
Returns a byte representing currently set packet "constants". Takes a one byte value representing packet "constants" bit which will be present in the next generated packets. Currently all constants are reserved so you probably shouldn't be using this.
flags
my $old_flags = $pack->flags;
$pack->flags( pack 'B*', '11000000' );
Returns a byte representing currently set flags (that is the do_up()
and no_create()
flags plus six more reserved bytes). Takes one optional argument which is a byte representing packet "flags" byte. Use the do_up()
and no_create()
methods to set the only two non-reserved flags.
REPOSITORY
Fork this module on GitHub: https://github.com/zoffixznet/Net-OBEX
BUGS
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
AUTHOR
Zoffix Znet <zoffix at cpan.org> (http://zoffix.com/, http://haslayout.net/)
LICENSE
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.