2016-09-11 11:44:14 +00:00
|
|
|
// ======================================================================================
|
2018-06-27 23:16:27 +00:00
|
|
|
// cgo compilation (for desktop platforms and local tests)
|
2016-09-11 11:44:14 +00:00
|
|
|
// ======================================================================================
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include "_cgo_export.h"
|
|
|
|
|
2018-06-27 23:16:27 +00:00
|
|
|
typedef void (*callback)(const char *jsonEvent);
|
|
|
|
callback gCallback = 0;
|
|
|
|
|
2016-09-11 11:44:14 +00:00
|
|
|
bool StatusServiceSignalEvent(const char *jsonEvent) {
|
2018-06-27 23:16:27 +00:00
|
|
|
if (gCallback) {
|
|
|
|
gCallback(jsonEvent);
|
|
|
|
} else {
|
|
|
|
NotifyNode((char *)jsonEvent); // re-send notification back to status node
|
|
|
|
}
|
2016-09-11 11:44:14 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2018-06-27 23:16:27 +00:00
|
|
|
void SetEventCallback(void *cb) {
|
|
|
|
gCallback = (callback)cb;
|
|
|
|
}
|