bluetooth_adr = sys.argv[1]
tool = pexpect.spawn('gatttool -b ' + bluetooth_adr + ' --interactive')
tool.expect('\[LE\]>')
print "Preparing to connect. You might need to press the side button..."
tool.sendline('connect')
# test for success of connect
tool.expect('\[CON\].*>')
tool.sendline('char-write-cmd 0x29 01')
tool.expect('\[LE\]>')
如何修改这个以便连接多个传感器?
谢谢