Coder Social home page Coder Social logo

cansocket-qt-lib's People

Contributors

gbosiger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cansocket-qt-lib's Issues

ISO-TP: application crash when receiving packet

Hi,
Is there any example for receiving ISO-TP packets?
send part is working great, but when I tried to receive packets via vcan, it crashed.
even when using given example, when I send a packet using following command, it crashes:
echo 11 22 33 44 55 66 DE AD BE EF aa bb 11 22 | isotpsend -s 321 -d 123 vcan0

this the code Im runing:

#include <QCoreApplication>
#include "isotphandler.h"
#include <QDebug>
int main(int argc, char *argv[])
{
    QCoreApplication coreApplication(argc, argv);

    QString interfaceName = "vcan0";
     char dataToSend[] = "\x11\x22\x33\x44\x55\xAA\xBB\xCC\x11\x22\x33\x55\xAA\xBB\xCC\xDD";

     CanIsoTpSocket *canIsoTpSocket = new CanIsoTpSocket(&coreApplication);
     new CanIsoTpReader(canIsoTpSocket, &coreApplication);

     canIsoTpSocket->setTxId(0x123);
     canIsoTpSocket->setRxId(0x321);
     canIsoTpSocket->connectToInterface(interfaceName);
     canIsoTpSocket->write(dataToSend, sizeof(dataToSend) - 1);

     // at this point, write is done, now i use isotpsend  in command line

    return coreApplication.exec();
}

following is back trace from gdb if it helps:

(gdb) run
Starting program: /home/deb/Qt_WorkSpace/build-isoTPTest-Desktop_Qt_5_14_1_GCC_64bit-Debug/isoTPTest 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
CanAbstractSocket::ConnectingState
CanAbstractSocket::ConnectedState
"1122334455aabbcc11223355aabbccdd"
ASSERT: "m_buf" in file /usr/include/x86_64-linux-gnu/qt5/QtCore/5.11.3/QtCore/private/qiodevice_p.h, line 101

Program received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff72ee535 in __GI_abort () at abort.c:79
#2  0x00007ffff788471c in QMessageLogger::fatal(char const*, ...) const ()
   from /home/deb/Qt5.14.1/5.14.1/gcc_64/lib/libQt5Core.so.5
#3  0x00007ffff7883e1b in qt_assert(char const*, char const*, int) ()
   from /home/deb/Qt5.14.1/5.14.1/gcc_64/lib/libQt5Core.so.5
#4  0x000055555555c71a in QIODevicePrivate::QRingBufferRef::reserve (this=0x555555595710, bytes=4096)
    at /usr/include/x86_64-linux-gnu/qt5/QtCore/5.11.3/QtCore/private/qiodevice_p.h:101
#5  0x000055555555b84b in CanAbstractSocketPrivate::readNotification (this=0x555555595680)
    at ../isoTPTest/src/canabstractsocket.cpp:583
#6  0x000055555555c9b2 in ReadNotifier::event (this=0x5555555972a0, e=0x7fffffffdea0)
    at ../isoTPTest/src/canabstractsocket.cpp:354
#7  0x00007ffff7a878e3 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
   from /home/deb/Qt5.14.1/5.14.1/gcc_64/lib/libQt5Core.so.5
#8  0x00007ffff7ae0fb8 in socketNotifierSourceDispatch(_GSource*, int (*)(void*), void*) ()
   from /home/deb/Qt5.14.1/5.14.1/gcc_64/lib/libQt5Core.so.5
#9  0x00007ffff4d9afee in g_main_context_dispatch () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#10 0x00007ffff4d9b288 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#11 0x00007ffff4d9b31c in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#12 0x00007ffff7ae040b in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /home/deb/Qt5.14.1/5.14.1/gcc_64/lib/libQt5Core.so.5
#13 0x00007ffff7a86312 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
   from /home/deb/Qt5.14.1/5.14.1/gcc_64/lib/libQt5Core.so.5
#14 0x00007ffff7a8f240 in QCoreApplication::exec() () from /home/deb/Qt5.14.1/5.14.1/gcc_64/lib/libQt5Core.so.5
#15 0x0000555555559e86 in main (argc=1, argv=0x7fffffffe248) at ../isoTPTest/main.cpp:21
(gdb) 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.