Python Forum
can I use 2 child.expect at the same time? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: can I use 2 child.expect at the same time? (/thread-27077.html)



can I use 2 child.expect at the same time? - korenron - May-25-2020

Hello
I'm running a code that scan bluetooth
I have notice that some time the reaply is wil rssi and sometime he print the name of the devcie
this is the cmd replay:
@raspberrypi:~ $ bluetoothctl 
Agent registered
[bluetooth]# scan on
Discovery started
[CHG] Controller DC:A6:32:75:55:C5 Discovering: yes
[NEW] Device EB:8E:13:4C:E0:AC MDBT42Q e0ac
[NEW] Device E9:EB:1B:66:08:1F MDBT42Q 081f
[NEW] Device A8:9C:ED:2A:9C:30 wallie
[CHG] Device EB:8E:13:4C:E0:AC RSSI: -70


in my code I use this regex
i = child.expect("Device (([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})) RSSI: (-[0-9]{2})", timeout=10)
is there any what to create antoher child.expect on the same answer?
so I will also can read the name ?

Thanks ,