1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

signal: extend format field

This commit is contained in:
Steffen Vogel 2018-08-01 17:00:56 +02:00
parent 10c02766f5
commit dfe56b89c0
2 changed files with 17 additions and 4 deletions

View file

@ -33,16 +33,22 @@ extern "C" {
struct list;
struct node;
enum signal_format {
SIGNAL_FORMAT_FLOAT = 0,
SIGNAL_FORMAT_INT = 1,
SIGNAL_FORMAT_BOOL = 2,
SIGNAL_FORMAT_UNKNOWN = -1
};
struct signal {
char *name; /**< The name of the signal. */
char *unit;
int enabled;
enum {
SIGNAL_FORMAT_INTEGER,
SIGNAL_FORMAT_REAL
} format;
enum signal_format format;
};
int signal_init(struct signal *s);
int signal_destroy(struct signal *s);
int signal_parse(struct signal *s, json_t *cfg);

View file

@ -27,6 +27,13 @@
#include "villas/utils.h"
#include "villas/node.h"
int signal_init(struct signal *s)
{
s->format = SIGNAL_FORMAT_UNKNOWN;
return 0;
}
int signal_destroy(struct signal *s)
{
if (s->name)