Net::OBEX::Packet::Headers::ByteSeq - construct "byte sequence" OBEX headers.
use strict; use warnings; use Net::OBEX::Packet::Headers::ByteSeq; my $raw = Net::OBEX::Packet::Headers::ByteSeq->new( target => pack 'H*', 'F9EC7BC4953C11D2984E525400DC9E09' )->make;
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 0x40 (byte sequence, length prefixed with 2 byte unsigned integer) packet headers. Unless you are making a custom header you probably want to use Net::OBEX::Packet::Headers instead.
0x40
# OBEX FTP "Target" header my $header = Net::OBEX::Packet::Headers::ByteSeq->new( target => pack 'H*', 'F9EC7BC4953C11D2984E525400DC9E09' ); # Custom header with HI of 0x41 my $header = Net::OBEX::Packet::Headers::ByteSeq->new( "\x41" => 'foos' );
Constructs and returns a Net::OBEX::Packet::Headers::Byte object. 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:
The Type header (type of object - e.g. text, html, binary, manufacturer specific)
Type
The Time header (date/time stamp - ISO 8601 version - preferred)
Time
The Target header (name of the service that operation is targeted to)
Target
The HTTP header (an HTTP 1.x header)
HTTP
The Body header (a chunk of the object body)
Body
The End of Body header (the final chunk of the object body)
End of Body
The Who header (identifies the OBEX application, used to tell if talking to a peer)
Who
The App. Parameters header (extended application request and response information)
App. Parameters
The Auth. Challenge header (authentication digest-challenge)
Auth. Challenge
The Auth. Response header (authentication digest-response)
Auth. Response
The Object Class header (OBEX Object class of object)
Object Class
my $raw_header = $header->make;
Takes no arguments, returns a raw data of the header suitable to go down the wire.
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.
make()
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.
new()
my $old_hi = $header->hi; $header->hi( "\x41" );
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.
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.