complete the check sim function
This commit is contained in:
+10
-11
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user