Net::OBEX::Packet::Request::SetPath - create OBEX protocol SetPath request packets.
SetPath
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;
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.
0x85
$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:
$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)
[]
$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
0
$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
1
$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)
"\x00"
my $raw_packet = $pack->make;
Takes no arguments, returns a raw OBEX packet ready to go down the wire.
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()).
make()
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.
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.
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.
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.
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.
do_up()
no_create()
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.