2023-09-04 12:21:37 +02:00
|
|
|
/* Node type: OPAL (libOpalAsync API).
|
2014-12-05 12:30:48 +01:00
|
|
|
*
|
2022-03-15 09:18:01 -04:00
|
|
|
* Author: Steffen Vogel <post@steffenvogel.de>
|
2022-03-15 09:28:57 -04:00
|
|
|
* SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
|
2022-07-04 18:20:03 +02:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2017-03-03 20:20:13 -04:00
|
|
|
*/
|
|
|
|
|
2017-02-16 09:04:12 -03:00
|
|
|
#pragma once
|
2014-12-05 12:30:48 +01:00
|
|
|
|
2015-03-17 22:46:46 +01:00
|
|
|
#include <pthread.h>
|
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
#include <villas/sample.hpp>
|
|
|
|
|
|
|
|
namespace villas {
|
|
|
|
namespace node {
|
2015-03-17 22:46:46 +01:00
|
|
|
|
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
|
|
|
|
2021-02-24 09:17:53 +01:00
|
|
|
extern "C" {
|
2023-09-07 11:46:39 +02:00
|
|
|
#include <OpalGenAsyncParamCtrl.h>
|
2021-02-24 09:17:53 +01:00
|
|
|
}
|
2015-03-12 22:56:58 +01:00
|
|
|
|
2014-12-05 12:30:48 +01:00
|
|
|
struct opal {
|
2023-09-07 11:46:39 +02:00
|
|
|
int reply;
|
|
|
|
int mode;
|
|
|
|
int sequenceNo;
|
2014-12-05 12:30:48 +01:00
|
|
|
|
2023-09-07 11:46:39 +02:00
|
|
|
unsigned sendID;
|
|
|
|
unsigned recvID;
|
2017-05-05 19:24:16 +00:00
|
|
|
|
2023-09-07 11:46:39 +02:00
|
|
|
Opal_SendAsyncParam sendParams;
|
|
|
|
Opal_RecvAsyncParam recvParams;
|
2014-12-05 12:30:48 +01:00
|
|
|
};
|
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
int opal_type_start(SuperNode *sn);
|
2015-03-17 22:46:46 +01:00
|
|
|
|
2021-02-24 09:17:53 +01:00
|
|
|
int opal_register_region(int argc, char *argv[]);
|
|
|
|
|
2018-07-16 08:08:17 +02:00
|
|
|
int opal_type_stop();
|
2015-03-12 22:56:58 +01:00
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
int opal_parse(NodeCompat *n, json_t *json);
|
2015-03-12 22:56:58 +01:00
|
|
|
|
2023-09-07 11:46:39 +02:00
|
|
|
char *opal_print(NodeCompat *n);
|
2015-03-17 22:46:46 +01:00
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
int opal_start(NodeCompat *n);
|
2015-03-12 22:56:58 +01:00
|
|
|
|
2021-08-10 10:12:48 -04:00
|
|
|
int opal_stop(NodeCompat *n);
|
2015-03-12 22:56:58 +01:00
|
|
|
|
2023-09-07 11:46:39 +02:00
|
|
|
int opal_read(NodeCompat *n, struct Sample *const smps[], unsigned cnt);
|
2015-03-12 22:56:58 +01:00
|
|
|
|
2023-09-07 11:46:39 +02:00
|
|
|
int opal_write(NodeCompat *n, struct Sample *const smps[], unsigned cnt);
|
2015-03-12 22:56:58 +01:00
|
|
|
|
2023-08-28 09:34:02 +02:00
|
|
|
} // namespace node
|
|
|
|
} // namespace villas
|