Add cellvoltage reading for ZoeGen2

This commit is contained in:
Daniel Öster 2025-05-22 16:14:41 +03:00
parent 72e3285dfb
commit 3e6d2bd30c
2 changed files with 549 additions and 49 deletions

View file

@ -241,6 +241,294 @@ void RenaultZoeGen2Battery::handle_incoming_can_frame(CAN_frame rx_frame) {
case POLL_SOC_MAX:
battery_soc_max = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_0:
datalayer.battery.status.cell_voltages_mV[0] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_1:
datalayer.battery.status.cell_voltages_mV[1] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_2:
datalayer.battery.status.cell_voltages_mV[2] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_3:
datalayer.battery.status.cell_voltages_mV[3] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_4:
datalayer.battery.status.cell_voltages_mV[4] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_5:
datalayer.battery.status.cell_voltages_mV[5] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_6:
datalayer.battery.status.cell_voltages_mV[6] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_7:
datalayer.battery.status.cell_voltages_mV[7] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_8:
datalayer.battery.status.cell_voltages_mV[8] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_9:
datalayer.battery.status.cell_voltages_mV[9] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_10:
datalayer.battery.status.cell_voltages_mV[10] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_11:
datalayer.battery.status.cell_voltages_mV[11] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_12:
datalayer.battery.status.cell_voltages_mV[12] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_13:
datalayer.battery.status.cell_voltages_mV[13] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_14:
datalayer.battery.status.cell_voltages_mV[14] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_15:
datalayer.battery.status.cell_voltages_mV[15] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_16:
datalayer.battery.status.cell_voltages_mV[16] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_17:
datalayer.battery.status.cell_voltages_mV[17] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_18:
datalayer.battery.status.cell_voltages_mV[18] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_19:
datalayer.battery.status.cell_voltages_mV[19] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_20:
datalayer.battery.status.cell_voltages_mV[20] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_21:
datalayer.battery.status.cell_voltages_mV[21] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_22:
datalayer.battery.status.cell_voltages_mV[22] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_23:
datalayer.battery.status.cell_voltages_mV[23] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_24:
datalayer.battery.status.cell_voltages_mV[24] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_25:
datalayer.battery.status.cell_voltages_mV[25] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_26:
datalayer.battery.status.cell_voltages_mV[26] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_27:
datalayer.battery.status.cell_voltages_mV[27] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_28:
datalayer.battery.status.cell_voltages_mV[28] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_29:
datalayer.battery.status.cell_voltages_mV[29] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_30:
datalayer.battery.status.cell_voltages_mV[30] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_31:
datalayer.battery.status.cell_voltages_mV[31] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_32:
datalayer.battery.status.cell_voltages_mV[32] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_33:
datalayer.battery.status.cell_voltages_mV[33] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_34:
datalayer.battery.status.cell_voltages_mV[34] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_35:
datalayer.battery.status.cell_voltages_mV[35] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_36:
datalayer.battery.status.cell_voltages_mV[36] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_37:
datalayer.battery.status.cell_voltages_mV[37] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_38:
datalayer.battery.status.cell_voltages_mV[38] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_39:
datalayer.battery.status.cell_voltages_mV[39] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_40:
datalayer.battery.status.cell_voltages_mV[40] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_41:
datalayer.battery.status.cell_voltages_mV[41] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_42:
datalayer.battery.status.cell_voltages_mV[42] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_43:
datalayer.battery.status.cell_voltages_mV[43] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_44:
datalayer.battery.status.cell_voltages_mV[44] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_45:
datalayer.battery.status.cell_voltages_mV[45] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_46:
datalayer.battery.status.cell_voltages_mV[46] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_47:
datalayer.battery.status.cell_voltages_mV[47] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_48:
datalayer.battery.status.cell_voltages_mV[48] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_49:
datalayer.battery.status.cell_voltages_mV[49] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_50:
datalayer.battery.status.cell_voltages_mV[50] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_51:
datalayer.battery.status.cell_voltages_mV[51] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_52:
datalayer.battery.status.cell_voltages_mV[52] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_53:
datalayer.battery.status.cell_voltages_mV[53] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_54:
datalayer.battery.status.cell_voltages_mV[54] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_55:
datalayer.battery.status.cell_voltages_mV[55] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_56:
datalayer.battery.status.cell_voltages_mV[56] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_57:
datalayer.battery.status.cell_voltages_mV[57] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_58:
datalayer.battery.status.cell_voltages_mV[58] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_59:
datalayer.battery.status.cell_voltages_mV[59] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_60:
datalayer.battery.status.cell_voltages_mV[60] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_61:
datalayer.battery.status.cell_voltages_mV[61] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_62:
datalayer.battery.status.cell_voltages_mV[62] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_63:
datalayer.battery.status.cell_voltages_mV[63] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_64:
datalayer.battery.status.cell_voltages_mV[64] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_65:
datalayer.battery.status.cell_voltages_mV[65] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_66:
datalayer.battery.status.cell_voltages_mV[66] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_67:
datalayer.battery.status.cell_voltages_mV[67] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_68:
datalayer.battery.status.cell_voltages_mV[68] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_69:
datalayer.battery.status.cell_voltages_mV[69] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_70:
datalayer.battery.status.cell_voltages_mV[70] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_71:
datalayer.battery.status.cell_voltages_mV[71] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_72:
datalayer.battery.status.cell_voltages_mV[72] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_73:
datalayer.battery.status.cell_voltages_mV[73] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_74:
datalayer.battery.status.cell_voltages_mV[74] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_75:
datalayer.battery.status.cell_voltages_mV[75] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_76:
datalayer.battery.status.cell_voltages_mV[76] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_77:
datalayer.battery.status.cell_voltages_mV[77] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_78:
datalayer.battery.status.cell_voltages_mV[78] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_79:
datalayer.battery.status.cell_voltages_mV[79] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_80:
datalayer.battery.status.cell_voltages_mV[80] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_81:
datalayer.battery.status.cell_voltages_mV[81] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_82:
datalayer.battery.status.cell_voltages_mV[82] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_83:
datalayer.battery.status.cell_voltages_mV[83] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_84:
datalayer.battery.status.cell_voltages_mV[84] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_85:
datalayer.battery.status.cell_voltages_mV[85] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_86:
datalayer.battery.status.cell_voltages_mV[86] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_87:
datalayer.battery.status.cell_voltages_mV[87] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_88:
datalayer.battery.status.cell_voltages_mV[88] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_89:
datalayer.battery.status.cell_voltages_mV[89] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_90:
datalayer.battery.status.cell_voltages_mV[90] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_91:
datalayer.battery.status.cell_voltages_mV[91] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_92:
datalayer.battery.status.cell_voltages_mV[92] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_93:
datalayer.battery.status.cell_voltages_mV[93] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_94:
datalayer.battery.status.cell_voltages_mV[94] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
case POLL_CELL_95:
datalayer.battery.status.cell_voltages_mV[95] = (rx_frame.data.u8[4] << 8) | rx_frame.data.u8[5];
break;
default: // Unknown reply
break;
}
@ -282,7 +570,7 @@ void RenaultZoeGen2Battery::transmit_can(unsigned long currentMillis) {
// Update current poll from the array
currentpoll = poll_commands[poll_index];
poll_index = (poll_index + 1) % 48;
poll_index = (poll_index + 1) % 163;
ZOE_POLL_18DADBF1.data.u8[2] = (uint8_t)((currentpoll & 0xFF00) >> 8);
ZOE_POLL_18DADBF1.data.u8[3] = (uint8_t)(currentpoll & 0x00FF);

View file

@ -63,6 +63,103 @@ class RenaultZoeGen2Battery : public CanBattery {
static const int POLL_SOC_MIN = 0x91B9;
static const int POLL_SOC_MAX = 0x91BA;
static const int POLL_CELL_0 = 0x9021;
static const int POLL_CELL_1 = 0x9022;
static const int POLL_CELL_2 = 0x9023;
static const int POLL_CELL_3 = 0x9024;
static const int POLL_CELL_4 = 0x9025;
static const int POLL_CELL_5 = 0x9026;
static const int POLL_CELL_6 = 0x9027;
static const int POLL_CELL_7 = 0x9028;
static const int POLL_CELL_8 = 0x9029;
static const int POLL_CELL_9 = 0x902A;
static const int POLL_CELL_10 = 0x902B;
static const int POLL_CELL_11 = 0x902C;
static const int POLL_CELL_12 = 0x902D;
static const int POLL_CELL_13 = 0x902E;
static const int POLL_CELL_14 = 0x902F;
static const int POLL_CELL_15 = 0x9030;
static const int POLL_CELL_16 = 0x9031;
static const int POLL_CELL_17 = 0x9032;
static const int POLL_CELL_18 = 0x9033;
static const int POLL_CELL_19 = 0x9034;
static const int POLL_CELL_20 = 0x9035;
static const int POLL_CELL_21 = 0x9036;
static const int POLL_CELL_22 = 0x9037;
static const int POLL_CELL_23 = 0x9038;
static const int POLL_CELL_24 = 0x9039;
static const int POLL_CELL_25 = 0x903A;
static const int POLL_CELL_26 = 0x903B;
static const int POLL_CELL_27 = 0x903C;
static const int POLL_CELL_28 = 0x903D;
static const int POLL_CELL_29 = 0x903E;
static const int POLL_CELL_30 = 0x903F;
static const int POLL_CELL_31 = 0x9041;
static const int POLL_CELL_32 = 0x9042;
static const int POLL_CELL_33 = 0x9043;
static const int POLL_CELL_34 = 0x9044;
static const int POLL_CELL_35 = 0x9045;
static const int POLL_CELL_36 = 0x9046;
static const int POLL_CELL_37 = 0x9047;
static const int POLL_CELL_38 = 0x9048;
static const int POLL_CELL_39 = 0x9049;
static const int POLL_CELL_40 = 0x904A;
static const int POLL_CELL_41 = 0x904B;
static const int POLL_CELL_42 = 0x904C;
static const int POLL_CELL_43 = 0x904D;
static const int POLL_CELL_44 = 0x904E;
static const int POLL_CELL_45 = 0x904F;
static const int POLL_CELL_46 = 0x9050;
static const int POLL_CELL_47 = 0x9051;
static const int POLL_CELL_48 = 0x9052;
static const int POLL_CELL_49 = 0x9053;
static const int POLL_CELL_50 = 0x9054;
static const int POLL_CELL_51 = 0x9055;
static const int POLL_CELL_52 = 0x9056;
static const int POLL_CELL_53 = 0x9057;
static const int POLL_CELL_54 = 0x9058;
static const int POLL_CELL_55 = 0x9059;
static const int POLL_CELL_56 = 0x905A;
static const int POLL_CELL_57 = 0x905B;
static const int POLL_CELL_58 = 0x905C;
static const int POLL_CELL_59 = 0x905D;
static const int POLL_CELL_60 = 0x905E;
static const int POLL_CELL_61 = 0x905F;
static const int POLL_CELL_62 = 0x9061;
static const int POLL_CELL_63 = 0x9062;
static const int POLL_CELL_64 = 0x9063;
static const int POLL_CELL_65 = 0x9064;
static const int POLL_CELL_66 = 0x9065;
static const int POLL_CELL_67 = 0x9066;
static const int POLL_CELL_68 = 0x9067;
static const int POLL_CELL_69 = 0x9068;
static const int POLL_CELL_70 = 0x9069;
static const int POLL_CELL_71 = 0x906A;
static const int POLL_CELL_72 = 0x906B;
static const int POLL_CELL_73 = 0x906C;
static const int POLL_CELL_74 = 0x906D;
static const int POLL_CELL_75 = 0x906E;
static const int POLL_CELL_76 = 0x906F;
static const int POLL_CELL_77 = 0x9070;
static const int POLL_CELL_78 = 0x9071;
static const int POLL_CELL_79 = 0x9072;
static const int POLL_CELL_80 = 0x9073;
static const int POLL_CELL_81 = 0x9074;
static const int POLL_CELL_82 = 0x9075;
static const int POLL_CELL_83 = 0x9076;
static const int POLL_CELL_84 = 0x9077;
static const int POLL_CELL_85 = 0x9078;
static const int POLL_CELL_86 = 0x9079;
static const int POLL_CELL_87 = 0x907A;
static const int POLL_CELL_88 = 0x907B;
static const int POLL_CELL_89 = 0x907C;
static const int POLL_CELL_90 = 0x907D;
static const int POLL_CELL_91 = 0x907E;
static const int POLL_CELL_92 = 0x907F;
static const int POLL_CELL_93 = 0x9081;
static const int POLL_CELL_94 = 0x9082;
static const int POLL_CELL_95 = 0x9083;
uint16_t battery_soc = 0;
uint16_t battery_usable_soc = 5000;
uint16_t battery_soh = 10000;
@ -151,54 +248,169 @@ class RenaultZoeGen2Battery : public CanBattery {
.ID = 0x18DADBF1,
.data = {0x04, 0x2E, 0x92, 0x81, 0x01, 0xAA, 0xAA, 0xAA}};
const uint16_t poll_commands[48] = {POLL_SOC,
POLL_USABLE_SOC,
POLL_SOH,
POLL_PACK_VOLTAGE,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_MAX_CELL_VOLTAGE,
POLL_MIN_CELL_VOLTAGE,
POLL_12V,
POLL_AVG_TEMP,
POLL_MIN_TEMP,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_MAX_TEMP,
POLL_MAX_POWER,
POLL_INTERLOCK,
POLL_KWH,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CURRENT_OFFSET,
POLL_MAX_GENERATED,
POLL_MAX_AVAILABLE,
POLL_CURRENT_VOLTAGE,
POLL_CHARGING_STATUS,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_REMAINING_CHARGE,
POLL_BALANCE_CAPACITY_TOTAL,
POLL_BALANCE_TIME_TOTAL,
POLL_BALANCE_CAPACITY_SLEEP,
POLL_BALANCE_TIME_SLEEP,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_BALANCE_CAPACITY_WAKE,
POLL_BALANCE_TIME_WAKE,
POLL_BMS_STATE,
POLL_BALANCE_SWITCHES,
POLL_ENERGY_COMPLETE,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_ENERGY_PARTIAL,
POLL_SLAVE_FAILURES,
POLL_MILEAGE,
POLL_FAN_SPEED,
POLL_FAN_PERIOD,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_FAN_CONTROL,
POLL_FAN_DUTY,
POLL_TEMPORISATION,
POLL_TIME,
POLL_PACK_TIME,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_SOC_MIN,
POLL_SOC_MAX};
const uint16_t poll_commands[163] = {POLL_SOC,
POLL_USABLE_SOC,
POLL_SOH,
POLL_PACK_VOLTAGE,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_MAX_CELL_VOLTAGE,
POLL_MIN_CELL_VOLTAGE,
POLL_12V,
POLL_AVG_TEMP,
POLL_MIN_TEMP,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_MAX_TEMP,
POLL_MAX_POWER,
POLL_INTERLOCK,
POLL_KWH,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CURRENT_OFFSET,
POLL_MAX_GENERATED,
POLL_MAX_AVAILABLE,
POLL_CURRENT_VOLTAGE,
POLL_CHARGING_STATUS,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_REMAINING_CHARGE,
POLL_BALANCE_CAPACITY_TOTAL,
POLL_BALANCE_TIME_TOTAL,
POLL_BALANCE_CAPACITY_SLEEP,
POLL_BALANCE_TIME_SLEEP,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_BALANCE_CAPACITY_WAKE,
POLL_BALANCE_TIME_WAKE,
POLL_BMS_STATE,
POLL_BALANCE_SWITCHES,
POLL_ENERGY_COMPLETE,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_ENERGY_PARTIAL,
POLL_SLAVE_FAILURES,
POLL_MILEAGE,
POLL_FAN_SPEED,
POLL_FAN_PERIOD,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_FAN_CONTROL,
POLL_FAN_DUTY,
POLL_TEMPORISATION,
POLL_TIME,
POLL_PACK_TIME,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_SOC_MIN,
POLL_SOC_MAX,
POLL_CELL_0,
POLL_CELL_1,
POLL_CELL_2,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_3,
POLL_CELL_4,
POLL_CELL_5,
POLL_CELL_6,
POLL_CELL_7,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_8,
POLL_CELL_9,
POLL_CELL_10,
POLL_CELL_11,
POLL_CELL_12,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_13,
POLL_CELL_14,
POLL_CELL_15,
POLL_CELL_16,
POLL_CELL_17,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_18,
POLL_CELL_19,
POLL_CELL_20,
POLL_CELL_21,
POLL_CELL_22,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_23,
POLL_CELL_24,
POLL_CELL_25,
POLL_CELL_26,
POLL_CELL_27,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_28,
POLL_CELL_29,
POLL_CELL_30,
POLL_CELL_31,
POLL_CELL_32,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_33,
POLL_CELL_34,
POLL_CELL_35,
POLL_CELL_36,
POLL_CELL_37,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_38,
POLL_CELL_39,
POLL_CELL_40,
POLL_CELL_41,
POLL_CELL_42,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_43,
POLL_CELL_44,
POLL_CELL_45,
POLL_CELL_46,
POLL_CELL_47,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_48,
POLL_CELL_49,
POLL_CELL_50,
POLL_CELL_51,
POLL_CELL_52,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_53,
POLL_CELL_54,
POLL_CELL_55,
POLL_CELL_56,
POLL_CELL_57,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_58,
POLL_CELL_59,
POLL_CELL_60,
POLL_CELL_61,
POLL_CELL_62,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_63,
POLL_CELL_64,
POLL_CELL_65,
POLL_CELL_66,
POLL_CELL_67,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_68,
POLL_CELL_69,
POLL_CELL_70,
POLL_CELL_71,
POLL_CELL_72,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_73,
POLL_CELL_74,
POLL_CELL_75,
POLL_CELL_76,
POLL_CELL_77,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_78,
POLL_CELL_79,
POLL_CELL_80,
POLL_CELL_81,
POLL_CELL_82,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_83,
POLL_CELL_84,
POLL_CELL_85,
POLL_CELL_86,
POLL_CELL_87,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_88,
POLL_CELL_89,
POLL_CELL_90,
POLL_CELL_91,
POLL_CELL_92,
POLL_CURRENT, //Repeated to speed up update rate on this critical measurement
POLL_CELL_93,
POLL_CELL_94,
POLL_CELL_95};
uint8_t counter_373 = 0;
uint8_t poll_index = 0;
uint16_t currentpoll = POLL_SOC;