I am trying to register a Javascript crontab callback as in the following:
ffi('void mgos_crontab_register_handler(char*, void (*)(char*, char*, userdata), userdata)')(
"vlx_cron", function(foo,bar,baz){
print("vlx_cron cb", JSON.stringify([foo,bar,baz]));
}, null);
When the crontab fires the log says no handler is found:
... Cron job 1 is firing: "vlx_cron" ...
... No actual handler for the cron action "vlx_cron"
What is wrong and how looks a working ffi call to mgos_crontab_register_handler
?