本文整理匯總了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]])