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"
|
|
|
|
|
2021-10-07 12:04:03 +02:00
|
|
|
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) {
|
2021-10-07 12:04:03 +02:00
|
|
|
gCallback = (keycardCallback)cb;
|
2021-09-29 11:32:34 +02:00
|
|
|
}
|