collin80 / SavvyCAN

QT based cross platform canbus tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Receiving packets does not work when using Lawicel/SLCAN protocol

rnadyrshin opened this issue · comments

Hello
I am testing SavvyCAN V208 with a Flipper Zero and MCP2518 based CAN/LIN-module.
The Flipper application implements the Lawicel protocol, which works perfectly with CanHacker 2.0 and SocketCAN (SLCAN).
In SavvyCAN opening CAN-interface and sending packets works fine, but receiving packets from the CAN does not work. Moreover, in the connection window in the console, incoming packets are visible, but they are not displayed in the main program window.
Connection window

Do you have any ideas what the problem might be?
Implementation of Lawicel in the Flipper Zero application: https://github.com/flipperdevices/flipperzero-firmware/tree/d48b107065c087357473a2e4c6cba2bc2bfc18fb/applications/external/can_lin_tools/lib/driver/can_hacker2

Hmm. These messages looks correct. If you able to build SavvyCAN locally (it should be easy enough), try to insert sendDebug(bla-bla) somewhere in these lines:

case 'T': //extended frame
//TIIIIIIIILDD.
buildFrame.setFrameId(mBuildLine.mid(1, 8).toInt(nullptr, 16));
buildFrame.isReceived = true;
buildFrame.setFrameType(QCanBusFrame::FrameType::DataFrame);
buildFrame.setExtendedFrameFormat(true);
buildData.resize(mBuildLine.mid(9, 1).toInt());
for (int c = 0; c < buildData.size(); c++)
{
buildData[c] = mBuildLine.mid(10 + (c*2), 2).toInt(nullptr, 16);
}
buildFrame.setPayload(buildData);
if (!isCapSuspended())
{
/* get frame from queue */
CANFrame* frame_p = getQueue().get();
if(frame_p) {
//qDebug() << "Lawicel got frame on bus " << frame_p->bus;
/* copy frame */
*frame_p = buildFrame;
checkTargettedFrame(buildFrame);
/* enqueue frame */
getQueue().queue();
}
else
qDebug() << "can't get a frame, ERROR";
}
break;

This was happening when i was using the v213 release. But the latest build seems fine.