Example #1
0
def handle_job_update(msg, methods=['GET', 'POST']):
    if msg['action'] == "connect":
        addr = msg['addr']
        res = u.Connect(timeout=5, addrss=addr)
        connection_lock.acquire()
        INFO['SERVER_CONNECTED'] = res
        connection_lock.release()
        socketio.emit('connect_resopnse', json.dumps({'response': int(res)}))
    elif msg['action'] == "disconnect":
        u.Disconnect()
        connection_lock.acquire()
        INFO['SERVER_CONNECTED'] = False
        connection_lock.release()
        socketio.emit('connect_resopnse', json.dumps({'response': int(False)}))
    elif msg['action'] == "ping":
        pass  # requires server dev
    elif msg['action'] == "restart":
        pass  # requires server dev
Example #2
0
## Print some diagnostic text
print(pwr_clc, ' dBm')
print(N_power)

## Do a VNA run with the USRP
vna_file, delay = puf2.vna_run(tx_gain=tx_gain,
                               rx_gain=rx_gain,
                               iter=1,
                               rate=rate,
                               freq=LO,
                               front_end='A',
                               f0=43e6,
                               f1=48e6,
                               lapse=20,
                               points=1e5,
                               ntones=N_power,
                               delay_duration=0.1,
                               delay_over='null',
                               subfolder=seriesPath)

## Fit the data acquired in this noise scan
fs, qs, _, _, _, _, _ = puf.vna_file_fit(vna_file + '.h5', [res], show=False)

## Extract the important parameters from fit
f = fs[0] * 1e9
q = qs[0]

## Disconnect from the USRP server
u.Disconnect()