mirror of
https://github.com/owntracks/recorder.git
synced 2024-11-15 18:08:28 -07:00
add (empty for now) monitoring hook
This commit is contained in:
parent
38711713b6
commit
d408e6f6a8
10
misc.c
10
misc.c
@ -21,3 +21,13 @@ char *bindump(char *buf, long buflen)
|
||||
}
|
||||
return (utstring_body(out));
|
||||
}
|
||||
|
||||
/*
|
||||
* At each received message, the recorder invokes this function with the
|
||||
* current epoch time and the topic being handled. Use this to update
|
||||
* a monitoring hoook.
|
||||
*/
|
||||
|
||||
void monitorhook(time_t now, char *topic)
|
||||
{
|
||||
}
|
||||
|
7
misc.h
7
misc.h
@ -1 +1,8 @@
|
||||
#ifndef MISC_H_INCLUDED
|
||||
# define MISC_H_INCLUDED
|
||||
|
||||
#include <time.h>
|
||||
char *bindump(char *buf, long buflen);
|
||||
void monitorhook(time_t now, char *topic);
|
||||
|
||||
#endif
|
||||
|
@ -388,6 +388,8 @@ void on_message(struct mosquitto *mosq, void *userdata, const struct mosquitto_m
|
||||
|
||||
time(&now);
|
||||
|
||||
monitorhook(now, m->topic);
|
||||
|
||||
/* FIXME: handle null leading topic `/` */
|
||||
utstring_printf(basetopic, "%s/%s/%s", topics[0], topics[1], topics[2]);
|
||||
utstring_printf(username, "%s", topics[1]);
|
||||
|
Loading…
Reference in New Issue
Block a user