diff --git a/CMakeLists.txt b/CMakeLists.txt index 7088c51..a4e8484 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,7 @@ set(PROGRAMS_CANLIB cansequence log2asc log2long + slcanpty ) set(PROGRAMS_J1939 @@ -58,7 +59,6 @@ set(PROGRAMS isotptun slcan_attach slcand - slcanpty ) add_executable(can-calc-bit-timing diff --git a/Makefile b/Makefile index 970a4cb..c3baa6b 100644 --- a/Makefile +++ b/Makefile @@ -119,6 +119,7 @@ canplayer.o: lib.h cansend.o: lib.h log2asc.o: lib.h log2long.o: lib.h +slcanpty.o: lib.h j1939acd.o: libj1939.h j1939cat.o: libj1939.h j1939spy.o: libj1939.h @@ -135,6 +136,7 @@ cansend: cansend.o lib.o cansequence: cansequence.o lib.o log2asc: log2asc.o lib.o log2long: log2long.o lib.o +slcanpty: slcanpty.o lib.o j1939acd: j1939acd.o libj1939.o j1939cat: j1939cat.o libj1939.o j1939spy: j1939spy.o libj1939.o diff --git a/slcanpty.c b/slcanpty.c index e6f1efe..4ac9e8a 100644 --- a/slcanpty.c +++ b/slcanpty.c @@ -43,27 +43,14 @@ #include #include +#include "lib.h" + /* maximum rx buffer len: extended CAN frame with timestamp */ #define SLC_MTU (sizeof("T1111222281122334455667788EA5F\r")+1) #define DEVICE_NAME_PTMX "/dev/ptmx" #define DEBUG -static int asc2nibble(char c) -{ - - if ((c >= '0') && (c <= '9')) - return c - '0'; - - if ((c >= 'A') && (c <= 'F')) - return c - 'A' + 10; - - if ((c >= 'a') && (c <= 'f')) - return c - 'a' + 10; - - return 16; /* error */ -} - /* read data from pty, send CAN frames to CAN socket and answer commands */ int pty2can(int pty, int socket, struct can_filter *fi, int *is_open, int *tstamp)