A generic task that represents a live train. For K4 this task would only need to deal with knowing the train speed, state of the lights, and state of the horn/functions. It should also probably know which train it actually represents.
The train task would function like a server, taking requests from other tasks, such as the terminal, async terminal commands (like a reverse notifier) or possibly other trains.
Each train may want to register with the name server using the train number (train 51 would be "51" or "TRAIN51"), so that the terminal and other tasks can look them up easily; alternatively some other protocol for task discovery could be used.
A generic task that represents a live train. For K4 this task would only need to deal with knowing the train speed, state of the lights, and state of the horn/functions. It should also probably know which train it actually represents.
The train task would function like a server, taking requests from other tasks, such as the terminal, async terminal commands (like a reverse notifier) or possibly other trains.
Each train may want to register with the name server using the train number (train 51 would be "51" or "TRAIN51"), so that the terminal and other tasks can look them up easily; alternatively some other protocol for task discovery could be used.