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
|
||||
global is_finished
|
||||
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))
|
||||
listen_at = time.time()
|
||||
while not is_finished:
|
||||
@@ -128,7 +128,7 @@ def init_modems() -> list:
|
||||
|
||||
|
||||
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
|
||||
result = ReserveResultPojo.from_json(body)
|
||||
result.sim_position = current_sim_position
|
||||
@@ -165,8 +165,8 @@ def read_all_the_phone_number():
|
||||
|
||||
|
||||
def start_book():
|
||||
slot_number = 14
|
||||
slot_sum = 31
|
||||
slot_number = 1
|
||||
slot_sum = 12
|
||||
for i in range(slot_number, slot_sum + 1):
|
||||
card_pool.reset()
|
||||
logger.info("will switch to " + str(i))
|
||||
@@ -197,6 +197,8 @@ def start_book():
|
||||
continue
|
||||
if modem.contact:
|
||||
logger.info("contact found for this ccid")
|
||||
signal = modem.modem.signalStrength
|
||||
logger.info("signal for this sim: "+str(signal))
|
||||
commandor.start_page(modem.contact)
|
||||
start_to_handle_sms(modem)
|
||||
except Exception as error:
|
||||
@@ -210,3 +212,5 @@ if __name__ == '__main__':
|
||||
logger.addHandler(logging.StreamHandler(stream=sys.stdout))
|
||||
start_listen()
|
||||
start_book()
|
||||
# card_pool.switch_to_slot(31)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user