EmbDev.net

Forum: µC & Digital Electronics CAN Sniffer for Linux


von Netseal (Guest)


Rate this post
useful
not useful
Hello,

I have developed a basic CAN Sniffer for Linux. It is the very first 
release.
See the howto in the attachment.

greetings
Netsel

von Netseal (Guest)


Rate this post
useful
not useful
test

von Netseal (Guest)


Rate this post
useful
not useful
Hello,
the attachment does not work for me.
I do not know why.
Checkot:
svn co https://qcanobserver.svn.sourceforge.net/svnroot/qcanobserver 
qcanobserver

von David M. (md2k7)


Rate this post
useful
not useful
I guess you need to be registered and logged in to post attachments (?)

Your software seems to be for the CAN ("PCAN") adapter of the company 
Peak System-Technik. I have an "Octopus CAN" from embedded-projects.net. 
Maybe if I have some time, I will adapt your software, but at the moment 
I'm too busy for that.
(There should be an abstraction layer somewhere, so the driver-related 
CAN calls can be adapted to another driver)

You should look into entering library dependencies into your Qt project 
file, AFAIK, it supports checking the system for their existence, so you 
don't get build errors for e.g. not finding an include file of libqwt. 
Instead, you get a nice info that you need to install the lib.

I will be able to further comment after having the kernel sources and 
built the peak driver.

von David M. (md2k7)


Rate this post
useful
not useful
Some suggestions on revision 2:

- my qwt include directory is /usr/include/qwt-qt4 (on Ubuntu 9.10 
Karmic Koala) - one more reason to automatically look for libraries!
  I also have to link with -lqwt-qt4

- in messagebufferinterface.h, I need to include <sys/time.h> for 
'struct timeval', I don't know why you apparently don't.

- in C++, you declare structs without typedef, simply as:
1
struct myStruct {
2
// bla bla
3
};

- mainwindow.h:49 -> 1. you don't usually declare variables in a header 
file, because many source files may include them, and then all of them 
have a separate variable, which then leads to a linker error.
  2. why make a struct with a single entry?

- there are a huge lot of warnings, the compiler usually means them. 
Good code doesn't produce warnings.

- write a README file which explains how to compile the code...

- SVN usually uses a directory structure with root directories 'trunk', 
'branches' and 'tags', your source goes in trunk.

The program itself (sadly, I don't have the adapter to really test it):

- name the columns, not "column 0", "column 1", ...

- if you click "start" without having the adapter, the program dies with 
a segmentation fault, that is not the way to handle errors :-)

Nice work for a start, anyway. Don't let me take your motivation :-)

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.