Skip to content

StatusNotification error severity mechanism & report resolved errors#331

Merged
matth-x merged 6 commits intomainfrom
feature/report-no-error
Jul 23, 2024
Merged

StatusNotification error severity mechanism & report resolved errors#331
matth-x merged 6 commits intomainfrom
feature/report-no-error

Conversation

@matth-x
Copy link
Owner

@matth-x matth-x commented Jun 27, 2024

This adds the error severity field to the MO error reporting mechanism. The severity can be used to avoid that less important errors are being reported to the server while still being in a highly severe error condition. If the most severe error is resolved, then MO reports the next most severe error. This behavior is useful for some backend systems.

See this example for changing the severity:

addErrorDataInput([] () -> ErrorData {
    if (/* error condition */) {
        ErrorData error = "OtherError";
        error.severity = 2; //increase severity to `2` (default is `1`)
        return error;
    }
    return nullptr;
});

The new build option MO_REPORT_NOERROR=1 applies to errors which don't lead to the Faulted status, i.e. where error.isFaulted == false (for example, the charger reports the WeakSignal error while remaining Available). If all of these errors are resolved, then MO sends a further StatusNotification message with the error code NoError.

@matth-x matth-x merged commit fb6a765 into main Jul 23, 2024
@matth-x matth-x deleted the feature/report-no-error branch July 23, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant