# CSerialPort **Repository Path**: liangsai12/CSerialPort ## Basic Information - **Project Name**: CSerialPort - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-07-02 - **Last Updated**: 2021-09-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # CSerialPort Project Overview This is a small and easy to use C library for serial port communication targeted for windows platform. It is a user-friendly wrapper for the Windows API serial port communication functions. It handles opening and closing of ports and data transition as well as some port's configurations. See the CSerialPort.h file for more details. ## Requirements This project works only on windows platform and require Windows API to be compiled. The project is made to work with C language projects but you can use it in C++ projects as well. ## Installing The installation process is very simple. Just include the CSerialPort.h file in your hedders files and the CSerialPort.c in your source files then start calling the library functions. To do this copy the CSerialPort.h and CSerialPort.c files to your project folder, then add them to the project in Visual Studio then include CSerialPort.h file. ## Simple Example This walk throw will help you create a simple project. You can also see the unit test project CSerialPortTest for real coded test. 1. Connect the serial port number 1 to the serial port number 2 in your machine. 2. Open visual studio and create a win32 c\c++ console project. 3. Downloading and installing this library in your project. 4. In your main source file write the following code: ``` #include #include "CSerialPort.h" using namespace std; int main(){ auto p1 = OpenPort(1); auto p2 = OpenPort(2); char sendstr[80] = "Hello CSerialPort"; char recivestr[80]; SendData(p1, sendstr); ReciveData(p2, recivestr, 80); cout<