NAME

Net::MQTT::Constants - Module to export constants for MQTT protocol

VERSION

version 1.110390

SYNOPSIS

use Net::MQTT::Constants;

DESCRIPTION

Module to export constants for MQTT protocol.

FUNCTIONS

decode_remaining_length( $data, \$offset )

Calculates the remaining length from the bytes in $data starting at the offset read from the scalar reference. The offset reference is subsequently incremented by the number of bytes processed.

encode_remaining_length( $length )

Calculates the remaining length bytes from the length, $length, and returns the packed bytes as a string.

decode_byte( $data, \$offset )

Returns a byte by unpacking it from $data starting at the offset read from the scalar reference. The offset reference is subsequently incremented by the number of bytes processed.

encode_byte( $byte )

Returns a packed byte.

decode_short( $data, \$offset )

Returns a short (two bytes) by unpacking it from $data starting at the offset read from the scalar reference. The offset reference is subsequently incremented by the number of bytes processed.

encode_short( $short )

Returns a packed short (two bytes).

decode_string( $data, \$offset )

Returns a string (short length followed by length bytes) by unpacking it from $data starting at the offset read from the scalar reference. The offset reference is subsequently incremented by the number of bytes processed.

encode_string( $string )

Returns a packed string (length as a short and then the bytes of the string).

qos_string( $qos_value )

Returns a string describing the given QoS value.

message_type_string( $message_type_value )

Returns a string describing the given message_type value.

dump_string( $data )

Returns a string representation of arbitrary data - as a string if it contains only printable characters or as a hex dump otherwise.

connect_return_code_string( $return_code_value )

Returns a string describing the given connect_return_code value.

topic_to_regexp( $topic )

Takes a topic and returns an equivalent regexp if it contains wild cards or undef if it doesn't contain wild cards.

AUTHOR

Mark Hindess <soft-cpan@temporalanomaly.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2011 by Mark Hindess.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.