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>
|
|
|
|
* @copyright 2017, Institute for Automation of Complex Power Systems, EONERC
|
|
|
|
* @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
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2017-06-13 03:18:16 +02:00
|
|
|
#include <libiec61850/sv_publisher.h>
|
|
|
|
|
2017-06-09 19:27:02 +02:00
|
|
|
#include "node.h"
|
|
|
|
#include "list.h"
|
|
|
|
|
2017-06-13 03:18:16 +02:00
|
|
|
enum {
|
2017-06-13 17:15:45 +02:00
|
|
|
/* According to IEC 61850-7-2 */
|
2017-06-13 03:18:16 +02:00
|
|
|
IEC61850_TYPE_BOOLEAN,
|
|
|
|
IEC61850_TYPE_INT8,
|
|
|
|
IEC61850_TYPE_INT16,
|
|
|
|
IEC61850_TYPE_INT32,
|
|
|
|
IEC61850_TYPE_INT64,
|
|
|
|
IEC61850_TYPE_INT8U,
|
|
|
|
IEC61850_TYPE_INT16U,
|
|
|
|
IEC61850_TYPE_INT24U,
|
|
|
|
IEC61850_TYPE_INT32U,
|
|
|
|
IEC61850_TYPE_FLOAT32,
|
|
|
|
IEC61850_TYPE_FLOAT64,
|
|
|
|
IEC61850_TYPE_ENUMERATED,
|
|
|
|
IEC61850_TYPE_CODED_ENUM,
|
|
|
|
IEC61850_TYPE_OCTET_STRING,
|
|
|
|
IEC61850_TYPE_VISIBLE_STRING,
|
2017-06-13 17:15:45 +02:00
|
|
|
IEC61850_TYPE_OBJECTNAME,
|
|
|
|
IEC61850_TYPE_OBJECTREFERENCE,
|
2017-06-13 03:18:16 +02:00
|
|
|
IEC61850_TYPE_TIMESTAMP,
|
|
|
|
IEC61850_TYPE_ENTRYTIME,
|
2017-06-13 17:15:45 +02:00
|
|
|
/* According to IEC 61850-8-1 */
|
2017-06-13 03:18:16 +02:00
|
|
|
IEC61850_TYPE_BITSTRING
|
|
|
|
} type;
|
|
|
|
|
2017-06-13 17:15:45 +02:00
|
|
|
struct iec61850_type_descriptor {
|
|
|
|
enum iec61850_type type;
|
|
|
|
const char *name;
|
|
|
|
unsigned size;
|
|
|
|
|
|
|
|
/* Functions pointers */
|
|
|
|
double (*subscriber_get)(SVClientASDU self, int index);
|
|
|
|
int (*publisher_add)(SV_ASDU self);
|
|
|
|
void (*publisher_set)(SV_ASDU self, int index, int8_t value);
|
|
|
|
};
|
|
|
|
|
2017-06-13 03:18:16 +02:00
|
|
|
struct iec61850_sv_mapping {
|
|
|
|
SV_ASDU *asdu;
|
|
|
|
|
|
|
|
int offset;
|
|
|
|
enum iec61850_type type;
|
|
|
|
};
|
|
|
|
|
2017-06-09 19:27:02 +02:00
|
|
|
struct iec61850_sv {
|
2017-06-13 03:18:16 +02:00
|
|
|
char *interface;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
SVReceiver receiver
|
|
|
|
SVSubscriber subscriber;
|
|
|
|
} in;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
SampledValuesPublisher publisher;
|
2017-06-09 19:27:02 +02:00
|
|
|
|
2017-06-13 03:18:16 +02:00
|
|
|
struct list mapping;
|
|
|
|
struct list asdus;
|
|
|
|
} out;
|
2017-06-09 19:27:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/** @} */
|