Connecting to serial ports
It is time to have some fun. Let’s break out of the confinements of the machine we are working on and step into the world of peripherals.
However, before we look at the code, we have to see how software communicates with hardware.
The path to the hardware
Let’s say we have an application connecting to some hardware. It doesn’t matter what kind of hardware, but let’s say we want to send data to a USB port.
Sending data from our application to the device involves several steps where the data is transformed. It is slightly like the OSI layer we discussed in the previous chapter.
It all starts with our application. We devised the C# code to send data to the USB device. We have downloaded the correct NuGet packages, installed the frameworks, written the code, and compiled it into an executable.
When that executable runs, that code is called the correct code in the .NET libraries installed on your machine when you installed...