complete the check sim function

This commit is contained in:
2022-03-24 23:20:33 +01:00
parent 97f258a1b3
commit 94a602c791
19 changed files with 61 additions and 3312 deletions
+10 -11
View File
@@ -20,9 +20,6 @@ commandor = CommandorPage()
thread_event = None
current_gsm_modem = None
card_pool = CardPool(CARD_POOL_PORT)
# used to save the current slot position
current_card_pool_slot = 1
current_sim_position = 1
def get_devices_ports() -> list:
@@ -49,9 +46,13 @@ def timeout_occurred(serial_modem: SerialModem):
def start_to_handle_sms(serial_modem: SerialModem):
global current_gsm_modem
current_gsm_modem = serial_modem.modem
if check_operator(serial_modem.ccid) == Operator.LYCAMOBILE:
# if check_operator(serial_modem.ccid) == Operator.LYCAMOBILE:
# lycamobile
try:
current_gsm_modem.deleteMultipleStoredSms(memory="SM")
except Exception as error:
print(error)
serial_modem.modem.smsReceivedCallback = handle_sms
serial_modem.modem.smsTextMode = False
logger.info('Waiting for SMS message, for phone number ' + str(serial_modem.phone_number))
@@ -84,9 +85,10 @@ def init_modems() -> list:
return modems
def start_book():
slot_number = 2
slot_sum = 2
def start_waiting_sms():
# logger = logging.getLogger()
slot_number = 1
slot_sum = 28
for i in range(slot_number, slot_sum + 1):
card_pool.reset()
logger.info("will switch to " + str(i))
@@ -97,10 +99,7 @@ def start_book():
# read the contact, and merge the 2 objects together
excel_reader = ExcelHelper()
contacts = excel_reader.read_contacts()
global current_sim_position
current_sim_position = 1
for modem in modem_list:
current_sim_position = current_sim_position + 1
try:
# get contact for current modem
modem.get_ccid()
@@ -119,4 +118,4 @@ if __name__ == '__main__':
init_logger()
logger = logging.getLogger()
logger.addHandler(logging.StreamHandler(stream=sys.stdout))
start_book()
start_waiting_sms()