2017-06-09 19:27:02 +02:00
|
|
|
/** Node type: IEC 61850-9-2 (Sampled Values)
|
|
|
|
*
|
|
|
|
* @file
|
2022-03-15 09:18:01 -04:00
|
|
|
* @author Steffen Vogel <svogel2@eonerc.rwth-aachen.de>
|
2022-03-15 09:28:57 -04:00
|
|
|
* @copyright 2014-2022, 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/>.
|
|
|
|
*********************************************************************************/
|
|
|
|
|
|
|
|
#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>
|
2021-08-10 10:12:48 -04:00
|
|
|
#include <villas/pool.hpp>
|
|
|
|
#include <villas/list.hpp>
|
2019-04-23 00:12:31 +02:00
|
|
|
#include <villas/nodes/iec61850.hpp>
|
2018-06-28 13:42:50 +02:00
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
namespace villas {
|
|
|
|
namespace node {
|
|
|
|
|
2021-06-21 16:11:42 -04:00
|
|
|
/* Forward declarations */
|
2021-08-10 10:12:48 -04:00
|
|
|
class NodeCompat;
|
2021-06-21 16:11:42 -04:00
|
|
|
|
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;
|
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
struct CQueueSignalled queue;
|
|
|
|
struct Pool pool;
|
2017-11-17 17:52:26 +01:00
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
struct List 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;
|
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
struct List 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
|
|
|
int iec61850_sv_type_stop();
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
int iec61850_sv_parse(NodeCompat *n, json_t *json);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
char * iec61850_sv_print(NodeCompat *n);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
int iec61850_sv_start(NodeCompat *n);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
int iec61850_sv_stop(NodeCompat *n);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
int iec61850_sv_destroy(NodeCompat *n);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
int iec61850_sv_read(NodeCompat *n, struct Sample * const smps[], unsigned cnt);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
int iec61850_sv_write(NodeCompat *n, struct Sample * const smps[], unsigned cnt);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
int iec61850_sv_poll_fds(NodeCompat *n, int fds[]);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
} /* namespace node */
|
|
|
|
} /* namespace villas */
|