| Home | Libraries | People | FAQ | More

#### boost::mqtt5::reason_code

A class holding Reason Code values originating from Control Packets.

##### Synopsis

Defined in header `<boost/mqtt5/reason_codes.hpp>`

    class reason_code;

##### Member Functions

Name | Description
--- | ---
message | Returns a message describing the meaning behind the Reason Code.
operator bool | Indication if the object holds a Reason Code indicating an error.
value | Returns the byte value of the Reason Code.

##### Friends

Name | Description
--- | ---
operator< | Operator less than.
operator<< | Insertion operator.
operator== | Equality operator.

##### Description

A Reason Code is a one byte unsigned value that indicates the result of an operation. Reason Codes less than 0x80 indicate successful completion of an operation. The normal Reason Code for success is 0. Reason Code values of 0x80 or greater indicate failure. The `CONNACK`, `PUBACK`, `PUBREC`, `PUBREL`, `PUBCOMP`, `DISCONNECT` and `AUTH` Control Packets have a single Reason Code as part of the Variable Header. The `SUBACK` and `UNSUBACK` packets contain a list of one or more Reason Codes in the Payload.

##### See Also

See `Reason Codes` for a complete list of all possible instances of this class.

Convenience header `<boost/mqtt5.hpp>`