summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2005-04-18 13:28:38 +0000
committerMarc Kleine-Budde <mkl@pengutronix.de>2005-04-18 13:28:38 +0000
commitc829ad1e855dd0c3916bebfcfdbd32ce6233a4ae (patch)
tree3f536a909e9ebad5af86f7565ed8781aa86eb432
parent2ae4e9e4073deae048588662b6e33b490c59e188 (diff)
downloadcanutils-c829ad1e855dd0c3916bebfcfdbd32ce6233a4ae.tar.gz
updated canframes playload union
git-svn-id: https://iocaste.extern.pengutronix.de/svn/canutils/trunks/canutils-1.0-trunk@24 5fd5a299-6ef2-0310-aa18-8b01d7c39d8c
-rw-r--r--Makefile.am2
-rw-r--r--candump.c2
-rw-r--r--canecho.c2
-rw-r--r--cansend.c4
-rw-r--r--configure.ac16
-rw-r--r--include/socket-can/can.h22
6 files changed, 28 insertions, 20 deletions
diff --git a/Makefile.am b/Makefile.am
index fbbbc59..00db34f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,8 +23,6 @@ EXTRA_DIST = \
man_MANS = canconfig.8 candump.8 canecho.8 cansend.8
-# info_TEXINFOS = can.texinfo
-
MAINTAINERCLEANFILES = \
configure \
Makefile.in \
diff --git a/candump.c b/candump.c
index 5d83b58..32367b6 100644
--- a/candump.c
+++ b/candump.c
@@ -101,7 +101,7 @@ int main(int argc, char **argv)
printf("[%d] ", frame.can_dlc);
for (i = 0; i < frame.can_dlc; i++) {
- printf("%02x ", frame.payload.byte[i]);
+ printf("%02x ", frame.payload.data[i]);
}
if (frame.can_id & CAN_FLAG_RTR)
printf("remote request");
diff --git a/canecho.c b/canecho.c
index cafa6d2..b2dc30b 100644
--- a/canecho.c
+++ b/canecho.c
@@ -107,7 +107,7 @@ int main(int argc, char **argv)
} else {
printf("[%d]", frame.can_dlc);
for (i = 0; i < frame.can_dlc; i++) {
- printf(" %02x", frame.payload.byte[i]);
+ printf(" %02x", frame.payload.data[i]);
}
}
printf("\n");
diff --git a/cansend.c b/cansend.c
index ab94ab2..4a075f5 100644
--- a/cansend.c
+++ b/cansend.c
@@ -105,7 +105,7 @@ int main(int argc, char **argv)
if (argv[optind+1] != NULL) {
frame.can_dlc = strlen(argv[optind+1]);
frame.can_dlc = frame.can_dlc > 8 ? 8 : frame.can_dlc;
- strncpy(frame.payload.byte, argv[optind+1],8);
+ strncpy(frame.payload.data, argv[optind+1],8);
} else {
frame.can_dlc = 0;
}
@@ -113,7 +113,7 @@ int main(int argc, char **argv)
printf("id: %d ",frame.can_id);
printf("dlc: %d\n",frame.can_dlc);
for(i = 0; i < frame.can_dlc; i++)
- printf("0x%02x ",frame.payload.byte[i]);
+ printf("0x%02x ",frame.payload.data[i]);
printf("\n");
num = 1;
diff --git a/configure.ac b/configure.ac
index 895d0fe..147cf4e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT([canutils], [1.0.2], [socket-can@pengutronix.de])
+AC_INIT([canutils], [1.0.3], [socket-can@pengutronix.de])
AC_CONFIG_HEADERS([include/can_config.h])
AC_CONFIG_SRCDIR([cansend.c])
AC_CONFIG_MACRO_DIR([config/m4])
@@ -22,7 +22,19 @@ AM_MAINTAINER_MODE
# Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS([stdlib.h string.h])
+AC_CHECK_HEADERS([ \
+ fcntl.h \
+ limits.h \
+ stdlib.h \
+ string.h \
+ termios.h \
+ unistd.h \
+ \
+ netinet/in.h \
+ \
+ sys/ioctl.h \
+ sys/socket.h \
+ ])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T
diff --git a/include/socket-can/can.h b/include/socket-can/can.h
index 6e88743..af72cf7 100644
--- a/include/socket-can/can.h
+++ b/include/socket-can/can.h
@@ -3,9 +3,7 @@
*
* Copyright (C) 2004, 2005
*
- * - Jan Kiszka, Uni Hannover
* - Robert Schwebel, Benedikt Spranger, Marc Kleine-Budde, Pengutronix
- * - Uwe Koppe, MicroControl GmbH
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the version 2 of the GNU General Public License
@@ -21,8 +19,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef CAN_H
-#define CAN_H
+#ifndef _SOCKET_CAN_CAN_H
+#define _SOCKET_CAN_CAN_H
+
+//#include <stdint.h>
#define CAN_ID_EXT_MASK 0x1FFFFFFF /* contains CAN id */
#define CAN_ID_STD_MASK 0x000007FF
@@ -30,8 +30,6 @@
#define CAN_FLAG_RTR 0x40000000 /* remote transmission flag*/
#define CAN_FLAG_EXTENDED 0x80000000 /* extended frame */
-#define CANIOCTYPE 0x23
-
#define SIOCSCANBAUDRATE (SIOCPROTOPRIVATE + 0)
#define SIOCGCANBAUDRATE (SIOCPROTOPRIVATE + 1)
#define SIOCSCANMODE (SIOCPROTOPRIVATE + 2)
@@ -185,8 +183,6 @@ union can_settings {
enum CAN_PROTO {
CAN_PROTO_RAW,
-/* CAN_PROTO_FOO, */
-/* CAN_PROTO_BAR, */
CAN_PROTO_MAX,
};
@@ -200,10 +196,12 @@ struct can_frame {
int can_id;
int can_dlc;
union {
- unsigned long long msgbits;
- unsigned long dword[2];
- unsigned char byte[8];
+ int64_t data_64;
+ int32_t data_32[2];
+ int16_t data_16[4];
+ int8_t data_8[8];
+ int8_t data[8]; /* shortcut */
} payload;
};
-#endif /* CAN_H */
+#endif /* !_SOCKET_CAN_CAN_H */