本文整理汇总了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)