Fixed linking

This commit is contained in:
Sebastian 2016-12-03 22:58:55 +01:00
parent c43eb50661
commit 93f060a5f2
4 changed files with 12 additions and 6 deletions

View File

@ -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 $@

View File

@ -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

View File

@ -1,7 +1,9 @@
#ifndef _LIBSSS7_H_
#define _LIBSSS7_H_
#include "sss7.h"
#include<stdint.h>
#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);

View File

@ -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';