Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Write to HID device of type (/dev/hidrawX) on Linux
Antweb last edited by
bool BusMain::openHidraw(QString device)
int fd = open(device.toLocal8Bit(),O_NONBLOCK);
if(fd <= 0)
qDebug()<<"[WARN]rcMouseHandler::open-> Cant open!";
qDebug() << fd << ": HID Connected";
m_read = new QSocketNotifier(fd, QSocketNotifier::Read);
connect(m_read, SIGNAL(activated(int)), this, SLOT(readyHIDRead()));
m_write = new QSocketNotifier(fd, QSocketNotifier::Write); emit this->hid_detected(); return true;
qDebug() << buffer;
int n = write(m_write->socket(),"GET",3);
if (n < 0)
qDebug() << "ERROR writing to socket";
qDebug() << "GET SENT";
hid_detected() is connected to a thread which executes readyHIDWrite every second.
My program connects to HID and reads perfectly well but is not able to Write.
AM i doing something wrong?