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

gtwif: added skeleton for new GTWIF node-type

This commit is contained in:
Steffen Vogel 2017-06-11 17:59:17 +02:00
parent dd1e47338a
commit 4d0f537edb
3 changed files with 151 additions and 0 deletions

View file

@ -0,0 +1,41 @@
/** Node type: GTWIF - RSCAD protocol for RTDS
*
* @file
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* VILLASnode
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
/**
* @addtogroup gtwif GTWIF protocol for RTDS node type
* @ingroup node
* @{
*/
#pragma once
#include <stdint.h>
#include "node.h"
#include "list.h"
struct gtwif {
};
/** @} */

View file

@ -51,6 +51,11 @@ ifeq ($(shell $(PKGCONFIG) libnl-route-3.0; echo $$?),0)
endif
endif
# Enable GTWIF node type
ifndef WITHOUT_GTWIF
LIB_SRCS += lib/nodes/gtwif.c
endif
# Enable nanomsg node type when libnanomsg is available
ifndef WITHOUT_NANOMSG
ifeq ($(shell $(PKGCONFIG) nanomsg; echo $$?),0)

105
lib/nodes/gtwif.c Normal file
View file

@ -0,0 +1,105 @@
/** Node type: GTWIF - RSCAD protocol for RTDS
*
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
* @license GNU General Public License (version 3)
*
* VILLASnode
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
#include <string.h>
#include "plugin.h"
#include "nodes/gtwif.h"
#include "utils.h"
#include "msg.h"
int gtwif_reverse(struct node *n)
{
struct gtwif *g __attribute__((unused)) = n->_vd;
return 0;
}
int gtwif_parse(struct node *n, config_setting_t *cfg)
{
struct gtwif *g __attribute__((unused)) = n->_vd;
return 0;
}
char * gtwif_print(struct node *n)
{
char *buf = NULL;
struct gtwif *g __attribute__((unused)) = n->_vd;
return buf;
}
int gtwif_start(struct node *n)
{
struct gtwif *g __attribute__((unused)) = n->_vd;
return 0;
}
int gtwif_stop(struct node *n)
{
struct gtwif *g __attribute__((unused)) = n->_vd;
return 0;
}
int gtwif_deinit()
{
return 0;
}
int gtwif_read(struct node *n, struct sample *smps[], unsigned cnt)
{
struct gtwif *g __attribute__((unused)) = n->_vd;
return 0;
}
int gtwif_write(struct node *n, struct sample *smps[], unsigned cnt)
{
struct gtwif *g __attribute__((unused)) = n->_vd;
return 0;
}
static struct plugin p = {
.name = "gtwif",
.description = "GTWIF - RSCAD protocol for RTDS",
.type = PLUGIN_TYPE_NODE,
.node = {
.vectorize = 0,
.size = sizeof(struct gtwif),
.reverse = gtwif_reverse,
.parse = gtwif_parse,
.print = gtwif_print,
.start = gtwif_start,
.stop = gtwif_stop,
.deinit = gtwif_deinit,
.read = gtwif_read,
.write = gtwif_write,
.instances = LIST_INIT()
}
};
REGISTER_PLUGIN(&p)