def POST(self): i = web.input() web.header('Content-Type', 'text/json') if 'adscripts' in i: ad = AD9361_c.AD9361_c() lines = i.adscripts.split('\n') for x in lines: adscripts.parse(x,ad.order) return json.dumps({'ret':'ok'}) elif 'bit' in i: f = open('/tmp/bit','w') f.write(i.bit) f.close() downloadThread('download','/tmp/bit').start() return json.dumps({'ret':'ok'}) return json.dumps({'ret':'err','res':'not bit or adscripts'})
def init(): path = os.path.split(os.path.realpath(__file__))[0] fn = path+"/../../AD9361/ad9361_config.reg" f = open(fn) ad = AD9361_c.AD9361_c() for x in f.readlines(): adscripts.parse(x,ad.order) ad.Check_FDD() ad.deinit() # ocm = axi2s_u.axi2s_u() # ocm.cleanTx() # ocm.deinit() # uut = axi2s_c.axi2s_c(_g.todict()) # uut.init() # uut.check() # uut.deinit() _g.init()
if i.tx != 'n': ad.Set_Tx_freq(25e6, float(i.tx)) if i.rx != 'n': ad.Set_Rx_freq(25e6, float(i.rx)) ad.deinit() web.header('Content-Type', 'text/json') return json.dumps({'ret': 'ok'}) if __name__ == "__main__": path = os.path.split(os.path.realpath(__file__))[0] fn = path + "/../../AD9361/ad9361_config.reg" f = open(fn) ad = AD9361_c.AD9361_c() for x in f.readlines(): adscripts.parse(x, ad.order) ad.Check_FDD() ad.deinit() ocm = axi2s_u.axi2s_u() ocm.cleanTx() ocm.deinit() uut = axi2s_c.axi2s_c() uut.init() uut.check() uut.deinit() app = web.application(urls, globals()) app.run()
if i.tx!='n': ad.Set_Tx_freq(25e6,float(i.tx)) if i.rx!='n': ad.Set_Rx_freq(25e6,float(i.rx)) ad.deinit() web.header('Content-Type', 'text/json') return json.dumps({'ret':'ok'}) if __name__ == "__main__": path = os.path.split(os.path.realpath(__file__))[0] fn = path+"/../../AD9361/ad9361_config.reg" f = open(fn) ad = AD9361_c.AD9361_c() for x in f.readlines(): adscripts.parse(x,ad.order) ad.Check_FDD() ad.deinit() ocm = axi2s_u.axi2s_u() ocm.cleanTx() ocm.deinit() uut = axi2s_c.axi2s_c() uut.init() uut.check() uut.deinit() app = web.application(urls, globals()) app.run()