diff options
Diffstat (limited to 'main.vala')
-rw-r--r-- | main.vala | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -10,11 +10,13 @@ public static int main(string[] args) { dev = new Device(args[1], 9600, 8, 1); db = new Database("shop.db"); - while(true) { - string message = dev.receive(); - if(interpret((string) message)) + dev.received_barcode.connect((data) => { + if(interpret(data)) dev.blink(10); - } + }); + + new MainLoop(null, false).run(); + return 0; } public static bool interpret(string data) { |