mirror of https://github.com/commaai/openpilot.git
tici: modem cleanups (#34071)
* tici: modem cleanups * rm that --------- Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
parent
d90d5a403f
commit
670cf27f8e
|
@ -107,9 +107,6 @@ class HardwareBase(ABC):
|
|||
def get_modem_version(self):
|
||||
return None
|
||||
|
||||
def get_modem_nv(self):
|
||||
return None
|
||||
|
||||
@abstractmethod
|
||||
def get_modem_temperatures(self):
|
||||
pass
|
||||
|
|
|
@ -99,7 +99,6 @@ def hw_state_thread(end_event, hw_queue):
|
|||
prev_hw_state = None
|
||||
|
||||
modem_version = None
|
||||
modem_nv = None
|
||||
modem_configured = False
|
||||
modem_restarted = False
|
||||
modem_missing_count = 0
|
||||
|
@ -114,12 +113,11 @@ def hw_state_thread(end_event, hw_queue):
|
|||
modem_temps = prev_hw_state.modem_temps
|
||||
|
||||
# Log modem version once
|
||||
if AGNOS and ((modem_version is None) or (modem_nv is None)):
|
||||
if AGNOS and (modem_version is None):
|
||||
modem_version = HARDWARE.get_modem_version()
|
||||
modem_nv = HARDWARE.get_modem_nv()
|
||||
|
||||
if (modem_version is not None) and (modem_nv is not None):
|
||||
cloudlog.event("modem version", version=modem_version, nv=modem_nv)
|
||||
if modem_version is not None:
|
||||
cloudlog.event("modem version", version=modem_version)
|
||||
else:
|
||||
if not modem_restarted:
|
||||
# TODO: we may be able to remove this with a MM update
|
||||
|
|
|
@ -294,19 +294,6 @@ class Tici(HardwareBase):
|
|||
except Exception:
|
||||
return None
|
||||
|
||||
def get_modem_nv(self):
|
||||
timeout = 0.2 # Default timeout is too short
|
||||
files = (
|
||||
'/nv/item_files/modem/mmode/ue_usage_setting',
|
||||
'/nv/item_files/ims/IMS_enable',
|
||||
'/nv/item_files/modem/mmode/sms_only',
|
||||
)
|
||||
try:
|
||||
modem = self.get_modem()
|
||||
return { fn: str(modem.Command(f'AT+QNVFR="{fn}"', math.ceil(timeout), dbus_interface=MM_MODEM, timeout=timeout)) for fn in files}
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
def get_modem_temperatures(self):
|
||||
timeout = 0.2 # Default timeout is too short
|
||||
try:
|
||||
|
@ -475,7 +462,7 @@ class Tici(HardwareBase):
|
|||
'AT$QCPCFG=usbNet,0',
|
||||
'AT$QCNETDEVCTL=3,1',
|
||||
]
|
||||
else:
|
||||
elif self.get_device_type() in ("tici", "tizi"):
|
||||
cmds += [
|
||||
# configure modem as data-centric
|
||||
'AT+QNVW=5280,0,"0102000000000000"',
|
||||
|
|
Loading…
Reference in New Issue