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

added new internal hook to add missing timestamps from GTFPGA cards

This commit is contained in:
Steffen Vogel 2015-11-16 10:59:42 +01:00
parent 74738a1184
commit 572ef55952
2 changed files with 15 additions and 0 deletions

View file

@ -106,6 +106,9 @@ int hook_convert(struct path *p, struct hook *h, int when);
/** Example hook: overwrite timestamp of message. */
int hook_ts(struct path *p, struct hook *h, int when);
/** Internal hook: add missing timestamps for node types which do not include a valid TS (ex. GTFPGA) */
int hook_fix_ts(struct path *p, struct hook *h, int when);
/** Example hook: Finite-Impulse-Response (FIR) filter. */
int hook_fir(struct path *p, struct hook *h, int when);

View file

@ -53,6 +53,18 @@ int hook_ts(struct path *p, struct hook *h, int when)
return 0;
}
REGISTER_HOOK("fix_ts", 0, hook_fix_ts, HOOK_INTERNAL | HOOK_MSG)
int hook_fix_ts(struct path *p, struct hook *h, int when)
{
struct msg *m = p->current;
if ((m->ts.sec == 0 && m->ts.nsec == 0) ||
(m->ts.sec == -1 && m->ts.nsec == -1))
hook_ts(p, h, when);
return 0;
}
REGISTER_HOOK("skip_unchanged", 99, hook_skip_unchanged, HOOK_PRIVATE | HOOK_ASYNC)
int hook_skip_unchanged(struct path *p, struct hook *h, int when)
{