SkillAgentSearch skills...

SerialCPP

SerialCPP is a cross-platform C++ library for serial communication, for use on both Windows and Unix-like systems (such as Linux or macOS).

Install / Use

/learn @joeinman/SerialCPP
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

SerialCPP

CMake

SerialCPP is a cross-platform C++ library for serial communication. Based on PySerial and Arduino Serial, it provides a simple and consistent API for use on both Windows and Unix-like systems (such as Linux or macOS).

Features:

  • Open & Close Serial Ports
  • Read and Write Data to Serial Ports
  • Read & Write a Line of Text to and From a Serial Port

Basic Example:

#include <SerialCPP/SerialCPP.h>
#include <iostream>
#include <string>

int main()
{
    // Create A SerialCPP Object Using The COM3 Port With A 115200 Baud Rate
    SerialCPP::SerialCPP serial("COM3", SerialCPP::BaudRate::BR_115200);

    // Open The Serial Port
    if (!serial.open())
    {
        std::cerr << "Failed To Open Serial Port.\n";
        return 1;
    }

    // Write A Line Of Text To The Serial Port
    serial.writeLine("Hello World.");

    // Read A Line Of Text From The Serial Port
    std::string line = serial.readLine();
    std::cout << "Received: " << line << '\n';

    // Close The Serial Port
    serial.close();
    return 0;
}
View on GitHub
GitHub Stars6
CategoryDevelopment
Updated9mo ago
Forks0

Languages

C++

Security Score

77/100

Audited on Jun 20, 2025

No findings