7#include <QCoreApplication>
11#include <QLoggingCategory>
12#include <QtCore/private/qcore_unix_p.h>
17#define LONG_BITS (sizeof(long) * 8
)
18#define LONG_FIELD_SIZE(bits) ((bits / LONG_BITS) + 1
)
22using namespace Qt::StringLiterals;
26QDeviceDiscovery *QDeviceDiscovery::create(QDeviceTypes types, QObject *parent)
28 return new QDeviceDiscoveryVxWorks(types, parent);
31QDeviceDiscoveryVxWorks::QDeviceDiscoveryVxWorks(QDeviceTypes types, QObject *parent)
32 : QDeviceDiscovery(types, parent)
34 qCDebug(lcDD) <<
"vxworks device discovery for type" << types;
37QStringList QDeviceDiscoveryVxWorks::scanConnectedDevices()
42 if (m_types & Device_InputMask) {
43 for (
const auto &entry : QDirListing(QString::fromLatin1(
"/input/"))) {
44 QString absoluteFilePath = entry.absoluteFilePath();
45 if (checkDeviceType(absoluteFilePath))
46 devices << absoluteFilePath;
50 if (m_types & Device_VideoMask) {
51 devices << QString::fromLatin1(
"/dev/dri/card0");
57bool QDeviceDiscoveryVxWorks::checkDeviceType(
const QString &device)
59 int fd = QT_OPEN(device.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0);
60 if (Q_UNLIKELY(fd == -1)) {
64 qCDebug(lcDD) <<
"Device discovery cannot open device" << device;
68 qCDebug(lcDD) <<
"doing static device discovery for " << device;
76 if (ERROR != ioctl(fd, EV_DEV_IO_GET_CAP, (
char *)&devCap)) {
77 if ((m_types & Device_Keyboard) && (devCap & EV_DEV_KEY)) {
78 if (!(devCap & EV_DEV_REL) && !(devCap & EV_DEV_ABS)) {
79 qCDebug(lcDD) <<
"DeviceDiscovery found keyboard at" << device;
85 if (m_types & Device_Mouse) {
86 if ((devCap & EV_DEV_REL) && (devCap & EV_DEV_KEY) && !(devCap & EV_DEV_ABS)) {
87 qCDebug(lcDD) <<
"DeviceDiscovery found mouse at" << device;
93 if ((m_types & (Device_Touchpad | Device_Touchscreen))) {
94 if ((m_types & Device_Touchscreen) && (devCap & EV_DEV_ABS && (devCap & EV_DEV_KEY))) {
95 qCDebug(lcDD) <<
"DeviceDiscovery found touchscreen at" << device;
Q_STATIC_LOGGING_CATEGORY(lcAccessibilityCore, "qt.accessibility.core")
#define QT_DRM_DEVICE_PREFIX