Merge branch 'master' of bitbucket.org:panleicim/appointement_modem_pool
This commit is contained in:
@@ -72,7 +72,7 @@ def start_to_handle_sms(serial_modem: SerialModem):
|
|||||||
serial_modem.modem.smsReceivedCallback = handle_sms
|
serial_modem.modem.smsReceivedCallback = handle_sms
|
||||||
global is_finished
|
global is_finished
|
||||||
is_finished = False
|
is_finished = False
|
||||||
serial_modem.modem.smsTextMode = True
|
serial_modem.modem.smsTextMode = False
|
||||||
logger.info('Waiting for SMS message, for phone number ' + str(serial_modem.phone_number))
|
logger.info('Waiting for SMS message, for phone number ' + str(serial_modem.phone_number))
|
||||||
listen_at = time.time()
|
listen_at = time.time()
|
||||||
while not is_finished:
|
while not is_finished:
|
||||||
@@ -128,7 +128,7 @@ def init_modems() -> list:
|
|||||||
|
|
||||||
|
|
||||||
def on_message_received(ch, method, properties, body):
|
def on_message_received(ch, method, properties, body):
|
||||||
logger.info(" [x] Received {} {}".format(body, datetime.datetime.now()))
|
print(" [x] Received {} {}".format(body, datetime.datetime.now()))
|
||||||
# parse the received message
|
# parse the received message
|
||||||
result = ReserveResultPojo.from_json(body)
|
result = ReserveResultPojo.from_json(body)
|
||||||
result.sim_position = current_sim_position
|
result.sim_position = current_sim_position
|
||||||
@@ -165,8 +165,8 @@ def read_all_the_phone_number():
|
|||||||
|
|
||||||
|
|
||||||
def start_book():
|
def start_book():
|
||||||
slot_number = 14
|
slot_number = 1
|
||||||
slot_sum = 31
|
slot_sum = 12
|
||||||
for i in range(slot_number, slot_sum + 1):
|
for i in range(slot_number, slot_sum + 1):
|
||||||
card_pool.reset()
|
card_pool.reset()
|
||||||
logger.info("will switch to " + str(i))
|
logger.info("will switch to " + str(i))
|
||||||
@@ -197,6 +197,8 @@ def start_book():
|
|||||||
continue
|
continue
|
||||||
if modem.contact:
|
if modem.contact:
|
||||||
logger.info("contact found for this ccid")
|
logger.info("contact found for this ccid")
|
||||||
|
signal = modem.modem.signalStrength
|
||||||
|
logger.info("signal for this sim: "+str(signal))
|
||||||
commandor.start_page(modem.contact)
|
commandor.start_page(modem.contact)
|
||||||
start_to_handle_sms(modem)
|
start_to_handle_sms(modem)
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
@@ -210,3 +212,5 @@ if __name__ == '__main__':
|
|||||||
logger.addHandler(logging.StreamHandler(stream=sys.stdout))
|
logger.addHandler(logging.StreamHandler(stream=sys.stdout))
|
||||||
start_listen()
|
start_listen()
|
||||||
start_book()
|
start_book()
|
||||||
|
# card_pool.switch_to_slot(31)
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ from main import card_pool, get_devices_ports
|
|||||||
def read_all_the_phone_number():
|
def read_all_the_phone_number():
|
||||||
params.oracle_log_sender.send_log(msg="SIM卡自检开始", subject=LOG_SUBJECT_EVENT, type=TYPE_EVENT_RESET_ALL_SIM_CARDS)
|
params.oracle_log_sender.send_log(msg="SIM卡自检开始", subject=LOG_SUBJECT_EVENT, type=TYPE_EVENT_RESET_ALL_SIM_CARDS)
|
||||||
slot_number = 1
|
slot_number = 1
|
||||||
slot_sum = 31
|
slot_sum = 12
|
||||||
# card_pool.switch_to_slot(29)
|
# card_pool.switch_to_slot(29)
|
||||||
params.firebase_store_manager.clear_all_sim_info()
|
params.firebase_store_manager.clear_all_sim_info()
|
||||||
for i in range(slot_number, slot_sum + 1):
|
for i in range(slot_number, slot_sum + 1):
|
||||||
|
|||||||
Reference in New Issue
Block a user