How to structure multiple serial ports controlling different devices on a microprocessor running the .net compact framework 3.5

I'm definitely a C# newbie and I'm having trouble conceptualizing how to build a program where multiple different serial ports will control different devices. I've built classes for the different devices where I will recall specific strings to send out the serial ports and the classes will parse the incoming strings.

I feel pretty confident in being able to send strings out dynamically if I create a Dictionary of com ports. I'm just at a little bit of a loss on the best way to send the incoming bytes to the correct instance of the class.

Should I create a class that contains the com port and have that class ask the control class what the delimiter for that device is? Should I simply pass every byte as it comes in to the control class and let it handle it itself? Any advice would be helpful.

by jschaud via /r/csharp

Leave a Reply