will merge gsm in project

This commit is contained in:
2022-03-24 15:48:41 +01:00
parent a99118125a
commit 13224a08d5
3 changed files with 29 additions and 18 deletions
+6 -5
View File
@@ -62,6 +62,8 @@ def timeout_occurred(serial_modem: SerialModem):
firebase_store_manager.save_timeout_contact(serial_modem.contact)
oracle_log_sender.send_timeout_log(serial_modem)
logger.info("will close timeout modem")
global thread_event
thread_event.set()
serial_modem.modem.close()
commandor.reset_air_plan_mode()
@@ -176,8 +178,8 @@ def on_ready_for_otp(e: Event, commandor: CommandorPage):
def start_book():
slot_number = 1
slot_sum = 1
slot_number = 2
slot_sum = 2
for i in range(slot_number, slot_sum + 1):
card_pool.reset()
logger.info("will switch to " + str(i))
@@ -191,14 +193,13 @@ def start_book():
excel_reader = ExcelHelper()
contacts = excel_reader.read_contacts()
global current_sim_position
current_sim_position = 1
current_sim_position = 0
for modem in modem_list:
current_sim_position = current_sim_position + 1
try:
# get contact for current modem
modem.get_ccid()
# find the contact with ccid
contact = [contact for contact in contacts if contact.ccid.replace("F", "") == modem.ccid]
contact = [contact for contact in contacts if contact.ccid.replace("F", "") == modem.ccid.replace("F", "")]
if len(contact) > 0:
modem.phone_number = contact[0].phone
modem.contact = contact[0]