Commit 4cc12d9d authored by Jeroen Vreeken's avatar Jeroen Vreeken
Browse files

Small fixes to get setpoint generator code working again.

parent e6ab4541
../../controller/controller/block_setpoint_generator.h
\ No newline at end of file
......@@ -26,8 +26,7 @@
#include <arpa/inet.h>
#include "tcp_connect.h"
#include "block_setpoint_generator.h"
#include "controller_setpoint_command.h"
struct setpoint_command {
int fd;
......
......@@ -38,7 +38,7 @@
#include "setpoint.h"
#include "tcp_listen.h"
#include "block_setpoint_generator.h"
#include "controller_setpoint_command.h"
#include "status_server.h"
#include "command_server.h"
......
......@@ -26,7 +26,7 @@
#include <stdint.h>
#include <inttypes.h>
#include <arpa/inet.h>
#include "block_setpoint_generator.h"
#include "controller_setpoint_command.h"
#define BUFSIZE 4096
......
......@@ -851,6 +851,8 @@ struct controller_block * block_setpoint_generator_create(char *name, va_list ap
if (!spg)
return NULL;
spg_name.block = spg;
spg->type = "setpoint_generator";
spg->name = malloc(strlen(name)+1);
if (!spg->name)
......
......@@ -380,6 +380,9 @@ void controller_setpoint_command_server_add(struct controller_spg_name *name)
tmp = realloc(spg_list, sizeof(struct controller_spg_name) * nr_spgs);
if (tmp) {
spg_list = tmp;
spg_list[nr_spgs-1].queue_space = name->queue_space;
spg_list[nr_spgs-1].command = name->command;
spg_list[nr_spgs-1].block = name->block;
spg_list[nr_spgs-1].name = strdup(name->name);
spg_list[nr_spgs-1].unit = strdup(name->unit);
spg_list[nr_spgs-1].blockname = strdup(name->blockname);
......
......@@ -19,6 +19,7 @@
#ifndef _INCLUDE_CONTROLLER_SETPOINT_COMMAND_H_
#define _INCLUDE_CONTROLLER_SETPOINT_COMMAND_H_
#include <stdbool.h>
enum {
BLOCK_SPG_SETPOINT,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment