|
19 | 19 | from openpilot.common.params import Params |
20 | 20 | from openpilot.common.realtime import DT_HW |
21 | 21 | from openpilot.selfdrive.selfdrived.alertmanager import set_offroad_alert |
22 | | -from openpilot.system.hardware import HARDWARE, TICI, AGNOS |
| 22 | +from openpilot.system.hardware import HARDWARE, TICI, AGNOS, PC |
23 | 23 | from openpilot.system.loggerd.config import get_available_percent |
24 | 24 | from openpilot.system.statsd import statlog |
25 | 25 | from openpilot.common.swaglog import cloudlog |
26 | 26 | from openpilot.system.hardware.power_monitoring import PowerMonitoring |
27 | 27 | from openpilot.system.hardware.fan_controller import TiciFanController |
28 | 28 | from openpilot.system.version import terms_version, training_version |
| 29 | +from openpilot.system.athena.registration import UNREGISTERED_DONGLE_ID |
29 | 30 |
|
30 | 31 | ThermalStatus = log.DeviceState.ThermalStatus |
31 | 32 | NetworkType = log.DeviceState.NetworkType |
@@ -325,6 +326,12 @@ def hardware_thread(end_event, hw_queue) -> None: |
325 | 326 | show_alert = (not onroad_conditions["device_temp_good"] or not startup_conditions["device_temp_engageable"]) and onroad_conditions["ignition"] |
326 | 327 | set_offroad_alert_if_changed("Offroad_TemperatureTooHigh", show_alert, extra_text=extra_text) |
327 | 328 |
|
| 329 | + # *** registration check *** |
| 330 | + if not PC: |
| 331 | + # we enforce this for our software, but you are welcome |
| 332 | + # to make a different decision in your software |
| 333 | + startup_conditions["registered_device"] = PC or (params.get("DongleId") != UNREGISTERED_DONGLE_ID) |
| 334 | + |
328 | 335 | # TODO: this should move to TICI.initialize_hardware, but we currently can't import params there |
329 | 336 | if TICI and HARDWARE.get_device_type() == "tici": |
330 | 337 | if not os.path.isfile("/persist/comma/living-in-the-moment"): |
|
0 commit comments