add slot_position and sim_position

This commit is contained in:
2022-03-25 22:44:43 +01:00
parent a025c8c9fa
commit cd8d837aaf
4 changed files with 24 additions and 18 deletions
+5 -9
View File
@@ -31,10 +31,6 @@ current_card_pool_slot = 1
current_sim_position = 1
def get_devices_ports() -> list:
return MODEM_POOL_PORTS
def send_command(cmd: str, ser, wait_time_in_s: int = 0) -> bytes:
ser.write(cmd.encode())
msg = ser.read(100)
@@ -131,7 +127,7 @@ def handle_sms(sms):
def init_modems() -> list:
modems = []
for port in get_devices_ports():
for port in params.MODEM_POOL_PORTS:
serial_modem = create_modem_for_port(port)
if serial_modem:
modems.append(serial_modem)
@@ -178,15 +174,15 @@ def on_ready_for_otp(e: Event, commandor: CommandorPage):
def start_book():
slot_number = 27
slot_sum = 27
for i in range(slot_number, slot_sum + 1):
start_slot_number = 27
end_slot_number = 27
for i in range(start_slot_number, end_slot_number + 1):
card_pool.reset()
logger.info("will switch to " + str(i))
global current_card_pool_slot
current_card_pool_slot = i
card_pool.switch_to_slot(i)
modem_pool = ModemPool(get_devices_ports())
modem_pool = ModemPool(MODEM_POOL_PORTS)
modem_pool.reset_all_modems()
modem_list = init_modems()
# read the contact, and contact the 2 objects together