2023-09-04 12:21:37 +02:00
|
|
|
/* Node type: IEC 61850-9-2 (Sampled Values).
|
2017-06-09 19:27:02 +02:00
|
|
|
*
|
2023-08-31 11:25:01 +02:00
|
|
|
* Author: Steffen Vogel <post@steffenvogel.de>
|
|
|
|
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2017-06-09 19:27:02 +02:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
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
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
#include <villas/list.hpp>
|
2019-04-23 00:12:31 +02:00
|
|
|
#include <villas/nodes/iec61850.hpp>
|
2023-09-07 11:46:39 +02:00
|
|
|
#include <villas/pool.hpp>
|
|
|
|
#include <villas/queue_signalled.h>
|
2018-06-28 13:42:50 +02:00
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
namespace villas {
|
|
|
|
namespace node {
|
|
|
|
|
2023-08-31 11:25:01 +02: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 {
|
2023-09-07 11:46:39 +02:00
|
|
|
char *interface;
|
|
|
|
int app_id;
|
|
|
|
struct ether_addr dst_address;
|
2017-11-17 17:52:26 +01:00
|
|
|
|
2023-09-07 11:46:39 +02:00
|
|
|
struct {
|
|
|
|
bool enabled;
|
2024-05-24 02:35:17 +02:00
|
|
|
bool check_dst_address;
|
2018-04-04 12:00:50 +02:00
|
|
|
|
2023-09-07 11:46:39 +02:00
|
|
|
SVSubscriber subscriber;
|
|
|
|
SVReceiver receiver;
|
2017-11-17 17:52:26 +01:00
|
|
|
|
2023-09-07 11:46:39 +02:00
|
|
|
struct CQueueSignalled queue;
|
|
|
|
struct Pool pool;
|
|
|
|
struct List signals; // Mappings of type struct iec61850_type_descriptor
|
2024-05-24 02:35:17 +02:00
|
|
|
|
|
|
|
unsigned total_size;
|
2023-09-07 11:46:39 +02:00
|
|
|
} in;
|
2017-06-13 03:18:16 +02:00
|
|
|
|
2023-09-07 11:46:39 +02:00
|
|
|
struct {
|
|
|
|
bool enabled;
|
2018-04-04 12:00:50 +02:00
|
|
|
|
2023-09-07 11:46:39 +02:00
|
|
|
SVPublisher publisher;
|
|
|
|
SVPublisher_ASDU asdu;
|
2017-11-17 17:52:26 +01:00
|
|
|
|
2024-05-24 02:35:17 +02:00
|
|
|
char *sv_id;
|
2017-11-17 17:52:26 +01:00
|
|
|
|
2024-05-24 02:35:17 +02:00
|
|
|
struct {
|
|
|
|
bool enabled;
|
|
|
|
int priority;
|
|
|
|
int id;
|
|
|
|
} vlan;
|
|
|
|
|
|
|
|
int smp_mod;
|
|
|
|
int smp_synch;
|
|
|
|
int smp_rate;
|
|
|
|
int conf_rev;
|
2017-11-17 17:52:26 +01:00
|
|
|
|
2023-09-07 11:46:39 +02:00
|
|
|
struct List signals; // Mappings of type struct iec61850_type_descriptor
|
2024-05-24 02:35:17 +02:00
|
|
|
|
|
|
|
unsigned asdu_length;
|
2023-09-07 11:46:39 +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
|
|
|
|
2023-09-07 11:46:39 +02: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
|
|
|
|
2024-05-24 02:35:17 +02:00
|
|
|
int iec61850_sv_init(NodeCompat *n);
|
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
int iec61850_sv_destroy(NodeCompat *n);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2023-09-07 11:46:39 +02:00
|
|
|
int iec61850_sv_read(NodeCompat *n, struct Sample *const smps[], unsigned cnt);
|
2017-11-19 19:21:46 +01:00
|
|
|
|
2023-09-07 11:46:39 +02: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
|
|
|
|
2023-08-28 09:34:02 +02:00
|
|
|
} // namespace node
|
|
|
|
} // namespace villas
|