summaryrefslogtreecommitdiff
path: root/receive-test.py
diff options
context:
space:
mode:
Diffstat (limited to 'receive-test.py')
-rwxr-xr-xreceive-test.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/receive-test.py b/receive-test.py
index cb95d7c..c1d9783 100755
--- a/receive-test.py
+++ b/receive-test.py
@@ -3,14 +3,13 @@
from RFXtrx import PySerialTransport
import sys, datetime, os
-transport = PySerialTransport('/dev/ttyUSB0')
-transport.reset()
-
-while True:
- if os.path.isfile('./stop'):
- break
-
- timestamp = datetime.datetime.timestamp(datetime.datetime.now())
- recv = transport.receive_blocking()
- print(str(recv))
+if __name__ == "__main__":
+ transport = PySerialTransport('/dev/ttyUSB0')
+ transport.reset()
+ while True:
+ if os.path.isfile('./stop'):
+ break
+ timestamp = datetime.datetime.timestamp(datetime.datetime.now())
+ recv = transport.receive_blocking()
+ print(str(recv))