13 Jun
2020
13 Jun
'20
7:09 a.m.
I'd like to add a boolean metric for gas vehicles as a prelude to the phone apps having this info. Would this be ok?
#define MS_V_MOT_GAS "v.m.gas"
ms_v_mot_gas = new OvmsMetricBool(MS_V_MOT_GAS);
The default to false. The other way would be via OvmsMetricInt and an enum (or defines):
typedef enum : uint8_t
{
Battery = 0,
Gasoline = 1,
} metric_vehicle_t;
#define MS_V_MOT_TYPE "v.m.type"
ms_v_mot_type = new OvmsMetricInt(MS_V_MOT_TYPE);
which would allow for more than two types.
Craig