sim-config: Improve alive check after reset
BugzID: 56371
This commit is contained in:
parent
d146532b31
commit
0ab0535705
|
|
@ -27,14 +27,12 @@ def reset_modem():
|
||||||
write_to_file(GPIO_PATH + 'gpio' + GPIO_SIM_RST + '/value', '1')
|
write_to_file(GPIO_PATH + 'gpio' + GPIO_SIM_RST + '/value', '1')
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
write_to_file(GPIO_PATH + 'gpio' + GPIO_SIM_RST + '/value', '0')
|
write_to_file(GPIO_PATH + 'gpio' + GPIO_SIM_RST + '/value', '0')
|
||||||
print("reset done")
|
# Wait until modem rebooted
|
||||||
# Wait until modem rebooted
|
while os.path.exists('dev/ttyACM0'):
|
||||||
while True:
|
|
||||||
dirs = os.listdir("/dev")
|
|
||||||
for file in dirs:
|
|
||||||
if file == 'ttyACM2':
|
|
||||||
sys.exit(0);
|
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
while not os.path.exists('/dev/ttyACM0'):
|
||||||
|
time.sleep(1)
|
||||||
|
print("reset done")
|
||||||
|
|
||||||
def is_rst_required():
|
def is_rst_required():
|
||||||
global rst
|
global rst
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue