I have created a winforms UI that sends and receives strings over a serial port to and from an MCU which has a known and simple command interface. I'm wondering how I can create a chain or queue of commands, or if there is already some built in way of doing this?
I was thinking the chain would consist of a header which points to the location of the next command to be executed. Each command would be associated with a pointer to the next command, eventually leading to a pointer which refers to NULL. Whenever a command is executed, the next command string would be updated to be in the location where the header points, and each subsequent command would move up the chain.
If anybody could point me in the right direction or offer some advice, that would be great.