Avoid reconnecting if no radio changes
This commit is contained in:
parent
4437c69d11
commit
85c95dff1b
1 changed files with 20 additions and 18 deletions
|
|
@ -289,7 +289,6 @@ async def waitForTx (packet_id: int):
|
|||
s = time()
|
||||
timed_out = False
|
||||
while not packet_id in txed and not timed_out:
|
||||
# sleep(0.1)
|
||||
await asyncio.sleep(0.1)
|
||||
if time() - s > 45:
|
||||
timed_out = True
|
||||
|
|
@ -325,10 +324,12 @@ async def runCues (cuesheet: Cuesheet, run_config: RunConfig):
|
|||
print(scenario)
|
||||
print('configure radio')
|
||||
scenario_prefix = f'{scenario['freq']},{scenario['bw']},{scenario['sf']},{scenario['cr']},{scenario['pow']}'
|
||||
configureRadio(scenario)
|
||||
did_change = configureRadio(scenario)
|
||||
if did_change:
|
||||
reconnectRadio()
|
||||
if scenario['sender'] == run_config['this_station']:
|
||||
print('waiting for start')
|
||||
while t < scenario['start']:
|
||||
while t < scenario['start']: # Give other stations time to get ready
|
||||
t = time() - start
|
||||
sleep(0.1)
|
||||
print('starting scenario')
|
||||
|
|
@ -340,6 +341,7 @@ async def runCues (cuesheet: Cuesheet, run_config: RunConfig):
|
|||
await sendPacket(scenario['sender'], scenario['size'])
|
||||
await asyncio.sleep(scenario['between'])
|
||||
else:
|
||||
print('waiting for rx')
|
||||
# Wait until the next scenario and just listen
|
||||
wait_for_s = max(scenario['end'] - t,0.5)
|
||||
await asyncio.sleep(wait_for_s)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue