1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-16 00:00:02 +01:00
VILLASnode/include/villas/nodes/opal.hpp

91 lines
2.2 KiB
C++
Raw Permalink Normal View History

/** Node type: OPAL (libOpalAsync API)
*
* @file
2015-06-02 21:53:04 +02:00
* @author Steffen Vogel <stvogel@eonerc.rwth-aachen.de>
2020-01-20 17:17:00 +01:00
* @copyright 2014-2020, Institute for Automation of Complex Power Systems, EONERC
2017-04-27 12:56:43 +02:00
* @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.
*
2017-04-27 12:56:43 +02:00
* 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.
*
2017-04-27 12:56:43 +02:00
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************************/
2015-09-19 18:48:00 +02:00
/**
* @ingroup node
* @addtogroup opal OPAL-RT Async Process node type
* @{
*/
2017-02-16 09:04:12 -03:00
#pragma once
#include <pthread.h>
2021-02-24 09:17:53 +01:00
#include <villas/sample.h>
2021-06-21 16:11:42 -04:00
/* Forward declarations */
struct vnode;
2021-02-24 09:17:53 +01:00
extern "C" {
#include <OpalGenAsyncParamCtrl.h>
}
struct opal {
int reply;
int mode;
2021-02-24 09:17:53 +01:00
int sequenceNo;
2021-02-24 09:17:53 +01:00
unsigned sendID;
unsigned recvID;
2021-02-24 09:17:53 +01:00
Opal_SendAsyncParam sendParams;
Opal_RecvAsyncParam recvParams;
};
/** Initialize global OPAL settings and maps shared memory regions.
*
* @see node_type::type_start
*/
2019-04-23 13:14:47 +02:00
int opal_type_start(villas::node::SuperNode *sn);
2021-02-24 09:17:53 +01:00
int opal_register_region(int argc, char *argv[]);
/** Free global OPAL settings and unmaps shared memory regions.
*
* @see node_type::type_stop
*/
int opal_type_stop();
2017-04-18 17:58:23 +02:00
/** @see node_type::parse */
2021-02-16 14:15:14 +01:00
int opal_parse(struct vnode *n, json_t *json);
2017-04-18 17:58:23 +02:00
/** @see node_type::print */
2020-08-25 21:00:52 +02:00
char * opal_print(struct vnode *n);
/** Print global settings of the OPAL node type. */
int opal_print_global();
2020-01-21 14:27:28 +01:00
/** @see node_type::start */
2020-08-25 21:00:52 +02:00
int opal_start(struct vnode *n);
2020-01-21 14:27:28 +01:00
/** @see node_type::stop */
2020-08-25 21:00:52 +02:00
int opal_stop(struct vnode *n);
2017-04-18 17:58:23 +02:00
/** @see node_type::read */
2021-05-10 00:12:30 +02:00
int opal_read(struct vnode *n, struct sample * const smps[], unsigned cnt);
2017-04-18 17:58:23 +02:00
/** @see node_type::write */
2021-05-10 00:12:30 +02:00
int opal_write(struct vnode *n, struct sample * const smps[], unsigned cnt);
2017-07-24 19:33:35 +02:00
/** @} */