/dev/pts/ hinzugefügt
This commit is contained in:
@@ -30,6 +30,8 @@ private slots:
|
||||
void refreshPorts();
|
||||
|
||||
private:
|
||||
void addPtyPorts();
|
||||
|
||||
QComboBox *m_portCombo = nullptr;
|
||||
QComboBox *m_baudCombo = nullptr;
|
||||
QComboBox *m_dataBitsCombo = nullptr;
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include <QVBoxLayout>
|
||||
#include <QFileDialog>
|
||||
#include <QLabel>
|
||||
#include <QDir>
|
||||
#include <algorithm>
|
||||
|
||||
ConnectDialog::ConnectDialog(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
@@ -91,10 +93,47 @@ void ConnectDialog::refreshPorts()
|
||||
m_portCombo->addItem(
|
||||
QStringLiteral("%1 — %2").arg(info.portName(), info.description()),
|
||||
info.portName());
|
||||
|
||||
// QSerialPortInfo::availablePorts() relies on udev/sysfs and does not
|
||||
// enumerate pseudo-terminals, so PTY slaves (e.g. the ones created by
|
||||
// `qemu -serial pty`) never show up above. Scan /dev/pts/ ourselves and
|
||||
// list the numeric slave nodes as additional selectable "ports". Store
|
||||
// the full path (e.g. "/dev/pts/4") as the item data so it is passed
|
||||
// straight through to QSerialPort::setPortName(), which accepts either
|
||||
// a bare name or a full system location. Baud/parity/etc. settings are
|
||||
// simply no-ops on a PTY, which is fine for this use case.
|
||||
addPtyPorts();
|
||||
|
||||
if (m_portCombo->count() == 0)
|
||||
m_portCombo->addItem(tr("(no ports found)"), QString());
|
||||
}
|
||||
|
||||
void ConnectDialog::addPtyPorts()
|
||||
{
|
||||
QDir ptsDir("/dev/pts");
|
||||
if (!ptsDir.exists())
|
||||
return;
|
||||
|
||||
// Entries are purely numeric device nodes (the "ptmx" master control
|
||||
// device is excluded on purpose - it isn't a connectable endpoint).
|
||||
QStringList nodes = ptsDir.entryList(QDir::System | QDir::NoDotAndDotDot);
|
||||
QList<int> numbers;
|
||||
for (const QString &node : std::as_const(nodes)) {
|
||||
bool ok = false;
|
||||
const int n = node.toInt(&ok);
|
||||
if (ok)
|
||||
numbers << n;
|
||||
}
|
||||
std::sort(numbers.begin(), numbers.end());
|
||||
|
||||
for (int n : std::as_const(numbers)) {
|
||||
const QString path = QStringLiteral("/dev/pts/%1").arg(n);
|
||||
m_portCombo->addItem(
|
||||
QStringLiteral("%1 — pseudo-terminal (e.g. qemu -serial pty)").arg(path),
|
||||
path);
|
||||
}
|
||||
}
|
||||
|
||||
void ConnectDialog::browseLogFile()
|
||||
{
|
||||
const QString path = QFileDialog::getSaveFileName(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Maintainer: diabolus <your@email.com>
|
||||
pkgname=uartscope
|
||||
pkgver=1.0.0.r3.gd3229c7
|
||||
pkgver=1.0.0.r4.g72a2b7e
|
||||
pkgrel=1
|
||||
pkgdesc="Qt6-based UART serial monitor with tag monitoring, table view and auto-reconnect"
|
||||
arch=('x86_64' 'aarch64')
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -3,10 +3,10 @@
|
||||
pkgname = uartscope
|
||||
pkgbase = uartscope
|
||||
xdata = pkgtype=pkg
|
||||
pkgver = 1.0.0.r3.gd3229c7-1
|
||||
pkgver = 1.0.0.r4.g72a2b7e-1
|
||||
pkgdesc = Qt6-based UART serial monitor with tag monitoring, table view and auto-reconnect
|
||||
url = https://git.projekt-hirnfrei.de/diabolus/uartscope
|
||||
builddate = 1782249637
|
||||
builddate = 1785955532
|
||||
packager = Unknown Packager
|
||||
size = 389745
|
||||
arch = x86_64
|
||||
|
||||
Binary file not shown.
Submodule uartscope-git/src/uartscope updated: d3229c7b64...72a2b7edd0
@@ -1,2 +1,2 @@
|
||||
d3229c7b648e41e6e11e745968686c64ba5ccde8 not-for-merge branch 'main' of https://git.projekt-hirnfrei.de/diabolus/uartscope
|
||||
72a2b7edd0d87becbbbfcae8b1c2ecda630f43e2 not-for-merge branch 'main' of https://git.projekt-hirnfrei.de/diabolus/uartscope
|
||||
cc102c93eb17f7b910d8e74c3505f198bed77f10 not-for-merge tag 'v1.0.0' of https://git.projekt-hirnfrei.de/diabolus/uartscope
|
||||
|
||||
Reference in New Issue
Block a user