Files
pybricks-projects/snippets/ev3/bluetooth_pc
Laurens Valk d5ee42156d ev3/snippets/bluetooth_pc: StreamRequestHandler
This restores the previously deleted custom StreamRequestHandler.

In the prevous commits, more and more pieces from the standard socket library were used instead of the custom-made ones made for EV3. This was giving compatibility issues on some platforms (Windows/Mac), and differences with EV3 made it harder to debug.

It was previously dropped to make the MailboxHandler work. This commit reverts that change and modifies the MailboxHandler instead to make it work with the BluetoothSocket objects, which do not have rfile.read. Instead we use recv directly and rely on zero length to detect disconnected state.

It would be useful to eventually use only components from the socket server module and no incomplete custom ones, but this provides at least a working cross platform starting point to fall back to.
2020-05-16 20:13:40 +02:00
..