add ccid to log
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import logging
|
||||
from dataclasses import dataclass
|
||||
|
||||
from gsmmodem import GsmModem
|
||||
@@ -13,14 +14,15 @@ class SerialModem():
|
||||
def __init__(self, modem: GsmModem, ccid: str = None):
|
||||
self.modem = modem
|
||||
self.ccid = ccid
|
||||
self.logger = logging.getLogger("SerialModem")
|
||||
|
||||
def get_ccid(self):
|
||||
cmd = "AT+CCID"
|
||||
self.modem.connect("0000")
|
||||
print("try to get ccid")
|
||||
self.logger.info("try to get ccid")
|
||||
response = self.modem.write(cmd, True)
|
||||
self.ccid = response[0].split(" ")[1].replace("\"", "")
|
||||
print("The SIM card ccid is:" + self.ccid)
|
||||
self.logger.info("The SIM card ccid is:" + self.ccid)
|
||||
# print("try to get phone number")
|
||||
# cmd_phone_number = "AT+CPBS=ON"
|
||||
# openBook = self.modem.write(cmd_phone_number, True)
|
||||
|
||||
Reference in New Issue
Block a user