OpenRoberta / robertalab-ev3dev

roberta lab connector for ev3dev
Apache License 2.0
17 stars 14 forks source link

Bluetooth message blocks are not interruptible #52

Closed ensonic closed 6 years ago

ensonic commented 6 years ago

See OpenRoberta/robertalab#680

We'll need to make the socket non-blocking and poll: https://docs.python.org/3.3/howto/sockets.html#non-blocking-sockets https://docs.python.org/3.3/library/socket.html#socket.socket.setblocking or we can use a timeout: https://docs.python.org/3.3/library/socket.html#socket.socket.settimeout catch the timeout exception and loop, so that canceling works.

For reference the pybluez code: https://github.com/karulis/pybluez/