aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Gustafsson <robg@student.chalmers.se>2017-10-14 11:18:03 +0200
committerAndreas Lindhé <andreas@lindhe.io>2017-10-18 20:34:22 +0200
commit9c87ed9c965847ee784c4bae092e9d27ee2ffed7 (patch)
treefc031d114610840a5bd154b230e48ff34a8ab81d
parentc219824ea8ebd862530a3d10bccac5303c7e240b (diff)
downloadmidbro-9c87ed9c965847ee784c4bae092e9d27ee2ffed7.tar.gz
midbro-9c87ed9c965847ee784c4bae092e9d27ee2ffed7.tar.bz2
Rename midbropasad -> midbro in C impl..
* files in script/ are not changed
-rw-r--r--broccoli/Makefile12
-rw-r--r--broccoli/includes/midbro.h (renamed from broccoli/includes/midbropasad.h)4
-rw-r--r--broccoli/src/broevent.c4
-rw-r--r--broccoli/src/midbro.c (renamed from broccoli/src/midbropasad.c)1
-rw-r--r--broccoli/test/midbro_test.c (renamed from broccoli/test/pasad_test.c)2
5 files changed, 12 insertions, 11 deletions
diff --git a/broccoli/Makefile b/broccoli/Makefile
index 8e39783..d50fb9e 100644
--- a/broccoli/Makefile
+++ b/broccoli/Makefile
@@ -4,19 +4,19 @@ CFLAGS =-c -DBROCCOLI
INC =-I/usr/local/include -I/usr/local/include -I./includes
LDFLAGS = -L/usr/local/lib -lbroccoli -pthread
DEBUG =
-SRC = midbropasad.c broevent.c fifoqueue.c
+SRC = midbro.c broevent.c fifoqueue.c
OBJ = $(patsubst %.c, build/%.o, $(SRC))
-all: dirs lib/midbropasad
+all: dirs lib/midbro
dirs:
mkdir -p build bin lib
-lib/midbropasad: $(OBJ)
- $(CC) -shared $^ -o lib/libmidbropasad.so $(LDFLAGS)
+lib/midbro: $(OBJ)
+ $(CC) -shared $^ -o lib/libmidbro.so $(LDFLAGS)
-pasad_test:
- $(CC) test/pasad_test.c -I./includes -o bin/pasad_test -L./lib -lmidbropasad
+midbro_test:
+ $(CC) test/midbro_test.c -I./includes -o bin/midbro_test -L./lib -lmidbro
build/%.o: src/%.c
$(CC) $(LIBCFLAGS) $(DEBUG) $(INC) $< -o $@
diff --git a/broccoli/includes/midbropasad.h b/broccoli/includes/midbro.h
index 73e3bec..3b3c59f 100644
--- a/broccoli/includes/midbropasad.h
+++ b/broccoli/includes/midbro.h
@@ -1,5 +1,5 @@
-#ifndef MIDBROPASAD_H
-#define MIDBROPASAD_H
+#ifndef MIDBRO_H
+#define MIDBRO_H
void request_n_values(int number, int arrayOfValues[]);
int request_value();
void start_data_capture();
diff --git a/broccoli/src/broevent.c b/broccoli/src/broevent.c
index 206ce17..362ed5e 100644
--- a/broccoli/src/broevent.c
+++ b/broccoli/src/broevent.c
@@ -9,7 +9,7 @@ char *port_default = "47760";
Fifo_q * q;
static void
-pasad_register_received(BroConn *conn, void *data, BroRecord *record)
+modbus_register_received(BroConn *conn, void *data, BroRecord *record)
{
int type = BRO_TYPE_COUNT;
uint64 *address = NULL;
@@ -56,7 +56,7 @@ bro_event_listener(void * args)
bro_debug_messages = 0;
bro_event_registry_add(bc, "pasad_register_received",
- (BroEventFunc) pasad_register_received, NULL);
+ (BroEventFunc) modbus_register_received, NULL);
if (! bro_conn_connect(bc))
{
diff --git a/broccoli/src/midbropasad.c b/broccoli/src/midbro.c
index a745091..6c83207 100644
--- a/broccoli/src/midbropasad.c
+++ b/broccoli/src/midbro.c
@@ -2,6 +2,7 @@
#include <unistd.h>
#include "fifoqueue.h"
#include "broevent.h"
+#include "midbro.h"
#ifdef BROCCOLI
#include <broccoli.h>
#endif
diff --git a/broccoli/test/pasad_test.c b/broccoli/test/midbro_test.c
index 5ed3481..c0f4ba6 100644
--- a/broccoli/test/pasad_test.c
+++ b/broccoli/test/midbro_test.c
@@ -1,4 +1,4 @@
-#include "midbropasad.h"
+#include "midbro.h"
int
main(int argc, char **argv)