                                                LOG_GNSS_POSITION_REPORT, LOG_GNSS_OEMDRE_MEASUREMENT_REPORT)
  
  DEBUG = int(os.getenv("DEBUG", "0"))==1
  
  miscStatusFields = {
    "multipathEstimateIsValid": 0,
    "directionIsValid": 1,
  }
 
</s> remove from selfdrive.sensord.rawgps.structs import dict_unpacker
from selfdrive.sensord.rawgps.structs import gps_measurement_report, gps_measurement_report_sv
from selfdrive.sensord.rawgps.structs import glonass_measurement_report, glonass_measurement_report_sv
from selfdrive.sensord.rawgps.structs import oemdre_measurement_report, oemdre_measurement_report_sv
from selfdrive.sensord.rawgps.structs import LOG_GNSS_GPS_MEASUREMENT_REPORT, LOG_GNSS_GLONASS_MEASUREMENT_REPORT
from selfdrive.sensord.rawgps.structs import position_report, LOG_GNSS_POSITION_REPORT, LOG_GNSS_OEMDRE_MEASUREMENT_REPORT
 </s> add from selfdrive.sensord.rawgps.structs import (dict_unpacker, position_report,
                                              gps_measurement_report, gps_measurement_report_sv,
                                              glonass_measurement_report, glonass_measurement_report_sv,
                                              oemdre_measurement_report, oemdre_measurement_report_sv,
                                              LOG_GNSS_GPS_MEASUREMENT_REPORT, LOG_GNSS_GLONASS_MEASUREMENT_REPORT,
                                              LOG_GNSS_POSITION_REPORT, LOG_GNSS_OEMDRE_MEASUREMENT_REPORT) </s> remove def main() -> NoReturn:
  unpack_gps_meas, size_gps_meas = dict_unpacker(gps_measurement_report, True)
  unpack_gps_meas_sv, size_gps_meas_sv = dict_unpacker(gps_measurement_report_sv, True)
 </s> add  </s> remove   unpack_glonass_meas, size_glonass_meas = dict_unpacker(glonass_measurement_report, True)
  unpack_glonass_meas_sv, size_glonass_meas_sv = dict_unpacker(glonass_measurement_report_sv, True)

  unpack_oemdre_meas, size_oemdre_meas = dict_unpacker(oemdre_measurement_report, True)
  unpack_oemdre_meas_sv, size_oemdre_meas_sv = dict_unpacker(oemdre_measurement_report_sv, True)

  log_types = [
    LOG_GNSS_GPS_MEASUREMENT_REPORT,
    LOG_GNSS_GLONASS_MEASUREMENT_REPORT,
    LOG_GNSS_OEMDRE_MEASUREMENT_REPORT,
  ]
  pub_types = ['qcomGnss']
  unpack_position, _ = dict_unpacker(position_report)
  log_types.append(LOG_GNSS_POSITION_REPORT)
  pub_types.append("gpsLocation")

  # connect to modem
  diag = ModemDiag()

  # NV enable OEMDRE
 </s> add def try_setup_logs(diag, log_types):
  for _ in range(5):
    try:
      setup_logs(diag, log_types)
      break
    except Exception:
      cloudlog.exception("setup logs failed, trying again")
  else:
    raise Exception(f"setup logs failed, {log_types=}")

def mmcli(cmd: str) -> None:
  for _ in range(5):
    try:
      subprocess.check_call(f"mmcli -m 0 {cmd}", shell=True)
      break
    except subprocess.CalledProcessError:
      cloudlog.exception("rawgps.mmcli_command_failed")
  else:
    raise Exception(f"failed to execute mmcli command {cmd=}")

def setup_quectel(diag: ModemDiag):
  # enable OEMDRE in the NV </s> remove   opcode, payload = send_recv(diag, DIAG_NV_WRITE_F, pack('<HI', NV_GNSS_OEM_FEATURE_MASK, 1))
  opcode, payload = send_recv(diag, DIAG_NV_READ_F, pack('<H', NV_GNSS_OEM_FEATURE_MASK))

  def try_setup_logs(diag, log_types):
    for _ in range(5):
      try:
        setup_logs(diag, log_types)
        break
      except Exception:
        pass

  def disable_logs(sig, frame):
    os.system("mmcli -m 0 --location-disable-gps-raw --location-disable-gps-nmea")
    cloudlog.warning("rawgpsd: shutting down")
    try_setup_logs(diag, [])
    cloudlog.warning("rawgpsd: logs disabled")
    sys.exit(0)
  signal.signal(signal.SIGINT, disable_logs)
  try_setup_logs(diag, log_types)
  cloudlog.warning("rawgpsd: setup logs done")
 </s> add   setup_logs(diag, LOG_TYPES)
LOG_TYPES = [
  LOG_GNSS_GPS_MEASUREMENT_REPORT,
  LOG_GNSS_GLONASS_MEASUREMENT_REPORT,
  LOG_GNSS_OEMDRE_MEASUREMENT_REPORT,
  LOG_GNSS_POSITION_REPORT,
]


                                                LOG_GNSS_POSITION_REPORT, LOG_GNSS_OEMDRE_MEASUREMENT_REPORT)
  
  DEBUG = int(os.getenv("DEBUG", "0"))==1
  
LOG_TYPES = [
  LOG_GNSS_GPS_MEASUREMENT_REPORT,
  LOG_GNSS_GLONASS_MEASUREMENT_REPORT,
  LOG_GNSS_OEMDRE_MEASUREMENT_REPORT,
  LOG_GNSS_POSITION_REPORT,
]


  miscStatusFields = {
    "multipathEstimateIsValid": 0,
    "directionIsValid": 1,
  }
keep keep keep add keep keep keep keep
 rawgpsd: more robust + simple test (#25977)

* rawgps cleanup

* wait for modem manager

* cleanup

Co-authored-by: Comma Device <device@comma.ai> 
selfdrive/sensord/rawgps/rawgpsd.py