2017-06-09 19:27:02 +02:00
|
|
|
/** Node type: IEC 61850-9-2 (Sampled Values)
|
|
|
|
*
|
|
|
|
* @file
|
2022-12-14 17:41:58 +01:00
|
|
|
* @author Steffen Vogel <post@steffenvogel.de>
|
2022-03-15 09:28:57 -04:00
|
|
|
* @copyright 2014-2022, Institute for Automation of Complex Power Systems, EONERC
|
2022-07-04 18:20:03 +02:00
|
|
|
* @license Apache 2.0
|
2017-06-09 19:27:02 +02:00
|
|
|
*********************************************************************************/
|
|
|
|
|
|
|
|
#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
|
|
|
|
2023-08-28 09:34:02 +02:00
|
|
|
} // namespace node
|
|
|
|
} // namespace villas
|