mirror of
https://github.com/Sani7/remote-ui.git
synced 2026-10-27 06:01:14 +01:00
Change can interface
Now emits can frames via signal
This commit is contained in:
@@ -16,7 +16,10 @@ CAN_Interface::CAN_Interface(QString dev, QObject *parent)
|
||||
|
||||
m_canDevice->connectDevice();
|
||||
connect(m_canDevice, &QCanBusDevice::framesReceived, this, [this] {
|
||||
emit frames_received();
|
||||
for (const QCanBusFrame &frame : m_canDevice->readAllFrames())
|
||||
{
|
||||
emit frame_received(frame);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -30,8 +33,3 @@ void CAN_Interface::send_frame(const QCanBusFrame &frame)
|
||||
{
|
||||
m_canDevice->writeFrame(frame);
|
||||
}
|
||||
|
||||
QCanBusFrame CAN_Interface::read_frame()
|
||||
{
|
||||
return m_canDevice->readFrame();
|
||||
}
|
||||
Reference in New Issue
Block a user