Exemplo n.º 1
0
 def format(self, rec, prefix=""):
     off = rec["offset"]
     addr = rec["addr"].toString()
     dev = getDevByAddr(addr).getName() if getDevByAddr(addr) else addr
     cr = ctrlToString(rec["type"])
     out(prefix + format(off, '04x') + " " + format(dev, '30s') + " " +
         format(addr, '8s') + " " + cr + " " +
         '{0:08b}'.format(rec["type"]) + " group: " +
         format(rec["group"], '02x') + " " + self.dataToString(rec["data"]))
Exemplo n.º 2
0
def dumpRecord(rec, prefix=""):
    off = rec["offset"]
    addr = rec["addr"].toString()
    dev = getDevByAddr(addr).getName() if getDevByAddr(addr) else addr
    cr = ctrlToString(rec["type"])
    out(prefix + format(off, '04x') + " " + format(dev, '30s') + " " +
        format(addr, '8s') + " " + cr + " " + '{0:08b}'.format(rec["type"]) +
        " group: " + format(rec["group"], '02x') + " data: " +
        ' '.join([format(x & 0xFF, '02x') for x in rec["data"]]))
Exemplo n.º 3
0
	def format(self, rec, prefix = ""):
		off  = rec["offset"]
		addr = rec["addr"].toString()
		dev = getDevByAddr(addr).getName() if getDevByAddr(addr) else addr
		cr = ctrlToString(rec["type"])
		out(prefix + format(off, '04x') + " " + format(dev, '30s') +
			" " + format(addr, '8s') + " " + cr + " " +
			'{0:08b}'.format(rec["type"]) + 
			" group: " + format(rec["group"], '02x') + " " +
			self.dataToString(rec["data"]))
Exemplo n.º 4
0
def dumpRecord(rec, prefix = ""):
	off  = rec["offset"]
	addr = rec["addr"].toString()
	dev = getDevByAddr(addr).getName() if getDevByAddr(addr) else addr
	cr = ctrlToString(rec["type"])
	out(prefix + format(off, '04x') + " " + format(dev, '30s') +
		" " + format(addr, '8s') + " " + cr + " " +
		'{0:08b}'.format(rec["type"]) + 
		" group: " + format(rec["group"], '02x') + " data: " +
		' '.join([format(x & 0xFF, '02x') for x in rec["data"]]))