Add periodic task
This commit is contained in:
parent
70284a4ff2
commit
e0893410a5
1 changed files with 11 additions and 0 deletions
11
src/core.c
11
src/core.c
|
@ -30,7 +30,18 @@
|
||||||
const char *gmrf_protocol_name = "babel";
|
const char *gmrf_protocol_name = "babel";
|
||||||
const char *gmrf_protocol_version = "experimental";
|
const char *gmrf_protocol_version = "experimental";
|
||||||
|
|
||||||
|
|
||||||
|
static void periodic_task(gmrf_t *gmrf, gmrf_context_t *ctx, void *arg) {
|
||||||
|
gmrf_logf(gmrf, LOG_DEBUG, "still there.");
|
||||||
|
|
||||||
|
gmrf_schedule(gmrf, periodic_task, NULL, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
gmrf_context_t* gmrf_protocol_init(gmrf_t *gmrf) {
|
gmrf_context_t* gmrf_protocol_init(gmrf_t *gmrf) {
|
||||||
|
gmrf_logf(gmrf, LOG_INFO, "initalizing...");
|
||||||
|
|
||||||
|
gmrf_schedule(gmrf, periodic_task, NULL, 1000);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue