本文整理汇总了Python中bluepy.btle.Peripheral.setMTU方法的典型用法代码示例。如果您正苦于以下问题:Python Peripheral.setMTU方法的具体用法?Python Peripheral.setMTU怎么用?Python Peripheral.setMTU使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bluepy.btle.Peripheral
的用法示例。
在下文中一共展示了Peripheral.setMTU方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: from bluepy.btle import Peripheral [as 别名]
# 或者: from bluepy.btle.Peripheral import setMTU [as 别名]
devices = scanner.scan(5.0)
wallet_address = 0
for dev in devices:
print ("Device %s (%s), RSSI=%d dB" % (dev.addr, dev.addrType, dev.rssi) )
for (adtype, desc, value) in dev.getScanData():
print (" %s = %s" % (desc, value))
if dev.rssi > -65 :
print("Get Wallet address:%s!" % dev.addr)
wallet_address = dev.addr
if wallet_address == 0:
print ("No wallet found")
exit()
p = Peripheral(wallet_address,btle.ADDR_TYPE_PUBLIC)
print(p.setMTU(144+3)) #not actually changing MTU
Address = input_str.split("&")[1].split("=")[1]
AES_Key = input_str.split("&")[2].split("=")[1]
Service_UUID = input_str.split("&")[3].split("=")[1]
TotalChar_UUID = [input_str.split("&")[4].split("=")[1][i:i+8] for i in range(0, len(input_str.split("&")[4].split("=")[1]), 8)]
print ("Wallet Address:",Address)
Characteristics = ["Transaction_UUID","Txn_UUID","AddERC20_UUID","Balance_UUID","General_CMD_UUID","General_Data_UUID"]
MainCharacteristics_head = {"Transaction_UUID":TotalChar_UUID[0],"Txn_UUID":TotalChar_UUID[1],"AddERC20_UUID":TotalChar_UUID[2],"Balance_UUID":TotalChar_UUID[3],"General_CMD_UUID":TotalChar_UUID[4],"General_Data_UUID":TotalChar_UUID[5]}
MainCharacteristics = {"Transaction_UUID":"","Txn_UUID":"","AddERC20_UUID":"","Balance_UUID":"","General_CMD_UUID":"","General_Data_UUID":""}