Saturday, December 4, 2010

Software: Serial Packet "Driver", First Bits

So the first software bit has been started to support these grandiose plans I have in my head for all of this boat electronic stuff. That particular bit is the serial port "driver" component. Written in Microsoft Visual C++ using Component Object Model (COM), it is the bit that will connect the "application software" to the "hardware" for your standard serial port. The use of COM ensures that this driver could be used by any number of application hosts written with various tools in Windows (.NET, MFC, C#, VB.NET, C++, Flash, Delphi).

Part of the development process includes a test application and a null modem connector connecting two serial ports on my computer. The test application tests all of the send and recieve functions of the driver. The null modem connector enables the two serial ports to talk to each other. What one port sends, the other recieves and vice versa. This test application is written in C# using .NET WinForms libraries. It acts as the "host application" providing a user interface to send/receive text one port to the other. Error and status logging is included to help diagnose any errors.

This software component is intended to be very low level. It just sends and recieves raw data packets and makes no assumptions about data "protocols", that will come later in other components (some design considerations need to be given on data protocols). The component supports send data, recieve data, and error reporting. The recieve functions are multi-threaded to provide maximum performance of the host application without risking data loss.

I plan to allow for multiple means of hardware communication. This could include serial port, ethernet, bluetooth, wifi or whatever. But, for getting started in the lab, the basic plain serial port will do just fine.

No comments:

Post a Comment