2017-06-09 19:27:02 +02:00
|
|
|
/** Node type: IEC 61850-9-2 (Sampled Values)
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @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-06-09 19:27:02 +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.
|
|
|
|
*
|
|
|
|
* 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 iec61850_sv IEC 61850-9-2 (Sampled Values) node type
|
|
|
|
* @ingroup node
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-06-23 16:57:00 +02:00
|
|
|
#include <cstdint>
|
2017-06-09 19:27:02 +02:00
|
|
|
|
2017-06-13 03:18:16 +02:00
|
|
|
#include <libiec61850/sv_publisher.h>
|
2017-11-17 17:52:26 +01:00
|
|
|
#include <libiec61850/sv_subscriber.h>
|
2017-06-13 03:18:16 +02:00
|
|
|
|
2018-03-28 14:15:08 +02:00
|
|
|
#include <villas/queue_signalled.h>
|
|
|
|
#include <villas/pool.h>
|
|
|
|
#include <villas/list.h>
|
2019-04-23 00:12:31 +02:00
|
|
|
#include <villas/nodes/iec61850.hpp>
|
2018-06-28 13:42:50 +02:00
|
|
|
|
2021-06-21 16:11:42 -04:00
|
|
|
/* Forward declarations */
|
|
|
|
struct vnode;
|
|
|
|
|
2017-06-09 19:27:02 +02:00
|
|
|
struct iec61850_sv {
|
2017-06-13 03:18:16 +02:00
|
|
|
char *interface;
|
2017-11-17 17:52:26 +01:00
|
|
|
int app_id;
|
|
|
|
struct ether_addr dst_address;
|
|
|
|
|
2017-06-13 03:18:16 +02:00
|
|
|
struct {
|
2018-04-04 12:00:50 +02:00
|
|
|
bool enabled;
|
|
|
|
|
2017-06-13 03:18:16 +02:00
|
|
|
SVSubscriber subscriber;
|
2017-11-17 17:52:26 +01:00
|
|
|
SVReceiver receiver;
|
|
|
|
|
|
|
|
struct queue_signalled queue;
|
|
|
|
struct pool pool;
|
|
|
|
|
2019-01-07 10:28:55 +01:00
|
|
|
struct vlist signals; /**< Mappings of type struct iec61850_type_descriptor */
|
2017-11-17 17:52:26 +01:00
|
|
|
int total_size;
|
2018-08-20 18:22:59 +02:00
|
|
|
} in;
|
2017-06-13 03:18:16 +02:00
|
|
|
|
|
|
|
struct {
|
2018-04-04 12:00:50 +02:00
|
|
|
bool enabled;
|
|
|
|
|
2017-11-17 17:52:26 +01:00
|
|
|
SVPublisher publisher;
|
|
|
|
SVPublisher_ASDU asdu;
|
|
|
|
|
|
|
|
char *svid;
|
|
|
|
|
|
|
|
int vlan_priority;
|
|
|
|
int vlan_id;
|
|
|
|
int smpmod;
|
2017-11-18 01:43:05 +01:00
|
|
|
int smprate;
|
2017-11-17 17:52:26 +01:00
|
|
|
int confrev;
|
|
|
|
|
2019-01-07 10:28:55 +01:00
|
|
|
struct vlist signals; /**< Mappings of type struct iec61850_type_descriptor */
|
2017-11-17 17:52:26 +01:00
|
|
|
int total_size;
|
2018-08-20 18:22:59 +02:00
|
|
|
} out;
|
2017-06-09 19:27:02 +02:00
|
|
|
};
|
|
|
|
|
2018-07-16 08:08:17 +02:00
|
|
|
/** @see node_type::type_stop */
|
|
|
|
int iec61850_sv_type_stop();
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2018-07-16 08:08:17 +02:00
|
|
|
/** @see node_type::parse */
|
2020-08-25 21:00:52 +02:00
|
|
|
int iec61850_sv_parse(struct vnode *n, json_t *json);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2018-07-16 08:08:17 +02:00
|
|
|
/** @see node_type::print */
|
2020-08-25 21:00:52 +02:00
|
|
|
char * iec61850_sv_print(struct vnode *n);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2018-07-16 08:08:17 +02:00
|
|
|
/** @see node_type::start */
|
2020-08-25 21:00:52 +02:00
|
|
|
int iec61850_sv_start(struct vnode *n);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2018-07-16 08:08:17 +02:00
|
|
|
/** @see node_type::stop */
|
2020-08-25 21:00:52 +02:00
|
|
|
int iec61850_sv_stop(struct vnode *n);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2018-07-16 08:08:17 +02:00
|
|
|
/** @see node_type::destroy */
|
2020-08-25 21:00:52 +02:00
|
|
|
int iec61850_sv_destroy(struct vnode *n);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2018-07-16 08:08:17 +02:00
|
|
|
/** @see node_type::read */
|
2021-05-10 00:12:30 +02:00
|
|
|
int iec61850_sv_read(struct vnode *n, struct sample * const smps[], unsigned cnt);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2018-07-16 08:08:17 +02:00
|
|
|
/** @see node_type::write */
|
2021-05-10 00:12:30 +02:00
|
|
|
int iec61850_sv_write(struct vnode *n, struct sample * const smps[], unsigned cnt);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2018-07-16 08:08:17 +02:00
|
|
|
/** @see node_type::fd */
|
2020-08-25 21:00:52 +02:00
|
|
|
int iec61850_sv_fd(struct vnode *n);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2017-11-17 17:52:26 +01:00
|
|
|
/** @} */
|