mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 17:59:27 +02:00
Stop sending most MG HS PHEV OBD PID requests
This commit is contained in:
parent
d489e9878c
commit
50619f8776
2 changed files with 4 additions and 36 deletions
|
@ -324,53 +324,20 @@ void MgHsPHEVBattery::transmit_can(unsigned long currentMillis) {
|
|||
if (currentMillis - previousMillis200 >= INTERVAL_200_MS) {
|
||||
previousMillis200 = currentMillis;
|
||||
|
||||
switch (messageindex) {
|
||||
switch (transmitIndex) {
|
||||
case 1:
|
||||
transmit_can_frame(&MG_HS_7E5_B0_42, can_config.battery); //Battery voltage
|
||||
break;
|
||||
case 2:
|
||||
transmit_can_frame(&MG_HS_7E5_B0_43, can_config.battery); //Battery current
|
||||
break;
|
||||
case 3:
|
||||
transmit_can_frame(&MG_HS_7E5_B0_46, can_config.battery); //Battery SoC
|
||||
break;
|
||||
case 4:
|
||||
transmit_can_frame(&MG_HS_7E5_B0_47, can_config.battery); // Get BMS error code
|
||||
break;
|
||||
case 5:
|
||||
transmit_can_frame(&MG_HS_7E5_B0_48, can_config.battery); // Get BMS status
|
||||
break;
|
||||
case 6:
|
||||
transmit_can_frame(&MG_HS_7E5_B0_49, can_config.battery); // Get System main relay B status
|
||||
break;
|
||||
case 7:
|
||||
transmit_can_frame(&MG_HS_7E5_B0_4A, can_config.battery); // Get System main relay G status
|
||||
break;
|
||||
case 8:
|
||||
transmit_can_frame(&MG_HS_7E5_B0_52, can_config.battery); // Get System main relay P status
|
||||
break;
|
||||
case 9:
|
||||
transmit_can_frame(&MG_HS_7E5_B0_56, can_config.battery); //Max cell temperature
|
||||
break;
|
||||
case 10:
|
||||
transmit_can_frame(&MG_HS_7E5_B0_57, can_config.battery); //Min cell temperature
|
||||
break;
|
||||
case 11:
|
||||
transmit_can_frame(&MG_HS_7E5_B0_58, can_config.battery); //Max cell voltage
|
||||
break;
|
||||
case 12:
|
||||
transmit_can_frame(&MG_HS_7E5_B0_59, can_config.battery); //Min cell voltage
|
||||
break;
|
||||
case 13:
|
||||
transmit_can_frame(&MG_HS_7E5_B0_61, can_config.battery); //Battery SoH
|
||||
messageindex = 0; //Return to the first message index. This goes in the last message entry
|
||||
transmitIndex = 0; //Return to the first message index. This goes in the last message entry
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
} //switch
|
||||
|
||||
messageindex++; //Increment the message index
|
||||
transmitIndex++; //Increment the message index
|
||||
|
||||
} //endif
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ class MgHsPHEVBattery : public CanBattery {
|
|||
static const uint16_t CELL_VOLTAGE_TIMEOUT = 10; // in seconds
|
||||
uint16_t cellVoltageValidTime = 0;
|
||||
|
||||
uint8_t transmitIndex = 0; //For polling switchcase
|
||||
|
||||
const int MaxChargePower = 3000; // Maximum allowable charge power, excluding the taper
|
||||
const int StartChargeTaper = 90; // Battery percentage above which the charge power will taper to zero
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue