Prechádzať zdrojové kódy

mapping temperature value to node works

FlorianPalm 11 rokov pred
rodič
commit
0ec0815c25

+ 2 - 1
examples/src/Makefile.am

@@ -25,8 +25,9 @@ else
 bin_PROGRAMS += $(top_builddir)/bin/exampleServer $(top_builddir)/bin/exampleServerACPLT $(top_builddir)/bin/exampleServerMini
 
 __top_builddir__bin_exampleServer_CFLAGS = -I$(top_builddir)/src -I$(top_builddir)/include $(GLOBAL_AM_CFLAGS)
-__top_builddir__bin_exampleServer_SOURCES = opcuaServer.c networklayer.c
+__top_builddir__bin_exampleServer_SOURCES = opcuaServer.c networklayer.c raspberrypi_io.c
 __top_builddir__bin_exampleServer_LDADD= $(top_builddir)/lib/libopen62541.a $(GLOBAL_AM_LDADD)
+__top_builddir__bin_exampleServer_LDFLAGS = -lwiringPi
 
 __top_builddir__bin_exampleServerACPLT_CFLAGS = -I$(top_builddir)/src -I$(top_builddir)/include $(GLOBAL_AM_CFLAGS)
 __top_builddir__bin_exampleServerACPLT_SOURCES = opcuaServerACPLT.c networklayer.c

+ 2 - 2
examples/src/raspberrypi_io.c

@@ -24,9 +24,9 @@ int readTemp(float *temp){
 
 	fgets(buf, 1000, ptr_file);
 
-	ptr_temp = strtok(buf, (int) delimiter);
+	ptr_temp = strtok(buf, (char*) delimiter);
 
-	ptr_temp = strtok((void*)0, (int) delimiter);
+	ptr_temp = strtok((void*)0, (char*) delimiter);
 
 	temperaturInmC = atol(ptr_temp);
 

+ 1 - 0
examples/src/raspberrypi_io.h

@@ -12,6 +12,7 @@
 #endif
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
 int readTemp(float *temp);
 int writeLEDred(int state);