sim-config: Improve alive check after reset

BugzID: 56371
This commit is contained in:
Alexandre Bard 2019-04-02 18:58:05 +02:00
parent 23d8ad5769
commit c3a7e34286
1 changed files with 5 additions and 7 deletions

View File

@ -27,14 +27,12 @@ def reset_modem():
write_to_file(GPIO_PATH + 'gpio' + GPIO_SIM_RST + '/value', '1')
time.sleep(2)
write_to_file(GPIO_PATH + 'gpio' + GPIO_SIM_RST + '/value', '0')
print("reset done")
# Wait until modem rebooted
while True:
dirs = os.listdir("/dev")
for file in dirs:
if file == 'ttyACM2':
sys.exit(0);
# Wait until modem rebooted
while os.path.exists('dev/ttyACM0'):
time.sleep(1)
while not os.path.exists('/dev/ttyACM0'):
time.sleep(1)
print("reset done")
def is_rst_required():
global rst