This is the error I am getting when I connect to my mobile phone using the connect method in this documentation: https://gist.github.com/egorf/66d88056a9d703928f93,
pexpect.exceptions.TIMEOUT: Timeout exceeded.
<pexpect.pty_spawn.spawn object at 0xb62e3ab0>
buffer (last 100 chars): 'mCHG\x1b[0m] Device 98:5F:D3:57:1A:BD RSSI: -47\r\n[\x 1b[0;93mCHG\x1b[0m] Device 98:5F:D3:57:1A:BD TxPower: 4\r\n'
before (last 100 chars): 'mCHG\x1b[0m] Device 98:5F:D3:57:1A:BD RSSI: -47\r\n[\x 1b[0;93mCHG\x1b[0m] Device 98:5F:D3:57:1A:BD TxPower: 4\r\n'
after: <class 'pexpect.exceptions.TIMEOUT'>
delimiter: <class 'pexpect.exceptions.EOF'>
0: re.compile("Failed to connect")
1: re.compile("Connection successful")
The connection is supposed to fail since my phone is connected to another device, however it should return "failed to connect" and move on to the next paired-device that I have in my loop which calls the connect method. Unfortunately I cannot show my code. What should I do in the connect method to bypass the exception and return false for failed to connect?