Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
6 years, 2 months ago.
mbed Socket Thread
I need to establish an ethernet connection between a host and mbed, where the host can send commands to the mbed (e.g. move forward, move backwards, stop, etc).
As there is no telling when these incoming commands might be received, would it be advisable to keep my Socket code in a separate thread, which polls socket.receive(..) in a while(true) loop, and then sets the state (based on the command received) of the main thread?
Alternatively is there a way to use an interrupt whenever there is data (i.e. a command) to be received?
What sort of issues might I run into with either of these methods?