Added info to webserver incase challenge failed

This commit is contained in:
Daniel Öster 2024-11-03 19:36:52 +02:00
parent 16fc2fb4f1
commit a2deca0f20
3 changed files with 6 additions and 1 deletions

View file

@ -354,6 +354,7 @@ void update_values_battery() { /* This function maps all the values fetched via
((solvedChallenge[7] << 24) | (solvedChallenge[6] << 16) | (solvedChallenge[5] << 8) | solvedChallenge[4]); ((solvedChallenge[7] << 24) | (solvedChallenge[6] << 16) | (solvedChallenge[5] << 8) | solvedChallenge[4]);
datalayer_extended.nissanleaf.SolvedChallengeLSB = datalayer_extended.nissanleaf.SolvedChallengeLSB =
((solvedChallenge[3] << 24) | (solvedChallenge[2] << 16) | (solvedChallenge[1] << 8) | solvedChallenge[0]); ((solvedChallenge[3] << 24) | (solvedChallenge[2] << 16) | (solvedChallenge[1] << 8) | solvedChallenge[0]);
datalayer_extended.nissanleaf.challengeFailed = challengeFailed;
// Update requests from webserver datalayer // Update requests from webserver datalayer
if (datalayer_extended.nissanleaf.UserRequestSOHreset) { if (datalayer_extended.nissanleaf.UserRequestSOHreset) {
@ -1287,7 +1288,7 @@ uint16_t Temp_fromRAW_to_F(uint16_t temperature) { //This function feels horrib
} }
void clearSOH(void) { void clearSOH(void) {
challengeFailed = false;
stop_battery_query = true; stop_battery_query = true;
hold_off_with_polling_10seconds = 10; // Active battery polling is paused for 100 seconds hold_off_with_polling_10seconds = 10; // Active battery polling is paused for 100 seconds

View file

@ -201,6 +201,9 @@ typedef struct {
/** bool */ /** bool */
/** User requesting SOH reset via WebUI*/ /** User requesting SOH reset via WebUI*/
bool UserRequestSOHreset = false; bool UserRequestSOHreset = false;
/** bool */
/** True if the crypto challenge response from BMS is signalling a failed attempt*/
bool challengeFailed = false;
/** uint32_t */ /** uint32_t */
/** Cryptographic challenge to be solved */ /** Cryptographic challenge to be solved */
uint32_t CryptoChallenge = 0; uint32_t CryptoChallenge = 0;

View file

@ -296,6 +296,7 @@ String advanced_battery_processor(const String& var) {
content += "<h4>CryptoChallenge: " + String(datalayer_extended.nissanleaf.CryptoChallenge) + "</h4>"; content += "<h4>CryptoChallenge: " + String(datalayer_extended.nissanleaf.CryptoChallenge) + "</h4>";
content += "<h4>SolvedChallenge: " + String(datalayer_extended.nissanleaf.SolvedChallengeMSB) + content += "<h4>SolvedChallenge: " + String(datalayer_extended.nissanleaf.SolvedChallengeMSB) +
String(datalayer_extended.nissanleaf.SolvedChallengeLSB) + "</h4>"; String(datalayer_extended.nissanleaf.SolvedChallengeLSB) + "</h4>";
content += "<h4>Challenge failed: " + String(datalayer_extended.nissanleaf.challengeFailed) + "</h4>";
#endif #endif
#if !defined(TESLA_BATTERY) && !defined(NISSAN_LEAF_BATTERY) && !defined(BMW_I3_BATTERY) && \ #if !defined(TESLA_BATTERY) && !defined(NISSAN_LEAF_BATTERY) && !defined(BMW_I3_BATTERY) && \