Generate examples for each hub by replacing ExampleHub by
the name of each hub, and skip examples that do not apply
to a particular hub. Such as examples with floating point.
These two are likely the first in a range of generic LEGO trains with a
City Hub and a DC Train Motor. Instead of adding examples to each,
we add generic train examples in a shared folder and link to them.
We reserve these folders specifically for these sets and their B models.
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.
Technically it does not matter much who is the server or the client.
However, if Windows PCs are involved, we found it to be easier if
Windows is the client and EV3 is the server.
That way, it is the Windows PC initiating the connection. It doesn't
seem to like it when other devices take the initiative.
So, we update the example accordingly to make it
accessible for most users without loss of generality.
You can still make the PC the server by just running the
server example on your PC.
Even though our main example will have the PC as the server, make it possible to use it as client as well.
Now, it works just like the EV3s. The only difference is that
you must enter the full address instead of the name if the EV3 is the server you are connecting to.