Skip to content

iMusinsky/Serial_Connection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serial Connection

It is a library for configuration and data transfer over a serial port.

Usage

The SerialConnection class must be initialized using the SerialDescription structure.

struct SerialDescription
{
    std::string portName;
    BaudRate    baudrate;
    DataBits    dataBits;
    Parity      parity;
    StopBits    stopBits;
};

Then it will be possible to write and read data.

long Read(std::string& data, int timeout) noexcept;
long Write(const std::string& data, int timeout) const noexcept;

How to build

CMake

#!/bin/bash
mkdir build && cd build
cmake ../ -DBUILD_EXAMPLE=ON && cmake --build .
cd ../

Use the BUILD_EXAMPLE option to build an example case.

License

This repository is released under version 2.0 of the Apache License.

About

A simple C++ library for working with a serial port.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors