Clean up code
This commit is contained in:
parent
6faf2aee97
commit
b17eca6d14
|
@ -174,22 +174,6 @@ void OvmsVehicleRenaultZoePh2OBD::IncomingBCM(uint16_t type, uint16_t pid, const
|
|||
}*/
|
||||
break;
|
||||
}
|
||||
/*case 0x4187: { //Position lights (Tagfahrlicht), working but no actual usecase for
|
||||
if ((bool)CAN_UINT(0)) {
|
||||
ESP_LOGD(TAG, "4187 Position lights: active");
|
||||
} else {
|
||||
ESP_LOGD(TAG, "4187 Position lights: inactive");
|
||||
}
|
||||
break;
|
||||
}*/
|
||||
/*case 0x6179: { //Rear fog lights, working but no actual usecase for
|
||||
if ((bool)CAN_UINT(0)) {
|
||||
ESP_LOGD(TAG, "6179 Rear fog lights: active");
|
||||
} else {
|
||||
ESP_LOGD(TAG, "6179 Rear fog lights: inactive");
|
||||
}
|
||||
break;
|
||||
}*/
|
||||
case 0x60C6: { //Ignition relay (switch)
|
||||
/*if ((bool)CAN_UINT(0)) {
|
||||
ESP_LOGD(TAG, "60C6 Ignition relay: active");
|
||||
|
@ -202,30 +186,6 @@ void OvmsVehicleRenaultZoePh2OBD::IncomingBCM(uint16_t type, uint16_t pid, const
|
|||
}
|
||||
break;
|
||||
}
|
||||
/*case 0x6164: { //Interior front roof light, working but no actual usecase for
|
||||
if ((bool)CAN_UINT(0)) {
|
||||
ESP_LOGD(TAG, "6164 Interior front roof light: active");
|
||||
} else {
|
||||
ESP_LOGD(TAG, "6164 Interior front roof light: inactive");
|
||||
}
|
||||
break;
|
||||
}*/
|
||||
/*case 0x6166: { //Interior tailgate light, working but no actual usecase for
|
||||
if ((bool)CAN_UINT(0)) {
|
||||
ESP_LOGD(TAG, "6166 Interior tailgate light: active");
|
||||
} else {
|
||||
ESP_LOGD(TAG, "6166 Interior tailgate light: inactive");
|
||||
}
|
||||
break;
|
||||
}*/
|
||||
/*case 0x6214: { //Interior tailgate light, working but no actual usecase for
|
||||
if ((bool)CAN_UINT(0)) {
|
||||
ESP_LOGD(TAG, "6214 Rain sensor: RAINING");
|
||||
} else {
|
||||
ESP_LOGD(TAG, "6214 Rain sensor: DRY");
|
||||
}
|
||||
break;
|
||||
}*/
|
||||
case 0x4060: { //Vehicle identificaftion number
|
||||
zoe_vin[0] = CAN_BYTE(0);
|
||||
zoe_vin[1] = CAN_BYTE(1);
|
||||
|
|
|
@ -42,29 +42,20 @@ void OvmsVehicleRenaultZoePh2OBD::IncomingEVC(uint16_t type, uint16_t pid, const
|
|||
//ESP_LOGD(TAG, "2005 EVC ms_v_charge_12v_voltage: %f", CAN_UINT(0) * 0.01);
|
||||
break;
|
||||
}
|
||||
case 0x21CF: { //Inverter status --- Main switch for polling and driving state
|
||||
case 0x21CF: { //Inverter status
|
||||
//ESP_LOGD(TAG, "21CF EVC mt_inv_status: %d", CAN_NIBL(0));
|
||||
if (CAN_NIBL(0) == 1) {
|
||||
mt_inv_status->SetValue("Inverter off");
|
||||
//StandardMetrics.ms_v_env_on->SetValue(false);
|
||||
//StandardMetrics.ms_v_env_awake->SetValue(false);
|
||||
|
||||
} else if (CAN_NIBL(0) == 2) {
|
||||
mt_inv_status->SetValue("Inverter on");
|
||||
//StandardMetrics.ms_v_env_on->SetValue(true);
|
||||
//StandardMetrics.ms_v_env_awake->SetValue(true);
|
||||
StandardMetrics.ms_v_door_chargeport->SetValue(false);
|
||||
} else if (CAN_NIBL(0) == 3) {
|
||||
mt_inv_status->SetValue("Inverter decharging");
|
||||
//StandardMetrics.ms_v_env_on->SetValue(false);
|
||||
//StandardMetrics.ms_v_env_awake->SetValue(false);
|
||||
} else if (CAN_NIBL(0) == 4) {
|
||||
mt_inv_status->SetValue("Inverter alternator mode");
|
||||
//StandardMetrics.ms_v_env_on->SetValue(false);
|
||||
//StandardMetrics.ms_v_env_awake->SetValue(false);
|
||||
} else if (CAN_NIBL(0) == 5) {
|
||||
mt_inv_status->SetValue("Inverter ready to sleep");
|
||||
//StandardMetrics.ms_v_env_on->SetValue(false);
|
||||
//StandardMetrics.ms_v_env_awake->SetValue(false);
|
||||
} else {
|
||||
mt_inv_status->SetValue("Inverter state unknown");
|
||||
}
|
||||
|
@ -254,11 +245,6 @@ void OvmsVehicleRenaultZoePh2OBD::IncomingEVC(uint16_t type, uint16_t pid, const
|
|||
//ESP_LOGD(TAG, "2B8A EVC ms_v_charge_voltage: %f", (CAN_UINT(0) * 0.5));
|
||||
break;
|
||||
}
|
||||
/*case 0x21CD: { // User SOC
|
||||
mt_bat_user_soc->SetValue((float) (CAN_UINT(0)), Percentage);
|
||||
//ESP_LOGD(TAG, "21CD EVC mt_bat_user_soc: %f", (float) CAN_UINT(0));
|
||||
break;
|
||||
}*/
|
||||
|
||||
default: {
|
||||
char *buf = NULL;
|
||||
|
|
|
@ -44,11 +44,6 @@ void OvmsVehicleRenaultZoePh2OBD::IncomingINV(uint16_t type, uint16_t pid, const
|
|||
//ESP_LOGD(TAG, "7010 INV mt_mot_temp_stator2: %f", float((CAN_UINT24(0) * 0.001953125) - 40));
|
||||
break;
|
||||
}
|
||||
//case 0x2001: { // Motor rpm
|
||||
// StandardMetrics.ms_v_mot_rpm->SetValue(float(CAN_UINT24(0) / 2) - 16000);
|
||||
// ESP_LOGD(TAG, "2001 INV ms_v_mot_rpm: %f", float(CAN_UINT24(0) / 2) - 16000);
|
||||
// break;
|
||||
//}
|
||||
case 0x2004: { // Battery voltage sense
|
||||
mt_inv_hv_voltage->SetValue(float(CAN_UINT(0) * 0.03125), Volts);
|
||||
//ESP_LOGD(TAG, "2004 INV mt_inv_hv_voltage: %f", float(CAN_UINT(0) * 0.03125));
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
/*
|
||||
; Project: Open Vehicle Monitor System
|
||||
; Date: 15th Apr 2022
|
||||
;
|
||||
; (C) 2022 Carsten Schmiemann
|
||||
;
|
||||
; Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
; of this software and associated documentation files (the "Software"), to deal
|
||||
; in the Software without restriction, including without limitation the rights
|
||||
; to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
; copies of the Software, and to permit persons to whom the Software is
|
||||
; furnished to do so, subject to the following conditions:
|
||||
;
|
||||
; The above copyright notice and this permission notice shall be included in
|
||||
; all copies or substantial portions of the Software.
|
||||
;
|
||||
; THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
; IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
; FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
; AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
; LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
; OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
; THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/*
|
||||
#include "vehicle_renaultzoe_ph2_obd.h"
|
||||
|
||||
void OvmsVehicleRenaultZoePh2OBD::IncomingCLUSTER(uint16_t type, uint16_t pid, const char* data, uint16_t len) {
|
||||
switch (pid) {
|
||||
case 0x2101: { // Cluster - trip counter
|
||||
mt_pos_car_trip->SetValue(CAN_UINT32(0), Kilometers);
|
||||
ESP_LOGD(TAG, "2101 CLUSTER mt_pos_car_trip: %f", float(CAN_UINT32(0)));
|
||||
//working very unreliable
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
char *buf = NULL;
|
||||
size_t rlen = len, offset = 0;
|
||||
do {
|
||||
rlen = FormatHexDump(&buf, data + offset, rlen, 16);
|
||||
offset += 16;
|
||||
ESP_LOGW(TAG, "OBD2: unhandled reply from CLUSTER [%02x %02x]: %s", type, pid, buf ? buf : "-");
|
||||
} while (rlen);
|
||||
if (buf)
|
||||
free(buf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
|
@ -59,7 +59,6 @@ static const OvmsVehicle::poll_pid_t renault_zoe_polls[] = {
|
|||
{ 0x18dadaf1, 0x18daf1da, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x300D, { 0, 10, 300, 3 }, 0, ISOTP_EXTFRAME }, // AC mains current
|
||||
{ 0x18dadaf1, 0x18daf1da, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x300B, { 0, 2, 300, 10 }, 0, ISOTP_EXTFRAME }, // AC phases
|
||||
{ 0x18dadaf1, 0x18daf1da, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x2B8A, { 0, 2, 300, 10 }, 0, ISOTP_EXTFRAME }, // AC mains voltage
|
||||
//{ 0x18dadaf1, 0x18daf1da, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x21CD, { 0, 10, 10, 10 }, 0, ISOTP_EXTFRAME }, // User SOC
|
||||
|
||||
//BCM
|
||||
//{ 0x745, 0x765, VEHICLE_POLL_TYPE_OBDIISESSION, SESSION_DEFAULT, { 0, 60, 60, 60 }, 0, ISOTP_STD }, // OBD Extended Diagnostic Session
|
||||
|
@ -82,12 +81,7 @@ static const OvmsVehicle::poll_pid_t renault_zoe_polls[] = {
|
|||
{ 0x745, 0x765, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x61B3, { 0, 3, 3, 3 }, 0, ISOTP_STD }, // Rear right door
|
||||
{ 0x745, 0x765, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x609B, { 0, 3, 3, 3 }, 0, ISOTP_STD }, // Tailgate
|
||||
{ 0x745, 0x765, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4186, { 0, 3, 3, 3 }, 0, ISOTP_STD }, // Low beam lights
|
||||
//{ 0x745, 0x765, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4187, { 0, 5, 5, 5 }, 0, ISOTP_STD }, // Position lights (Tagfahrlicht), working but no actual usecase for
|
||||
//{ 0x745, 0x765, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x6179, { 0, 5, 5, 5 }, 0, ISOTP_STD }, // Rear fog lights, working but no actual usecase for
|
||||
{ 0x745, 0x765, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x60C6, { 0, 3, 6, 60 }, 0, ISOTP_STD }, // Ignition relay (switch), working but behavior on CHARING testing needed
|
||||
//{ 0x745, 0x765, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x6164, { 0, 5, 5, 5 }, 0, ISOTP_STD }, // Interior front roof light, working but no actual usecase for
|
||||
//{ 0x745, 0x765, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x6166, { 0, 5, 5, 5 }, 0, ISOTP_STD }, // Interior tailgate light, working but no actual usecase for
|
||||
//{ 0x745, 0x765, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x6214, { 0, 5, 5, 5 }, 0, ISOTP_STD }, // Rain detection, working butno actual usecase for
|
||||
{ 0x745, 0x765, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4060, { 0, 600, 0, 0 }, 0, ISOTP_STD }, // Vehicle identificaftion number
|
||||
|
||||
//LBC
|
||||
|
@ -226,8 +220,5 @@ static const OvmsVehicle::poll_pid_t renault_zoe_polls[] = {
|
|||
//{ 0x74D, 0x76D, VEHICLE_POLL_TYPE_OBDIISESSION, SESSION_AfterSales, { 0, 60, 60, 60 }, 0, ISOTP_STD }, // OBD Extended Diagnostic Session
|
||||
{ 0x74D, 0x76D, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x6079, { 0, 10, 10, 10 }, 0, ISOTP_STD }, // 12V Battery current
|
||||
|
||||
//TDB
|
||||
//{ 0x743, 0x763, VEHICLE_POLL_TYPE_OBDIISESSION, SESSION_AfterSales, { 0, 60, 60, 60 }, 0, ISOTP_STD }, // OBD Extended Diagnostic Session
|
||||
//{ 0x743, 0x763, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x2101, { 0, 30, 10, 300 }, 0, ISOTP_STD }, // Cluster - trip counter, not working reliable enough
|
||||
POLL_LIST_END
|
||||
};
|
Loading…
Reference in New Issue