24 lines
610 B
C
Raw Normal View History

2021-09-29 11:32:34 +02:00
// ======================================================================================
// cgo compilation (for desktop platforms and local tests)
// ======================================================================================
#include <stdio.h>
#include <stddef.h>
#include <stdbool.h>
#include "_cgo_export.h"
typedef void (*keycardCallback)(const char *jsonEvent);
keycardCallback gCallback = 0;
2021-09-29 11:32:34 +02:00
2021-10-07 11:50:53 +02:00
bool KeycardServiceSignalEvent(const char *jsonEvent) {
2021-09-29 11:32:34 +02:00
if (gCallback) {
gCallback(jsonEvent);
}
return true;
}
2021-10-07 11:50:53 +02:00
void KeycardSetEventCallback(void *cb) {
gCallback = (keycardCallback)cb;
2021-09-29 11:32:34 +02:00
}