[Ovmsdev] v2 android clients crashes while v3 is charging

Tom Parker tom at carrott.org
Thu Nov 2 16:57:54 HKT 2017

I found that the android client crashes when my leaf with v3 hardware is 
charging. This is because it expects integers for some values and throws 
NumberFormatException parsing if it encounters a floating point string. 
The AsString() method on float metrics returns a floating point string 
and we have a bunch of metrics that used to be integers but are now 
(correctly) floats.

I've sent a pull request with one possible solution 
but I'm pretty sure it's the wrong solution. I added a special case unit 
conversion to integer, but having done this I think an 
AsIntString(default, unit) method on the floating point metrics would be 
a more appropriate api. As I've written it, you can't combine a unit 
conversion and a rounding to integer.


I also sent another pull request for a minimal implementation of the 
charger state related values in the v2 protocol, and some small leaf fixes.

More information about the OvmsDev mailing list