def packetToDict(pkt):
	"""
	Given a packet, this turns it into a dictionary ... is this useful?

	in: packet, array of numbers
	out: dictionary (key, value)
	"""

	d = {
		'id': pkt[4],
		'instruction': xl320.InstrToStr[pkt[7]],
		'length': (pkt[6] << 8) + pkt[5],
		'params': pkt[8:-2],
		'crc': pkt[-2:]
	}

	return d