From 26696599b3ca7b95adc2eaa084c1f6cdcfbb0f25 Mon Sep 17 00:00:00 2001 From: LongHairedHacker Date: Fri, 23 Dec 2016 02:08:57 +0100 Subject: [PATCH] Python should work now --- software/python/sss7.py | 6 +++--- software/python/test.py | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/software/python/sss7.py b/software/python/sss7.py index 6069fa0..3529a13 100644 --- a/software/python/sss7.py +++ b/software/python/sss7.py @@ -57,12 +57,12 @@ class _SSS7(object): return tmp == 1 def has_received(self): - return _LIB_SSS7.libsss7_get_received() + return _LIB_SSS7.libsss7_has_received() def get_received(self): - payload = [0] * LIBSSS7_PAYLOAD_SIZE + payload = _SSS7_PAYLOAD_TYPE() _LIB_SSS7.libsss7_get_received(payload) - return payload + return [payload[i] for i in range(0, LIBSSS7_PAYLOAD_SIZE)] def stop(self): _LIB_SSS7.libsss7_stop() diff --git a/software/python/test.py b/software/python/test.py index 602924b..88b0418 100644 --- a/software/python/test.py +++ b/software/python/test.py @@ -25,10 +25,11 @@ def main(): print "Send failed" - #while(!bus.hasReceived()); - #byte[] data = bus.getReceived(); - #String str = new String(data); - #System.out.println(str); + while not SSS7.has_received(): + sleep(0.1) + + print to_string(SSS7.get_received()) + SSS7.stop()