本文整理汇总了Python中Command.Command.queryMemory方法的典型用法代码示例。如果您正苦于以下问题:Python Command.queryMemory方法的具体用法?Python Command.queryMemory怎么用?Python Command.queryMemory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Command.Command
的用法示例。
在下文中一共展示了Command.queryMemory方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: traverseAldb
# 需要导入模块: from Command import Command [as 别名]
# 或者: from Command.Command import queryMemory [as 别名]
def traverseAldb(self, startAddress):
while startAddress > 0x00:
print("Checking: 0x%0.2x" % startAddress)
SerialInstance().ser.flushInput()
SerialInstance().ser.flushOutput()
Command.queryMemory(self.deviceId, bytes([0x0F, startAddress]))
i = SerialInstance().ser.readline()
sleep(.3)
#Keep reading the address until we don't get a NACK
if re.search(r'(\w)+(15)\b', Command.bToS(i)):
print('Received NACK')
continue #This makes it stop here and try again
elif re.search(r'(\w)+(06)\b', Command.bToS(i)):
for _ in range(50):
SerialInstance().ser.flushInput()
SerialInstance().ser.flushOutput()
i = SerialInstance().ser.readline()
cmdStr = Command.bToS(i)
if len(i) > 0:
print("06: %s" % cmdStr)
if (len(i) > 0 and len(cmdStr) == 50):
self.addToAldb(i)
startAddress = startAddress - 0x08
print("address Decremented")
break
if re.search(r'(\w)+0(0|1)0000000000000000(\w\w){0,1}\b', Command.bToS(i)):
print("Found blank address: %02x" % startAddress)
return bytearray([i[13], i[14]])