1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00
VILLASnode/include/villas/nodes/ngsi.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

79 lines
2.4 KiB
C++
Raw Permalink Normal View History

/* Node type: OMA Next Generation Services Interface 10 (NGSI) (FIWARE context broker).
*
* This file implements the NGSI context interface. NGSI is RESTful HTTP is specified by
* the Open Mobile Alliance (OMA).
* It uses the standard operations of the NGSI 10 context information standard.
*
* @see https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FI-WARE_NGSI-10_Open_RESTful_API_Specification
* @see http://technical.openmobilealliance.org/Technical/Release_Program/docs/NGSI/V1_0-20120529-A/OMA-TS-NGSI_Context_Management-V1_0-20120529-A.pdf
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-02-16 09:04:12 -03:00
#pragma once
#include <curl/curl.h>
#include <jansson.h>
#include <villas/list.hpp>
2020-03-04 13:06:28 +01:00
#include <villas/task.hpp>
namespace villas {
namespace node {
2018-07-03 21:51:48 +02:00
// Forward declarations
class NodeCompat;
struct ngsi {
const char *endpoint; // The NGSI context broker endpoint URL.
const char *entity_id; // The context broker entity id related to this node
const char *entity_type; // The type of the entity
const char *
access_token; // An optional authentication token which will be sent as HTTP header.
2015-10-11 13:22:58 +02:00
bool create; // Weather we want to create the context element during startup.
bool remove; // Weather we want to delete the context element during startup.
double timeout; // HTTP timeout in seconds
double rate; // Rate used for polling.
2015-10-11 13:22:58 +02:00
struct Task task; // Timer for periodic events.
int ssl_verify; // Boolean flag whether SSL server certificates should be verified or not.
struct curl_slist *headers; // List of HTTP request headers for libcurl
2015-10-11 13:22:58 +02:00
struct {
CURL *curl; // libcurl: handle
struct List
signals; // A mapping between indices of the VILLASnode samples and the attributes in ngsi::context
} in, out;
};
int ngsi_type_start(SuperNode *sn);
int ngsi_type_stop();
int ngsi_parse(NodeCompat *n, json_t *json);
char *ngsi_print(NodeCompat *n);
int ngsi_init(NodeCompat *n);
int ngsi_destroy(NodeCompat *n);
int ngsi_start(NodeCompat *n);
int ngsi_stop(NodeCompat *n);
int ngsi_reverse(NodeCompat *n);
int ngsi_read(NodeCompat *n, struct Sample *const smps[], unsigned cnt);
int ngsi_write(NodeCompat *n, struct Sample *const smps[], unsigned cnt);
int ngsi_poll_fds(NodeCompat *n, int fds[]);
} // namespace node
} // namespace villas