diff --git a/lib/hooks/CMakeLists.txt b/lib/hooks/CMakeLists.txt index afc12824d..c601809df 100644 --- a/lib/hooks/CMakeLists.txt +++ b/lib/hooks/CMakeLists.txt @@ -21,22 +21,23 @@ ################################################################################### set(HOOK_SRC + average.c + cast.c decimate.c + dp.c drop.c + dump.c + ebm.c + fix.c jitter_calc.c + limit_rate.c restart.c + scale.c shift_seq.c shift_ts.c skip_first.c stats.c ts.c - limit_rate.c - scale.c - fix.c - cast.c - average.c - dump.c - dp.c ) if(WITH_IO) diff --git a/lib/hooks/ebm.c b/lib/hooks/ebm.c new file mode 100644 index 000000000..e82671c17 --- /dev/null +++ b/lib/hooks/ebm.c @@ -0,0 +1,105 @@ +/** Energy-based Metric hook. + * + * @author Steffen Vogel + * @copyright 2014-2019, 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 . + *********************************************************************************/ + +/** @addtogroup hooks Hook functions + * @{ + */ + +#include +#include +#include + +struct ebm { + +}; + +static int ebm_init(struct hook *h) +{ + __attribute__((unused)) struct ebm *e = (struct ebm *) h->_vd; + + return 0; +} + +static int ebm_destroy(struct hook *h) +{ + __attribute__((unused)) struct ebm *e = (struct ebm *) h->_vd; + + return 0; +} + +static int ebm_start(struct hook *h) +{ + __attribute__((unused)) struct ebm *e = (struct ebm *) h->_vd; + + return 0; +} + +static int ebm_stop(struct hook *h) +{ + __attribute__((unused)) struct ebm *e = (struct ebm *) h->_vd; + + return 0; +} + +static int ebm_parse(struct hook *h, json_t *cfg) +{ + __attribute__((unused)) struct ebm *e = (struct ebm *) h->_vd; + + return 0; +} + +static int ebm_prepare(struct hook *h) +{ + __attribute__((unused)) struct ebm *e = (struct ebm *) h->_vd; + + return 0; +} + + +static int ebm_process(struct hook *h, struct sample *smps[], unsigned *cnt) +{ + __attribute__((unused)) struct ebm *e = (struct ebm *) h->_vd; + + return 0; +} + +static struct plugin p = { + .name = "ebm", + .description = "Energy-based Metric", + .type = PLUGIN_TYPE_HOOK, + .hook = { + .flags = HOOK_PATH | HOOK_NODE_READ | HOOK_NODE_WRITE, + .priority = 99, + .init = ebm_init, + .init_signals = ebm_prepare, + .destroy = ebm_destroy, + .start = ebm_start, + .stop = ebm_stop, + .parse = ebm_parse, + .process = ebm_process, + .size = sizeof(struct ebm) + } +}; + +REGISTER_PLUGIN(&p) + +/** @} */