def decode(self, packet):
        '''
        Decode a SUBSCRIBE 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):
            topic, packet_remaining = decodeString(packet_remaining)
            qos =  int (packet_remaining[0]) & 0x03
            self.topics.append((topic,qos))
            packet_remaining = packet_remaining[1:]
def decode(self, 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):
            topic, packet_remaining = decodeString(packet_remaining)
            qos =  int (packet_remaining[0]) & 0x03
            self.topics.append((topic,qos))
            packet_remaining = packet_remaining[1:]
def decode ( self , 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 ) : topic , packet_remaining = decodeString ( packet_remaining ) qos = int ( packet_remaining [ 0 ] ) & 0x03 self . topics . append ( ( topic , qos ) ) packet_remaining = packet_remaining [ 1 : ]
Decode a SUBSCRIBE control packet.
Decode a SUBSCRIBE control packet .