summaryrefslogtreecommitdiff
path: root/gr-sbhs/python/testing.py
diff options
context:
space:
mode:
authormanojgudi2013-12-24 21:07:36 +0530
committermanojgudi2013-12-24 21:07:36 +0530
commit576936961996253c5a7ea27b63e5bb2ce0bb01aa (patch)
treeb7b92b6025a04317ff7972e3a087b278468209a8 /gr-sbhs/python/testing.py
parentda744ab20441967db5bc7885fcd5224f7fd75100 (diff)
downloadgnuradio-576936961996253c5a7ea27b63e5bb2ce0bb01aa.tar.gz
gnuradio-576936961996253c5a7ea27b63e5bb2ce0bb01aa.tar.bz2
gnuradio-576936961996253c5a7ea27b63e5bb2ce0bb01aa.zip
Aded SBHS block
Diffstat (limited to 'gr-sbhs/python/testing.py')
-rwxr-xr-xgr-sbhs/python/testing.py60
1 files changed, 60 insertions, 0 deletions
diff --git a/gr-sbhs/python/testing.py b/gr-sbhs/python/testing.py
new file mode 100755
index 000000000..a71655b40
--- /dev/null
+++ b/gr-sbhs/python/testing.py
@@ -0,0 +1,60 @@
+#!/usr/bin/python -tt
+
+import serial
+import time
+from time import sleep
+
+ser = serial.Serial('/dev/ttyUSB0', baudrate=9600, timeout=1)
+ser.open()
+
+
+from time import sleep
+
+import urllib
+import urllib2
+from sbhs import *
+#from bottle import *
+from scan_machines import *
+
+
+new_device = Sbhs()
+new_device.connect(252)
+new_device.connect_device(0)
+
+
+for i in range(10):
+ #new_device.setHeat(10)
+ #new_device.setFan(30)
+ f=new_device.getTemp()
+ print f
+ time.sleep(3)
+ser.close()
+#f = 10
+
+#@route('/temp')
+#def hello():
+# return str(f)
+#run(host='localhost', port=8080, debug=True)
+'''
+#writing to google app-engine
+ data = {}
+ data['temp'] = '30'#float value not int
+ data['heat'] = '200'
+ data['fan'] = '100'
+ url_val = urllib.urlencode(data)
+ print url_val
+
+ url = 'http://remote-cloudlabs.appspot.com/hello'
+ full_url = url + '?' + url_val
+ data = urllib2.urlopen(full_url)
+
+#reading from url
+ req = urllib2.Request('http://remote-cloudlabs.appspot.com/display')
+ response = urllib2.urlopen(req)
+ data = response.read()
+ print data
+
+
+ time.sleep(10)
+
+'''