def decode_payload(payload, seqid, size, packettype, pktnum):
    cur = 0
    try:
        for x in range(round((size / SINGLE_NODE_REPORT_SIZE))):
            nid = int(payload[cur:(cur + 12)], 16)
            cur = (cur + 12)
            lastrssi = int(payload[cur:(cur + 2)], 16)
            cur = (cur + 2)
            maxrssi = int(payload[cur:(cur + 2)], 16)
            cur = (cur + 2)
            pktcounter = int(payload[cur:(cur + 2)], 16)
            cur = (cur + 2)
            contact = ContactData(nid, lastrssi, maxrssi, pktcounter)
            messageSequenceList[seqid].datalist.append(contact)
            messageSequenceList[seqid].datacounter += SINGLE_NODE_REPORT_SIZE
    except ValueError:
        net.addPrint('[Node {0}] Requested to decode more bytes than available. Requested: {1}'.format(messageSequenceList[seqid].nodeid, size))
    finally:
        return
def decode_payload(payload, seqid, size, packettype, pktnum):
    cur = 0
    try:
        for x in range(round((size / SINGLE_NODE_REPORT_SIZE))):
            nid = int(payload[cur:(cur + 12)], 16)
            cur = (cur + 12)
            lastrssi = int(payload[cur:(cur + 2)], 16)
            cur = (cur + 2)
            maxrssi = int(payload[cur:(cur + 2)], 16)
            cur = (cur + 2)
            pktcounter = int(payload[cur:(cur + 2)], 16)
            cur = (cur + 2)
            contact = ContactData(nid, lastrssi, maxrssi, pktcounter)
            messageSequenceList[seqid].datalist.append(contact)
            messageSequenceList[seqid].datacounter += SINGLE_NODE_REPORT_SIZE
    except ValueError:
        net.addPrint('[Node {0}] Requested to decode more bytes than available. Requested: {1}'.format(messageSequenceList[seqid].nodeid, size))
    finally:
        return