Loading...
Searching...
No Matches
SerialInfo.hpp
1// Ported from Qt 6 QSerialPortInfo. Original copyrights:
2// Copyright (C) 2012 Denis Shienkov <denis.shienkov@gmail.com>
3// Copyright (C) 2012 Laszlo Papp <lpapp@kde.org>
4// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
5
6#pragma once
7
8#include <score_plugin_protocols_export.h>
9
10#include <cstdint>
11#include <optional>
12#include <string>
13#include <vector>
14namespace serial {
15
16struct port_info {
17 std::string port_name; // e.g. "ttyUSB0", "COM3", "cu.usbserial-1410"
18 std::string system_location; // e.g. "/dev/ttyUSB0", "\\\\.\\COM3"
19 std::string description;
20 std::string manufacturer;
21 std::string serial_number;
22
23 std::optional<uint16_t> vendor_id;
24 std::optional<uint16_t> product_id;
25};
26
27// Enumerate all serial ports currently available on the system.
28// The returned system_location strings are directly usable with
29// boost::asio::serial_port(io_context, system_location).
30SCORE_PLUGIN_PROTOCOLS_EXPORT
31std::vector<port_info> available_ports();
32SCORE_PLUGIN_PROTOCOLS_EXPORT
33std::vector<int32_t> standard_baud_rates();
34}
Definition SerialInfo.hpp:16