#include "serialport.h"
#include <iostream>
#pragma comment(lib, "serialport.lib")
using namespace LuHang;
/* When data is comming, Lib calls this function */
void Callback(const char* data, int len)
{
// to-do with recved data
}
int main()
{
SerialPort sp(&Callback);
bool ret = sp.open("COM1");
// sp.setBaudRate(115200);
// sp.setBitsNum(8);
// sp.setParity(Parity::NO);
// sp.setStopBits(StopBits::ONEBIT);
// sp.setFlowControl(FlowControl::NONE);
// ...
// sp.write(buf, len);
std::cin.get();
return 0;
}
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
a serialport class for Windows C++ proj
License
wax100628/serialportlib
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
a serialport class for Windows C++ proj
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published