summaryrefslogtreecommitdiff
path: root/nfcommander.c
diff options
context:
space:
mode:
Diffstat (limited to 'nfcommander.c')
-rw-r--r--nfcommander.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/nfcommander.c b/nfcommander.c
new file mode 100644
index 0000000..de50ef4
--- /dev/null
+++ b/nfcommander.c
@@ -0,0 +1,37 @@
+#include <stdio.h>
+
+#include "nfcommander.h"
+#include "config.h"
+#include "reader.h"
+#include "control.h"
+
+int usage(char* fn){
+ printf("NFCommander - trigger actions based on near-field tags\n");
+ printf("\tUsage: %s <config-file>\n", fn);
+ return EXIT_FAILURE;
+}
+
+int main(int argc, char** argv){
+ if(argc < 2){
+ return usage(argv[0]);
+ }
+
+ //read configuration
+ if(config_read(argv[1])){
+ return usage(argv[0]);
+ }
+
+ //start reader api
+ reader_init();
+
+ //start control api
+ control_start();
+
+ //handle events
+ //TODO
+
+ //clean up
+ reader_free();
+ control_free();
+ config_free();
+}