mqtt/pdu.py
def decodeLength(encoded):
    '''
    Decodes a variable length value defined in the MQTT protocol.
    This value typically represents remaining field lengths
    '''
    value      = 0
    multiplier = 1
    for i in encoded:
        value += (i & 0x7F) * multiplier
        multiplier *= 0x80
        if (i & 0x80) != 0x80:
            break
    return value
def decodeLength(encoded):
    '''
    Decodes a variable length value defined in the MQTT protocol.
    This value typically represents remaining field lengths
    '''
    value      = 0
    multiplier = 1
    for i in encoded:
        value += (i & 0x7F) * multiplier
        multiplier *= 0x80
        if (i & 0x80) != 0x80:
            break
    return value
def decodeLength ( encoded ) : value = 0 multiplier = 1 for i in encoded : value += ( i & 0x7F ) * multiplier multiplier *= 0x80 if ( i & 0x80 ) != 0x80 : break return value
Decodes a variable length value defined in the MQTT protocol.
    This value typically represents remaining field lengths
Decodes a variable length value defined in the MQTT protocol . This value typically represents remaining field lengths