[Ovmsdev] A query on vehicle type switch (and failure)

Michael Geddes frog at bunyip.wheelycreek.net
Sun Nov 26 09:26:09 HKT 2023


This code is from OvmsVehicleFactor::SetVehicle

  m_currentvehicle = NewVehicle(type);
  if (m_currentvehicle)
  {
  m_currentvehicle->m_ready = true;
  }
  m_currentvehicletype = std::string(type);
  StandardMetrics.ms_v_type->SetValue(m_currentvehicle ? type : "");
  MyEvents.SignalEvent("vehicle.type.set", (void*)type, strlen(type)+1);

My question is about what happens when NewVehicle() returns NULL.

Should  m_currecntvehicletype,  v.type  and the SignalEvent  all be set as
blank?  Any particular reason why only the v.type is set as blank?

//.ichael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvehicles.com/pipermail/ovmsdev/attachments/20231126/70c38ee0/attachment.htm>


More information about the OvmsDev mailing list