Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Uwe Vogt authored and uv-software committed Apr 24, 2024
0 parents commit 587093d
Show file tree
Hide file tree
Showing 7 changed files with 1,672 additions and 0 deletions.
340 changes: 340 additions & 0 deletions COPYING

Large diffs are not rendered by default.

63 changes: 63 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# #############################################################################
# Copyright (C) 2007 by UV Software, Friedrichshafen, Germany.
#
# http://www.uv-software.de/
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Makefile for can_moni (CAN Monitor using socketCAN)
#
# For berliOS socketCAN over PEAK PCAN-USB Dongle. For information
# about socketCAN see "http://socketcan.berlios.de/".
#
# Written by Uwe Vogt, UV Software <http://www.uv-software.de/>
# #############################################################################

CFLAGS = -O2 -Wall -Wno-parentheses \
-fno-strict-aliasing \
-DPF_CAN=29 \
-DAF_CAN=PF_CAN

PROGRAM = can_moni

OBJECTS = main.o can_io.o

MAIN_DEPS = can_io.h can_defs.h

CAN_IO_DEPS = can_io.h can_defs.h


all: $(PROGRAM)

clean:
rm -f $(PROGRAM) *.o

install:
cp -f $(PROGRAM) /usr/local/bin

distclean:
rm -f $(PROGRAM) *.o *~


main.o: main.c $(MAIN_DEPS)

can_io.o: can_io.c $(CAN_IO_DEPS)


can_moni: $(OBJECTS)
gcc -o $(PROGRAM) $(OBJECTS)


# #############################################################################
21 changes: 21 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CAN Monitor (using berliOS socketCAN).

Copyright (C) 2007 UV Software, Friedrichshafen.

Usage: can_moni <interface> [<options>]
Options:
-b, --baudrate=<baudrate> bit timing in kbps (default=125)
-t, --time=(abs|rel|zero) absolute or relative time
-i, --id=(hex|dec|oct) display mode of COB-IDs
-d, --data=(hex|dec|oct) display mode of data bytes
-a, --ascii=(on|off) display data bytes as ascii
-x, --exclude=[~]<id-list> exclude COB-IDs: <id>[-<id>]{,<id>[-<id>]}
-s, --script=<filename> execute a script file
-h, --help display this help and exit
--version output version information and exit

This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Uwe Vogt, UV Software <http://www.uv-software.de/>
59 changes: 59 additions & 0 deletions can_defs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/* *** $Header: /home/uwe/sources/socketCAN/RCS/can_defs.h,v 1.1 2007/08/20 19:52:42 uwe Sav uwe $ ***
*
* Copyright (C) 2007 UV Software, Friedrichshafen.
*
* http://www.uv-software.de/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* CAN Definitions and Options.
*
* For berliOS socketCAN over PEAK PCAN-USB Dongle. For information
* about socketCAN see "http://socketcan.berlios.de/".
*
* Written by Uwe Vogt, UV Software <http://www.uv-software.de/>
*/

#ifndef __CAN_DEFS_H
#define __CAN_DEFS_H


/* *** options ***
*/


/* *** defines ***
*/

#ifndef _CAN_DEFS /* socketCAN interfaces */

#define CAN_NETDEV (-1L) /* it´s a network device */

struct _can_param /* installation parameters: */
{
char* ifname; /* interface name */
int family; /* protocol family */
int type; /* communication semantics */
int protocol; /* protocol to be used */
};
#define CANBDR_SOCKET (-1) /* socketCAN baud rate (external!) */
#define CANERR_SOCKET (-10000)/* socketCAN error ('errno' is set)*/
#endif

#endif

/* *** end of file ***
*/

0 comments on commit 587093d

Please sign in to comment.