From 93f060a5f214a68efaf09f7d024ca69abcdf4533 Mon Sep 17 00:00:00 2001 From: LongHairedHacker Date: Sat, 3 Dec 2016 22:58:55 +0100 Subject: [PATCH] Fixed linking --- software/linux/Makefile | 4 ++-- software/linux/libsss7.c | 4 ++++ software/linux/libsss7.h | 6 ++++-- software/linux/test.c | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/software/linux/Makefile b/software/linux/Makefile index f24f417..a49955f 100644 --- a/software/linux/Makefile +++ b/software/linux/Makefile @@ -15,7 +15,7 @@ start: @echo " SSS7 linux port $(VERSION)" @echo "==========================" -$(OBJDIR)/test : $(OBJDIR)/test.o $(OBJDIR)/sss7core/sss7.o $(OBJDIR)/libsss7.so +$(OBJDIR)/test : $(OBJDIR)/libsss7.so $(OBJDIR)/%.o : %.c $(HEADERS) Makefile @mkdir -p $$(dirname $@) @@ -25,7 +25,7 @@ $(OBJDIR)/sss7core/%.o : ../sss7core/%.c $(HEADERS) Makefile @mkdir -p $$(dirname $@) $(CC) $(CFLAGS) -c $< -o $@ -$(OBJDIR)/%.so : $(OBJDIR)/%.o +$(OBJDIR)/libsss7.so : $(OBJDIR)/libsss7.o $(OBJDIR)/sss7core/sss7.o @mkdir -p $$(dirname $@) $(CC) $+ -shared $(LDFLAGS) -o $@ diff --git a/software/linux/libsss7.c b/software/linux/libsss7.c index d31a1ac..1586b43 100644 --- a/software/linux/libsss7.c +++ b/software/linux/libsss7.c @@ -11,6 +11,10 @@ #include "sss7.h" +#if LIBSSS7_PAYLOAD_SIZE != SSS7_PAYLOAD_SIZE + #error LIBSSS7_PAYLOAD_SIZE is not equal to SSS7_PAYLOAD_SIZE +#endif + // A state kept a across eventloop iterations to emulate tx complete interrupts enum UartTxState { TX_IDLE, // Idle state diff --git a/software/linux/libsss7.h b/software/linux/libsss7.h index 0f246ca..08942f4 100644 --- a/software/linux/libsss7.h +++ b/software/linux/libsss7.h @@ -1,7 +1,9 @@ #ifndef _LIBSSS7_H_ #define _LIBSSS7_H_ -#include "sss7.h" +#include + +#define LIBSSS7_PAYLOAD_SIZE 16 // See libsss7.c for more detailed descriptions @@ -12,7 +14,7 @@ int libsss7_start(char *serialport); int libsss7_can_send(void); // Send a frame with the payload msg -void libsss7_send(uint8_t *msg); +void libsss7_send(uint8_t msg[LIBSSS7_PAYLOAD_SIZE]); // Check if the last transmission failed int libsss7_send_failed(void); diff --git a/software/linux/test.c b/software/linux/test.c index 34ac7dd..f75db5c 100644 --- a/software/linux/test.c +++ b/software/linux/test.c @@ -8,8 +8,8 @@ int main(int argc, char const *argv[]) { libsss7_start("/dev/ttyUSB0"); - uint8_t msg[SSS7_PAYLOAD_SIZE]; - memset(msg, 0, SSS7_PAYLOAD_SIZE); + uint8_t msg[LIBSSS7_PAYLOAD_SIZE]; + memset(msg, 0, LIBSSS7_PAYLOAD_SIZE); msg[0] = 'H'; msg[1] = 'e'; msg[2] = 'l';