show signal streath

This commit is contained in:
2022-03-17 09:17:46 +01:00
parent a1b7cb239b
commit 9b1939d9a0
2 changed files with 9 additions and 5 deletions
+8 -4
View File
@@ -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)