Net::OBEX::Packet::Request - create OBEX protocol request packets.
use Net::OBEX::Packet::Request; use Net::OBEX::Packet::Headers; my $head = Net::OBEX::Packet::Headers->new; my $req = Net::OBEX::Packet::Request->new; my $obexftp_target = $head->make( target => pack 'H*', 'F9EC7BC4953C11D2984E525400DC9E09'); my $connect_packet = $req->make( packet => 'connect', headers => [ $obexftp_target ], ); # send $connect_packet down the wire my $disconnect_packet = $req->make( packet => 'disconnect' ); # this one can go too now.
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 raw OBEX packets ready to go down the wire. The module does not provide Headers creation, to create packet headers use Net::OBEX::Packet::Headers
my $req = Net::OBEX::Packet::Request->new;
Takes no arguments, returns a freshly baked Net::OBEX::Packet::Request object ready for request packet production.
Net::OBEX::Packet::Request
my $connect_packet = $req->make( packet => 'connect', headers => [ $obexftp_target ], ); my $disconnect_packet = $req->make( packet => 'disconnect' );
Takes several name/value arguments. The packet argument indicates which packet to construct, the rest of the arguments will go directly into a specific packet's constructor (new()) method. The following is a list of valid packet argument values with a corresponding module, read the documentation of that module's constructor to find out the rest of the possible arguments to make() method.
packet
new()
make()
Will make OBEX Connect packet, see Net::OBEX::Packet::Request::Connect
Connect
Will make OBEX Disconnect packet, see Net::OBEX::Packet::Request::Disconnect
Disconnect
Will make OBEX SetPath packet, see Net::OBEX::Packet::Request::SetPath
SetPath
Will make OBEX Get packet, see Net::OBEX::Packet::Request::Get
Get
Will make OBEX Get packet, see Net::OBEX::Packet::Request::Put
Will make OBEX Abort packet, see Net::OBEX::Packet::Request::Abort
Abort
The rest of packets are yet to be implemented.
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.