mqtt/pdu.py
def decode(self, packet):
        '''
        Decode a UNSUBACK control packet. 
        '''
        self.encoded = packet
        lenLen = 1
        while packet[lenLen] & 0x80:
            lenLen += 1
        packet_remaining = packet[lenLen+1:]
        self.msgId   = decode16Int(packet_remaining[0:2])
        self.topics = []
        packet_remaining = packet_remaining[2:]
        while len(packet_remaining):
            l = decode16Int(packet_remaining[0:2])
            topic = packet_remaining[2:2+l].decode(encoding='utf-8')
            self.topics.append(topic)
            packet_remaining = packet_remaining[2+l:]
def decode(self, packet):
        '''
        Decode a UNSUBACK control packet. 
        '''
        self.encoded = packet
        lenLen = 1
        while packet[lenLen] & 0x80:
            lenLen += 1
        packet_remaining = packet[lenLen+1:]
        self.msgId   = decode16Int(packet_remaining[0:2])
        self.topics = []
        packet_remaining = packet_remaining[2:]
        while len(packet_remaining):
            l = decode16Int(packet_remaining[0:2])
            topic = packet_remaining[2:2+l].decode(encoding='utf-8')
            self.topics.append(topic)
            packet_remaining = packet_remaining[2+l:]
Decode a UNSUBACK control packet.