connectFlagByte method

int connectFlagByte()

Return the connect flag value

Implementation

int connectFlagByte() =>
    (reserved1 ? 1 : 0) |
    (cleanStart ? 1 : 0) << 1 |
    (willFlag ? 1 : 0) << 2 |
    (willQos.index) << 3 |
    (willRetain ? 1 : 0) << 5 |
    (passwordFlag ? 1 : 0) << 6 |
    (usernameFlag ? 1 : 0) << 7;