160 likes | 318 Views
Com Port API. Karl Riehl http://compsci.snc.edu/cs460/riehkf. Project Definition. Build a simple full featured serial port application interface. Project Requirements.
E N D
Com Port API Karl Riehl http://compsci.snc.edu/cs460/riehkf
Project Definition • Build a simple full featured serial port application interface.
Project Requirements • Modules in the driver for the API will offer most all of the primary features for controlling the port including (but not limited to) functions that open, close, read, write, and allow buffered and event processing. • Design simple test routines that users can easily check the com port in new environments. • The API uses standard C procedural protocols.
Project Requirements cont. • Test the API on the Visual 6 software development platform as well as the Visual .NET software development platform. • Also, test the API using several USB to COM adaptors.
Solutions • The API Functions affecting • Open • Close • Read • Write • Buffers • Properties
Solutions cont. • Sample procedures to check in new environments • API works in C++, VB6, and C# • Able to incorporate the Serial to USB adapter
Exceptions • Event Processing • Taken off as requirement
Methodology • Main Structures Used • DCB • COMSTAT • COMMTIMEOUTS
Methodology cont. • Created functions in a C program • Compiled Often • Continually Testing and Debugging • Moved to dll • Started moving into other languages • Change data types as needed
Methodology cont. • Event Include Statements Main { OpenPort StartThread Continue With Code } SomeFunction() { WaitCommEvent Read Deal With Data }
Strategies • Get Good Base • Start with Open and Close • Built up the functions from there • Trial and Error in New Languages • MSDN – Best Friend • Visual Studio Help Files • Random Websites
Knowledge • Data Structures • Operating Systems • Debugging • Problem Solving
Extensions • Event Processing • Create class or object in .NET
Advice for Class of 2006 • START EARLY!!!! • Allow for extra time • rarely works correctly the first time • Save Frequently in VB • Keep an archive • Meet with Professors