本文整理匯總了Python中TestLib.reverseBytes方法的典型用法代碼示例。如果您正苦於以下問題:Python TestLib.reverseBytes方法的具體用法?Python TestLib.reverseBytes怎麽用?Python TestLib.reverseBytes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TestLib
的用法示例。
在下文中一共展示了TestLib.reverseBytes方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: readIgloo
# 需要導入模塊: import TestLib [as 別名]
# 或者: from TestLib import reverseBytes [as 別名]
def readIgloo(slot, address, num_bytes):
b.write(0x00,[0x06])
b.write(t.bridgeAddress(slot),[0x11,0x03,0,0,0])
b.write(0x09,[address])
b.read(0x09, num_bytes)
message = b.sendBatch()[-1]
return t.reverseBytes(message)
示例2: bridgeTests
# 需要導入模塊: import TestLib [as 別名]
# 或者: from TestLib import reverseBytes [as 別名]
def bridgeTests(slot, num_tests, verbosity=0):
passed = 0
failed = 0
neither = 0
print '## Number of Tests: '+str(num_tests)
for test in xrange(num_tests):
print '\n### Bridge Test: '+str(test)+' ###'
print '\n### Test Name: '+str(bridgeDict[test]['name'])
function = bridgeDict[test]['function']
address = bridgeDict[test]['address']
num_bytes = bridgeDict[test]['bits']/8
message = t.readRegisterBridge(slot, address, num_bytes)
print '\n*********** RAW MESSAGE :'+str(t.reverseBytes(message))+'\n'
result = function(message)
if result == 'PASS':
passed += 1
elif result == 'FAIL':
failed += 1
else:
print 'Neither PASS Nor FAIL'
neither += 1
if verbosity:
print 'Register Name: '+str(bridgeDict[test]['name'])
print 'Register Value: '+str(message)
print 'Test Result: '+str(result)
test_list = [passed, failed, neither]
return test_list
示例3: writeIgloo
# 需要導入模塊: import TestLib [as 別名]
# 或者: from TestLib import reverseBytes [as 別名]
def writeIgloo(rm,slot,address,messageList):
t.openRM(b,rm)
b.write(0x00,[0x06])
b.write(t.bridgeAddress(slot),[0x11,0x03,0,0,0])
b.write(0x09,[address] + messageList)
message = b.sendBatch()[-1]
return t.reverseBytes(message)
示例4: readBridge
# 需要導入模塊: import TestLib [as 別名]
# 或者: from TestLib import reverseBytes [as 別名]
def readBridge(slot, address, num_bytes):
b.write(t.bridgeAddress(slot),[address])
b.read(t.bridgeAddress(slot), num_bytes)
message = b.sendBatch()[-1]
return t.reverseBytes(message)