Class FaultProvider
Defined in File fault_provider.hpp
Class Documentation
-
class FaultProvider
Provider interface for entity fault/DTC resources.
Typed provider interface for plugins that serve SOVD faults (GET /{entity_type}/{id}/faults, GET /{entity_type}/{id}/faults/{code}). Per-entity routing like DataProvider.
Plugins implementing this interface query their backend (e.g., UDS ReadDTCInformation 0x19) on demand and return faults in SOVD format.
See also
GatewayPlugin for the base class all plugins must also implement
See also
DataProvider for the data counterpart
- Thread safety
All methods may be called concurrently. Implementations must synchronize.
Public Functions
-
virtual ~FaultProvider() = default
-
virtual tl::expected<dto::FaultListResult, FaultProviderErrorInfo> list_faults(const std::string &entity_id) = 0
List faults for an entity.
Returns a typed
FaultListResultenvelope around the plugin-defined response body. JsonWriter emitscontentverbatim, so the wire bytes are byte-identical to the pre-typednlohmann::jsonABI. The payload shape is plugin-determined (typically{"items": [...]}with per-item fields varying across backends - UDS DTC records, OPC-UA alarm metadata, vendor extensions, …). The OpenAPI schema is opaque (x-medkit-opaque:true).- Parameters:
entity_id – SOVD entity ID
-
virtual tl::expected<dto::FaultDetailResult, FaultProviderErrorInfo> get_fault(const std::string &entity_id, const std::string &fault_code) = 0
Get a specific fault with environment data.
Returns a typed
FaultDetailResultenvelope around the plugin-defined response body. JsonWriter emitscontentverbatim, so the wire bytes are byte-identical to the pre-typednlohmann::jsonABI. The payload shape is runtime-dependent (UDS environment records, OPC-UA condition state, vendor extended status) and the OpenAPI schema is opaque (x-medkit-opaque:true).- Parameters:
entity_id – SOVD entity ID
fault_code – Fault code (e.g., DTC identifier)
-
virtual tl::expected<dto::FaultClearResult, FaultProviderErrorInfo> clear_fault(const std::string &entity_id, const std::string &fault_code) = 0
Clear a fault.
Returns a typed
FaultClearResultenvelope around the plugin-defined response body. JsonWriter emitscontentverbatim, so the wire bytes are byte-identical to the pre-typednlohmann::jsonABI. The payload shape is plugin-determined (typically{"code": ..., "cleared": true}or{"status": "ok"}) and the OpenAPI schema is opaque (x-medkit-opaque:true).- Parameters:
entity_id – SOVD entity ID
fault_code – Fault code to clear