Example #1
0
def read_value():
    print "x"
    out = ""
    if request.method == 'POST':
        print "post"
        data = request.get_data()
        print data
        out = handle_write(json.loads(data))
    else:
        print "get"
        #pom = request.url
        data = request.data
        #print pom
        #ind = pom.find('?')
        #print ind
        #data = pom[ind+1:len(pom)]
        print data
        out = handle_read(json.loads(data))
        print out
    return out
Example #2
0
def read_value():
	print "x"
	out=""
	if request.method=='POST':
		print "post"
		data = request.get_data()
		print data
		out=handle_write(json.loads(data))
	else:
		print "get"
		#pom = request.url
		data = request.data
		#print pom
		#ind = pom.find('?')
		#print ind
		#data = pom[ind+1:len(pom)]
		print data
		out=handle_read(json.loads(data))
		print out
	return out
Example #3
0
 def test_handle_write(self):
     print 'Sending communiaction'
     r=handle_write(json.loads('{"addr":"7","baud":"9600","st":"300","val":"100"}'))
     print r
     sleep(30)
Example #4
0
 def test_handle_write(self):
     print 'Sending communiaction'
     r = handle_write(
         json.loads('{"addr":"7","baud":"9600","st":"300","val":"100"}'))
     print r
     sleep(30)