[Ovmsdev] Reading config in OvmsVehicleXXXInit
ovms at soko.cc
Sun Jul 26 00:25:06 HKT 2020
I'd like to keep the sources for the T26A and OBD version for the VW
With my little understanding of the OVMS framework I've created one
(abstract) class for the vehicle with the web-interface stuff.
Then two derived classes, one for OBD one for T26A.
Now I try to register those two different classes depending on the settings:
int how_connected = MyConfig.GetParamValueInt("vwup",
ESP_LOGI(TAG, "Registering Vehicle: VW e-Up (9000).
if (how_connected == CONN_T26A)
MyVehicleFactory.RegisterVehicle<VWeUpT26a>("VWUP", "VW e-Up");
MyVehicleFactory.RegisterVehicle<VWeUpObd>("VWUP", "VW e-Up");
I know already that this only gets called during reboot as the
log-message doesn't show up when I change the vehicle. But it seems that
MyConfig isn't really the correct/same instance (?) as I'm getting
inside my classes. Because the web-interface shows
how_connected=CONN_T26A, but here it is always CONN_OBD (default value).
How do I do this properly?
Or is it even a better idea to do two separate vehicles??
More information about the OvmsDev